From ee9f84816751245e930618725139ebbe0da1593b Mon Sep 17 00:00:00 2001 From: Ansu Jammeh Date: Mon, 30 Jan 2023 11:10:29 +0000 Subject: [PATCH 01/44] Inprogress --- client/package-lock.json | 1945 ++++++++++++++++++++++++++++++++++++-- client/package.json | 14 +- client/public/index.html | 6 +- client/src/App.js | 39 +- client/src/Cards.js | 27 + client/src/Form.js | 49 + client/src/Heading.js | 15 + client/src/Home.js | 12 + client/src/Search.js | 14 + client/src/index.css | 67 +- client/src/index.js | 4 + client/yarn.lock | 724 ++++++++++++-- 12 files changed, 2748 insertions(+), 168 deletions(-) create mode 100644 client/src/Cards.js create mode 100644 client/src/Form.js create mode 100644 client/src/Heading.js create mode 100644 client/src/Home.js create mode 100644 client/src/Search.js diff --git a/client/package-lock.json b/client/package-lock.json index f7a30f85fa..07f71c568b 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -8,14 +8,26 @@ "name": "video-recommendation", "version": "0.1.0", "dependencies": { + "@emotion/react": "^11.10.5", + "@emotion/styled": "^11.10.5", + "@fontsource/roboto": "^4.5.8", + "@mui/icons-material": "^5.11.0", + "@mui/material": "^5.11.6", + "@mui/styled-engine-sc": "^5.11.0", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.1.10", - "bootstrap": "^5.1.3", + "bootstrap": "^5.2.3", "react": "^17.0.2", + "react-bootstrap": "^2.7.0", "react-dom": "^17.0.2", "react-scripts": "^5.0.0", + "react-youtube": "^10.1.0", + "styled-components": "^5.3.6", "web-vitals": "^1.1.2" + }, + "devDependencies": { + "nodemon": "^2.0.20" } }, "node_modules/@babel/code-frame": { @@ -302,11 +314,11 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", - "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" @@ -342,9 +354,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz", - "integrity": "sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", + "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", "engines": { "node": ">=6.9.0" } @@ -410,10 +422,18 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "engines": { "node": ">=6.9.0" } @@ -932,11 +952,11 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.5.tgz", - "integrity": "sha512-42OGssv9NPk4QHKVgIHlzeLgPOW5rGgfV5jzG90AhcXXIv6hu/eqj63w4VgvRxdvZY3AlYeDgPiSJ3BqAd1Y6Q==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", + "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", "dependencies": { - "@babel/helper-plugin-utils": "^7.16.5" + "@babel/helper-plugin-utils": "^7.18.6" }, "engines": { "node": ">=6.9.0" @@ -1789,11 +1809,11 @@ } }, "node_modules/@babel/runtime": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.5.tgz", - "integrity": "sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==", + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz", + "integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==", "dependencies": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.13.11" }, "engines": { "node": ">=6.9.0" @@ -1845,11 +1865,12 @@ } }, "node_modules/@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1866,6 +1887,175 @@ "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-12.0.0.tgz", "integrity": "sha512-M0qqxAcwCsIVfpFQSlGN5XjXWu8l5JDZN+fPt1LeW5SZexQTgnaEvgXAY+CeygRw0EeppWHi12JxESWiWrB0Sg==" }, + "node_modules/@emotion/babel-plugin": { + "version": "11.10.5", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.10.5.tgz", + "integrity": "sha512-xE7/hyLHJac7D2Ve9dKroBBZqBT7WuPQmWcq7HSGb84sUuP4mlOWoB8dvVfD9yk5DHkU1m6RW7xSoDtnQHNQeA==", + "dependencies": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/plugin-syntax-jsx": "^7.17.12", + "@babel/runtime": "^7.18.3", + "@emotion/hash": "^0.9.0", + "@emotion/memoize": "^0.8.0", + "@emotion/serialize": "^1.1.1", + "babel-plugin-macros": "^3.1.0", + "convert-source-map": "^1.5.0", + "escape-string-regexp": "^4.0.0", + "find-root": "^1.1.0", + "source-map": "^0.5.7", + "stylis": "4.1.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@emotion/babel-plugin/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@emotion/babel-plugin/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@emotion/cache": { + "version": "11.10.5", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.10.5.tgz", + "integrity": "sha512-dGYHWyzTdmK+f2+EnIGBpkz1lKc4Zbj2KHd4cX3Wi8/OWr5pKslNjc3yABKH4adRGCvSX4VDC0i04mrrq0aiRA==", + "dependencies": { + "@emotion/memoize": "^0.8.0", + "@emotion/sheet": "^1.2.1", + "@emotion/utils": "^1.2.0", + "@emotion/weak-memoize": "^0.3.0", + "stylis": "4.1.3" + } + }, + "node_modules/@emotion/hash": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.0.tgz", + "integrity": "sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ==" + }, + "node_modules/@emotion/is-prop-valid": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.0.tgz", + "integrity": "sha512-3aDpDprjM0AwaxGE09bOPkNxHpBd+kA6jty3RnaEXdweX1DF1U3VQpPYb0g1IStAuK7SVQ1cy+bNBBKp4W3Fjg==", + "dependencies": { + "@emotion/memoize": "^0.8.0" + } + }, + "node_modules/@emotion/memoize": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.0.tgz", + "integrity": "sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA==" + }, + "node_modules/@emotion/react": { + "version": "11.10.5", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.10.5.tgz", + "integrity": "sha512-TZs6235tCJ/7iF6/rvTaOH4oxQg2gMAcdHemjwLKIjKz4rRuYe1HJ2TQJKnAcRAfOUDdU8XoDadCe1rl72iv8A==", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.10.5", + "@emotion/cache": "^11.10.5", + "@emotion/serialize": "^1.1.1", + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0", + "@emotion/utils": "^1.2.0", + "@emotion/weak-memoize": "^0.3.0", + "hoist-non-react-statics": "^3.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0", + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@emotion/serialize": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.1.tgz", + "integrity": "sha512-Zl/0LFggN7+L1liljxXdsVSVlg6E/Z/olVWpfxUTxOAmi8NU7YoeWeLfi1RmnB2TATHoaWwIBRoL+FvAJiTUQA==", + "dependencies": { + "@emotion/hash": "^0.9.0", + "@emotion/memoize": "^0.8.0", + "@emotion/unitless": "^0.8.0", + "@emotion/utils": "^1.2.0", + "csstype": "^3.0.2" + } + }, + "node_modules/@emotion/sheet": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.1.tgz", + "integrity": "sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA==" + }, + "node_modules/@emotion/styled": { + "version": "11.10.5", + "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.10.5.tgz", + "integrity": "sha512-8EP6dD7dMkdku2foLoruPCNkRevzdcBaY6q0l0OsbyJK+x8D9HWjX27ARiSIKNF634hY9Zdoedh8bJCiva8yZw==", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.10.5", + "@emotion/is-prop-valid": "^1.2.0", + "@emotion/serialize": "^1.1.1", + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0", + "@emotion/utils": "^1.2.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0", + "@emotion/react": "^11.0.0-rc.0", + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@emotion/stylis": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" + }, + "node_modules/@emotion/unitless": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz", + "integrity": "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==" + }, + "node_modules/@emotion/use-insertion-effect-with-fallbacks": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.0.tgz", + "integrity": "sha512-1eEgUGmkaljiBnRMTdksDV1W4kUnmwgp7X9G8B++9GYwl1lUdqSndSriIrTJ0N7LQaoauY9JJ2yhiOYK5+NI4A==", + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@emotion/utils": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.0.tgz", + "integrity": "sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw==" + }, + "node_modules/@emotion/weak-memoize": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz", + "integrity": "sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==" + }, "node_modules/@eslint/eslintrc": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", @@ -1926,6 +2116,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@fontsource/roboto": { + "version": "4.5.8", + "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.8.tgz", + "integrity": "sha512-CnD7zLItIzt86q4Sj3kZUiLcBk1dSk81qcqgMGaZe7SQ1P8hFNxhMl5AZthK1zrDM5m74VVhaOpuMGIL4gagaA==" + }, "node_modules/@humanwhocodes/config-array": { "version": "0.9.2", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", @@ -2266,6 +2461,287 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, + "node_modules/@mui/base": { + "version": "5.0.0-alpha.115", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.115.tgz", + "integrity": "sha512-OGQ84whT/yNYd6xKCGGS6MxqEfjVjk5esXM7HP6bB2Rim7QICUapxZt4nm8q39fpT08rNDkv3xPVqDDwRdRg1g==", + "dependencies": { + "@babel/runtime": "^7.20.7", + "@emotion/is-prop-valid": "^1.2.0", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.2", + "@popperjs/core": "^2.11.6", + "clsx": "^1.2.1", + "prop-types": "^15.8.1", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/base/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + }, + "node_modules/@mui/core-downloads-tracker": { + "version": "5.11.6", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.6.tgz", + "integrity": "sha512-lbD3qdafBOf2dlqKhOcVRxaPAujX+9UlPC6v8iMugMeAXe0TCgU3QbGXY3zrJsu6ex64WYDpH4y1+WOOBmWMuA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + } + }, + "node_modules/@mui/icons-material": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.11.0.tgz", + "integrity": "sha512-I2LaOKqO8a0xcLGtIozC9xoXjZAto5G5gh0FYUMAlbsIHNHIjn4Xrw9rvjY20vZonyiGrZNMAlAXYkY6JvhF6A==", + "dependencies": { + "@babel/runtime": "^7.20.6" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@mui/material": "^5.0.0", + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/material": { + "version": "5.11.6", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.6.tgz", + "integrity": "sha512-MzkkL5KC2PCkFiv8cLpkzgLUPXSrAtnvJBR0emV7mLVWbkwV3n5832vjBx154B6R032fHjFTziTh7YEb50nK6Q==", + "dependencies": { + "@babel/runtime": "^7.20.7", + "@mui/base": "5.0.0-alpha.115", + "@mui/core-downloads-tracker": "^5.11.6", + "@mui/system": "^5.11.5", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.2", + "@types/react-transition-group": "^4.4.5", + "clsx": "^1.2.1", + "csstype": "^3.1.1", + "prop-types": "^15.8.1", + "react-is": "^18.2.0", + "react-transition-group": "^4.4.5" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@emotion/react": "^11.5.0", + "@emotion/styled": "^11.3.0", + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/material/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + }, + "node_modules/@mui/private-theming": { + "version": "5.11.2", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.2.tgz", + "integrity": "sha512-qZwMaqRFPwlYmqwVKblKBGKtIjJRAj3nsvX93pOmatsXyorW7N/0IPE/swPgz1VwChXhHO75DwBEx8tB+aRMNg==", + "dependencies": { + "@babel/runtime": "^7.20.7", + "@mui/utils": "^5.11.2", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/styled-engine": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.11.0.tgz", + "integrity": "sha512-AF06K60Zc58qf0f7X+Y/QjaHaZq16znliLnGc9iVrV/+s8Ln/FCoeNuFvhlCbZZQ5WQcJvcy59zp0nXrklGGPQ==", + "dependencies": { + "@babel/runtime": "^7.20.6", + "@emotion/cache": "^11.10.5", + "csstype": "^3.1.1", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@emotion/react": "^11.4.1", + "@emotion/styled": "^11.3.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + } + } + }, + "node_modules/@mui/styled-engine-sc": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/styled-engine-sc/-/styled-engine-sc-5.11.0.tgz", + "integrity": "sha512-U8cA7DHB3fnLpDVM5qd/9FGnw5y+LrmwIXQ9Lzk3HYkF903tSMx9jXIbiz1vltpOfZTKX/Rn02m/nkH4OF6Pcg==", + "dependencies": { + "@babel/runtime": "^7.20.6", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@types/styled-components": "^5.1.14", + "styled-components": "^5.3.1" + }, + "peerDependenciesMeta": { + "@types/styled-components": { + "optional": true + } + } + }, + "node_modules/@mui/system": { + "version": "5.11.5", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.5.tgz", + "integrity": "sha512-KNVsJ0sgRRp2XBqhh4wPS5aacteqjwxgiYTVwVnll2fgkgunZKo3DsDiGMrFlCg25ZHA3Ax58txWGE9w58zp0w==", + "dependencies": { + "@babel/runtime": "^7.20.7", + "@mui/private-theming": "^5.11.2", + "@mui/styled-engine": "^5.11.0", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.2", + "clsx": "^1.2.1", + "csstype": "^3.1.1", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@emotion/react": "^11.5.0", + "@emotion/styled": "^11.3.0", + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/types": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.3.tgz", + "integrity": "sha512-tZ+CQggbe9Ol7e/Fs5RcKwg/woU+o8DCtOnccX6KmbBc7YrfqMYEYuaIcXHuhpT880QwNkZZ3wQwvtlDFA2yOw==", + "peerDependencies": { + "@types/react": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/utils": { + "version": "5.11.2", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.11.2.tgz", + "integrity": "sha512-AyizuHHlGdAtH5hOOXBW3kriuIwUIKUIgg0P7LzMvzf6jPhoQbENYqY6zJqfoZ7fAWMNNYT8mgN5EftNGzwE2w==", + "dependencies": { + "@babel/runtime": "^7.20.7", + "@types/prop-types": "^15.7.5", + "@types/react-is": "^16.7.1 || ^17.0.0", + "prop-types": "^15.8.1", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0" + } + }, + "node_modules/@mui/utils/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2356,15 +2832,56 @@ } }, "node_modules/@popperjs/core": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.0.tgz", - "integrity": "sha512-zrsUxjLOKAzdewIDRWy9nsV1GQsKBCWaGwsZQlCgr6/q+vjyZhFgqedLfFBuI9anTPEUT4APq9Mu0SZBTzIcGQ==", - "peer": true, + "version": "2.11.6", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz", + "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==", "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" } }, + "node_modules/@react-aria/ssr": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.4.1.tgz", + "integrity": "sha512-NmhoilMDyIfQiOSdQgxpVH2tC2u85Y0mVijtBNbI9kcDYLEiW/r6vKYVKtkyU+C4qobXhGMPfZ70PTc0lysSVA==", + "dependencies": { + "@swc/helpers": "^0.4.14" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" + } + }, + "node_modules/@restart/hooks": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.8.tgz", + "integrity": "sha512-Ivvp1FZ0Lja80iUTYAhbzy+stxwO7FbPHP95ypCtIh0wyOLiayQywXhVJ2ZYP5S1AjW2GmKHeRU4UglMwTG2sA==", + "dependencies": { + "dequal": "^2.0.2" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@restart/ui": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.5.3.tgz", + "integrity": "sha512-8Zx3HUMxOeC+ZmN7MwChkolpDQaV55prSgpNoGOw5heKnn32HgzEQ6Y0Rz0YqMBUtEKS0NsvNpsskve+O8qXAQ==", + "dependencies": { + "@babel/runtime": "^7.20.7", + "@popperjs/core": "^2.11.6", + "@react-aria/ssr": "^3.4.1", + "@restart/hooks": "^0.4.7", + "@types/warning": "^3.0.0", + "dequal": "^2.0.3", + "dom-helpers": "^5.2.0", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + }, + "peerDependencies": { + "react": ">=16.14.0", + "react-dom": ">=16.14.0" + } + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz", @@ -2678,6 +3195,14 @@ "url": "https://github.com/sponsors/gregberge" } }, + "node_modules/@swc/helpers": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz", + "integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==", + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@testing-library/dom": { "version": "8.11.1", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-8.11.1.tgz", @@ -3045,6 +3570,11 @@ "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.2.tgz", "integrity": "sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA==" }, + "node_modules/@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + }, "node_modules/@types/q": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.5.tgz", @@ -3060,6 +3590,32 @@ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" }, + "node_modules/@types/react": { + "version": "18.0.27", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.27.tgz", + "integrity": "sha512-3vtRKHgVxu3Jp9t718R9BuzoD4NcQ8YJ5XRzsSKxNDiDonD2MXIT1TmSkenxuCycZJoQT5d2vE8LwWJxBC1gmA==", + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-is": { + "version": "17.0.3", + "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.3.tgz", + "integrity": "sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -3073,6 +3629,11 @@ "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==" }, + "node_modules/@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + }, "node_modules/@types/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", @@ -3116,6 +3677,11 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz", "integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==" }, + "node_modules/@types/warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz", + "integrity": "sha512-t/Tvs5qR47OLOr+4E9ckN8AmP2Tf16gWq+/qA4iUGS/OOyHVO8wv2vjJuX8SNOUTJyWb+2t7wJm6cXILFnOROA==" + }, "node_modules/@types/ws": { "version": "8.2.2", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", @@ -3489,6 +4055,12 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==" }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, "node_modules/accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -4091,6 +4663,26 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/babel-plugin-styled-components": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.0.7.tgz", + "integrity": "sha512-i7YhvPgVqRKfoQ66toiZ06jPNA3p6ierpfUuEWxNF+fV27Uv5gxBkf8KZLHUCc1nFA9j6+80pYoIpqCeyW3/bA==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-module-imports": "^7.16.0", + "babel-plugin-syntax-jsx": "^6.18.0", + "lodash": "^4.17.11", + "picomatch": "^2.3.0" + }, + "peerDependencies": { + "styled-components": ">= 2" + } + }, + "node_modules/babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==" + }, "node_modules/babel-plugin-transform-react-remove-prop-types": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz", @@ -4272,15 +4864,21 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, "node_modules/bootstrap": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", - "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/bootstrap" - }, + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz", + "integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/twbs" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/bootstrap" + } + ], "peerDependencies": { - "@popperjs/core": "^2.10.2" + "@popperjs/core": "^2.11.6" } }, "node_modules/brace-expansion": { @@ -4415,6 +5013,14 @@ "node": ">= 6" } }, + "node_modules/camelize": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", + "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/caniuse-api": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", @@ -4520,6 +5126,11 @@ "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==" }, + "node_modules/classnames": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + }, "node_modules/clean-css": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.2.tgz", @@ -4549,6 +5160,14 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "engines": { + "node": ">=6" + } + }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -4922,6 +5541,14 @@ "postcss": "^8.3" } }, + "node_modules/css-color-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", + "engines": { + "node": ">=4" + } + }, "node_modules/css-declaration-sorter": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.1.3.tgz", @@ -5109,6 +5736,16 @@ "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==" }, + "node_modules/css-to-react-native": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.1.0.tgz", + "integrity": "sha512-AryfkFA29b4I3vG7N4kxFboq15DxwSXzhXM37XNEjwJMgjYIc8BcqfiprpAqX0zadI5PMByEIwAMzXxk5Vcc4g==", + "dependencies": { + "camelize": "^1.0.0", + "css-color-keywords": "^1.0.0", + "postcss-value-parser": "^4.0.2" + } + }, "node_modules/css-tree": { "version": "1.0.0-alpha.37", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", @@ -5275,6 +5912,11 @@ "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" }, + "node_modules/csstype": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", + "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + }, "node_modules/damerau-levenshtein": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.7.tgz", @@ -5428,6 +6070,14 @@ "node": ">= 0.6" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "engines": { + "node": ">=6" + } + }, "node_modules/destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", @@ -5566,6 +6216,15 @@ "utila": "~0.4" } }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, "node_modules/dom-serializer": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", @@ -6879,6 +7538,11 @@ "node": ">=8" } }, + "node_modules/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -7385,6 +8049,19 @@ "he": "bin/he" } }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/hoist-non-react-statics/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, "node_modules/hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -7639,6 +8316,12 @@ "node": ">= 4" } }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, "node_modules/immer": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.7.tgz", @@ -7815,6 +8498,14 @@ "node": ">= 0.4" } }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, "node_modules/ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", @@ -9185,6 +9876,11 @@ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, + "node_modules/load-script": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/load-script/-/load-script-1.0.0.tgz", + "integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==" + }, "node_modules/loader-runner": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", @@ -9603,6 +10299,100 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==" }, + "node_modules/nodemon": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/nodemon/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/nodemon/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -11379,15 +12169,32 @@ } }, "node_modules/prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", - "react-is": "^16.8.1" + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types-extra": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz", + "integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==", + "dependencies": { + "react-is": "^16.3.2", + "warning": "^4.0.0" + }, + "peerDependencies": { + "react": ">=0.14.0" } }, + "node_modules/prop-types-extra/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, "node_modules/prop-types/node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -11418,6 +12225,12 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -11570,6 +12383,35 @@ "node": ">=14" } }, + "node_modules/react-bootstrap": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.7.0.tgz", + "integrity": "sha512-Jcrn6aUuRVBeSB6dzKODKZU1TONOdhAxu0IDm4Sv74SJUm98dMdhSotF2SNvFEADANoR+stV+7TK6SNX1wWu5w==", + "dependencies": { + "@babel/runtime": "^7.17.2", + "@restart/hooks": "^0.4.6", + "@restart/ui": "^1.4.1", + "@types/react-transition-group": "^4.4.4", + "classnames": "^2.3.1", + "dom-helpers": "^5.2.1", + "invariant": "^2.2.4", + "prop-types": "^15.8.1", + "prop-types-extra": "^1.1.0", + "react-transition-group": "^4.4.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + }, + "peerDependencies": { + "@types/react": ">=16.14.8", + "react": ">=16.14.0", + "react-dom": ">=16.14.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/react-dev-utils": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.0.tgz", @@ -11646,6 +12488,11 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, + "node_modules/react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" + }, "node_modules/react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", @@ -11740,6 +12587,37 @@ "node": ">=10" } }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, + "node_modules/react-youtube": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/react-youtube/-/react-youtube-10.1.0.tgz", + "integrity": "sha512-ZfGtcVpk0SSZtWCSTYOQKhfx5/1cfyEW1JN/mugGNfAxT3rmVJeMbGpA9+e78yG21ls5nc/5uZJETE3cm3knBg==", + "dependencies": { + "fast-deep-equal": "3.1.3", + "prop-types": "15.8.1", + "youtube-player": "5.5.2" + }, + "engines": { + "node": ">= 14.x" + }, + "peerDependencies": { + "react": ">=0.14.1" + } + }, "node_modules/readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -11804,9 +12682,9 @@ } }, "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, "node_modules/regenerator-transform": { "version": "0.14.5", @@ -12350,6 +13228,11 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -12392,6 +13275,32 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==" }, + "node_modules/simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", + "dev": true, + "dependencies": { + "semver": "~7.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/sister": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sister/-/sister-3.0.2.tgz", + "integrity": "sha512-p19rtTs+NksBRKW9qn0UhZ8/TUI9BPw9lmtHny+Y3TinWlOa9jWh9xB0AtPSdmOy49NJJJSSe0Ey4C7h0TrcYA==" + }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -12751,6 +13660,60 @@ "webpack": "^5.0.0" } }, + "node_modules/styled-components": { + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.6.tgz", + "integrity": "sha512-hGTZquGAaTqhGWldX7hhfzjnIYBZ0IXQXkCYdvF1Sq3DsUaLx6+NTHC5Jj1ooM2F68sBiVz3lvhfwQs/S3l6qg==", + "hasInstallScript": true, + "dependencies": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/traverse": "^7.4.5", + "@emotion/is-prop-valid": "^1.1.0", + "@emotion/stylis": "^0.8.4", + "@emotion/unitless": "^0.7.4", + "babel-plugin-styled-components": ">= 1.12.0", + "css-to-react-native": "^3.0.0", + "hoist-non-react-statics": "^3.0.0", + "shallowequal": "^1.1.0", + "supports-color": "^5.5.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/styled-components" + }, + "peerDependencies": { + "react": ">= 16.8.0", + "react-dom": ">= 16.8.0", + "react-is": ">= 16.8.0" + } + }, + "node_modules/styled-components/node_modules/@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" + }, + "node_modules/styled-components/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/styled-components/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/stylehacks": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.0.1.tgz", @@ -12766,6 +13729,11 @@ "postcss": "^8.2.15" } }, + "node_modules/stylis": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.1.3.tgz", + "integrity": "sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA==" + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -13179,6 +14147,18 @@ "node": ">=0.6" } }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, "node_modules/tough-cookie": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", @@ -13247,9 +14227,9 @@ } }, "node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -13347,6 +14327,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/uncontrollable": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", + "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==", + "dependencies": { + "@babel/runtime": "^7.6.3", + "@types/react": ">=16.9.11", + "invariant": "^2.2.4", + "react-lifecycles-compat": "^3.0.4" + }, + "peerDependencies": { + "react": ">=15.0.0" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -13547,6 +14547,14 @@ "makeerror": "1.0.12" } }, + "node_modules/warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, "node_modules/watchpack": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", @@ -14411,6 +15419,29 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/youtube-player": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/youtube-player/-/youtube-player-5.5.2.tgz", + "integrity": "sha512-ZGtsemSpXnDky2AUYWgxjaopgB+shFHgXVpiJFeNB5nWEugpW1KWYDaHKuLqh2b67r24GtP6HoSW5swvf0fFIQ==", + "dependencies": { + "debug": "^2.6.6", + "load-script": "^1.0.0", + "sister": "^3.0.0" + } + }, + "node_modules/youtube-player/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/youtube-player/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } }, "dependencies": { @@ -14621,11 +15652,11 @@ } }, "@babel/helper-module-imports": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", - "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.18.6" } }, "@babel/helper-module-transforms": { @@ -14652,9 +15683,9 @@ } }, "@babel/helper-plugin-utils": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz", - "integrity": "sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ==" + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", + "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==" }, "@babel/helper-remap-async-to-generator": { "version": "7.16.5", @@ -14702,10 +15733,15 @@ "@babel/types": "^7.16.0" } }, + "@babel/helper-string-parser": { + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==" + }, "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==" + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==" }, "@babel/helper-validator-option": { "version": "7.14.5", @@ -15046,11 +16082,11 @@ } }, "@babel/plugin-syntax-jsx": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.5.tgz", - "integrity": "sha512-42OGssv9NPk4QHKVgIHlzeLgPOW5rGgfV5jzG90AhcXXIv6hu/eqj63w4VgvRxdvZY3AlYeDgPiSJ3BqAd1Y6Q==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", + "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", "requires": { - "@babel/helper-plugin-utils": "^7.16.5" + "@babel/helper-plugin-utils": "^7.18.6" } }, "@babel/plugin-syntax-logical-assignment-operators": { @@ -15600,11 +16636,11 @@ } }, "@babel/runtime": { - "version": "7.16.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.5.tgz", - "integrity": "sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==", + "version": "7.20.13", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz", + "integrity": "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==", "requires": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.13.11" } }, "@babel/runtime-corejs3": { @@ -15644,23 +16680,156 @@ } }, "@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", + "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", + "requires": { + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", + "to-fast-properties": "^2.0.0" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" + }, + "@csstools/normalize.css": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-12.0.0.tgz", + "integrity": "sha512-M0qqxAcwCsIVfpFQSlGN5XjXWu8l5JDZN+fPt1LeW5SZexQTgnaEvgXAY+CeygRw0EeppWHi12JxESWiWrB0Sg==" + }, + "@emotion/babel-plugin": { + "version": "11.10.5", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.10.5.tgz", + "integrity": "sha512-xE7/hyLHJac7D2Ve9dKroBBZqBT7WuPQmWcq7HSGb84sUuP4mlOWoB8dvVfD9yk5DHkU1m6RW7xSoDtnQHNQeA==", + "requires": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/plugin-syntax-jsx": "^7.17.12", + "@babel/runtime": "^7.18.3", + "@emotion/hash": "^0.9.0", + "@emotion/memoize": "^0.8.0", + "@emotion/serialize": "^1.1.1", + "babel-plugin-macros": "^3.1.0", + "convert-source-map": "^1.5.0", + "escape-string-regexp": "^4.0.0", + "find-root": "^1.1.0", + "source-map": "^0.5.7", + "stylis": "4.1.3" + }, + "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==" + } + } + }, + "@emotion/cache": { + "version": "11.10.5", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.10.5.tgz", + "integrity": "sha512-dGYHWyzTdmK+f2+EnIGBpkz1lKc4Zbj2KHd4cX3Wi8/OWr5pKslNjc3yABKH4adRGCvSX4VDC0i04mrrq0aiRA==", + "requires": { + "@emotion/memoize": "^0.8.0", + "@emotion/sheet": "^1.2.1", + "@emotion/utils": "^1.2.0", + "@emotion/weak-memoize": "^0.3.0", + "stylis": "4.1.3" + } + }, + "@emotion/hash": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.0.tgz", + "integrity": "sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ==" + }, + "@emotion/is-prop-valid": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.0.tgz", + "integrity": "sha512-3aDpDprjM0AwaxGE09bOPkNxHpBd+kA6jty3RnaEXdweX1DF1U3VQpPYb0g1IStAuK7SVQ1cy+bNBBKp4W3Fjg==", + "requires": { + "@emotion/memoize": "^0.8.0" + } + }, + "@emotion/memoize": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.0.tgz", + "integrity": "sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA==" + }, + "@emotion/react": { + "version": "11.10.5", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.10.5.tgz", + "integrity": "sha512-TZs6235tCJ/7iF6/rvTaOH4oxQg2gMAcdHemjwLKIjKz4rRuYe1HJ2TQJKnAcRAfOUDdU8XoDadCe1rl72iv8A==", + "requires": { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.10.5", + "@emotion/cache": "^11.10.5", + "@emotion/serialize": "^1.1.1", + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0", + "@emotion/utils": "^1.2.0", + "@emotion/weak-memoize": "^0.3.0", + "hoist-non-react-statics": "^3.3.1" + } + }, + "@emotion/serialize": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.1.tgz", + "integrity": "sha512-Zl/0LFggN7+L1liljxXdsVSVlg6E/Z/olVWpfxUTxOAmi8NU7YoeWeLfi1RmnB2TATHoaWwIBRoL+FvAJiTUQA==", + "requires": { + "@emotion/hash": "^0.9.0", + "@emotion/memoize": "^0.8.0", + "@emotion/unitless": "^0.8.0", + "@emotion/utils": "^1.2.0", + "csstype": "^3.0.2" + } + }, + "@emotion/sheet": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.1.tgz", + "integrity": "sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA==" + }, + "@emotion/styled": { + "version": "11.10.5", + "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.10.5.tgz", + "integrity": "sha512-8EP6dD7dMkdku2foLoruPCNkRevzdcBaY6q0l0OsbyJK+x8D9HWjX27ARiSIKNF634hY9Zdoedh8bJCiva8yZw==", "requires": { - "@babel/helper-validator-identifier": "^7.15.7", - "to-fast-properties": "^2.0.0" + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.10.5", + "@emotion/is-prop-valid": "^1.2.0", + "@emotion/serialize": "^1.1.1", + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0", + "@emotion/utils": "^1.2.0" } }, - "@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" + "@emotion/stylis": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" }, - "@csstools/normalize.css": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-12.0.0.tgz", - "integrity": "sha512-M0qqxAcwCsIVfpFQSlGN5XjXWu8l5JDZN+fPt1LeW5SZexQTgnaEvgXAY+CeygRw0EeppWHi12JxESWiWrB0Sg==" + "@emotion/unitless": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz", + "integrity": "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==" + }, + "@emotion/use-insertion-effect-with-fallbacks": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.0.tgz", + "integrity": "sha512-1eEgUGmkaljiBnRMTdksDV1W4kUnmwgp7X9G8B++9GYwl1lUdqSndSriIrTJ0N7LQaoauY9JJ2yhiOYK5+NI4A==", + "requires": {} + }, + "@emotion/utils": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.0.tgz", + "integrity": "sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw==" + }, + "@emotion/weak-memoize": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz", + "integrity": "sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==" }, "@eslint/eslintrc": { "version": "1.0.5", @@ -15706,6 +16875,11 @@ } } }, + "@fontsource/roboto": { + "version": "4.5.8", + "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.8.tgz", + "integrity": "sha512-CnD7zLItIzt86q4Sj3kZUiLcBk1dSk81qcqgMGaZe7SQ1P8hFNxhMl5AZthK1zrDM5m74VVhaOpuMGIL4gagaA==" + }, "@humanwhocodes/config-array": { "version": "0.9.2", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", @@ -15971,6 +17145,137 @@ "chalk": "^4.0.0" } }, + "@mui/base": { + "version": "5.0.0-alpha.115", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.115.tgz", + "integrity": "sha512-OGQ84whT/yNYd6xKCGGS6MxqEfjVjk5esXM7HP6bB2Rim7QICUapxZt4nm8q39fpT08rNDkv3xPVqDDwRdRg1g==", + "requires": { + "@babel/runtime": "^7.20.7", + "@emotion/is-prop-valid": "^1.2.0", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.2", + "@popperjs/core": "^2.11.6", + "clsx": "^1.2.1", + "prop-types": "^15.8.1", + "react-is": "^18.2.0" + }, + "dependencies": { + "react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + } + } + }, + "@mui/core-downloads-tracker": { + "version": "5.11.6", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.6.tgz", + "integrity": "sha512-lbD3qdafBOf2dlqKhOcVRxaPAujX+9UlPC6v8iMugMeAXe0TCgU3QbGXY3zrJsu6ex64WYDpH4y1+WOOBmWMuA==" + }, + "@mui/icons-material": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.11.0.tgz", + "integrity": "sha512-I2LaOKqO8a0xcLGtIozC9xoXjZAto5G5gh0FYUMAlbsIHNHIjn4Xrw9rvjY20vZonyiGrZNMAlAXYkY6JvhF6A==", + "requires": { + "@babel/runtime": "^7.20.6" + } + }, + "@mui/material": { + "version": "5.11.6", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.6.tgz", + "integrity": "sha512-MzkkL5KC2PCkFiv8cLpkzgLUPXSrAtnvJBR0emV7mLVWbkwV3n5832vjBx154B6R032fHjFTziTh7YEb50nK6Q==", + "requires": { + "@babel/runtime": "^7.20.7", + "@mui/base": "5.0.0-alpha.115", + "@mui/core-downloads-tracker": "^5.11.6", + "@mui/system": "^5.11.5", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.2", + "@types/react-transition-group": "^4.4.5", + "clsx": "^1.2.1", + "csstype": "^3.1.1", + "prop-types": "^15.8.1", + "react-is": "^18.2.0", + "react-transition-group": "^4.4.5" + }, + "dependencies": { + "react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + } + } + }, + "@mui/private-theming": { + "version": "5.11.2", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.2.tgz", + "integrity": "sha512-qZwMaqRFPwlYmqwVKblKBGKtIjJRAj3nsvX93pOmatsXyorW7N/0IPE/swPgz1VwChXhHO75DwBEx8tB+aRMNg==", + "requires": { + "@babel/runtime": "^7.20.7", + "@mui/utils": "^5.11.2", + "prop-types": "^15.8.1" + } + }, + "@mui/styled-engine": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.11.0.tgz", + "integrity": "sha512-AF06K60Zc58qf0f7X+Y/QjaHaZq16znliLnGc9iVrV/+s8Ln/FCoeNuFvhlCbZZQ5WQcJvcy59zp0nXrklGGPQ==", + "requires": { + "@babel/runtime": "^7.20.6", + "@emotion/cache": "^11.10.5", + "csstype": "^3.1.1", + "prop-types": "^15.8.1" + } + }, + "@mui/styled-engine-sc": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/styled-engine-sc/-/styled-engine-sc-5.11.0.tgz", + "integrity": "sha512-U8cA7DHB3fnLpDVM5qd/9FGnw5y+LrmwIXQ9Lzk3HYkF903tSMx9jXIbiz1vltpOfZTKX/Rn02m/nkH4OF6Pcg==", + "requires": { + "@babel/runtime": "^7.20.6", + "prop-types": "^15.8.1" + } + }, + "@mui/system": { + "version": "5.11.5", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.5.tgz", + "integrity": "sha512-KNVsJ0sgRRp2XBqhh4wPS5aacteqjwxgiYTVwVnll2fgkgunZKo3DsDiGMrFlCg25ZHA3Ax58txWGE9w58zp0w==", + "requires": { + "@babel/runtime": "^7.20.7", + "@mui/private-theming": "^5.11.2", + "@mui/styled-engine": "^5.11.0", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.2", + "clsx": "^1.2.1", + "csstype": "^3.1.1", + "prop-types": "^15.8.1" + } + }, + "@mui/types": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.3.tgz", + "integrity": "sha512-tZ+CQggbe9Ol7e/Fs5RcKwg/woU+o8DCtOnccX6KmbBc7YrfqMYEYuaIcXHuhpT880QwNkZZ3wQwvtlDFA2yOw==", + "requires": {} + }, + "@mui/utils": { + "version": "5.11.2", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.11.2.tgz", + "integrity": "sha512-AyizuHHlGdAtH5hOOXBW3kriuIwUIKUIgg0P7LzMvzf6jPhoQbENYqY6zJqfoZ7fAWMNNYT8mgN5EftNGzwE2w==", + "requires": { + "@babel/runtime": "^7.20.7", + "@types/prop-types": "^15.7.5", + "@types/react-is": "^16.7.1 || ^17.0.0", + "prop-types": "^15.8.1", + "react-is": "^18.2.0" + }, + "dependencies": { + "react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + } + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -16018,10 +17323,41 @@ } }, "@popperjs/core": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.0.tgz", - "integrity": "sha512-zrsUxjLOKAzdewIDRWy9nsV1GQsKBCWaGwsZQlCgr6/q+vjyZhFgqedLfFBuI9anTPEUT4APq9Mu0SZBTzIcGQ==", - "peer": true + "version": "2.11.6", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz", + "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==" + }, + "@react-aria/ssr": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.4.1.tgz", + "integrity": "sha512-NmhoilMDyIfQiOSdQgxpVH2tC2u85Y0mVijtBNbI9kcDYLEiW/r6vKYVKtkyU+C4qobXhGMPfZ70PTc0lysSVA==", + "requires": { + "@swc/helpers": "^0.4.14" + } + }, + "@restart/hooks": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.8.tgz", + "integrity": "sha512-Ivvp1FZ0Lja80iUTYAhbzy+stxwO7FbPHP95ypCtIh0wyOLiayQywXhVJ2ZYP5S1AjW2GmKHeRU4UglMwTG2sA==", + "requires": { + "dequal": "^2.0.2" + } + }, + "@restart/ui": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.5.3.tgz", + "integrity": "sha512-8Zx3HUMxOeC+ZmN7MwChkolpDQaV55prSgpNoGOw5heKnn32HgzEQ6Y0Rz0YqMBUtEKS0NsvNpsskve+O8qXAQ==", + "requires": { + "@babel/runtime": "^7.20.7", + "@popperjs/core": "^2.11.6", + "@react-aria/ssr": "^3.4.1", + "@restart/hooks": "^0.4.7", + "@types/warning": "^3.0.0", + "dequal": "^2.0.3", + "dom-helpers": "^5.2.0", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + } }, "@rollup/plugin-babel": { "version": "5.3.0", @@ -16212,6 +17548,14 @@ "loader-utils": "^2.0.0" } }, + "@swc/helpers": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz", + "integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==", + "requires": { + "tslib": "^2.4.0" + } + }, "@testing-library/dom": { "version": "8.11.1", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-8.11.1.tgz", @@ -16540,6 +17884,11 @@ "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.2.tgz", "integrity": "sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA==" }, + "@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + }, "@types/q": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.5.tgz", @@ -16555,6 +17904,32 @@ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" }, + "@types/react": { + "version": "18.0.27", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.27.tgz", + "integrity": "sha512-3vtRKHgVxu3Jp9t718R9BuzoD4NcQ8YJ5XRzsSKxNDiDonD2MXIT1TmSkenxuCycZJoQT5d2vE8LwWJxBC1gmA==", + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "@types/react-is": { + "version": "17.0.3", + "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.3.tgz", + "integrity": "sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==", + "requires": { + "@types/react": "*" + } + }, + "@types/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==", + "requires": { + "@types/react": "*" + } + }, "@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -16568,6 +17943,11 @@ "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==" }, + "@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + }, "@types/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", @@ -16611,6 +17991,11 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz", "integrity": "sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==" }, + "@types/warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz", + "integrity": "sha512-t/Tvs5qR47OLOr+4E9ckN8AmP2Tf16gWq+/qA4iUGS/OOyHVO8wv2vjJuX8SNOUTJyWb+2t7wJm6cXILFnOROA==" + }, "@types/ws": { "version": "8.2.2", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", @@ -16895,6 +18280,12 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==" }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -17324,6 +18715,23 @@ "@babel/helper-define-polyfill-provider": "^0.3.0" } }, + "babel-plugin-styled-components": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.0.7.tgz", + "integrity": "sha512-i7YhvPgVqRKfoQ66toiZ06jPNA3p6ierpfUuEWxNF+fV27Uv5gxBkf8KZLHUCc1nFA9j6+80pYoIpqCeyW3/bA==", + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.0", + "@babel/helper-module-imports": "^7.16.0", + "babel-plugin-syntax-jsx": "^6.18.0", + "lodash": "^4.17.11", + "picomatch": "^2.3.0" + } + }, + "babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==" + }, "babel-plugin-transform-react-remove-prop-types": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz", @@ -17480,9 +18888,9 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, "bootstrap": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", - "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz", + "integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==", "requires": {} }, "brace-expansion": { @@ -17580,6 +18988,11 @@ "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==" }, + "camelize": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", + "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==" + }, "caniuse-api": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", @@ -17660,6 +19073,11 @@ "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==" }, + "classnames": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + }, "clean-css": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.2.tgz", @@ -17683,6 +19101,11 @@ "wrap-ansi": "^7.0.0" } }, + "clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==" + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -17966,6 +19389,11 @@ "postcss-selector-parser": "^6.0.7" } }, + "css-color-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==" + }, "css-declaration-sorter": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.1.3.tgz", @@ -18080,6 +19508,16 @@ "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==" }, + "css-to-react-native": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.1.0.tgz", + "integrity": "sha512-AryfkFA29b4I3vG7N4kxFboq15DxwSXzhXM37XNEjwJMgjYIc8BcqfiprpAqX0zadI5PMByEIwAMzXxk5Vcc4g==", + "requires": { + "camelize": "^1.0.0", + "css-color-keywords": "^1.0.0", + "postcss-value-parser": "^4.0.2" + } + }, "css-tree": { "version": "1.0.0-alpha.37", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", @@ -18205,6 +19643,11 @@ } } }, + "csstype": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", + "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + }, "damerau-levenshtein": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.7.tgz", @@ -18317,6 +19760,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, + "dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==" + }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", @@ -18432,6 +19880,15 @@ "utila": "~0.4" } }, + "dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "requires": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, "dom-serializer": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", @@ -19405,6 +20862,11 @@ } } }, + "find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" + }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -19744,6 +21206,21 @@ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + }, + "dependencies": { + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } + } + }, "hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -19939,6 +21416,12 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, "immer": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.7.tgz", @@ -20067,6 +21550,14 @@ "side-channel": "^1.0.4" } }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, "ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", @@ -21063,6 +22554,11 @@ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, + "load-script": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/load-script/-/load-script-1.0.0.tgz", + "integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==" + }, "loader-runner": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", @@ -21378,6 +22874,74 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==" }, + "nodemon": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", + "dev": true, + "requires": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "requires": { + "abbrev": "1" + } + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -22501,13 +24065,29 @@ } }, "prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "requires": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", - "react-is": "^16.8.1" + "react-is": "^16.13.1" + }, + "dependencies": { + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } + } + }, + "prop-types-extra": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz", + "integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==", + "requires": { + "react-is": "^16.3.2", + "warning": "^4.0.0" }, "dependencies": { "react-is": { @@ -22538,6 +24118,12 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -22637,6 +24223,25 @@ "whatwg-fetch": "^3.6.2" } }, + "react-bootstrap": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.7.0.tgz", + "integrity": "sha512-Jcrn6aUuRVBeSB6dzKODKZU1TONOdhAxu0IDm4Sv74SJUm98dMdhSotF2SNvFEADANoR+stV+7TK6SNX1wWu5w==", + "requires": { + "@babel/runtime": "^7.17.2", + "@restart/hooks": "^0.4.6", + "@restart/ui": "^1.4.1", + "@types/react-transition-group": "^4.4.4", + "classnames": "^2.3.1", + "dom-helpers": "^5.2.1", + "invariant": "^2.2.4", + "prop-types": "^15.8.1", + "prop-types-extra": "^1.1.0", + "react-transition-group": "^4.4.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" + } + }, "react-dev-utils": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.0.tgz", @@ -22700,6 +24305,11 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, + "react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" + }, "react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", @@ -22770,6 +24380,27 @@ } } }, + "react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "requires": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + } + }, + "react-youtube": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/react-youtube/-/react-youtube-10.1.0.tgz", + "integrity": "sha512-ZfGtcVpk0SSZtWCSTYOQKhfx5/1cfyEW1JN/mugGNfAxT3rmVJeMbGpA9+e78yG21ls5nc/5uZJETE3cm3knBg==", + "requires": { + "fast-deep-equal": "3.1.3", + "prop-types": "15.8.1", + "youtube-player": "5.5.2" + } + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -22819,9 +24450,9 @@ } }, "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, "regenerator-transform": { "version": "0.14.5", @@ -23225,6 +24856,11 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -23258,6 +24894,28 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==" }, + "simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", + "dev": true, + "requires": { + "semver": "~7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, + "sister": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sister/-/sister-3.0.2.tgz", + "integrity": "sha512-p19rtTs+NksBRKW9qn0UhZ8/TUI9BPw9lmtHny+Y3TinWlOa9jWh9xB0AtPSdmOy49NJJJSSe0Ey4C7h0TrcYA==" + }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -23529,6 +25187,43 @@ "integrity": "sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==", "requires": {} }, + "styled-components": { + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.6.tgz", + "integrity": "sha512-hGTZquGAaTqhGWldX7hhfzjnIYBZ0IXQXkCYdvF1Sq3DsUaLx6+NTHC5Jj1ooM2F68sBiVz3lvhfwQs/S3l6qg==", + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/traverse": "^7.4.5", + "@emotion/is-prop-valid": "^1.1.0", + "@emotion/stylis": "^0.8.4", + "@emotion/unitless": "^0.7.4", + "babel-plugin-styled-components": ">= 1.12.0", + "css-to-react-native": "^3.0.0", + "hoist-non-react-statics": "^3.0.0", + "shallowequal": "^1.1.0", + "supports-color": "^5.5.0" + }, + "dependencies": { + "@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "stylehacks": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.0.1.tgz", @@ -23538,6 +25233,11 @@ "postcss-selector-parser": "^6.0.4" } }, + "stylis": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.1.3.tgz", + "integrity": "sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA==" + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -23840,6 +25540,15 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "requires": { + "nopt": "~1.0.10" + } + }, "tough-cookie": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", @@ -23897,9 +25606,9 @@ } }, "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "tsutils": { "version": "3.21.0", @@ -23968,6 +25677,23 @@ "which-boxed-primitive": "^1.0.2" } }, + "uncontrollable": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", + "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==", + "requires": { + "@babel/runtime": "^7.6.3", + "@types/react": ">=16.9.11", + "invariant": "^2.2.4", + "react-lifecycles-compat": "^3.0.4" + } + }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -24126,6 +25852,14 @@ "makeerror": "1.0.12" } }, + "warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "requires": { + "loose-envify": "^1.0.0" + } + }, "watchpack": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", @@ -24797,6 +26531,31 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" + }, + "youtube-player": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/youtube-player/-/youtube-player-5.5.2.tgz", + "integrity": "sha512-ZGtsemSpXnDky2AUYWgxjaopgB+shFHgXVpiJFeNB5nWEugpW1KWYDaHKuLqh2b67r24GtP6HoSW5swvf0fFIQ==", + "requires": { + "debug": "^2.6.6", + "load-script": "^1.0.0", + "sister": "^3.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + } + } } } } diff --git a/client/package.json b/client/package.json index 1bf7be0a0d..3bc8ce12e0 100644 --- a/client/package.json +++ b/client/package.json @@ -3,13 +3,22 @@ "version": "0.1.0", "private": true, "dependencies": { + "@emotion/react": "^11.10.5", + "@emotion/styled": "^11.10.5", + "@fontsource/roboto": "^4.5.8", + "@mui/icons-material": "^5.11.0", + "@mui/material": "^5.11.6", + "@mui/styled-engine-sc": "^5.11.0", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.1.10", - "bootstrap": "^5.1.3", + "bootstrap": "^5.2.3", "react": "^17.0.2", + "react-bootstrap": "^2.7.0", "react-dom": "^17.0.2", "react-scripts": "^5.0.0", + "react-youtube": "^10.1.0", + "styled-components": "^5.3.6", "web-vitals": "^1.1.2" }, "scripts": { @@ -35,5 +44,8 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "nodemon": "^2.0.20" } } diff --git a/client/public/index.html b/client/public/index.html index ee4938a321..1a50b76e46 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -10,14 +10,14 @@ content="Web site created using create-react-app" /> - + - + React App + @@ -47,5 +48,6 @@ To begin the development, run `npm start` or `yarn start`. To create a production bundle, use `npm run build` or `yarn build`. --> + diff --git a/client/src/App.js b/client/src/App.js index bcf61b17da..52d98ddb57 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,11 +1,42 @@ -import "./App.css"; +import Heading from "./Heading"; +import Home from "./Home"; +import Form from "./Form"; + +import Search from "./Search"; +import Cards from "./Cards"; +import { useState } from "react"; function App() { + const [videos, setVideos] = useState([ + { + id: 523523, + title: "Never Gonna Give You Up", + url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ", + rating: 23, + }, + { + id: 523427, + title: "The Coding Train", + url: "https://www.youtube.com/watch?v=HerCR8bw_GE", + rating: 230, + }, + ]); + + const addVideo=(video)=>{ + setVideos([video,...videos]) + } + return (
-
-

Video Recommendation

-
+ +
+
+ +
+ + + + {/*
*/}
); } diff --git a/client/src/Cards.js b/client/src/Cards.js new file mode 100644 index 0000000000..6d89d0498d --- /dev/null +++ b/client/src/Cards.js @@ -0,0 +1,27 @@ + +import React from 'react' + + + +function Cards({videos}) { + return ( +
+ { + videos.map((video)=>{ + return
+ +

{video.title}

+
+ }) + } +
+ ) +} + +export default Cards + + + + + + diff --git a/client/src/Form.js b/client/src/Form.js new file mode 100644 index 0000000000..0d987a4d1f --- /dev/null +++ b/client/src/Form.js @@ -0,0 +1,49 @@ +import React, { useState } from "react"; + +function Form({addVideo}) { + const [title, setTitle] = useState(""); + + const [url, setUrl] = useState(""); + + const [showForm, setShowForm] = useState(false); + + return ( +
+ { + e.preventDefault() + const video = { + title, + url + } + + addVideo(video) + }} id="form-input"> +

setShowForm(true)}>add video

+ {showForm && ( + <> + setTitle(e.target.value)} + className="title" + type="text" + placeholder="TITLE" + /> + setUrl(e.target.value)} + className="url" + type="text" + placeholder="URL" + /> +
+ + +
+ + )} + +
+ ); +} + +export default Form; diff --git a/client/src/Heading.js b/client/src/Heading.js new file mode 100644 index 0000000000..b159783c1c --- /dev/null +++ b/client/src/Heading.js @@ -0,0 +1,15 @@ +const Heading = () => { + + + return ( +
+
+

Video Recommendation

+
+ +
+ + ); + } + +export default Heading; \ No newline at end of file diff --git a/client/src/Home.js b/client/src/Home.js new file mode 100644 index 0000000000..105fe55bef --- /dev/null +++ b/client/src/Home.js @@ -0,0 +1,12 @@ + import React from 'react' + + function Home() { + return ( +
+ +
+ ) + } + + export default Home + \ No newline at end of file diff --git a/client/src/Search.js b/client/src/Search.js new file mode 100644 index 0000000000..cf6a7c10bc --- /dev/null +++ b/client/src/Search.js @@ -0,0 +1,14 @@ + +import React from 'react' + +function Search() { + return ( +
+ + + +
+ ); +} + +export default Search \ No newline at end of file diff --git a/client/src/index.css b/client/src/index.css index ec2585e8c0..3beed2ea41 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -1,13 +1,62 @@ -body { +*{ margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + padding: 0; + box-sizing: border-box; } -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; +body{ + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + background: #f1f5f8; + color: #222; + } + + +.App h4{ + color:#fff; + font-style: oblique; + background-color: #254e70; + padding: 2rem 0; + text-align: center; +} + +/* .search h5{ + color: rgb(65, 65, 180); + margin-top: 80px; + margin-left: 10px; +} */ +.search input[type=text] { + + padding: 6px; + border:1px solid #ccc; + + +} +.title{ + + border:1px solid #ccc; + +} +.url{ + + border:1px solid #ccc; + + margin-top: 10px; + +} +.form-container{ + display: flex; + justify-content: space-between; + padding-left: 50px; + padding-right: 50px; +} +#form-input{ + display: flex; + flex-direction: column; +} +.btn-container{ + display: flex; + justify-content: center; + gap: 20px; + margin-top: 10px; +} \ No newline at end of file diff --git a/client/src/index.js b/client/src/index.js index 846ed2ced3..43cf9f6828 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -1,11 +1,15 @@ import React from "react"; + import ReactDOM from "react-dom"; import "./index.css"; import App from "./App"; + + ReactDOM.render( + , document.getElementById("root") ); diff --git a/client/yarn.lock b/client/yarn.lock index 3d1c9847b5..97e7e22a4c 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -166,12 +166,12 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.0": - "integrity" "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==" - "resolved" "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz" - "version" "7.16.0" +"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.0", "@babel/helper-module-imports@^7.16.7": + "integrity" "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==" + "resolved" "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz" + "version" "7.18.6" dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.18.6" "@babel/helper-module-transforms@^7.16.5": "integrity" "sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==" @@ -194,10 +194,10 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - "integrity" "sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ==" - "resolved" "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz" - "version" "7.16.5" +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + "integrity" "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==" + "resolved" "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz" + "version" "7.20.2" "@babel/helper-remap-async-to-generator@^7.16.5": "integrity" "sha512-X+aAJldyxrOmN9v3FKp+Hu1NO69VWgYgDGq6YDykwRPzxs5f2N+X988CBXS7EQahDU+Vpet5QYMqLk+nsp+Qxw==" @@ -240,10 +240,15 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-validator-identifier@^7.15.7": - "integrity" "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==" - "resolved" "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz" - "version" "7.15.7" +"@babel/helper-string-parser@^7.19.4": + "integrity" "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==" + "resolved" "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz" + "version" "7.19.4" + +"@babel/helper-validator-identifier@^7.15.7", "@babel/helper-validator-identifier@^7.19.1": + "integrity" "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==" + "resolved" "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz" + "version" "7.19.1" "@babel/helper-validator-option@^7.14.5": "integrity" "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==" @@ -506,12 +511,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.16.5": - "integrity" "sha512-42OGssv9NPk4QHKVgIHlzeLgPOW5rGgfV5jzG90AhcXXIv6hu/eqj63w4VgvRxdvZY3AlYeDgPiSJ3BqAd1Y6Q==" - "resolved" "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.5.tgz" - "version" "7.16.5" +"@babel/plugin-syntax-jsx@^7.16.5", "@babel/plugin-syntax-jsx@^7.17.12": + "integrity" "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==" + "resolved" "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz" + "version" "7.18.6" dependencies: - "@babel/helper-plugin-utils" "^7.16.5" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": "integrity" "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==" @@ -1014,12 +1019,12 @@ "core-js-pure" "^3.19.0" "regenerator-runtime" "^0.13.4" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - "integrity" "sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==" - "resolved" "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.5.tgz" - "version" "7.16.5" +"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.6", "@babel/runtime@^7.20.7", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": + "integrity" "sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==" + "resolved" "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.13.tgz" + "version" "7.20.13" dependencies: - "regenerator-runtime" "^0.13.4" + "regenerator-runtime" "^0.13.11" "@babel/template@^7.16.0", "@babel/template@^7.3.3": "integrity" "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==" @@ -1030,7 +1035,7 @@ "@babel/parser" "^7.16.0" "@babel/types" "^7.16.0" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.5", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.5", "@babel/traverse@^7.4.5", "@babel/traverse@^7.7.2": "integrity" "sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==" "resolved" "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.5.tgz" "version" "7.16.5" @@ -1046,12 +1051,13 @@ "debug" "^4.1.0" "globals" "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.6", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - "integrity" "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==" - "resolved" "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz" - "version" "7.16.0" +"@babel/types@^7.0.0", "@babel/types@^7.12.6", "@babel/types@^7.16.0", "@babel/types@^7.18.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + "integrity" "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==" + "resolved" "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz" + "version" "7.20.7" dependencies: - "@babel/helper-validator-identifier" "^7.15.7" + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" "to-fast-properties" "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -1064,6 +1070,124 @@ "resolved" "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-12.0.0.tgz" "version" "12.0.0" +"@emotion/babel-plugin@^11.10.5": + "integrity" "sha512-xE7/hyLHJac7D2Ve9dKroBBZqBT7WuPQmWcq7HSGb84sUuP4mlOWoB8dvVfD9yk5DHkU1m6RW7xSoDtnQHNQeA==" + "resolved" "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.10.5.tgz" + "version" "11.10.5" + dependencies: + "@babel/helper-module-imports" "^7.16.7" + "@babel/plugin-syntax-jsx" "^7.17.12" + "@babel/runtime" "^7.18.3" + "@emotion/hash" "^0.9.0" + "@emotion/memoize" "^0.8.0" + "@emotion/serialize" "^1.1.1" + "babel-plugin-macros" "^3.1.0" + "convert-source-map" "^1.5.0" + "escape-string-regexp" "^4.0.0" + "find-root" "^1.1.0" + "source-map" "^0.5.7" + "stylis" "4.1.3" + +"@emotion/cache@^11.10.5": + "integrity" "sha512-dGYHWyzTdmK+f2+EnIGBpkz1lKc4Zbj2KHd4cX3Wi8/OWr5pKslNjc3yABKH4adRGCvSX4VDC0i04mrrq0aiRA==" + "resolved" "https://registry.npmjs.org/@emotion/cache/-/cache-11.10.5.tgz" + "version" "11.10.5" + dependencies: + "@emotion/memoize" "^0.8.0" + "@emotion/sheet" "^1.2.1" + "@emotion/utils" "^1.2.0" + "@emotion/weak-memoize" "^0.3.0" + "stylis" "4.1.3" + +"@emotion/hash@^0.9.0": + "integrity" "sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ==" + "resolved" "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.0.tgz" + "version" "0.9.0" + +"@emotion/is-prop-valid@^1.1.0", "@emotion/is-prop-valid@^1.2.0": + "integrity" "sha512-3aDpDprjM0AwaxGE09bOPkNxHpBd+kA6jty3RnaEXdweX1DF1U3VQpPYb0g1IStAuK7SVQ1cy+bNBBKp4W3Fjg==" + "resolved" "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.0.tgz" + "version" "1.2.0" + dependencies: + "@emotion/memoize" "^0.8.0" + +"@emotion/memoize@^0.8.0": + "integrity" "sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA==" + "resolved" "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.0.tgz" + "version" "0.8.0" + +"@emotion/react@^11.0.0-rc.0", "@emotion/react@^11.10.5", "@emotion/react@^11.4.1", "@emotion/react@^11.5.0": + "integrity" "sha512-TZs6235tCJ/7iF6/rvTaOH4oxQg2gMAcdHemjwLKIjKz4rRuYe1HJ2TQJKnAcRAfOUDdU8XoDadCe1rl72iv8A==" + "resolved" "https://registry.npmjs.org/@emotion/react/-/react-11.10.5.tgz" + "version" "11.10.5" + dependencies: + "@babel/runtime" "^7.18.3" + "@emotion/babel-plugin" "^11.10.5" + "@emotion/cache" "^11.10.5" + "@emotion/serialize" "^1.1.1" + "@emotion/use-insertion-effect-with-fallbacks" "^1.0.0" + "@emotion/utils" "^1.2.0" + "@emotion/weak-memoize" "^0.3.0" + "hoist-non-react-statics" "^3.3.1" + +"@emotion/serialize@^1.1.1": + "integrity" "sha512-Zl/0LFggN7+L1liljxXdsVSVlg6E/Z/olVWpfxUTxOAmi8NU7YoeWeLfi1RmnB2TATHoaWwIBRoL+FvAJiTUQA==" + "resolved" "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.1.tgz" + "version" "1.1.1" + dependencies: + "@emotion/hash" "^0.9.0" + "@emotion/memoize" "^0.8.0" + "@emotion/unitless" "^0.8.0" + "@emotion/utils" "^1.2.0" + "csstype" "^3.0.2" + +"@emotion/sheet@^1.2.1": + "integrity" "sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA==" + "resolved" "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.1.tgz" + "version" "1.2.1" + +"@emotion/styled@^11.10.5", "@emotion/styled@^11.3.0": + "integrity" "sha512-8EP6dD7dMkdku2foLoruPCNkRevzdcBaY6q0l0OsbyJK+x8D9HWjX27ARiSIKNF634hY9Zdoedh8bJCiva8yZw==" + "resolved" "https://registry.npmjs.org/@emotion/styled/-/styled-11.10.5.tgz" + "version" "11.10.5" + dependencies: + "@babel/runtime" "^7.18.3" + "@emotion/babel-plugin" "^11.10.5" + "@emotion/is-prop-valid" "^1.2.0" + "@emotion/serialize" "^1.1.1" + "@emotion/use-insertion-effect-with-fallbacks" "^1.0.0" + "@emotion/utils" "^1.2.0" + +"@emotion/stylis@^0.8.4": + "integrity" "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" + "resolved" "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz" + "version" "0.8.5" + +"@emotion/unitless@^0.7.4": + "integrity" "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" + "resolved" "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz" + "version" "0.7.5" + +"@emotion/unitless@^0.8.0": + "integrity" "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==" + "resolved" "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz" + "version" "0.8.0" + +"@emotion/use-insertion-effect-with-fallbacks@^1.0.0": + "integrity" "sha512-1eEgUGmkaljiBnRMTdksDV1W4kUnmwgp7X9G8B++9GYwl1lUdqSndSriIrTJ0N7LQaoauY9JJ2yhiOYK5+NI4A==" + "resolved" "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.0.tgz" + "version" "1.0.0" + +"@emotion/utils@^1.2.0": + "integrity" "sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw==" + "resolved" "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.0.tgz" + "version" "1.2.0" + +"@emotion/weak-memoize@^0.3.0": + "integrity" "sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==" + "resolved" "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz" + "version" "0.3.0" + "@eslint/eslintrc@^1.0.5": "integrity" "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==" "resolved" "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz" @@ -1079,6 +1203,11 @@ "minimatch" "^3.0.4" "strip-json-comments" "^3.1.1" +"@fontsource/roboto@^4.5.8": + "integrity" "sha512-CnD7zLItIzt86q4Sj3kZUiLcBk1dSk81qcqgMGaZe7SQ1P8hFNxhMl5AZthK1zrDM5m74VVhaOpuMGIL4gagaA==" + "resolved" "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.8.tgz" + "version" "4.5.8" + "@humanwhocodes/config-array@^0.9.2": "integrity" "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==" "resolved" "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz" @@ -1289,6 +1418,107 @@ "@types/yargs" "^16.0.0" "chalk" "^4.0.0" +"@mui/base@5.0.0-alpha.115": + "integrity" "sha512-OGQ84whT/yNYd6xKCGGS6MxqEfjVjk5esXM7HP6bB2Rim7QICUapxZt4nm8q39fpT08rNDkv3xPVqDDwRdRg1g==" + "resolved" "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.115.tgz" + "version" "5.0.0-alpha.115" + dependencies: + "@babel/runtime" "^7.20.7" + "@emotion/is-prop-valid" "^1.2.0" + "@mui/types" "^7.2.3" + "@mui/utils" "^5.11.2" + "@popperjs/core" "^2.11.6" + "clsx" "^1.2.1" + "prop-types" "^15.8.1" + "react-is" "^18.2.0" + +"@mui/core-downloads-tracker@^5.11.6": + "integrity" "sha512-lbD3qdafBOf2dlqKhOcVRxaPAujX+9UlPC6v8iMugMeAXe0TCgU3QbGXY3zrJsu6ex64WYDpH4y1+WOOBmWMuA==" + "resolved" "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.6.tgz" + "version" "5.11.6" + +"@mui/icons-material@^5.11.0": + "integrity" "sha512-I2LaOKqO8a0xcLGtIozC9xoXjZAto5G5gh0FYUMAlbsIHNHIjn4Xrw9rvjY20vZonyiGrZNMAlAXYkY6JvhF6A==" + "resolved" "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.11.0.tgz" + "version" "5.11.0" + dependencies: + "@babel/runtime" "^7.20.6" + +"@mui/material@^5.0.0", "@mui/material@^5.11.6": + "integrity" "sha512-MzkkL5KC2PCkFiv8cLpkzgLUPXSrAtnvJBR0emV7mLVWbkwV3n5832vjBx154B6R032fHjFTziTh7YEb50nK6Q==" + "resolved" "https://registry.npmjs.org/@mui/material/-/material-5.11.6.tgz" + "version" "5.11.6" + dependencies: + "@babel/runtime" "^7.20.7" + "@mui/base" "5.0.0-alpha.115" + "@mui/core-downloads-tracker" "^5.11.6" + "@mui/system" "^5.11.5" + "@mui/types" "^7.2.3" + "@mui/utils" "^5.11.2" + "@types/react-transition-group" "^4.4.5" + "clsx" "^1.2.1" + "csstype" "^3.1.1" + "prop-types" "^15.8.1" + "react-is" "^18.2.0" + "react-transition-group" "^4.4.5" + +"@mui/private-theming@^5.11.2": + "integrity" "sha512-qZwMaqRFPwlYmqwVKblKBGKtIjJRAj3nsvX93pOmatsXyorW7N/0IPE/swPgz1VwChXhHO75DwBEx8tB+aRMNg==" + "resolved" "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.2.tgz" + "version" "5.11.2" + dependencies: + "@babel/runtime" "^7.20.7" + "@mui/utils" "^5.11.2" + "prop-types" "^15.8.1" + +"@mui/styled-engine-sc@^5.11.0": + "integrity" "sha512-U8cA7DHB3fnLpDVM5qd/9FGnw5y+LrmwIXQ9Lzk3HYkF903tSMx9jXIbiz1vltpOfZTKX/Rn02m/nkH4OF6Pcg==" + "resolved" "https://registry.npmjs.org/@mui/styled-engine-sc/-/styled-engine-sc-5.11.0.tgz" + "version" "5.11.0" + dependencies: + "@babel/runtime" "^7.20.6" + "prop-types" "^15.8.1" + +"@mui/styled-engine@^5.11.0": + "integrity" "sha512-AF06K60Zc58qf0f7X+Y/QjaHaZq16znliLnGc9iVrV/+s8Ln/FCoeNuFvhlCbZZQ5WQcJvcy59zp0nXrklGGPQ==" + "resolved" "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.11.0.tgz" + "version" "5.11.0" + dependencies: + "@babel/runtime" "^7.20.6" + "@emotion/cache" "^11.10.5" + "csstype" "^3.1.1" + "prop-types" "^15.8.1" + +"@mui/system@^5.11.5": + "integrity" "sha512-KNVsJ0sgRRp2XBqhh4wPS5aacteqjwxgiYTVwVnll2fgkgunZKo3DsDiGMrFlCg25ZHA3Ax58txWGE9w58zp0w==" + "resolved" "https://registry.npmjs.org/@mui/system/-/system-5.11.5.tgz" + "version" "5.11.5" + dependencies: + "@babel/runtime" "^7.20.7" + "@mui/private-theming" "^5.11.2" + "@mui/styled-engine" "^5.11.0" + "@mui/types" "^7.2.3" + "@mui/utils" "^5.11.2" + "clsx" "^1.2.1" + "csstype" "^3.1.1" + "prop-types" "^15.8.1" + +"@mui/types@^7.2.3": + "integrity" "sha512-tZ+CQggbe9Ol7e/Fs5RcKwg/woU+o8DCtOnccX6KmbBc7YrfqMYEYuaIcXHuhpT880QwNkZZ3wQwvtlDFA2yOw==" + "resolved" "https://registry.npmjs.org/@mui/types/-/types-7.2.3.tgz" + "version" "7.2.3" + +"@mui/utils@^5.11.2": + "integrity" "sha512-AyizuHHlGdAtH5hOOXBW3kriuIwUIKUIgg0P7LzMvzf6jPhoQbENYqY6zJqfoZ7fAWMNNYT8mgN5EftNGzwE2w==" + "resolved" "https://registry.npmjs.org/@mui/utils/-/utils-5.11.2.tgz" + "version" "5.11.2" + dependencies: + "@babel/runtime" "^7.20.7" + "@types/prop-types" "^15.7.5" + "@types/react-is" "^16.7.1 || ^17.0.0" + "prop-types" "^15.8.1" + "react-is" "^18.2.0" + "@nodelib/fs.scandir@2.1.5": "integrity" "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==" "resolved" "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" @@ -1325,10 +1555,39 @@ "schema-utils" "^3.0.0" "source-map" "^0.7.3" -"@popperjs/core@^2.10.2": - "integrity" "sha512-zrsUxjLOKAzdewIDRWy9nsV1GQsKBCWaGwsZQlCgr6/q+vjyZhFgqedLfFBuI9anTPEUT4APq9Mu0SZBTzIcGQ==" - "resolved" "https://registry.npmjs.org/@popperjs/core/-/core-2.11.0.tgz" - "version" "2.11.0" +"@popperjs/core@^2.11.6": + "integrity" "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==" + "resolved" "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz" + "version" "2.11.6" + +"@react-aria/ssr@^3.4.1": + "integrity" "sha512-NmhoilMDyIfQiOSdQgxpVH2tC2u85Y0mVijtBNbI9kcDYLEiW/r6vKYVKtkyU+C4qobXhGMPfZ70PTc0lysSVA==" + "resolved" "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.4.1.tgz" + "version" "3.4.1" + dependencies: + "@swc/helpers" "^0.4.14" + +"@restart/hooks@^0.4.6", "@restart/hooks@^0.4.7": + "integrity" "sha512-Ivvp1FZ0Lja80iUTYAhbzy+stxwO7FbPHP95ypCtIh0wyOLiayQywXhVJ2ZYP5S1AjW2GmKHeRU4UglMwTG2sA==" + "resolved" "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.8.tgz" + "version" "0.4.8" + dependencies: + "dequal" "^2.0.2" + +"@restart/ui@^1.4.1": + "integrity" "sha512-8Zx3HUMxOeC+ZmN7MwChkolpDQaV55prSgpNoGOw5heKnn32HgzEQ6Y0Rz0YqMBUtEKS0NsvNpsskve+O8qXAQ==" + "resolved" "https://registry.npmjs.org/@restart/ui/-/ui-1.5.3.tgz" + "version" "1.5.3" + dependencies: + "@babel/runtime" "^7.20.7" + "@popperjs/core" "^2.11.6" + "@react-aria/ssr" "^3.4.1" + "@restart/hooks" "^0.4.7" + "@types/warning" "^3.0.0" + "dequal" "^2.0.3" + "dom-helpers" "^5.2.0" + "uncontrollable" "^7.2.1" + "warning" "^4.0.3" "@rollup/plugin-babel@^5.2.0": "integrity" "sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw==" @@ -1499,6 +1758,13 @@ "@svgr/plugin-svgo" "^5.5.0" "loader-utils" "^2.0.0" +"@swc/helpers@^0.4.14": + "integrity" "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==" + "resolved" "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz" + "version" "0.4.14" + dependencies: + "tslib" "^2.4.0" + "@testing-library/dom@^7.28.1": "integrity" "sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ==" "resolved" "https://registry.npmjs.org/@testing-library/dom/-/dom-7.31.2.tgz" @@ -1756,6 +2022,11 @@ "resolved" "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.2.tgz" "version" "2.4.2" +"@types/prop-types@*", "@types/prop-types@^15.7.5": + "integrity" "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + "resolved" "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz" + "version" "15.7.5" + "@types/q@^1.5.1": "integrity" "sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ==" "resolved" "https://registry.npmjs.org/@types/q/-/q-1.5.5.tgz" @@ -1771,6 +2042,29 @@ "resolved" "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz" "version" "1.2.4" +"@types/react-is@^16.7.1 || ^17.0.0": + "integrity" "sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==" + "resolved" "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.3.tgz" + "version" "17.0.3" + dependencies: + "@types/react" "*" + +"@types/react-transition-group@^4.4.4", "@types/react-transition-group@^4.4.5": + "integrity" "sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==" + "resolved" "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz" + "version" "4.4.5" + dependencies: + "@types/react" "*" + +"@types/react@*", "@types/react@^17.0.0 || ^18.0.0", "@types/react@>=16.14.8", "@types/react@>=16.9.11": + "integrity" "sha512-3vtRKHgVxu3Jp9t718R9BuzoD4NcQ8YJ5XRzsSKxNDiDonD2MXIT1TmSkenxuCycZJoQT5d2vE8LwWJxBC1gmA==" + "resolved" "https://registry.npmjs.org/@types/react/-/react-18.0.27.tgz" + "version" "18.0.27" + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + "csstype" "^3.0.2" + "@types/resolve@1.17.1": "integrity" "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==" "resolved" "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz" @@ -1783,6 +2077,11 @@ "resolved" "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz" "version" "0.12.1" +"@types/scheduler@*": + "integrity" "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + "resolved" "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz" + "version" "0.16.2" + "@types/serve-index@^1.9.1": "integrity" "sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==" "resolved" "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz" @@ -1822,6 +2121,11 @@ "resolved" "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.2.tgz" "version" "2.0.2" +"@types/warning@^3.0.0": + "integrity" "sha512-t/Tvs5qR47OLOr+4E9ckN8AmP2Tf16gWq+/qA4iUGS/OOyHVO8wv2vjJuX8SNOUTJyWb+2t7wJm6cXILFnOROA==" + "resolved" "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz" + "version" "3.0.0" + "@types/ws@^8.2.2": "integrity" "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==" "resolved" "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz" @@ -2054,6 +2358,11 @@ "resolved" "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz" "version" "2.0.5" +"abbrev@1": + "integrity" "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "resolved" "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" + "version" "1.1.1" + "accepts@~1.3.4", "accepts@~1.3.5", "accepts@~1.3.7": "integrity" "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==" "resolved" "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz" @@ -2478,6 +2787,22 @@ dependencies: "@babel/helper-define-polyfill-provider" "^0.3.0" +"babel-plugin-styled-components@>= 1.12.0": + "integrity" "sha512-i7YhvPgVqRKfoQ66toiZ06jPNA3p6ierpfUuEWxNF+fV27Uv5gxBkf8KZLHUCc1nFA9j6+80pYoIpqCeyW3/bA==" + "resolved" "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.0.7.tgz" + "version" "2.0.7" + dependencies: + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-module-imports" "^7.16.0" + "babel-plugin-syntax-jsx" "^6.18.0" + "lodash" "^4.17.11" + "picomatch" "^2.3.0" + +"babel-plugin-syntax-jsx@^6.18.0": + "integrity" "sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==" + "resolved" "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz" + "version" "6.18.0" + "babel-plugin-transform-react-remove-prop-types@^0.4.24": "integrity" "sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==" "resolved" "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz" @@ -2599,10 +2924,10 @@ "resolved" "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz" "version" "1.0.0" -"bootstrap@^5.1.3": - "integrity" "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==" - "resolved" "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz" - "version" "5.1.3" +"bootstrap@^5.2.3": + "integrity" "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==" + "resolved" "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz" + "version" "5.2.3" "brace-expansion@^1.1.7": "integrity" "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==" @@ -2703,6 +3028,11 @@ "resolved" "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz" "version" "6.2.1" +"camelize@^1.0.0": + "integrity" "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==" + "resolved" "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz" + "version" "1.0.1" + "caniuse-api@^3.0.0": "integrity" "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==" "resolved" "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz" @@ -2811,6 +3141,11 @@ "resolved" "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz" "version" "1.2.2" +"classnames@^2.3.1": + "integrity" "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + "resolved" "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz" + "version" "2.3.2" + "clean-css@^5.2.2": "integrity" "sha512-/eR8ru5zyxKzpBLv9YZvMXgTSSQn7AdkMItMYynsFgGwTveCRVam9IUPFloE85B4vAIj05IuKmmEoV7/AQjT0w==" "resolved" "https://registry.npmjs.org/clean-css/-/clean-css-5.2.2.tgz" @@ -2832,6 +3167,11 @@ "strip-ansi" "^6.0.0" "wrap-ansi" "^7.0.0" +"clsx@^1.2.1": + "integrity" "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==" + "resolved" "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz" + "version" "1.2.1" + "co@^4.6.0": "integrity" "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" "resolved" "https://registry.npmjs.org/co/-/co-4.6.0.tgz" @@ -2969,7 +3309,7 @@ "resolved" "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz" "version" "1.0.4" -"convert-source-map@^1.4.0", "convert-source-map@^1.6.0", "convert-source-map@^1.7.0": +"convert-source-map@^1.4.0", "convert-source-map@^1.5.0", "convert-source-map@^1.6.0", "convert-source-map@^1.7.0": "integrity" "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==" "resolved" "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz" "version" "1.8.0" @@ -3052,6 +3392,11 @@ dependencies: "postcss-selector-parser" "^6.0.7" +"css-color-keywords@^1.0.0": + "integrity" "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==" + "resolved" "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz" + "version" "1.0.0" + "css-declaration-sorter@^6.0.3": "integrity" "sha512-SvjQjNRZgh4ULK1LDJ2AduPKUKxIqmtU7ZAyi47BTV+M90Qvxr9AB6lKlLbDUfXqI9IQeYA8LbAsCZPpJEV3aA==" "resolved" "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.1.3.tgz" @@ -3123,6 +3468,15 @@ "domutils" "^2.8.0" "nth-check" "^2.0.1" +"css-to-react-native@^3.0.0": + "integrity" "sha512-AryfkFA29b4I3vG7N4kxFboq15DxwSXzhXM37XNEjwJMgjYIc8BcqfiprpAqX0zadI5PMByEIwAMzXxk5Vcc4g==" + "resolved" "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "camelize" "^1.0.0" + "css-color-keywords" "^1.0.0" + "postcss-value-parser" "^4.0.2" + "css-tree@^1.1.2": "integrity" "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==" "resolved" "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz" @@ -3254,6 +3608,11 @@ dependencies: "cssom" "~0.3.6" +"csstype@^3.0.2", "csstype@^3.1.1": + "integrity" "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + "resolved" "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz" + "version" "3.1.1" + "damerau-levenshtein@^1.0.7": "integrity" "sha512-VvdQIPGdWP0SqFXghj79Wf/5LArmreyMsGLa6FG6iC4t3j7j5s71TrwWmT/4akbDQIqjfACkLZmjXhA7g2oUZw==" "resolved" "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.7.tgz" @@ -3275,6 +3634,13 @@ dependencies: "ms" "2.0.0" +"debug@^2.6.6": + "integrity" "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==" + "resolved" "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" + "version" "2.6.9" + dependencies: + "ms" "2.0.0" + "debug@^2.6.9": "integrity" "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==" "resolved" "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" @@ -3395,6 +3761,11 @@ "resolved" "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" "version" "1.1.2" +"dequal@^2.0.2", "dequal@^2.0.3": + "integrity" "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==" + "resolved" "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz" + "version" "2.0.3" + "destroy@~1.0.4": "integrity" "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" "resolved" "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz" @@ -3495,6 +3866,14 @@ dependencies: "utila" "~0.4" +"dom-helpers@^5.0.1", "dom-helpers@^5.2.0", "dom-helpers@^5.2.1": + "integrity" "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==" + "resolved" "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz" + "version" "5.2.1" + dependencies: + "@babel/runtime" "^7.8.7" + "csstype" "^3.0.2" + "dom-serializer@^1.0.1": "integrity" "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==" "resolved" "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz" @@ -4082,7 +4461,7 @@ "utils-merge" "1.0.1" "vary" "~1.1.2" -"fast-deep-equal@^3.1.1", "fast-deep-equal@^3.1.3": +"fast-deep-equal@^3.1.1", "fast-deep-equal@^3.1.3", "fast-deep-equal@3.1.3": "integrity" "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" "resolved" "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" "version" "3.1.3" @@ -4185,6 +4564,11 @@ "make-dir" "^3.0.2" "pkg-dir" "^4.1.0" +"find-root@^1.1.0": + "integrity" "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" + "resolved" "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz" + "version" "1.1.0" + "find-up@^2.1.0": "integrity" "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=" "resolved" "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz" @@ -4521,6 +4905,13 @@ "resolved" "https://registry.npmjs.org/he/-/he-1.2.0.tgz" "version" "1.2.0" +"hoist-non-react-statics@^3.0.0", "hoist-non-react-statics@^3.3.1": + "integrity" "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==" + "resolved" "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz" + "version" "3.3.2" + dependencies: + "react-is" "^16.7.0" + "hoopy@^0.1.4": "integrity" "sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==" "resolved" "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz" @@ -4691,6 +5082,11 @@ dependencies: "harmony-reflect" "^1.4.6" +"ignore-by-default@^1.0.1": + "integrity" "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + "resolved" "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz" + "version" "1.0.1" + "ignore@^4.0.6": "integrity" "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" "resolved" "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz" @@ -4783,6 +5179,13 @@ "has" "^1.0.3" "side-channel" "^1.0.4" +"invariant@^2.2.4": + "integrity" "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==" + "resolved" "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz" + "version" "2.2.4" + dependencies: + "loose-envify" "^1.0.0" + "ip@^1.1.0": "integrity" "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" "resolved" "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz" @@ -5679,6 +6082,11 @@ "resolved" "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" "version" "1.2.4" +"load-script@^1.0.0": + "integrity" "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==" + "resolved" "https://registry.npmjs.org/load-script/-/load-script-1.0.0.tgz" + "version" "1.0.0" + "loader-runner@^4.2.0": "integrity" "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==" "resolved" "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz" @@ -5762,12 +6170,12 @@ "resolved" "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz" "version" "4.5.0" -"lodash@^4.17.14", "lodash@^4.17.15", "lodash@^4.17.20", "lodash@^4.17.21", "lodash@^4.7.0": +"lodash@^4.17.11", "lodash@^4.17.14", "lodash@^4.17.15", "lodash@^4.17.20", "lodash@^4.17.21", "lodash@^4.7.0": "integrity" "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" "resolved" "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" "version" "4.17.21" -"loose-envify@^1.1.0", "loose-envify@^1.4.0": +"loose-envify@^1.0.0", "loose-envify@^1.1.0", "loose-envify@^1.4.0": "integrity" "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==" "resolved" "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" "version" "1.4.0" @@ -5910,6 +6318,13 @@ dependencies: "brace-expansion" "^1.1.7" +"minimatch@^3.1.2": + "integrity" "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==" + "resolved" "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" + "version" "3.1.2" + dependencies: + "brace-expansion" "^1.1.7" + "minimist@^1.1.1", "minimist@^1.2.0", "minimist@^1.2.5": "integrity" "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" "resolved" "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" @@ -5993,6 +6408,29 @@ "resolved" "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz" "version" "2.0.1" +"nodemon@^2.0.20": + "integrity" "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==" + "resolved" "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz" + "version" "2.0.20" + dependencies: + "chokidar" "^3.5.2" + "debug" "^3.2.7" + "ignore-by-default" "^1.0.1" + "minimatch" "^3.1.2" + "pstree.remy" "^1.1.8" + "semver" "^5.7.1" + "simple-update-notifier" "^1.0.7" + "supports-color" "^5.5.0" + "touch" "^3.1.0" + "undefsafe" "^2.0.5" + +"nopt@~1.0.10": + "integrity" "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==" + "resolved" "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz" + "version" "1.0.10" + dependencies: + "abbrev" "1" + "normalize-path@^3.0.0", "normalize-path@~3.0.0": "integrity" "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" "resolved" "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" @@ -6354,7 +6792,7 @@ "resolved" "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" "version" "1.0.0" -"picomatch@^2.0.4", "picomatch@^2.2.1", "picomatch@^2.2.2", "picomatch@^2.2.3": +"picomatch@^2.0.4", "picomatch@^2.2.1", "picomatch@^2.2.2", "picomatch@^2.2.3", "picomatch@^2.3.0": "integrity" "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" "resolved" "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" "version" "2.3.0" @@ -6985,14 +7423,22 @@ "kleur" "^3.0.3" "sisteransi" "^1.0.5" -"prop-types@^15.7.2": - "integrity" "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==" - "resolved" "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz" - "version" "15.7.2" +"prop-types-extra@^1.1.0": + "integrity" "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==" + "resolved" "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz" + "version" "1.1.1" + dependencies: + "react-is" "^16.3.2" + "warning" "^4.0.0" + +"prop-types@^15.6.2", "prop-types@^15.7.2", "prop-types@^15.8.1", "prop-types@15.8.1": + "integrity" "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==" + "resolved" "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz" + "version" "15.8.1" dependencies: "loose-envify" "^1.4.0" "object-assign" "^4.1.1" - "react-is" "^16.8.1" + "react-is" "^16.13.1" "proxy-addr@~2.0.7": "integrity" "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==" @@ -7007,6 +7453,11 @@ "resolved" "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" "version" "1.8.0" +"pstree.remy@^1.1.8": + "integrity" "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + "resolved" "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz" + "version" "1.1.8" + "punycode@^2.1.0", "punycode@^2.1.1": "integrity" "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" "resolved" "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" @@ -7083,6 +7534,24 @@ "regenerator-runtime" "^0.13.9" "whatwg-fetch" "^3.6.2" +"react-bootstrap@^2.7.0": + "integrity" "sha512-Jcrn6aUuRVBeSB6dzKODKZU1TONOdhAxu0IDm4Sv74SJUm98dMdhSotF2SNvFEADANoR+stV+7TK6SNX1wWu5w==" + "resolved" "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.7.0.tgz" + "version" "2.7.0" + dependencies: + "@babel/runtime" "^7.17.2" + "@restart/hooks" "^0.4.6" + "@restart/ui" "^1.4.1" + "@types/react-transition-group" "^4.4.4" + "classnames" "^2.3.1" + "dom-helpers" "^5.2.1" + "invariant" "^2.2.4" + "prop-types" "^15.8.1" + "prop-types-extra" "^1.1.0" + "react-transition-group" "^4.4.2" + "uncontrollable" "^7.2.1" + "warning" "^4.0.3" + "react-dev-utils@^12.0.0": "integrity" "sha512-xBQkitdxozPxt1YZ9O1097EJiVpwHr9FoAuEVURCKV0Av8NBERovJauzP7bo1ThvuhZ4shsQ1AJiu4vQpoT1AQ==" "resolved" "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.0.tgz" @@ -7113,7 +7582,7 @@ "strip-ansi" "^6.0.1" "text-table" "^0.2.0" -"react-dom@*", "react-dom@^17.0.2": +"react-dom@*", "react-dom@^17.0.0 || ^18.0.0", "react-dom@^17.0.2", "react-dom@>= 16.8.0", "react-dom@>=16.14.0", "react-dom@>=16.6.0": "integrity" "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==" "resolved" "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz" "version" "17.0.2" @@ -7127,16 +7596,36 @@ "resolved" "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.10.tgz" "version" "6.0.10" -"react-is@^16.8.1": +"react-is@^16.13.1": + "integrity" "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + "resolved" "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz" + "version" "16.13.1" + +"react-is@^16.3.2": + "integrity" "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + "resolved" "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz" + "version" "16.13.1" + +"react-is@^16.7.0": "integrity" "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" "resolved" "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz" "version" "16.13.1" -"react-is@^17.0.1": +"react-is@^17.0.1", "react-is@>= 16.8.0": "integrity" "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" "resolved" "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz" "version" "17.0.2" +"react-is@^18.2.0": + "integrity" "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + "resolved" "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" + "version" "18.2.0" + +"react-lifecycles-compat@^3.0.4": + "integrity" "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" + "resolved" "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz" + "version" "3.0.4" + "react-refresh@^0.11.0", "react-refresh@>=0.10.0 <1.0.0": "integrity" "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==" "resolved" "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz" @@ -7197,7 +7686,26 @@ optionalDependencies: "fsevents" "^2.3.2" -"react@*", "react@^17.0.2", "react@>= 16", "react@17.0.2": +"react-transition-group@^4.4.2", "react-transition-group@^4.4.5": + "integrity" "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==" + "resolved" "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz" + "version" "4.4.5" + dependencies: + "@babel/runtime" "^7.5.5" + "dom-helpers" "^5.0.1" + "loose-envify" "^1.4.0" + "prop-types" "^15.6.2" + +"react-youtube@^10.1.0": + "integrity" "sha512-ZfGtcVpk0SSZtWCSTYOQKhfx5/1cfyEW1JN/mugGNfAxT3rmVJeMbGpA9+e78yG21ls5nc/5uZJETE3cm3knBg==" + "resolved" "https://registry.npmjs.org/react-youtube/-/react-youtube-10.1.0.tgz" + "version" "10.1.0" + dependencies: + "fast-deep-equal" "3.1.3" + "prop-types" "15.8.1" + "youtube-player" "5.5.2" + +"react@*", "react@^16.8.0 || ^17.0.0-rc.1 || ^18.0.0", "react@^17.0.0 || ^18.0.0", "react@^17.0.2", "react@>= 16", "react@>= 16.8.0", "react@>=0.14.0", "react@>=0.14.1", "react@>=15.0.0", "react@>=16.14.0", "react@>=16.6.0", "react@>=16.8.0", "react@17.0.2": "integrity" "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==" "resolved" "https://registry.npmjs.org/react/-/react-17.0.2.tgz" "version" "17.0.2" @@ -7261,10 +7769,10 @@ "resolved" "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz" "version" "1.4.2" -"regenerator-runtime@^0.13.4", "regenerator-runtime@^0.13.9": - "integrity" "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" - "resolved" "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz" - "version" "0.13.9" +"regenerator-runtime@^0.13.11", "regenerator-runtime@^0.13.4", "regenerator-runtime@^0.13.9": + "integrity" "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + "resolved" "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz" + "version" "0.13.11" "regenerator-transform@^0.14.2": "integrity" "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==" @@ -7538,6 +8046,11 @@ dependencies: "node-forge" "^0.10.0" +"semver@^5.7.1": + "integrity" "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "resolved" "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" + "version" "5.7.1" + "semver@^6.0.0", "semver@^6.1.1", "semver@^6.1.2", "semver@^6.3.0": "integrity" "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" "resolved" "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" @@ -7564,6 +8077,11 @@ dependencies: "lru-cache" "^6.0.0" +"semver@~7.0.0": + "integrity" "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==" + "resolved" "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz" + "version" "7.0.0" + "semver@7.0.0": "integrity" "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==" "resolved" "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz" @@ -7635,6 +8153,11 @@ "resolved" "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz" "version" "1.2.0" +"shallowequal@^1.1.0": + "integrity" "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" + "resolved" "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz" + "version" "1.1.0" + "shebang-command@^2.0.0": "integrity" "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==" "resolved" "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" @@ -7666,6 +8189,18 @@ "resolved" "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz" "version" "3.0.6" +"simple-update-notifier@^1.0.7": + "integrity" "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==" + "resolved" "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "semver" "~7.0.0" + +"sister@^3.0.0": + "integrity" "sha512-p19rtTs+NksBRKW9qn0UhZ8/TUI9BPw9lmtHny+Y3TinWlOa9jWh9xB0AtPSdmOy49NJJJSSe0Ey4C7h0TrcYA==" + "resolved" "https://registry.npmjs.org/sister/-/sister-3.0.2.tgz" + "version" "3.0.2" + "sisteransi@^1.0.5": "integrity" "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" "resolved" "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" @@ -7740,6 +8275,11 @@ "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" "version" "0.5.7" +"source-map@^0.5.7": + "integrity" "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==" + "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" + "version" "0.5.7" + "source-map@^0.6.0", "source-map@^0.6.1", "source-map@~0.6.0", "source-map@~0.6.1", "source-map@0.6.1": "integrity" "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" @@ -7958,6 +8498,22 @@ "resolved" "https://registry.npmjs.org/style-loader/-/style-loader-3.3.1.tgz" "version" "3.3.1" +"styled-components@^5.3.1", "styled-components@^5.3.6", "styled-components@>= 2": + "integrity" "sha512-hGTZquGAaTqhGWldX7hhfzjnIYBZ0IXQXkCYdvF1Sq3DsUaLx6+NTHC5Jj1ooM2F68sBiVz3lvhfwQs/S3l6qg==" + "resolved" "https://registry.npmjs.org/styled-components/-/styled-components-5.3.6.tgz" + "version" "5.3.6" + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/traverse" "^7.4.5" + "@emotion/is-prop-valid" "^1.1.0" + "@emotion/stylis" "^0.8.4" + "@emotion/unitless" "^0.7.4" + "babel-plugin-styled-components" ">= 1.12.0" + "css-to-react-native" "^3.0.0" + "hoist-non-react-statics" "^3.0.0" + "shallowequal" "^1.1.0" + "supports-color" "^5.5.0" + "stylehacks@^5.0.1": "integrity" "sha512-Es0rVnHIqbWzveU1b24kbw92HsebBepxfcqe5iix7t9j0PQqhs0IxXVXv0pY2Bxa08CgMkzD6OWql7kbGOuEdA==" "resolved" "https://registry.npmjs.org/stylehacks/-/stylehacks-5.0.1.tgz" @@ -7966,6 +8522,11 @@ "browserslist" "^4.16.0" "postcss-selector-parser" "^6.0.4" +"stylis@4.1.3": + "integrity" "sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA==" + "resolved" "https://registry.npmjs.org/stylis/-/stylis-4.1.3.tgz" + "version" "4.1.3" + "supports-color@^5.3.0": "integrity" "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==" "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" @@ -7973,6 +8534,13 @@ dependencies: "has-flag" "^3.0.0" +"supports-color@^5.5.0": + "integrity" "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==" + "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" + "version" "5.5.0" + dependencies: + "has-flag" "^3.0.0" + "supports-color@^7.0.0", "supports-color@^7.1.0": "integrity" "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==" "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" @@ -8175,6 +8743,13 @@ "resolved" "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz" "version" "1.0.1" +"touch@^3.1.0": + "integrity" "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==" + "resolved" "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "nopt" "~1.0.10" + "tough-cookie@^4.0.0": "integrity" "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==" "resolved" "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz" @@ -8218,10 +8793,10 @@ "resolved" "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" "version" "1.14.1" -"tslib@^2.0.3": - "integrity" "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - "resolved" "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz" - "version" "2.3.1" +"tslib@^2.0.3", "tslib@^2.4.0": + "integrity" "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + "resolved" "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz" + "version" "2.5.0" "tsutils@^3.21.0": "integrity" "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==" @@ -8294,6 +8869,21 @@ "has-symbols" "^1.0.2" "which-boxed-primitive" "^1.0.2" +"uncontrollable@^7.2.1": + "integrity" "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==" + "resolved" "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz" + "version" "7.2.1" + dependencies: + "@babel/runtime" "^7.6.3" + "@types/react" ">=16.9.11" + "invariant" "^2.2.4" + "react-lifecycles-compat" "^3.0.4" + +"undefsafe@^2.0.5": + "integrity" "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + "resolved" "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz" + "version" "2.0.5" + "unicode-canonical-property-names-ecmascript@^2.0.0": "integrity" "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==" "resolved" "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" @@ -8434,6 +9024,13 @@ dependencies: "makeerror" "1.0.12" +"warning@^4.0.0", "warning@^4.0.3": + "integrity" "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==" + "resolved" "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz" + "version" "4.0.3" + dependencies: + "loose-envify" "^1.0.0" + "watchpack@^2.3.1": "integrity" "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==" "resolved" "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz" @@ -8911,3 +9508,12 @@ "integrity" "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" "resolved" "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" "version" "0.1.0" + +"youtube-player@5.5.2": + "integrity" "sha512-ZGtsemSpXnDky2AUYWgxjaopgB+shFHgXVpiJFeNB5nWEugpW1KWYDaHKuLqh2b67r24GtP6HoSW5swvf0fFIQ==" + "resolved" "https://registry.npmjs.org/youtube-player/-/youtube-player-5.5.2.tgz" + "version" "5.5.2" + dependencies: + "debug" "^2.6.6" + "load-script" "^1.0.0" + "sister" "^3.0.0" From 988d7cfc461bf362fd98144261178c86731d8d0c Mon Sep 17 00:00:00 2001 From: Ansu Jammeh Date: Tue, 31 Jan 2023 11:01:27 +0000 Subject: [PATCH 02/44] completed level1 --- client/package-lock.json | 83 +++++++++++++++++++++++++++++++++++++--- client/package.json | 2 + client/src/App.js | 60 +++++++++++++++++++---------- client/src/Cards.js | 14 +++++-- client/src/Form.js | 3 +- client/src/Heading.js | 14 +++---- client/src/index.css | 20 ++++++++++ client/yarn.lock | 36 +++++++++++++++-- 8 files changed, 190 insertions(+), 42 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index 07f71c568b..97b6d1623d 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -17,10 +17,12 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.1.10", + "axios": "^1.2.6", "bootstrap": "^5.2.3", "react": "^17.0.2", "react-bootstrap": "^2.7.0", "react-dom": "^17.0.2", + "react-icons": "^4.7.1", "react-scripts": "^5.0.0", "react-youtube": "^10.1.0", "styled-components": "^5.3.6", @@ -4483,6 +4485,29 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.6.tgz", + "integrity": "sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -7576,9 +7601,9 @@ "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==" }, "node_modules/follow-redirects": { - "version": "1.14.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz", - "integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==", + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "funding": [ { "type": "individual", @@ -12220,6 +12245,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -12483,6 +12513,14 @@ "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.10.tgz", "integrity": "sha512-mKR90fX7Pm5seCOfz8q9F+66VCc1PGsWSBxKbITjfKVQHMNF2zudxHnMdJiB1fRCb+XsbQV9sO9DCkgsMQgBIA==" }, + "node_modules/react-icons": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.7.1.tgz", + "integrity": "sha512-yHd3oKGMgm7zxo3EA7H2n7vxSoiGmHk5t6Ou4bXsfcgWyhfDKMpyKfhHR6Bjnn63c+YXBLBPUql9H4wPJM6sXw==", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -18580,6 +18618,28 @@ "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.3.5.tgz", "integrity": "sha512-WKTW1+xAzhMS5dJsxWkliixlO/PqC4VhmO9T4juNYcaTg9jzWiJsou6m5pxWYGfigWbwzJWeFY6z47a+4neRXA==" }, + "axios": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.6.tgz", + "integrity": "sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + }, + "dependencies": { + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, "axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -20891,9 +20951,9 @@ "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==" }, "follow-redirects": { - "version": "1.14.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz", - "integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==" + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" }, "fork-ts-checker-webpack-plugin": { "version": "6.5.0", @@ -24113,6 +24173,11 @@ } } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -24300,6 +24365,12 @@ "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.10.tgz", "integrity": "sha512-mKR90fX7Pm5seCOfz8q9F+66VCc1PGsWSBxKbITjfKVQHMNF2zudxHnMdJiB1fRCb+XsbQV9sO9DCkgsMQgBIA==" }, + "react-icons": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.7.1.tgz", + "integrity": "sha512-yHd3oKGMgm7zxo3EA7H2n7vxSoiGmHk5t6Ou4bXsfcgWyhfDKMpyKfhHR6Bjnn63c+YXBLBPUql9H4wPJM6sXw==", + "requires": {} + }, "react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", diff --git a/client/package.json b/client/package.json index 3bc8ce12e0..1686aa1c3e 100644 --- a/client/package.json +++ b/client/package.json @@ -12,10 +12,12 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.1.10", + "axios": "^1.2.6", "bootstrap": "^5.2.3", "react": "^17.0.2", "react-bootstrap": "^2.7.0", "react-dom": "^17.0.2", + "react-icons": "^4.7.1", "react-scripts": "^5.0.0", "react-youtube": "^10.1.0", "styled-components": "^5.3.6", diff --git a/client/src/App.js b/client/src/App.js index 52d98ddb57..864c65a765 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,40 +1,58 @@ import Heading from "./Heading"; import Home from "./Home"; import Form from "./Form"; +import axios from "axios"; import Search from "./Search"; import Cards from "./Cards"; -import { useState } from "react"; +import { useEffect, useState } from "react"; function App() { - const [videos, setVideos] = useState([ - { - id: 523523, - title: "Never Gonna Give You Up", - url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ", - rating: 23, - }, - { - id: 523427, - title: "The Coding Train", - url: "https://www.youtube.com/watch?v=HerCR8bw_GE", - rating: 230, - }, - ]); - - const addVideo=(video)=>{ - setVideos([video,...videos]) - } + const [videos, setVideos] = useState([]); + + const getVideos = async () => { + let res = await axios.get("http://localhost:8000/videos"); + setVideos(res.data); + }; + + useEffect(() => { + getVideos(); + }, []); + + const addVideo = (video) => { + video.id = videos.length + 1; + setVideos([video, ...videos]); + }; + + const upVote = (id) => { + const newVideos = videos.map((video) => { + if (video.id == id) { + video.rating++; + } + return video; + }); + setVideos(newVideos); + }; + + const downVote = (id) => { + const newVideos = videos.map((video) => { + if (video.id == id) { + video.rating--; + } + return video; + }); + setVideos(newVideos); + }; return (
-
+
- + {/*
*/}
diff --git a/client/src/Cards.js b/client/src/Cards.js index 6d89d0498d..a31d99d66f 100644 --- a/client/src/Cards.js +++ b/client/src/Cards.js @@ -1,16 +1,24 @@ import React from 'react' +import { BsFillHandThumbsUpFill, BsHandThumbsDownFill } from "react-icons/bs"; -function Cards({videos}) { + +function Cards({videos, upVote, downVote}) { return ( -
+
{ videos.map((video)=>{ - return
+ return

{video.title}

+

votes: {video.rating}

+
+ upVote(video.id)}/> + downVote(video.id)}/> +
+
}) } diff --git a/client/src/Form.js b/client/src/Form.js index 0d987a4d1f..2e9896cd03 100644 --- a/client/src/Form.js +++ b/client/src/Form.js @@ -13,7 +13,8 @@ function Form({addVideo}) { e.preventDefault() const video = { title, - url + url, + rating:0 } addVideo(video) diff --git a/client/src/Heading.js b/client/src/Heading.js index b159783c1c..235939ea39 100644 --- a/client/src/Heading.js +++ b/client/src/Heading.js @@ -2,13 +2,13 @@ const Heading = () => { return ( -
-
-

Video Recommendation

-
- -
- +
+
+

Video Recommendation

+
+ +
+ ); } diff --git a/client/src/index.css b/client/src/index.css index 3beed2ea41..42fd941e6f 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -59,4 +59,24 @@ body{ justify-content: center; gap: 20px; margin-top: 10px; +} +.videos-container{ + display: flex; + flex-wrap: wrap; + gap: 20px; + margin-top: 50px; +} +.video{ + width: 300px; + box-shadow: 1px 1px 5px rgba(0,0,0,0.2); + +} +.video >h3{ + font-size: 20px; +} +.video-icons{ + display: flex; + gap: 20px; + margin-bottom: 5px; + } \ No newline at end of file diff --git a/client/yarn.lock b/client/yarn.lock index 97e7e22a4c..a1a16d09fc 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -2692,6 +2692,15 @@ "resolved" "https://registry.npmjs.org/axe-core/-/axe-core-4.3.5.tgz" "version" "4.3.5" +"axios@^1.2.6": + "integrity" "sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ==" + "resolved" "https://registry.npmjs.org/axios/-/axios-1.2.6.tgz" + "version" "1.2.6" + dependencies: + "follow-redirects" "^1.15.0" + "form-data" "^4.0.0" + "proxy-from-env" "^1.1.0" + "axobject-query@^2.2.0": "integrity" "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==" "resolved" "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz" @@ -4620,10 +4629,10 @@ "resolved" "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz" "version" "3.2.4" -"follow-redirects@^1.0.0": - "integrity" "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==" - "resolved" "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz" - "version" "1.14.6" +"follow-redirects@^1.0.0", "follow-redirects@^1.15.0": + "integrity" "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + "resolved" "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz" + "version" "1.15.2" "fork-ts-checker-webpack-plugin@^6.5.0": "integrity" "sha512-cS178Y+xxtIjEUorcHddKS7yCMlrDPV31mt47blKKRfMd70Kxu5xruAFE2o9sDY6wVC5deuob/u/alD04YYHnw==" @@ -4653,6 +4662,15 @@ "combined-stream" "^1.0.8" "mime-types" "^2.1.12" +"form-data@^4.0.0": + "integrity" "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==" + "resolved" "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz" + "version" "4.0.0" + dependencies: + "asynckit" "^0.4.0" + "combined-stream" "^1.0.8" + "mime-types" "^2.1.12" + "forwarded@0.2.0": "integrity" "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" "resolved" "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz" @@ -7448,6 +7466,11 @@ "forwarded" "0.2.0" "ipaddr.js" "1.9.1" +"proxy-from-env@^1.1.0": + "integrity" "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + "resolved" "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" + "version" "1.1.0" + "psl@^1.1.33": "integrity" "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" "resolved" "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" @@ -7596,6 +7619,11 @@ "resolved" "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.10.tgz" "version" "6.0.10" +"react-icons@^4.7.1": + "integrity" "sha512-yHd3oKGMgm7zxo3EA7H2n7vxSoiGmHk5t6Ou4bXsfcgWyhfDKMpyKfhHR6Bjnn63c+YXBLBPUql9H4wPJM6sXw==" + "resolved" "https://registry.npmjs.org/react-icons/-/react-icons-4.7.1.tgz" + "version" "4.7.1" + "react-is@^16.13.1": "integrity" "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" "resolved" "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz" From ab6564955a4744c045fa6406450272ecbb53b35f Mon Sep 17 00:00:00 2001 From: Ansu Jammeh Date: Sat, 4 Feb 2023 09:07:52 +0000 Subject: [PATCH 03/44] Completed --- client/src/App.js | 16 +- client/src/Cards.js | 28 +- client/src/index.css | 44 +- package-lock.json | 19 + server/node_modules/.bin/fxparser | 1 + server/node_modules/.bin/is-ci | 15 - server/node_modules/.bin/nodemon | 16 +- server/node_modules/.bin/rc | 15 - server/node_modules/.bin/uuid | 1 + server/node_modules/.package-lock.json | 2250 +++++ .../@aws-crypto/ie11-detection/CHANGELOG.md | 46 + .../@aws-crypto/ie11-detection/LICENSE | 202 + .../@aws-crypto/ie11-detection/README.md | 20 + .../ie11-detection/build/CryptoOperation.d.ts | 19 + .../ie11-detection/build/CryptoOperation.js | 3 + .../build/CryptoOperation.js.map | 1 + .../@aws-crypto/ie11-detection/build/Key.d.ts | 12 + .../@aws-crypto/ie11-detection/build/Key.js | 3 + .../ie11-detection/build/Key.js.map | 1 + .../ie11-detection/build/KeyOperation.d.ts | 12 + .../ie11-detection/build/KeyOperation.js | 3 + .../ie11-detection/build/KeyOperation.js.map | 1 + .../ie11-detection/build/MsSubtleCrypto.d.ts | 33 + .../ie11-detection/build/MsSubtleCrypto.js | 3 + .../build/MsSubtleCrypto.js.map | 1 + .../ie11-detection/build/MsWindow.d.ts | 21 + .../ie11-detection/build/MsWindow.js | 32 + .../ie11-detection/build/MsWindow.js.map | 1 + .../ie11-detection/build/index.d.ts | 5 + .../@aws-crypto/ie11-detection/build/index.js | 9 + .../ie11-detection/build/index.js.map | 1 + .../node_modules/tslib/CopyrightNotice.txt | 15 + .../node_modules/tslib/LICENSE.txt | 12 + .../node_modules/tslib/README.md | 142 + .../node_modules/tslib/modules/index.js | 51 + .../node_modules/tslib/modules/package.json | 3 + .../node_modules/tslib/package.json | 37 + .../index.js | 23 + .../package.json | 6 + .../node_modules/tslib/tslib.d.ts | 37 + .../node_modules/tslib/tslib.es6.html | 1 + .../node_modules/tslib/tslib.es6.js | 218 + .../node_modules/tslib/tslib.html | 1 + .../node_modules/tslib/tslib.js | 284 + .../@aws-crypto/ie11-detection/package.json | 26 + .../ie11-detection/src/CryptoOperation.ts | 21 + .../@aws-crypto/ie11-detection/src/Key.ts | 12 + .../ie11-detection/src/KeyOperation.ts | 13 + .../ie11-detection/src/MsSubtleCrypto.ts | 88 + .../ie11-detection/src/MsWindow.ts | 59 + .../@aws-crypto/ie11-detection/src/index.ts | 5 + .../@aws-crypto/ie11-detection/tsconfig.json | 17 + .../@aws-crypto/sha256-browser/CHANGELOG.md | 88 + .../@aws-crypto/sha256-browser/LICENSE | 202 + .../@aws-crypto/sha256-browser/README.md | 31 + .../sha256-browser/build/constants.d.ts | 10 + .../sha256-browser/build/constants.js | 43 + .../sha256-browser/build/constants.js.map | 1 + .../build/crossPlatformSha256.d.ts | 8 + .../build/crossPlatformSha256.js | 35 + .../build/crossPlatformSha256.js.map | 1 + .../sha256-browser/build/ie11Sha256.d.ts | 9 + .../sha256-browser/build/ie11Sha256.js | 80 + .../sha256-browser/build/ie11Sha256.js.map | 1 + .../sha256-browser/build/index.d.ts | 3 + .../@aws-crypto/sha256-browser/build/index.js | 10 + .../sha256-browser/build/index.js.map | 1 + .../sha256-browser/build/isEmptyData.d.ts | 2 + .../sha256-browser/build/isEmptyData.js | 11 + .../sha256-browser/build/isEmptyData.js.map | 1 + .../sha256-browser/build/webCryptoSha256.d.ts | 10 + .../sha256-browser/build/webCryptoSha256.js | 56 + .../build/webCryptoSha256.js.map | 1 + .../node_modules/tslib/CopyrightNotice.txt | 15 + .../node_modules/tslib/LICENSE.txt | 12 + .../node_modules/tslib/README.md | 142 + .../node_modules/tslib/modules/index.js | 51 + .../node_modules/tslib/modules/package.json | 3 + .../node_modules/tslib/package.json | 37 + .../index.js | 23 + .../package.json | 6 + .../node_modules/tslib/tslib.d.ts | 37 + .../node_modules/tslib/tslib.es6.html | 1 + .../node_modules/tslib/tslib.es6.js | 218 + .../node_modules/tslib/tslib.html | 1 + .../node_modules/tslib/tslib.js | 284 + .../@aws-crypto/sha256-browser/package.json | 33 + .../sha256-browser/src/constants.ts | 41 + .../sha256-browser/src/crossPlatformSha256.ts | 34 + .../sha256-browser/src/ie11Sha256.ts | 108 + .../@aws-crypto/sha256-browser/src/index.ts | 3 + .../sha256-browser/src/isEmptyData.ts | 9 + .../sha256-browser/src/webCryptoSha256.ts | 71 + .../@aws-crypto/sha256-browser/tsconfig.json | 22 + .../@aws-crypto/sha256-js/CHANGELOG.md | 86 + .../@aws-crypto/sha256-js/LICENSE | 201 + .../@aws-crypto/sha256-js/README.md | 29 + .../sha256-js/build/RawSha256.d.ts | 17 + .../@aws-crypto/sha256-js/build/RawSha256.js | 124 + .../sha256-js/build/RawSha256.js.map | 1 + .../sha256-js/build/constants.d.ts | 20 + .../@aws-crypto/sha256-js/build/constants.js | 98 + .../sha256-js/build/constants.js.map | 1 + .../@aws-crypto/sha256-js/build/index.d.ts | 1 + .../@aws-crypto/sha256-js/build/index.js | 5 + .../@aws-crypto/sha256-js/build/index.js.map | 1 + .../@aws-crypto/sha256-js/build/jsSha256.d.ts | 12 + .../@aws-crypto/sha256-js/build/jsSha256.js | 85 + .../sha256-js/build/jsSha256.js.map | 1 + .../sha256-js/build/knownHashes.fixture.d.ts | 5 + .../sha256-js/build/knownHashes.fixture.js | 322 + .../build/knownHashes.fixture.js.map | 1 + .../node_modules/tslib/CopyrightNotice.txt | 15 + .../sha256-js/node_modules/tslib/LICENSE.txt | 12 + .../sha256-js/node_modules/tslib/README.md | 142 + .../node_modules/tslib/modules/index.js | 51 + .../node_modules/tslib/modules/package.json | 3 + .../sha256-js/node_modules/tslib/package.json | 37 + .../index.js | 23 + .../package.json | 6 + .../sha256-js/node_modules/tslib/tslib.d.ts | 37 + .../node_modules/tslib/tslib.es6.html | 1 + .../sha256-js/node_modules/tslib/tslib.es6.js | 218 + .../sha256-js/node_modules/tslib/tslib.html | 1 + .../sha256-js/node_modules/tslib/tslib.js | 284 + .../@aws-crypto/sha256-js/package.json | 28 + .../@aws-crypto/sha256-js/src/RawSha256.ts | 164 + .../@aws-crypto/sha256-js/src/constants.ts | 98 + .../@aws-crypto/sha256-js/src/index.ts | 1 + .../@aws-crypto/sha256-js/src/jsSha256.ts | 94 + .../sha256-js/src/knownHashes.fixture.ts | 401 + .../@aws-crypto/sha256-js/tsconfig.json | 17 + .../supports-web-crypto/CHANGELOG.md | 46 + .../@aws-crypto/supports-web-crypto/LICENSE | 202 + .../@aws-crypto/supports-web-crypto/README.md | 32 + .../supports-web-crypto/build/index.d.ts | 1 + .../supports-web-crypto/build/index.js | 5 + .../build/supportsWebCrypto.d.ts | 4 + .../build/supportsWebCrypto.js | 69 + .../node_modules/tslib/CopyrightNotice.txt | 15 + .../node_modules/tslib/LICENSE.txt | 12 + .../node_modules/tslib/README.md | 142 + .../node_modules/tslib/modules/index.js | 51 + .../node_modules/tslib/modules/package.json | 3 + .../node_modules/tslib/package.json | 37 + .../index.js | 23 + .../package.json | 6 + .../node_modules/tslib/tslib.d.ts | 37 + .../node_modules/tslib/tslib.es6.html | 1 + .../node_modules/tslib/tslib.es6.js | 218 + .../node_modules/tslib/tslib.html | 1 + .../node_modules/tslib/tslib.js | 284 + .../supports-web-crypto/package.json | 26 + .../supports-web-crypto/src/index.ts | 1 + .../src/supportsWebCrypto.ts | 76 + .../supports-web-crypto/tsconfig.json | 16 + .../@aws-crypto/util/CHANGELOG.md | 47 + server/node_modules/@aws-crypto/util/LICENSE | 201 + .../node_modules/@aws-crypto/util/README.md | 16 + .../util/build/convertToBuffer.d.ts | 2 + .../@aws-crypto/util/build/convertToBuffer.js | 24 + .../util/build/convertToBuffer.js.map | 1 + .../@aws-crypto/util/build/index.d.ts | 4 + .../@aws-crypto/util/build/index.js | 14 + .../@aws-crypto/util/build/index.js.map | 1 + .../@aws-crypto/util/build/isEmptyData.d.ts | 2 + .../@aws-crypto/util/build/isEmptyData.js | 13 + .../@aws-crypto/util/build/isEmptyData.js.map | 1 + .../@aws-crypto/util/build/numToUint8.d.ts | 1 + .../@aws-crypto/util/build/numToUint8.js | 15 + .../@aws-crypto/util/build/numToUint8.js.map | 1 + .../util/build/uint32ArrayFrom.d.ts | 1 + .../@aws-crypto/util/build/uint32ArrayFrom.js | 20 + .../util/build/uint32ArrayFrom.js.map | 1 + .../node_modules/tslib/CopyrightNotice.txt | 15 + .../util/node_modules/tslib/LICENSE.txt | 12 + .../util/node_modules/tslib/README.md | 142 + .../util/node_modules/tslib/modules/index.js | 51 + .../node_modules/tslib/modules/package.json | 3 + .../util/node_modules/tslib/package.json | 37 + .../index.js | 23 + .../package.json | 6 + .../util/node_modules/tslib/tslib.d.ts | 37 + .../util/node_modules/tslib/tslib.es6.html | 1 + .../util/node_modules/tslib/tslib.es6.js | 218 + .../util/node_modules/tslib/tslib.html | 1 + .../util/node_modules/tslib/tslib.js | 284 + .../@aws-crypto/util/package.json | 31 + .../@aws-crypto/util/src/convertToBuffer.ts | 30 + .../@aws-crypto/util/src/index.ts | 7 + .../@aws-crypto/util/src/isEmptyData.ts | 12 + .../@aws-crypto/util/src/numToUint8.ts | 11 + .../@aws-crypto/util/src/uint32ArrayFrom.ts | 16 + .../@aws-crypto/util/tsconfig.json | 23 + .../@aws-sdk/abort-controller/LICENSE | 201 + .../@aws-sdk/abort-controller/README.md | 4 + .../dist-cjs/AbortController.js | 13 + .../abort-controller/dist-cjs/AbortSignal.js | 24 + .../abort-controller/dist-cjs/index.js | 5 + .../dist-es/AbortController.js | 9 + .../abort-controller/dist-es/AbortSignal.js | 20 + .../abort-controller/dist-es/index.js | 2 + .../dist-types/AbortController.d.ts | 6 + .../dist-types/AbortSignal.d.ts | 14 + .../abort-controller/dist-types/index.d.ts | 2 + .../dist-types/ts3.4/AbortController.d.ts | 6 + .../dist-types/ts3.4/AbortSignal.d.ts | 8 + .../dist-types/ts3.4/index.d.ts | 2 + .../@aws-sdk/abort-controller/package.json | 54 + .../@aws-sdk/client-cognito-identity/LICENSE | 201 + .../client-cognito-identity/README.md | 219 + .../dist-cjs/CognitoIdentity.js | 352 + .../dist-cjs/CognitoIdentityClient.js | 39 + .../commands/CreateIdentityPoolCommand.js | 48 + .../commands/DeleteIdentitiesCommand.js | 48 + .../commands/DeleteIdentityPoolCommand.js | 48 + .../commands/DescribeIdentityCommand.js | 48 + .../commands/DescribeIdentityPoolCommand.js | 48 + .../GetCredentialsForIdentityCommand.js | 46 + .../dist-cjs/commands/GetIdCommand.js | 46 + .../commands/GetIdentityPoolRolesCommand.js | 48 + .../commands/GetOpenIdTokenCommand.js | 46 + ...tOpenIdTokenForDeveloperIdentityCommand.js | 48 + .../GetPrincipalTagAttributeMapCommand.js | 48 + .../commands/ListIdentitiesCommand.js | 48 + .../commands/ListIdentityPoolsCommand.js | 48 + .../commands/ListTagsForResourceCommand.js | 48 + .../LookupDeveloperIdentityCommand.js | 48 + .../MergeDeveloperIdentitiesCommand.js | 48 + .../commands/SetIdentityPoolRolesCommand.js | 48 + .../SetPrincipalTagAttributeMapCommand.js | 48 + .../dist-cjs/commands/TagResourceCommand.js | 48 + .../UnlinkDeveloperIdentityCommand.js | 48 + .../commands/UnlinkIdentityCommand.js | 46 + .../dist-cjs/commands/UntagResourceCommand.js | 48 + .../commands/UpdateIdentityPoolCommand.js | 48 + .../dist-cjs/commands/index.js | 26 + .../dist-cjs/endpoint/EndpointParameters.js | 12 + .../dist-cjs/endpoint/endpointResolver.js | 12 + .../dist-cjs/endpoint/ruleset.js | 7 + .../client-cognito-identity/dist-cjs/index.js | 11 + .../models/CognitoIdentityServiceException.js | 11 + .../dist-cjs/models/index.js | 4 + .../dist-cjs/models/models_0.js | 354 + .../dist-cjs/pagination/Interfaces.js | 2 + .../pagination/ListIdentityPoolsPaginator.js | 36 + .../dist-cjs/pagination/index.js | 5 + .../dist-cjs/protocols/Aws_json1_1.js | 2219 +++++ .../dist-cjs/runtimeConfig.browser.js | 39 + .../dist-cjs/runtimeConfig.js | 48 + .../dist-cjs/runtimeConfig.native.js | 15 + .../dist-cjs/runtimeConfig.shared.js | 21 + .../dist-es/CognitoIdentity.js | 348 + .../dist-es/CognitoIdentityClient.js | 35 + .../commands/CreateIdentityPoolCommand.js | 44 + .../commands/DeleteIdentitiesCommand.js | 44 + .../commands/DeleteIdentityPoolCommand.js | 44 + .../commands/DescribeIdentityCommand.js | 44 + .../commands/DescribeIdentityPoolCommand.js | 44 + .../GetCredentialsForIdentityCommand.js | 42 + .../dist-es/commands/GetIdCommand.js | 42 + .../commands/GetIdentityPoolRolesCommand.js | 44 + .../dist-es/commands/GetOpenIdTokenCommand.js | 42 + ...tOpenIdTokenForDeveloperIdentityCommand.js | 44 + .../GetPrincipalTagAttributeMapCommand.js | 44 + .../dist-es/commands/ListIdentitiesCommand.js | 44 + .../commands/ListIdentityPoolsCommand.js | 44 + .../commands/ListTagsForResourceCommand.js | 44 + .../LookupDeveloperIdentityCommand.js | 44 + .../MergeDeveloperIdentitiesCommand.js | 44 + .../commands/SetIdentityPoolRolesCommand.js | 44 + .../SetPrincipalTagAttributeMapCommand.js | 44 + .../dist-es/commands/TagResourceCommand.js | 44 + .../UnlinkDeveloperIdentityCommand.js | 44 + .../dist-es/commands/UnlinkIdentityCommand.js | 42 + .../dist-es/commands/UntagResourceCommand.js | 44 + .../commands/UpdateIdentityPoolCommand.js | 44 + .../dist-es/commands/index.js | 23 + .../dist-es/endpoint/EndpointParameters.js | 8 + .../dist-es/endpoint/endpointResolver.js | 8 + .../dist-es/endpoint/ruleset.js | 4 + .../client-cognito-identity/dist-es/index.js | 6 + .../models/CognitoIdentityServiceException.js | 7 + .../dist-es/models/index.js | 1 + .../dist-es/models/models_0.js | 293 + .../dist-es/pagination/Interfaces.js | 1 + .../pagination/ListIdentityPoolsPaginator.js | 32 + .../dist-es/pagination/index.js | 2 + .../dist-es/protocols/Aws_json1_1.js | 2170 +++++ .../dist-es/runtimeConfig.browser.js | 34 + .../dist-es/runtimeConfig.js | 43 + .../dist-es/runtimeConfig.native.js | 11 + .../dist-es/runtimeConfig.shared.js | 17 + .../dist-types/CognitoIdentity.d.ts | 295 + .../dist-types/CognitoIdentityClient.d.ts | 177 + .../commands/CreateIdentityPoolCommand.d.ts | 63 + .../commands/DeleteIdentitiesCommand.d.ts | 39 + .../commands/DeleteIdentityPoolCommand.d.ts | 39 + .../commands/DescribeIdentityCommand.d.ts | 39 + .../commands/DescribeIdentityPoolCommand.d.ts | 39 + .../GetCredentialsForIdentityCommand.d.ts | 41 + .../dist-types/commands/GetIdCommand.d.ts | 39 + .../commands/GetIdentityPoolRolesCommand.d.ts | 38 + .../commands/GetOpenIdTokenCommand.d.ts | 41 + ...penIdTokenForDeveloperIdentityCommand.d.ts | 49 + .../GetPrincipalTagAttributeMapCommand.d.ts | 37 + .../commands/ListIdentitiesCommand.d.ts | 38 + .../commands/ListIdentityPoolsCommand.d.ts | 38 + .../commands/ListTagsForResourceCommand.d.ts | 40 + .../LookupDeveloperIdentityCommand.d.ts | 53 + .../MergeDeveloperIdentitiesCommand.d.ts | 49 + .../commands/SetIdentityPoolRolesCommand.d.ts | 38 + .../SetPrincipalTagAttributeMapCommand.d.ts | 37 + .../commands/TagResourceCommand.d.ts | 51 + .../UnlinkDeveloperIdentityCommand.d.ts | 41 + .../commands/UnlinkIdentityCommand.d.ts | 40 + .../commands/UntagResourceCommand.d.ts | 38 + .../commands/UpdateIdentityPoolCommand.d.ts | 38 + .../dist-types/commands/index.d.ts | 23 + .../endpoint/EndpointParameters.d.ts | 19 + .../dist-types/endpoint/endpointResolver.d.ts | 5 + .../dist-types/endpoint/ruleset.d.ts | 2 + .../dist-types/index.d.ts | 6 + .../CognitoIdentityServiceException.d.ts | 10 + .../dist-types/models/index.d.ts | 1 + .../dist-types/models/models_0.d.ts | 1166 +++ .../dist-types/pagination/Interfaces.d.ts | 6 + .../ListIdentityPoolsPaginator.d.ts | 4 + .../dist-types/pagination/index.d.ts | 2 + .../dist-types/protocols/Aws_json1_1.d.ts | 71 + .../dist-types/runtimeConfig.browser.d.ts | 42 + .../dist-types/runtimeConfig.d.ts | 42 + .../dist-types/runtimeConfig.native.d.ts | 41 + .../dist-types/runtimeConfig.shared.d.ts | 18 + .../dist-types/ts3.4/CognitoIdentity.d.ts | 398 + .../ts3.4/CognitoIdentityClient.d.ts | 248 + .../commands/CreateIdentityPoolCommand.d.ts | 35 + .../commands/DeleteIdentitiesCommand.d.ts | 37 + .../commands/DeleteIdentityPoolCommand.d.ts | 33 + .../commands/DescribeIdentityCommand.d.ts | 34 + .../commands/DescribeIdentityPoolCommand.d.ts | 38 + .../GetCredentialsForIdentityCommand.d.ts | 41 + .../ts3.4/commands/GetIdCommand.d.ts | 32 + .../commands/GetIdentityPoolRolesCommand.d.ts | 41 + .../ts3.4/commands/GetOpenIdTokenCommand.d.ts | 37 + ...penIdTokenForDeveloperIdentityCommand.d.ts | 41 + .../GetPrincipalTagAttributeMapCommand.d.ts | 41 + .../ts3.4/commands/ListIdentitiesCommand.d.ts | 37 + .../commands/ListIdentityPoolsCommand.d.ts | 37 + .../commands/ListTagsForResourceCommand.d.ts | 38 + .../LookupDeveloperIdentityCommand.d.ts | 41 + .../MergeDeveloperIdentitiesCommand.d.ts | 41 + .../commands/SetIdentityPoolRolesCommand.d.ts | 36 + .../SetPrincipalTagAttributeMapCommand.d.ts | 41 + .../ts3.4/commands/TagResourceCommand.d.ts | 34 + .../UnlinkDeveloperIdentityCommand.d.ts | 37 + .../ts3.4/commands/UnlinkIdentityCommand.d.ts | 32 + .../ts3.4/commands/UntagResourceCommand.d.ts | 34 + .../commands/UpdateIdentityPoolCommand.d.ts | 34 + .../dist-types/ts3.4/commands/index.d.ts | 23 + .../ts3.4/endpoint/EndpointParameters.d.ts | 34 + .../ts3.4/endpoint/endpointResolver.d.ts | 8 + .../dist-types/ts3.4/endpoint/ruleset.d.ts | 2 + .../dist-types/ts3.4/index.d.ts | 6 + .../CognitoIdentityServiceException.d.ts | 7 + .../dist-types/ts3.4/models/index.d.ts | 1 + .../dist-types/ts3.4/models/models_0.d.ts | 449 + .../ts3.4/pagination/Interfaces.d.ts | 7 + .../ListIdentityPoolsPaginator.d.ts | 11 + .../dist-types/ts3.4/pagination/index.d.ts | 2 + .../ts3.4/protocols/Aws_json1_1.d.ts | 281 + .../ts3.4/runtimeConfig.browser.d.ts | 93 + .../dist-types/ts3.4/runtimeConfig.d.ts | 93 + .../ts3.4/runtimeConfig.native.d.ts | 82 + .../ts3.4/runtimeConfig.shared.d.ts | 20 + .../client-cognito-identity/package.json | 106 + .../@aws-sdk/client-sso-oidc/LICENSE | 201 + .../@aws-sdk/client-sso-oidc/README.md | 244 + .../client-sso-oidc/dist-cjs/SSOOIDC.js | 52 + .../client-sso-oidc/dist-cjs/SSOOIDCClient.js | 37 + .../dist-cjs/commands/CreateTokenCommand.js | 46 + .../commands/RegisterClientCommand.js | 46 + .../StartDeviceAuthorizationCommand.js | 46 + .../dist-cjs/commands/index.js | 6 + .../dist-cjs/endpoint/EndpointParameters.js | 12 + .../dist-cjs/endpoint/endpointResolver.js | 12 + .../dist-cjs/endpoint/ruleset.js | 7 + .../client-sso-oidc/dist-cjs/index.js | 10 + .../models/SSOOIDCServiceException.js | 11 + .../client-sso-oidc/dist-cjs/models/index.js | 4 + .../dist-cjs/models/models_0.js | 208 + .../dist-cjs/protocols/Aws_restJson1.js | 522 ++ .../dist-cjs/runtimeConfig.browser.js | 38 + .../client-sso-oidc/dist-cjs/runtimeConfig.js | 45 + .../dist-cjs/runtimeConfig.native.js | 15 + .../dist-cjs/runtimeConfig.shared.js | 21 + .../client-sso-oidc/dist-es/SSOOIDC.js | 48 + .../client-sso-oidc/dist-es/SSOOIDCClient.js | 33 + .../dist-es/commands/CreateTokenCommand.js | 42 + .../dist-es/commands/RegisterClientCommand.js | 42 + .../StartDeviceAuthorizationCommand.js | 42 + .../client-sso-oidc/dist-es/commands/index.js | 3 + .../dist-es/endpoint/EndpointParameters.js | 8 + .../dist-es/endpoint/endpointResolver.js | 8 + .../dist-es/endpoint/ruleset.js | 4 + .../@aws-sdk/client-sso-oidc/dist-es/index.js | 5 + .../dist-es/models/SSOOIDCServiceException.js | 7 + .../client-sso-oidc/dist-es/models/index.js | 1 + .../dist-es/models/models_0.js | 187 + .../dist-es/protocols/Aws_restJson1.js | 513 ++ .../dist-es/runtimeConfig.browser.js | 33 + .../client-sso-oidc/dist-es/runtimeConfig.js | 40 + .../dist-es/runtimeConfig.native.js | 11 + .../dist-es/runtimeConfig.shared.js | 17 + .../client-sso-oidc/dist-types/SSOOIDC.d.ts | 71 + .../dist-types/SSOOIDCClient.d.ts | 177 + .../commands/CreateTokenCommand.d.ts | 39 + .../commands/RegisterClientCommand.d.ts | 38 + .../StartDeviceAuthorizationCommand.d.ts | 38 + .../dist-types/commands/index.d.ts | 3 + .../endpoint/EndpointParameters.d.ts | 19 + .../dist-types/endpoint/endpointResolver.d.ts | 5 + .../dist-types/endpoint/ruleset.d.ts | 2 + .../client-sso-oidc/dist-types/index.d.ts | 5 + .../models/SSOOIDCServiceException.d.ts | 10 + .../dist-types/models/index.d.ts | 1 + .../dist-types/models/models_0.d.ts | 371 + .../dist-types/protocols/Aws_restJson1.d.ts | 11 + .../dist-types/runtimeConfig.browser.d.ts | 35 + .../dist-types/runtimeConfig.d.ts | 35 + .../dist-types/runtimeConfig.native.d.ts | 34 + .../dist-types/runtimeConfig.shared.d.ts | 18 + .../dist-types/ts3.4/SSOOIDC.d.ts | 55 + .../dist-types/ts3.4/SSOOIDCClient.d.ts | 122 + .../ts3.4/commands/CreateTokenCommand.d.ts | 34 + .../ts3.4/commands/RegisterClientCommand.d.ts | 37 + .../StartDeviceAuthorizationCommand.d.ts | 41 + .../dist-types/ts3.4/commands/index.d.ts | 3 + .../ts3.4/endpoint/EndpointParameters.d.ts | 34 + .../ts3.4/endpoint/endpointResolver.d.ts | 8 + .../dist-types/ts3.4/endpoint/ruleset.d.ts | 2 + .../dist-types/ts3.4/index.d.ts | 5 + .../ts3.4/models/SSOOIDCServiceException.d.ts | 7 + .../dist-types/ts3.4/models/index.d.ts | 1 + .../dist-types/ts3.4/models/models_0.d.ts | 169 + .../ts3.4/protocols/Aws_restJson1.d.ts | 41 + .../ts3.4/runtimeConfig.browser.d.ts | 67 + .../dist-types/ts3.4/runtimeConfig.d.ts | 67 + .../ts3.4/runtimeConfig.native.d.ts | 56 + .../ts3.4/runtimeConfig.shared.d.ts | 18 + .../@aws-sdk/client-sso-oidc/package.json | 99 + .../node_modules/@aws-sdk/client-sso/LICENSE | 201 + .../@aws-sdk/client-sso/README.md | 223 + .../@aws-sdk/client-sso/dist-cjs/SSO.js | 67 + .../@aws-sdk/client-sso/dist-cjs/SSOClient.js | 37 + .../commands/GetRoleCredentialsCommand.js | 46 + .../commands/ListAccountRolesCommand.js | 46 + .../dist-cjs/commands/ListAccountsCommand.js | 46 + .../dist-cjs/commands/LogoutCommand.js | 46 + .../client-sso/dist-cjs/commands/index.js | 7 + .../dist-cjs/endpoint/EndpointParameters.js | 12 + .../dist-cjs/endpoint/endpointResolver.js | 12 + .../client-sso/dist-cjs/endpoint/ruleset.js | 7 + .../@aws-sdk/client-sso/dist-cjs/index.js | 11 + .../dist-cjs/models/SSOServiceException.js | 11 + .../client-sso/dist-cjs/models/index.js | 4 + .../client-sso/dist-cjs/models/models_0.js | 104 + .../dist-cjs/pagination/Interfaces.js | 2 + .../pagination/ListAccountRolesPaginator.js | 36 + .../pagination/ListAccountsPaginator.js | 36 + .../client-sso/dist-cjs/pagination/index.js | 6 + .../dist-cjs/protocols/Aws_restJson1.js | 417 + .../dist-cjs/runtimeConfig.browser.js | 38 + .../client-sso/dist-cjs/runtimeConfig.js | 45 + .../dist-cjs/runtimeConfig.native.js | 15 + .../dist-cjs/runtimeConfig.shared.js | 21 + .../@aws-sdk/client-sso/dist-es/SSO.js | 63 + .../@aws-sdk/client-sso/dist-es/SSOClient.js | 33 + .../commands/GetRoleCredentialsCommand.js | 42 + .../commands/ListAccountRolesCommand.js | 42 + .../dist-es/commands/ListAccountsCommand.js | 42 + .../dist-es/commands/LogoutCommand.js | 42 + .../client-sso/dist-es/commands/index.js | 4 + .../dist-es/endpoint/EndpointParameters.js | 8 + .../dist-es/endpoint/endpointResolver.js | 8 + .../client-sso/dist-es/endpoint/ruleset.js | 4 + .../@aws-sdk/client-sso/dist-es/index.js | 6 + .../dist-es/models/SSOServiceException.js | 7 + .../client-sso/dist-es/models/index.js | 1 + .../client-sso/dist-es/models/models_0.js | 87 + .../dist-es/pagination/Interfaces.js | 1 + .../pagination/ListAccountRolesPaginator.js | 32 + .../pagination/ListAccountsPaginator.js | 32 + .../client-sso/dist-es/pagination/index.js | 3 + .../dist-es/protocols/Aws_restJson1.js | 406 + .../dist-es/runtimeConfig.browser.js | 33 + .../client-sso/dist-es/runtimeConfig.js | 40 + .../dist-es/runtimeConfig.native.js | 11 + .../dist-es/runtimeConfig.shared.js | 17 + .../@aws-sdk/client-sso/dist-types/SSO.d.ts | 71 + .../client-sso/dist-types/SSOClient.d.ts | 157 + .../commands/GetRoleCredentialsCommand.d.ts | 38 + .../commands/ListAccountRolesCommand.d.ts | 37 + .../commands/ListAccountsCommand.d.ts | 39 + .../dist-types/commands/LogoutCommand.d.ts | 52 + .../client-sso/dist-types/commands/index.d.ts | 4 + .../endpoint/EndpointParameters.d.ts | 19 + .../dist-types/endpoint/endpointResolver.d.ts | 5 + .../dist-types/endpoint/ruleset.d.ts | 2 + .../@aws-sdk/client-sso/dist-types/index.d.ts | 6 + .../models/SSOServiceException.d.ts | 10 + .../client-sso/dist-types/models/index.d.ts | 1 + .../dist-types/models/models_0.d.ts | 229 + .../dist-types/pagination/Interfaces.d.ts | 6 + .../pagination/ListAccountRolesPaginator.d.ts | 4 + .../pagination/ListAccountsPaginator.d.ts | 4 + .../dist-types/pagination/index.d.ts | 3 + .../dist-types/protocols/Aws_restJson1.d.ts | 14 + .../dist-types/runtimeConfig.browser.d.ts | 35 + .../client-sso/dist-types/runtimeConfig.d.ts | 35 + .../dist-types/runtimeConfig.native.d.ts | 34 + .../dist-types/runtimeConfig.shared.d.ts | 18 + .../client-sso/dist-types/ts3.4/SSO.d.ts | 72 + .../dist-types/ts3.4/SSOClient.d.ts | 127 + .../commands/GetRoleCredentialsCommand.d.ts | 38 + .../commands/ListAccountRolesCommand.d.ts | 37 + .../ts3.4/commands/ListAccountsCommand.d.ts | 34 + .../ts3.4/commands/LogoutCommand.d.ts | 32 + .../dist-types/ts3.4/commands/index.d.ts | 4 + .../ts3.4/endpoint/EndpointParameters.d.ts | 34 + .../ts3.4/endpoint/endpointResolver.d.ts | 8 + .../dist-types/ts3.4/endpoint/ruleset.d.ts | 2 + .../client-sso/dist-types/ts3.4/index.d.ts | 6 + .../ts3.4/models/SSOServiceException.d.ts | 7 + .../dist-types/ts3.4/models/index.d.ts | 1 + .../dist-types/ts3.4/models/models_0.d.ts | 101 + .../ts3.4/pagination/Interfaces.d.ts | 6 + .../pagination/ListAccountRolesPaginator.d.ts | 11 + .../pagination/ListAccountsPaginator.d.ts | 11 + .../dist-types/ts3.4/pagination/index.d.ts | 3 + .../ts3.4/protocols/Aws_restJson1.d.ts | 53 + .../ts3.4/runtimeConfig.browser.d.ts | 67 + .../dist-types/ts3.4/runtimeConfig.d.ts | 67 + .../ts3.4/runtimeConfig.native.d.ts | 56 + .../ts3.4/runtimeConfig.shared.d.ts | 18 + .../@aws-sdk/client-sso/package.json | 99 + .../node_modules/@aws-sdk/client-sts/LICENSE | 201 + .../@aws-sdk/client-sts/README.md | 210 + .../@aws-sdk/client-sts/dist-cjs/STS.js | 127 + .../@aws-sdk/client-sts/dist-cjs/STSClient.js | 39 + .../dist-cjs/commands/AssumeRoleCommand.js | 49 + .../commands/AssumeRoleWithSAMLCommand.js | 47 + .../AssumeRoleWithWebIdentityCommand.js | 47 + .../DecodeAuthorizationMessageCommand.js | 49 + .../commands/GetAccessKeyInfoCommand.js | 49 + .../commands/GetCallerIdentityCommand.js | 49 + .../commands/GetFederationTokenCommand.js | 49 + .../commands/GetSessionTokenCommand.js | 49 + .../client-sts/dist-cjs/commands/index.js | 11 + .../dist-cjs/defaultRoleAssumers.js | 28 + .../dist-cjs/defaultStsRoleAssumers.js | 76 + .../dist-cjs/endpoint/EndpointParameters.js | 13 + .../dist-cjs/endpoint/endpointResolver.js | 12 + .../client-sts/dist-cjs/endpoint/ruleset.js | 7 + .../@aws-sdk/client-sts/dist-cjs/index.js | 11 + .../dist-cjs/models/STSServiceException.js | 11 + .../client-sts/dist-cjs/models/index.js | 4 + .../client-sts/dist-cjs/models/models_0.js | 192 + .../dist-cjs/protocols/Aws_query.js | 1083 +++ .../dist-cjs/runtimeConfig.browser.js | 39 + .../client-sts/dist-cjs/runtimeConfig.js | 48 + .../dist-cjs/runtimeConfig.native.js | 15 + .../dist-cjs/runtimeConfig.shared.js | 21 + .../@aws-sdk/client-sts/dist-es/STS.js | 123 + .../@aws-sdk/client-sts/dist-es/STSClient.js | 35 + .../dist-es/commands/AssumeRoleCommand.js | 45 + .../commands/AssumeRoleWithSAMLCommand.js | 43 + .../AssumeRoleWithWebIdentityCommand.js | 43 + .../DecodeAuthorizationMessageCommand.js | 45 + .../commands/GetAccessKeyInfoCommand.js | 45 + .../commands/GetCallerIdentityCommand.js | 45 + .../commands/GetFederationTokenCommand.js | 45 + .../commands/GetSessionTokenCommand.js | 45 + .../client-sts/dist-es/commands/index.js | 8 + .../client-sts/dist-es/defaultRoleAssumers.js | 22 + .../dist-es/defaultStsRoleAssumers.js | 70 + .../dist-es/endpoint/EndpointParameters.js | 9 + .../dist-es/endpoint/endpointResolver.js | 8 + .../client-sts/dist-es/endpoint/ruleset.js | 4 + .../@aws-sdk/client-sts/dist-es/index.js | 6 + .../dist-es/models/STSServiceException.js | 7 + .../client-sts/dist-es/models/index.js | 1 + .../client-sts/dist-es/models/models_0.js | 160 + .../client-sts/dist-es/protocols/Aws_query.js | 1064 +++ .../dist-es/runtimeConfig.browser.js | 34 + .../client-sts/dist-es/runtimeConfig.js | 43 + .../dist-es/runtimeConfig.native.js | 11 + .../dist-es/runtimeConfig.shared.js | 17 + .../@aws-sdk/client-sts/dist-types/STS.d.ts | 619 ++ .../client-sts/dist-types/STSClient.d.ts | 153 + .../commands/AssumeRoleCommand.d.ts | 124 + .../commands/AssumeRoleWithSAMLCommand.d.ts | 165 + .../AssumeRoleWithWebIdentityCommand.d.ts | 169 + .../DecodeAuthorizationMessageCommand.d.ts | 72 + .../commands/GetAccessKeyInfoCommand.d.ts | 54 + .../commands/GetCallerIdentityCommand.d.ts | 46 + .../commands/GetFederationTokenCommand.d.ts | 123 + .../commands/GetSessionTokenCommand.d.ts | 95 + .../client-sts/dist-types/commands/index.d.ts | 8 + .../dist-types/defaultRoleAssumers.d.ts | 20 + .../dist-types/defaultStsRoleAssumers.d.ts | 35 + .../endpoint/EndpointParameters.d.ts | 21 + .../dist-types/endpoint/endpointResolver.d.ts | 5 + .../dist-types/endpoint/ruleset.d.ts | 2 + .../@aws-sdk/client-sts/dist-types/index.d.ts | 6 + .../models/STSServiceException.d.ts | 10 + .../client-sts/dist-types/models/index.d.ts | 1 + .../dist-types/models/models_0.d.ts | 1115 +++ .../dist-types/protocols/Aws_query.d.ts | 26 + .../dist-types/runtimeConfig.browser.d.ts | 43 + .../client-sts/dist-types/runtimeConfig.d.ts | 43 + .../dist-types/runtimeConfig.native.d.ts | 42 + .../dist-types/runtimeConfig.shared.d.ts | 18 + .../client-sts/dist-types/ts3.4/STS.d.ts | 140 + .../dist-types/ts3.4/STSClient.d.ts | 159 + .../ts3.4/commands/AssumeRoleCommand.d.ts | 34 + .../commands/AssumeRoleWithSAMLCommand.d.ts | 38 + .../AssumeRoleWithWebIdentityCommand.d.ts | 41 + .../DecodeAuthorizationMessageCommand.d.ts | 41 + .../commands/GetAccessKeyInfoCommand.d.ts | 37 + .../commands/GetCallerIdentityCommand.d.ts | 38 + .../commands/GetFederationTokenCommand.d.ts | 38 + .../commands/GetSessionTokenCommand.d.ts | 37 + .../dist-types/ts3.4/commands/index.d.ts | 8 + .../dist-types/ts3.4/defaultRoleAssumers.d.ts | 22 + .../ts3.4/defaultStsRoleAssumers.d.ts | 25 + .../ts3.4/endpoint/EndpointParameters.d.ts | 36 + .../ts3.4/endpoint/endpointResolver.d.ts | 8 + .../dist-types/ts3.4/endpoint/ruleset.d.ts | 2 + .../client-sts/dist-types/ts3.4/index.d.ts | 6 + .../ts3.4/models/STSServiceException.d.ts | 7 + .../dist-types/ts3.4/models/index.d.ts | 1 + .../dist-types/ts3.4/models/models_0.d.ts | 238 + .../dist-types/ts3.4/protocols/Aws_query.d.ts | 101 + .../ts3.4/runtimeConfig.browser.d.ts | 95 + .../dist-types/ts3.4/runtimeConfig.d.ts | 93 + .../ts3.4/runtimeConfig.native.d.ts | 84 + .../ts3.4/runtimeConfig.shared.d.ts | 18 + .../@aws-sdk/client-sts/package.json | 105 + .../@aws-sdk/config-resolver/LICENSE | 201 + .../@aws-sdk/config-resolver/README.md | 10 + .../NodeUseDualstackEndpointConfigOptions.js | 12 + .../NodeUseFipsEndpointConfigOptions.js | 12 + .../dist-cjs/endpointsConfig/index.js | 7 + .../resolveCustomEndpointsConfig.js | 16 + .../endpointsConfig/resolveEndpointsConfig.js | 20 + .../utils/getEndpointFromRegion.js | 20 + .../config-resolver/dist-cjs/index.js | 6 + .../dist-cjs/regionConfig/config.js | 15 + .../dist-cjs/regionConfig/getRealRegion.js | 10 + .../dist-cjs/regionConfig/index.js | 5 + .../dist-cjs/regionConfig/isFipsRegion.js | 5 + .../regionConfig/resolveRegionConfig.js | 29 + .../dist-cjs/regionInfo/EndpointVariant.js | 2 + .../dist-cjs/regionInfo/EndpointVariantTag.js | 2 + .../dist-cjs/regionInfo/PartitionHash.js | 2 + .../dist-cjs/regionInfo/RegionHash.js | 2 + .../regionInfo/getHostnameFromVariants.js | 8 + .../dist-cjs/regionInfo/getRegionInfo.js | 34 + .../regionInfo/getResolvedHostname.js | 9 + .../regionInfo/getResolvedPartition.js | 5 + .../regionInfo/getResolvedSigningRegion.js | 16 + .../dist-cjs/regionInfo/index.js | 6 + .../NodeUseDualstackEndpointConfigOptions.js | 9 + .../NodeUseFipsEndpointConfigOptions.js | 9 + .../dist-es/endpointsConfig/index.js | 4 + .../resolveCustomEndpointsConfig.js | 11 + .../endpointsConfig/resolveEndpointsConfig.js | 15 + .../utils/getEndpointFromRegion.js | 15 + .../@aws-sdk/config-resolver/dist-es/index.js | 3 + .../dist-es/regionConfig/config.js | 12 + .../dist-es/regionConfig/getRealRegion.js | 6 + .../dist-es/regionConfig/index.js | 2 + .../dist-es/regionConfig/isFipsRegion.js | 1 + .../regionConfig/resolveRegionConfig.js | 25 + .../dist-es/regionInfo/EndpointVariant.js | 1 + .../dist-es/regionInfo/EndpointVariantTag.js | 1 + .../dist-es/regionInfo/PartitionHash.js | 1 + .../dist-es/regionInfo/RegionHash.js | 1 + .../regionInfo/getHostnameFromVariants.js | 1 + .../dist-es/regionInfo/getRegionInfo.js | 29 + .../dist-es/regionInfo/getResolvedHostname.js | 5 + .../regionInfo/getResolvedPartition.js | 1 + .../regionInfo/getResolvedSigningRegion.js | 12 + .../dist-es/regionInfo/index.js | 3 + ...NodeUseDualstackEndpointConfigOptions.d.ts | 5 + .../NodeUseFipsEndpointConfigOptions.d.ts | 5 + .../dist-types/endpointsConfig/index.d.ts | 4 + .../resolveCustomEndpointsConfig.d.ts | 20 + .../resolveEndpointsConfig.d.ts | 43 + .../utils/getEndpointFromRegion.d.ts | 11 + .../config-resolver/dist-types/index.d.ts | 3 + .../dist-types/regionConfig/config.d.ts | 5 + .../regionConfig/getRealRegion.d.ts | 1 + .../dist-types/regionConfig/index.d.ts | 2 + .../dist-types/regionConfig/isFipsRegion.d.ts | 1 + .../regionConfig/resolveRegionConfig.d.ts | 25 + .../regionInfo/EndpointVariant.d.ts | 8 + .../regionInfo/EndpointVariantTag.d.ts | 5 + .../dist-types/regionInfo/PartitionHash.d.ts | 12 + .../dist-types/regionInfo/RegionHash.d.ts | 10 + .../regionInfo/getHostnameFromVariants.d.ts | 6 + .../dist-types/regionInfo/getRegionInfo.d.ts | 11 + .../regionInfo/getResolvedHostname.d.ts | 5 + .../regionInfo/getResolvedPartition.d.ts | 5 + .../regionInfo/getResolvedSigningRegion.d.ts | 6 + .../dist-types/regionInfo/index.d.ts | 3 + ...NodeUseDualstackEndpointConfigOptions.d.ts | 5 + .../NodeUseFipsEndpointConfigOptions.d.ts | 5 + .../ts3.4/endpointsConfig/index.d.ts | 4 + .../resolveCustomEndpointsConfig.d.ts | 18 + .../resolveEndpointsConfig.d.ts | 27 + .../utils/getEndpointFromRegion.d.ts | 13 + .../dist-types/ts3.4/index.d.ts | 3 + .../dist-types/ts3.4/regionConfig/config.d.ts | 8 + .../ts3.4/regionConfig/getRealRegion.d.ts | 1 + .../dist-types/ts3.4/regionConfig/index.d.ts | 2 + .../ts3.4/regionConfig/isFipsRegion.d.ts | 1 + .../regionConfig/resolveRegionConfig.d.ts | 14 + .../ts3.4/regionInfo/EndpointVariant.d.ts | 5 + .../ts3.4/regionInfo/EndpointVariantTag.d.ts | 1 + .../ts3.4/regionInfo/PartitionHash.d.ts | 10 + .../ts3.4/regionInfo/RegionHash.d.ts | 9 + .../regionInfo/getHostnameFromVariants.d.ts | 9 + .../ts3.4/regionInfo/getRegionInfo.d.ts | 20 + .../ts3.4/regionInfo/getResolvedHostname.d.ts | 8 + .../regionInfo/getResolvedPartition.d.ts | 8 + .../regionInfo/getResolvedSigningRegion.d.ts | 13 + .../dist-types/ts3.4/regionInfo/index.d.ts | 3 + .../@aws-sdk/config-resolver/package.json | 57 + .../LICENSE | 201 + .../README.md | 11 + .../dist-cjs/CognitoProviderParameters.js | 2 + .../dist-cjs/InMemoryStorage.js | 21 + .../dist-cjs/IndexedDbStorage.js | 71 + .../dist-cjs/Logins.js | 2 + .../dist-cjs/Storage.js | 2 + .../dist-cjs/fromCognitoIdentity.js | 32 + .../dist-cjs/fromCognitoIdentityPool.js | 42 + .../dist-cjs/index.js | 8 + .../dist-cjs/localStorage.js | 16 + .../dist-cjs/resolveLogins.js | 19 + .../dist-es/CognitoProviderParameters.js | 1 + .../dist-es/InMemoryStorage.js | 17 + .../dist-es/IndexedDbStorage.js | 67 + .../dist-es/Logins.js | 1 + .../dist-es/Storage.js | 1 + .../dist-es/fromCognitoIdentity.js | 28 + .../dist-es/fromCognitoIdentityPool.js | 38 + .../dist-es/index.js | 5 + .../dist-es/localStorage.js | 12 + .../dist-es/resolveLogins.js | 15 + .../dist-types/CognitoProviderParameters.d.ts | 25 + .../dist-types/InMemoryStorage.d.ts | 8 + .../dist-types/IndexedDbStorage.d.ts | 10 + .../dist-types/Logins.d.ts | 3 + .../dist-types/Storage.d.ts | 14 + .../dist-types/fromCognitoIdentity.d.ts | 23 + .../dist-types/fromCognitoIdentityPool.d.ts | 44 + .../dist-types/index.d.ts | 5 + .../dist-types/localStorage.d.ts | 2 + .../dist-types/resolveLogins.d.ts | 5 + .../ts3.4/CognitoProviderParameters.d.ts | 7 + .../dist-types/ts3.4/InMemoryStorage.d.ts | 8 + .../dist-types/ts3.4/IndexedDbStorage.d.ts | 10 + .../dist-types/ts3.4/Logins.d.ts | 3 + .../dist-types/ts3.4/Storage.d.ts | 5 + .../dist-types/ts3.4/fromCognitoIdentity.d.ts | 14 + .../ts3.4/fromCognitoIdentityPool.d.ts | 19 + .../dist-types/ts3.4/index.d.ts | 5 + .../dist-types/ts3.4/localStorage.d.ts | 2 + .../dist-types/ts3.4/resolveLogins.d.ts | 2 + .../package.json | 56 + .../@aws-sdk/credential-provider-env/LICENSE | 201 + .../credential-provider-env/README.md | 11 + .../dist-cjs/fromEnv.js | 24 + .../credential-provider-env/dist-cjs/index.js | 4 + .../dist-es/fromEnv.js | 20 + .../credential-provider-env/dist-es/index.js | 1 + .../dist-types/fromEnv.d.ts | 11 + .../dist-types/index.d.ts | 1 + .../dist-types/ts3.4/fromEnv.d.ts | 6 + .../dist-types/ts3.4/index.d.ts | 1 + .../credential-provider-env/package.json | 60 + .../@aws-sdk/credential-provider-imds/LICENSE | 201 + .../credential-provider-imds/README.md | 11 + .../dist-cjs/config/Endpoint.js | 8 + .../dist-cjs/config/EndpointConfigOptions.js | 10 + .../dist-cjs/config/EndpointMode.js | 8 + .../config/EndpointModeConfigOptions.js | 11 + .../dist-cjs/fromContainerMetadata.js | 70 + .../dist-cjs/fromInstanceMetadata.js | 95 + .../dist-cjs/index.js | 12 + .../remoteProvider/ImdsCredentials.js | 17 + .../remoteProvider/RemoteProviderInit.js | 7 + .../dist-cjs/remoteProvider/httpRequest.js | 41 + .../dist-cjs/remoteProvider/index.js | 5 + .../dist-cjs/remoteProvider/retry.js | 11 + .../dist-cjs/types.js | 2 + .../getExtendedInstanceMetadataCredentials.js | 22 + .../utils/getInstanceMetadataEndpoint.js | 23 + .../dist-cjs/utils/staticStabilityProvider.js | 29 + .../dist-es/config/Endpoint.js | 5 + .../dist-es/config/EndpointConfigOptions.js | 7 + .../dist-es/config/EndpointMode.js | 5 + .../config/EndpointModeConfigOptions.js | 8 + .../dist-es/fromContainerMetadata.js | 66 + .../dist-es/fromInstanceMetadata.js | 91 + .../credential-provider-imds/dist-es/index.js | 6 + .../dist-es/remoteProvider/ImdsCredentials.js | 12 + .../remoteProvider/RemoteProviderInit.js | 3 + .../dist-es/remoteProvider/httpRequest.js | 36 + .../dist-es/remoteProvider/index.js | 2 + .../dist-es/remoteProvider/retry.js | 7 + .../credential-provider-imds/dist-es/types.js | 1 + .../getExtendedInstanceMetadataCredentials.js | 17 + .../utils/getInstanceMetadataEndpoint.js | 19 + .../dist-es/utils/staticStabilityProvider.js | 25 + .../dist-types/config/Endpoint.d.ts | 4 + .../config/EndpointConfigOptions.d.ts | 4 + .../dist-types/config/EndpointMode.d.ts | 4 + .../config/EndpointModeConfigOptions.d.ts | 4 + .../dist-types/fromContainerMetadata.d.ts | 10 + .../dist-types/fromInstanceMetadata.d.ts | 8 + .../dist-types/index.d.ts | 6 + .../remoteProvider/ImdsCredentials.d.ts | 9 + .../remoteProvider/RemoteProviderInit.d.ts | 17 + .../remoteProvider/httpRequest.d.ts | 6 + .../dist-types/remoteProvider/index.d.ts | 2 + .../dist-types/remoteProvider/retry.d.ts | 7 + .../dist-types/ts3.4/config/Endpoint.d.ts | 4 + .../ts3.4/config/EndpointConfigOptions.d.ts | 6 + .../dist-types/ts3.4/config/EndpointMode.d.ts | 4 + .../config/EndpointModeConfigOptions.d.ts | 8 + .../ts3.4/fromContainerMetadata.d.ts | 9 + .../ts3.4/fromInstanceMetadata.d.ts | 6 + .../dist-types/ts3.4/index.d.ts | 6 + .../ts3.4/remoteProvider/ImdsCredentials.d.ts | 11 + .../remoteProvider/RemoteProviderInit.d.ts | 14 + .../ts3.4/remoteProvider/httpRequest.d.ts | 2 + .../ts3.4/remoteProvider/index.d.ts | 2 + .../ts3.4/remoteProvider/retry.d.ts | 7 + .../dist-types/ts3.4/types.d.ts | 4 + ...etExtendedInstanceMetadataCredentials.d.ts | 6 + .../utils/getInstanceMetadataEndpoint.d.ts | 2 + .../ts3.4/utils/staticStabilityProvider.d.ts | 8 + .../dist-types/types.d.ts | 4 + ...etExtendedInstanceMetadataCredentials.d.ts | 3 + .../utils/getInstanceMetadataEndpoint.d.ts | 21 + .../utils/staticStabilityProvider.d.ts | 14 + .../credential-provider-imds/package.json | 63 + .../@aws-sdk/credential-provider-ini/LICENSE | 201 + .../credential-provider-ini/README.md | 11 + .../dist-cjs/fromIni.js | 10 + .../credential-provider-ini/dist-cjs/index.js | 4 + .../dist-cjs/resolveAssumeRoleCredentials.js | 51 + .../dist-cjs/resolveCredentialSource.js | 21 + .../dist-cjs/resolveProcessCredentials.js | 13 + .../dist-cjs/resolveProfileData.js | 32 + .../dist-cjs/resolveSsoCredentials.js | 17 + .../dist-cjs/resolveStaticCredentials.js | 15 + .../dist-cjs/resolveWebIdentityCredentials.js | 17 + .../dist-es/fromIni.js | 6 + .../credential-provider-ini/dist-es/index.js | 1 + .../dist-es/resolveAssumeRoleCredentials.js | 46 + .../dist-es/resolveCredentialSource.js | 17 + .../dist-es/resolveProcessCredentials.js | 8 + .../dist-es/resolveProfileData.js | 28 + .../dist-es/resolveSsoCredentials.js | 12 + .../dist-es/resolveStaticCredentials.js | 10 + .../dist-es/resolveWebIdentityCredentials.js | 12 + .../dist-types/fromIni.d.ts | 36 + .../dist-types/index.d.ts | 1 + .../resolveAssumeRoleCredentials.d.ts | 32 + .../dist-types/resolveCredentialSource.d.ts | 9 + .../dist-types/resolveProcessCredentials.d.ts | 7 + .../dist-types/resolveProfileData.d.ts | 3 + .../dist-types/resolveSsoCredentials.d.ts | 3 + .../dist-types/resolveStaticCredentials.d.ts | 8 + .../resolveWebIdentityCredentials.d.ts | 9 + .../dist-types/ts3.4/fromIni.d.ts | 20 + .../dist-types/ts3.4/index.d.ts | 1 + .../ts3.4/resolveAssumeRoleCredentials.d.ts | 16 + .../ts3.4/resolveCredentialSource.d.ts | 5 + .../ts3.4/resolveProcessCredentials.d.ts | 10 + .../dist-types/ts3.4/resolveProfileData.d.ts | 8 + .../ts3.4/resolveSsoCredentials.d.ts | 5 + .../ts3.4/resolveStaticCredentials.d.ts | 12 + .../ts3.4/resolveWebIdentityCredentials.d.ts | 14 + .../credential-provider-ini/package.json | 66 + .../@aws-sdk/credential-provider-node/LICENSE | 201 + .../credential-provider-node/README.md | 101 + .../dist-cjs/defaultProvider.js | 15 + .../dist-cjs/index.js | 4 + .../dist-cjs/remoteProvider.js | 18 + .../dist-es/defaultProvider.js | 11 + .../credential-provider-node/dist-es/index.js | 1 + .../dist-es/remoteProvider.js | 14 + .../dist-types/defaultProvider.d.ts | 42 + .../dist-types/index.d.ts | 1 + .../dist-types/remoteProvider.d.ts | 4 + .../dist-types/ts3.4/defaultProvider.d.ts | 14 + .../dist-types/ts3.4/index.d.ts | 1 + .../dist-types/ts3.4/remoteProvider.d.ts | 6 + .../credential-provider-node/package.json | 67 + .../credential-provider-process/LICENSE | 201 + .../credential-provider-process/README.md | 11 + .../dist-cjs/ProcessCredentials.js | 2 + .../dist-cjs/fromProcess.js | 10 + .../getValidatedProcessCredentials.js | 25 + .../dist-cjs/index.js | 4 + .../dist-cjs/resolveProcessCredentials.js | 37 + .../dist-es/ProcessCredentials.js | 1 + .../dist-es/fromProcess.js | 6 + .../dist-es/getValidatedProcessCredentials.js | 21 + .../dist-es/index.js | 1 + .../dist-es/resolveProcessCredentials.js | 33 + .../dist-types/ProcessCredentials.d.ts | 7 + .../dist-types/fromProcess.d.ts | 9 + .../getValidatedProcessCredentials.d.ts | 3 + .../dist-types/index.d.ts | 1 + .../dist-types/resolveProcessCredentials.d.ts | 2 + .../dist-types/ts3.4/ProcessCredentials.d.ts | 7 + .../dist-types/ts3.4/fromProcess.d.ts | 6 + .../ts3.4/getValidatedProcessCredentials.d.ts | 6 + .../dist-types/ts3.4/index.d.ts | 1 + .../ts3.4/resolveProcessCredentials.d.ts | 5 + .../credential-provider-process/package.json | 61 + .../@aws-sdk/credential-provider-sso/LICENSE | 201 + .../credential-provider-sso/README.md | 11 + .../dist-cjs/fromSSO.js | 61 + .../credential-provider-sso/dist-cjs/index.js | 7 + .../dist-cjs/isSsoProfile.js | 10 + .../dist-cjs/resolveSSOCredentials.js | 55 + .../credential-provider-sso/dist-cjs/types.js | 2 + .../dist-cjs/validateSsoProfile.js | 13 + .../dist-es/fromSSO.js | 57 + .../credential-provider-sso/dist-es/index.js | 4 + .../dist-es/isSsoProfile.js | 6 + .../dist-es/resolveSSOCredentials.js | 51 + .../credential-provider-sso/dist-es/types.js | 1 + .../dist-es/validateSsoProfile.js | 9 + .../dist-types/fromSSO.d.ts | 59 + .../dist-types/index.d.ts | 4 + .../dist-types/isSsoProfile.d.ts | 6 + .../dist-types/resolveSSOCredentials.d.ts | 6 + .../dist-types/ts3.4/fromSSO.d.ts | 16 + .../dist-types/ts3.4/index.d.ts | 4 + .../dist-types/ts3.4/isSsoProfile.d.ts | 3 + .../ts3.4/resolveSSOCredentials.d.ts | 11 + .../dist-types/ts3.4/types.d.ts | 14 + .../dist-types/ts3.4/validateSsoProfile.d.ts | 4 + .../dist-types/types.d.ts | 20 + .../dist-types/validateSsoProfile.d.ts | 5 + .../credential-provider-sso/package.json | 63 + .../credential-provider-web-identity/LICENSE | 201 + .../README.md | 11 + .../dist-cjs/fromTokenFile.js | 28 + .../dist-cjs/fromWebToken.js | 21 + .../dist-cjs/index.js | 5 + .../dist-es/fromTokenFile.js | 23 + .../dist-es/fromWebToken.js | 17 + .../dist-es/index.js | 2 + .../dist-types/fromTokenFile.d.ts | 12 + .../dist-types/fromWebToken.d.ts | 126 + .../dist-types/index.d.ts | 2 + .../dist-types/ts3.4/fromTokenFile.d.ts | 11 + .../dist-types/ts3.4/fromWebToken.d.ts | 35 + .../dist-types/ts3.4/index.d.ts | 2 + .../package.json | 68 + .../@aws-sdk/credential-providers/LICENSE | 201 + .../@aws-sdk/credential-providers/README.md | 692 ++ .../dist-cjs/fromCognitoIdentity.js | 13 + .../dist-cjs/fromCognitoIdentityPool.js | 13 + .../dist-cjs/fromContainerMetadata.js | 6 + .../credential-providers/dist-cjs/fromEnv.js | 6 + .../credential-providers/dist-cjs/fromIni.js | 14 + .../dist-cjs/fromInstanceMetadata.js | 6 + .../dist-cjs/fromNodeProviderChain.js | 14 + .../dist-cjs/fromProcess.js | 6 + .../credential-providers/dist-cjs/fromSSO.js | 7 + .../dist-cjs/fromTemporaryCredentials.js | 36 + .../dist-cjs/fromTokenFile.js | 13 + .../dist-cjs/fromWebToken.js | 13 + .../credential-providers/dist-cjs/index.js | 15 + .../dist-cjs/index.web.js | 7 + .../dist-es/fromCognitoIdentity.js | 6 + .../dist-es/fromCognitoIdentityPool.js | 6 + .../dist-es/fromContainerMetadata.js | 2 + .../credential-providers/dist-es/fromEnv.js | 2 + .../credential-providers/dist-es/fromIni.js | 7 + .../dist-es/fromInstanceMetadata.js | 2 + .../dist-es/fromNodeProviderChain.js | 7 + .../dist-es/fromProcess.js | 2 + .../credential-providers/dist-es/fromSSO.js | 3 + .../dist-es/fromTemporaryCredentials.js | 31 + .../dist-es/fromTokenFile.js | 6 + .../dist-es/fromWebToken.js | 6 + .../credential-providers/dist-es/index.js | 12 + .../credential-providers/dist-es/index.web.js | 4 + .../dist-types/fromCognitoIdentity.d.ts | 45 + .../dist-types/fromCognitoIdentityPool.d.ts | 46 + .../dist-types/fromContainerMetadata.d.ts | 24 + .../dist-types/fromEnv.d.ts | 26 + .../dist-types/fromIni.d.ts | 47 + .../dist-types/fromInstanceMetadata.d.ts | 22 + .../dist-types/fromNodeProviderChain.d.ts | 33 + .../dist-types/fromProcess.d.ts | 28 + .../dist-types/fromSSO.d.ts | 48 + .../dist-types/fromTemporaryCredentials.d.ts | 52 + .../dist-types/fromTokenFile.d.ts | 36 + .../dist-types/fromWebToken.d.ts | 45 + .../dist-types/index.d.ts | 12 + .../dist-types/index.web.d.ts | 4 + .../dist-types/ts3.4/fromCognitoIdentity.d.ts | 17 + .../ts3.4/fromCognitoIdentityPool.d.ts | 15 + .../ts3.4/fromContainerMetadata.d.ts | 6 + .../dist-types/ts3.4/fromEnv.d.ts | 2 + .../dist-types/ts3.4/fromIni.d.ts | 10 + .../ts3.4/fromInstanceMetadata.d.ts | 5 + .../ts3.4/fromNodeProviderChain.d.ts | 10 + .../dist-types/ts3.4/fromProcess.d.ts | 6 + .../dist-types/ts3.4/fromSSO.d.ts | 10 + .../ts3.4/fromTemporaryCredentials.d.ts | 21 + .../dist-types/ts3.4/fromTokenFile.d.ts | 10 + .../dist-types/ts3.4/fromWebToken.d.ts | 10 + .../dist-types/ts3.4/index.d.ts | 12 + .../dist-types/ts3.4/index.web.d.ts | 4 + .../credential-providers/package.json | 75 + .../@aws-sdk/fetch-http-handler/LICENSE | 201 + .../@aws-sdk/fetch-http-handler/README.md | 4 + .../dist-cjs/fetch-http-handler.js | 87 + .../fetch-http-handler/dist-cjs/index.js | 5 + .../dist-cjs/request-timeout.js | 15 + .../dist-cjs/stream-collector.js | 50 + .../dist-es/fetch-http-handler.js | 83 + .../fetch-http-handler/dist-es/index.js | 2 + .../dist-es/request-timeout.js | 11 + .../dist-es/stream-collector.js | 45 + .../dist-types/fetch-http-handler.d.ts | 21 + .../fetch-http-handler/dist-types/index.d.ts | 2 + .../dist-types/request-timeout.d.ts | 1 + .../dist-types/stream-collector.d.ts | 2 + .../dist-types/ts3.4/fetch-http-handler.d.ts | 21 + .../dist-types/ts3.4/index.d.ts | 2 + .../dist-types/ts3.4/request-timeout.d.ts | 1 + .../dist-types/ts3.4/stream-collector.d.ts | 2 + .../@aws-sdk/fetch-http-handler/package.json | 55 + .../node_modules/@aws-sdk/hash-node/LICENSE | 201 + .../node_modules/@aws-sdk/hash-node/README.md | 10 + .../@aws-sdk/hash-node/dist-cjs/index.js | 38 + .../@aws-sdk/hash-node/dist-es/index.js | 34 + .../@aws-sdk/hash-node/dist-types/index.d.ts | 10 + .../hash-node/dist-types/ts3.4/index.d.ts | 10 + .../@aws-sdk/hash-node/package.json | 57 + .../@aws-sdk/invalid-dependency/LICENSE | 201 + .../@aws-sdk/invalid-dependency/README.md | 10 + .../invalid-dependency/dist-cjs/index.js | 5 + .../dist-cjs/invalidFunction.js | 7 + .../dist-cjs/invalidProvider.js | 5 + .../invalid-dependency/dist-es/index.js | 2 + .../dist-es/invalidFunction.js | 3 + .../dist-es/invalidProvider.js | 1 + .../invalid-dependency/dist-types/index.d.ts | 2 + .../dist-types/invalidFunction.d.ts | 1 + .../dist-types/invalidProvider.d.ts | 2 + .../dist-types/ts3.4/index.d.ts | 2 + .../dist-types/ts3.4/invalidFunction.d.ts | 1 + .../dist-types/ts3.4/invalidProvider.d.ts | 2 + .../@aws-sdk/invalid-dependency/package.json | 50 + .../@aws-sdk/is-array-buffer/CHANGELOG.md | 663 ++ .../@aws-sdk/is-array-buffer/LICENSE | 201 + .../@aws-sdk/is-array-buffer/README.md | 10 + .../is-array-buffer/dist-cjs/index.js | 6 + .../@aws-sdk/is-array-buffer/dist-es/index.js | 2 + .../is-array-buffer/dist-types/index.d.ts | 1 + .../dist-types/ts3.4/index.d.ts | 1 + .../@aws-sdk/is-array-buffer/package.json | 53 + .../middleware-content-length/LICENSE | 201 + .../middleware-content-length/README.md | 4 + .../dist-cjs/index.js | 44 + .../dist-es/index.js | 39 + .../dist-types/index.d.ts | 6 + .../dist-types/ts3.4/index.d.ts | 13 + .../middleware-content-length/package.json | 54 + .../@aws-sdk/middleware-endpoint/LICENSE | 201 + .../@aws-sdk/middleware-endpoint/README.md | 10 + .../adaptors/createConfigValueProvider.js | 30 + .../adaptors/getEndpointFromInstructions.js | 43 + .../dist-cjs/adaptors/index.js | 5 + .../dist-cjs/adaptors/toEndpointV1.js | 14 + .../dist-cjs/endpointMiddleware.js | 25 + .../dist-cjs/getEndpointPlugin.js | 22 + .../middleware-endpoint/dist-cjs/index.js | 8 + .../dist-cjs/resolveEndpointConfig.js | 21 + .../dist-cjs/service-customizations/index.js | 4 + .../dist-cjs/service-customizations/s3.js | 43 + .../middleware-endpoint/dist-cjs/types.js | 2 + .../adaptors/createConfigValueProvider.js | 25 + .../adaptors/getEndpointFromInstructions.js | 37 + .../dist-es/adaptors/index.js | 2 + .../dist-es/adaptors/toEndpointV1.js | 10 + .../dist-es/endpointMiddleware.js | 20 + .../dist-es/getEndpointPlugin.js | 18 + .../middleware-endpoint/dist-es/index.js | 5 + .../dist-es/resolveEndpointConfig.js | 16 + .../dist-es/service-customizations/index.js | 1 + .../dist-es/service-customizations/s3.js | 37 + .../middleware-endpoint/dist-es/types.js | 1 + .../adaptors/createConfigValueProvider.d.ts | 13 + .../adaptors/getEndpointFromInstructions.d.ts | 22 + .../dist-types/adaptors/index.d.ts | 2 + .../dist-types/adaptors/toEndpointV1.d.ts | 2 + .../dist-types/endpointMiddleware.d.ts | 10 + .../dist-types/getEndpointPlugin.d.ts | 5 + .../middleware-endpoint/dist-types/index.d.ts | 5 + .../dist-types/resolveEndpointConfig.d.ts | 81 + .../service-customizations/index.d.ts | 1 + .../dist-types/service-customizations/s3.d.ts | 14 + .../adaptors/createConfigValueProvider.d.ts | 7 + .../adaptors/getEndpointFromInstructions.d.ts | 29 + .../dist-types/ts3.4/adaptors/index.d.ts | 2 + .../ts3.4/adaptors/toEndpointV1.d.ts | 4 + .../dist-types/ts3.4/endpointMiddleware.d.ts | 10 + .../dist-types/ts3.4/getEndpointPlugin.d.ts | 14 + .../dist-types/ts3.4/index.d.ts | 5 + .../ts3.4/resolveEndpointConfig.d.ts | 62 + .../ts3.4/service-customizations/index.d.ts | 1 + .../ts3.4/service-customizations/s3.d.ts | 8 + .../dist-types/ts3.4/types.d.ts | 23 + .../middleware-endpoint/dist-types/types.d.ts | 19 + .../@aws-sdk/middleware-endpoint/package.json | 59 + .../@aws-sdk/middleware-host-header/LICENSE | 201 + .../@aws-sdk/middleware-host-header/README.md | 4 + .../middleware-host-header/dist-cjs/index.js | 36 + .../middleware-host-header/dist-es/index.js | 30 + .../dist-types/index.d.ts | 17 + .../dist-types/ts3.4/index.d.ts | 29 + .../middleware-host-header/package.json | 54 + .../@aws-sdk/middleware-logger/LICENSE | 201 + .../@aws-sdk/middleware-logger/README.md | 4 + .../middleware-logger/dist-cjs/index.js | 4 + .../dist-cjs/loggerMiddleware.js | 35 + .../middleware-logger/dist-es/index.js | 1 + .../dist-es/loggerMiddleware.js | 30 + .../middleware-logger/dist-types/index.d.ts | 1 + .../dist-types/loggerMiddleware.d.ts | 4 + .../dist-types/ts3.4/index.d.ts | 1 + .../dist-types/ts3.4/loggerMiddleware.d.ts | 17 + .../@aws-sdk/middleware-logger/package.json | 55 + .../middleware-recursion-detection/LICENSE | 201 + .../middleware-recursion-detection/README.md | 10 + .../dist-cjs/index.js | 39 + .../dist-es/index.js | 34 + .../dist-types/index.d.ts | 12 + .../dist-types/ts3.4/index.d.ts | 18 + .../package.json | 54 + .../@aws-sdk/middleware-retry/LICENSE | 201 + .../@aws-sdk/middleware-retry/README.md | 4 + .../dist-cjs/AdaptiveRetryStrategy.js | 24 + .../dist-cjs/StandardRetryStrategy.js | 95 + .../dist-cjs/configurations.js | 57 + .../dist-cjs/defaultRetryQuota.js | 32 + .../middleware-retry/dist-cjs/delayDecider.js | 6 + .../middleware-retry/dist-cjs/index.js | 10 + .../dist-cjs/omitRetryHeadersMiddleware.js | 27 + .../middleware-retry/dist-cjs/retryDecider.js | 11 + .../dist-cjs/retryMiddleware.js | 110 + .../middleware-retry/dist-cjs/types.js | 2 + .../middleware-retry/dist-cjs/util.js | 13 + .../dist-es/AdaptiveRetryStrategy.js | 20 + .../dist-es/StandardRetryStrategy.js | 90 + .../dist-es/configurations.js | 52 + .../dist-es/defaultRetryQuota.js | 27 + .../middleware-retry/dist-es/delayDecider.js | 2 + .../middleware-retry/dist-es/index.js | 7 + .../dist-es/omitRetryHeadersMiddleware.js | 22 + .../middleware-retry/dist-es/retryDecider.js | 7 + .../dist-es/retryMiddleware.js | 104 + .../middleware-retry/dist-es/types.js | 1 + .../@aws-sdk/middleware-retry/dist-es/util.js | 9 + .../dist-types/AdaptiveRetryStrategy.d.ts | 20 + .../dist-types/StandardRetryStrategy.d.ts | 30 + .../dist-types/configurations.d.ts | 37 + .../dist-types/defaultRetryQuota.d.ts | 18 + .../dist-types/delayDecider.d.ts | 4 + .../middleware-retry/dist-types/index.d.ts | 7 + .../omitRetryHeadersMiddleware.d.ts | 4 + .../dist-types/retryDecider.d.ts | 2 + .../dist-types/retryMiddleware.d.ts | 6 + .../ts3.4/AdaptiveRetryStrategy.d.ts | 29 + .../ts3.4/StandardRetryStrategy.d.ts | 37 + .../dist-types/ts3.4/configurations.d.ts | 23 + .../dist-types/ts3.4/defaultRetryQuota.d.ts | 10 + .../dist-types/ts3.4/delayDecider.d.ts | 4 + .../dist-types/ts3.4/index.d.ts | 7 + .../ts3.4/omitRetryHeadersMiddleware.d.ts | 15 + .../dist-types/ts3.4/retryDecider.d.ts | 2 + .../dist-types/ts3.4/retryMiddleware.d.ts | 21 + .../dist-types/ts3.4/types.d.ts | 16 + .../dist-types/ts3.4/util.d.ts | 2 + .../middleware-retry/dist-types/types.d.ts | 53 + .../middleware-retry/dist-types/util.d.ts | 2 + .../@aws-sdk/middleware-retry/package.json | 60 + .../@aws-sdk/middleware-sdk-sts/LICENSE | 201 + .../@aws-sdk/middleware-sdk-sts/README.md | 4 + .../middleware-sdk-sts/dist-cjs/index.js | 9 + .../middleware-sdk-sts/dist-es/index.js | 5 + .../middleware-sdk-sts/dist-types/index.d.ts | 34 + .../dist-types/ts3.4/index.d.ts | 34 + .../@aws-sdk/middleware-sdk-sts/package.json | 57 + .../@aws-sdk/middleware-serde/LICENSE | 201 + .../@aws-sdk/middleware-serde/README.md | 4 + .../dist-cjs/deserializerMiddleware.js | 20 + .../middleware-serde/dist-cjs/index.js | 6 + .../middleware-serde/dist-cjs/serdePlugin.js | 26 + .../dist-cjs/serializerMiddleware.js | 18 + .../dist-es/deserializerMiddleware.js | 16 + .../middleware-serde/dist-es/index.js | 3 + .../middleware-serde/dist-es/serdePlugin.js | 22 + .../dist-es/serializerMiddleware.js | 13 + .../dist-types/deserializerMiddleware.d.ts | 2 + .../middleware-serde/dist-types/index.d.ts | 3 + .../dist-types/serdePlugin.d.ts | 8 + .../dist-types/serializerMiddleware.d.ts | 3 + .../ts3.4/deserializerMiddleware.d.ts | 9 + .../dist-types/ts3.4/index.d.ts | 3 + .../dist-types/ts3.4/serdePlugin.d.ts | 27 + .../ts3.4/serializerMiddleware.d.ts | 14 + .../@aws-sdk/middleware-serde/package.json | 53 + .../@aws-sdk/middleware-signing/LICENSE | 201 + .../@aws-sdk/middleware-signing/README.md | 4 + .../dist-cjs/configurations.js | 108 + .../middleware-signing/dist-cjs/index.js | 5 + .../middleware-signing/dist-cjs/middleware.js | 50 + .../dist-cjs/utils/getSkewCorrectedDate.js | 5 + .../utils/getUpdatedSystemClockOffset.js | 12 + .../dist-cjs/utils/isClockSkewed.js | 6 + .../dist-es/configurations.js | 103 + .../middleware-signing/dist-es/index.js | 2 + .../middleware-signing/dist-es/middleware.js | 43 + .../dist-es/utils/getSkewCorrectedDate.js | 1 + .../utils/getUpdatedSystemClockOffset.js | 8 + .../dist-es/utils/isClockSkewed.js | 2 + .../dist-types/configurations.d.ts | 92 + .../middleware-signing/dist-types/index.d.ts | 2 + .../dist-types/middleware.d.ts | 6 + .../dist-types/ts3.4/configurations.d.ts | 68 + .../dist-types/ts3.4/index.d.ts | 2 + .../dist-types/ts3.4/middleware.d.ts | 19 + .../ts3.4/utils/getSkewCorrectedDate.d.ts | 1 + .../utils/getUpdatedSystemClockOffset.d.ts | 4 + .../dist-types/ts3.4/utils/isClockSkewed.d.ts | 4 + .../utils/getSkewCorrectedDate.d.ts | 6 + .../utils/getUpdatedSystemClockOffset.d.ts | 8 + .../dist-types/utils/isClockSkewed.d.ts | 7 + .../@aws-sdk/middleware-signing/package.json | 57 + .../@aws-sdk/middleware-stack/LICENSE | 201 + .../@aws-sdk/middleware-stack/README.md | 78 + .../dist-cjs/MiddlewareStack.js | 225 + .../middleware-stack/dist-cjs/index.js | 4 + .../middleware-stack/dist-cjs/types.js | 2 + .../dist-es/MiddlewareStack.js | 221 + .../middleware-stack/dist-es/index.js | 1 + .../middleware-stack/dist-es/types.js | 1 + .../dist-types/MiddlewareStack.d.ts | 2 + .../middleware-stack/dist-types/index.d.ts | 1 + .../dist-types/ts3.4/MiddlewareStack.d.ts | 5 + .../dist-types/ts3.4/index.d.ts | 1 + .../dist-types/ts3.4/types.d.ts | 47 + .../middleware-stack/dist-types/types.d.ts | 22 + .../@aws-sdk/middleware-stack/package.json | 55 + .../@aws-sdk/middleware-user-agent/LICENSE | 201 + .../@aws-sdk/middleware-user-agent/README.md | 4 + .../dist-cjs/configurations.js | 10 + .../dist-cjs/constants.js | 7 + .../middleware-user-agent/dist-cjs/index.js | 5 + .../dist-cjs/user-agent-middleware.js | 61 + .../dist-es/configurations.js | 6 + .../dist-es/constants.js | 4 + .../middleware-user-agent/dist-es/index.js | 2 + .../dist-es/user-agent-middleware.js | 55 + .../dist-types/configurations.d.ts | 28 + .../dist-types/constants.d.ts | 4 + .../dist-types/index.d.ts | 2 + .../dist-types/ts3.4/configurations.d.ts | 17 + .../dist-types/ts3.4/constants.d.ts | 4 + .../dist-types/ts3.4/index.d.ts | 2 + .../ts3.4/user-agent-middleware.d.ts | 20 + .../dist-types/user-agent-middleware.d.ts | 17 + .../middleware-user-agent/package.json | 55 + .../@aws-sdk/node-config-provider/LICENSE | 201 + .../@aws-sdk/node-config-provider/README.md | 4 + .../dist-cjs/configLoader.js | 9 + .../node-config-provider/dist-cjs/fromEnv.js | 17 + .../dist-cjs/fromSharedConfigFiles.js | 26 + .../dist-cjs/fromStatic.js | 7 + .../node-config-provider/dist-cjs/index.js | 4 + .../dist-es/configLoader.js | 5 + .../node-config-provider/dist-es/fromEnv.js | 13 + .../dist-es/fromSharedConfigFiles.js | 22 + .../dist-es/fromStatic.js | 3 + .../node-config-provider/dist-es/index.js | 1 + .../dist-types/configLoader.d.ts | 22 + .../dist-types/fromEnv.d.ts | 7 + .../dist-types/fromSharedConfigFiles.d.ts | 15 + .../dist-types/fromStatic.d.ts | 3 + .../dist-types/index.d.ts | 1 + .../dist-types/ts3.4/configLoader.d.ts | 18 + .../dist-types/ts3.4/fromEnv.d.ts | 7 + .../ts3.4/fromSharedConfigFiles.d.ts | 10 + .../dist-types/ts3.4/fromStatic.d.ts | 5 + .../dist-types/ts3.4/index.d.ts | 1 + .../node-config-provider/package.json | 58 + .../@aws-sdk/node-http-handler/LICENSE | 201 + .../@aws-sdk/node-http-handler/README.md | 4 + .../node-http-handler/dist-cjs/constants.js | 4 + .../dist-cjs/get-transformed-headers.js | 12 + .../node-http-handler/dist-cjs/index.js | 6 + .../dist-cjs/node-http-handler.js | 100 + .../dist-cjs/node-http2-handler.js | 147 + .../dist-cjs/readable.mock.js | 23 + .../node-http-handler/dist-cjs/server.mock.js | 60 + .../dist-cjs/set-connection-timeout.js | 22 + .../dist-cjs/set-socket-timeout.js | 10 + .../dist-cjs/stream-collector/collector.js | 15 + .../dist-cjs/stream-collector/index.js | 18 + .../stream-collector/readable.mock.js | 23 + .../dist-cjs/write-request-body.js | 27 + .../node-http-handler/dist-es/constants.js | 1 + .../dist-es/get-transformed-headers.js | 9 + .../node-http-handler/dist-es/index.js | 3 + .../dist-es/node-http-handler.js | 95 + .../dist-es/node-http2-handler.js | 142 + .../dist-es/readable.mock.js | 19 + .../node-http-handler/dist-es/server.mock.js | 51 + .../dist-es/set-connection-timeout.js | 18 + .../dist-es/set-socket-timeout.js | 6 + .../dist-es/stream-collector/collector.js | 11 + .../dist-es/stream-collector/index.js | 14 + .../dist-es/stream-collector/readable.mock.js | 19 + .../dist-es/write-request-body.js | 23 + .../dist-types/constants.d.ts | 5 + .../dist-types/get-transformed-headers.d.ts | 4 + .../node-http-handler/dist-types/index.d.ts | 3 + .../dist-types/node-http-handler.d.ts | 35 + .../dist-types/node-http2-handler.d.ts | 57 + .../dist-types/readable.mock.d.ts | 13 + .../dist-types/server.mock.d.ts | 10 + .../dist-types/set-connection-timeout.d.ts | 2 + .../dist-types/set-socket-timeout.d.ts | 2 + .../stream-collector/collector.d.ts | 6 + .../dist-types/stream-collector/index.d.ts | 2 + .../stream-collector/readable.mock.d.ts | 13 + .../dist-types/ts3.4/constants.d.ts | 1 + .../ts3.4/get-transformed-headers.d.ts | 6 + .../dist-types/ts3.4/index.d.ts | 3 + .../dist-types/ts3.4/node-http-handler.d.ts | 28 + .../dist-types/ts3.4/node-http2-handler.d.ts | 28 + .../dist-types/ts3.4/readable.mock.d.ts | 12 + .../dist-types/ts3.4/server.mock.d.ts | 17 + .../ts3.4/set-connection-timeout.d.ts | 6 + .../dist-types/ts3.4/set-socket-timeout.d.ts | 6 + .../ts3.4/stream-collector/collector.d.ts | 9 + .../ts3.4/stream-collector/index.d.ts | 2 + .../ts3.4/stream-collector/readable.mock.d.ts | 12 + .../dist-types/ts3.4/write-request-body.d.ts | 7 + .../dist-types/write-request-body.d.ts | 5 + .../@aws-sdk/node-http-handler/package.json | 59 + .../@aws-sdk/property-provider/LICENSE | 201 + .../@aws-sdk/property-provider/README.md | 10 + .../dist-cjs/CredentialsProviderError.js | 13 + .../dist-cjs/ProviderError.js | 15 + .../dist-cjs/TokenProviderError.js | 13 + .../property-provider/dist-cjs/chain.js | 19 + .../property-provider/dist-cjs/fromStatic.js | 5 + .../property-provider/dist-cjs/index.js | 9 + .../property-provider/dist-cjs/memoize.js | 49 + .../dist-es/CredentialsProviderError.js | 9 + .../dist-es/ProviderError.js | 11 + .../dist-es/TokenProviderError.js | 9 + .../property-provider/dist-es/chain.js | 15 + .../property-provider/dist-es/fromStatic.js | 1 + .../property-provider/dist-es/index.js | 6 + .../property-provider/dist-es/memoize.js | 45 + .../dist-types/CredentialsProviderError.d.ts | 15 + .../dist-types/ProviderError.d.ts | 15 + .../dist-types/TokenProviderError.d.ts | 15 + .../property-provider/dist-types/chain.d.ts | 11 + .../dist-types/fromStatic.d.ts | 2 + .../property-provider/dist-types/index.d.ts | 6 + .../property-provider/dist-types/memoize.d.ts | 37 + .../ts3.4/CredentialsProviderError.d.ts | 6 + .../dist-types/ts3.4/ProviderError.d.ts | 6 + .../dist-types/ts3.4/TokenProviderError.d.ts | 6 + .../dist-types/ts3.4/chain.d.ts | 2 + .../dist-types/ts3.4/fromStatic.d.ts | 2 + .../dist-types/ts3.4/index.d.ts | 6 + .../dist-types/ts3.4/memoize.d.ts | 11 + .../@aws-sdk/property-provider/package.json | 53 + .../@aws-sdk/protocol-http/LICENSE | 201 + .../@aws-sdk/protocol-http/README.md | 4 + .../protocol-http/dist-cjs/httpHandler.js | 2 + .../protocol-http/dist-cjs/httpRequest.js | 49 + .../protocol-http/dist-cjs/httpResponse.js | 17 + .../@aws-sdk/protocol-http/dist-cjs/index.js | 7 + .../protocol-http/dist-cjs/isValidHostname.js | 8 + .../protocol-http/dist-es/httpHandler.js | 1 + .../protocol-http/dist-es/httpRequest.js | 45 + .../protocol-http/dist-es/httpResponse.js | 13 + .../@aws-sdk/protocol-http/dist-es/index.js | 4 + .../protocol-http/dist-es/isValidHostname.js | 4 + .../protocol-http/dist-types/httpHandler.d.ts | 4 + .../protocol-http/dist-types/httpRequest.d.ts | 20 + .../dist-types/httpResponse.d.ts | 14 + .../protocol-http/dist-types/index.d.ts | 4 + .../dist-types/isValidHostname.d.ts | 1 + .../dist-types/ts3.4/httpHandler.d.ts | 8 + .../dist-types/ts3.4/httpRequest.d.ts | 26 + .../dist-types/ts3.4/httpResponse.d.ts | 17 + .../protocol-http/dist-types/ts3.4/index.d.ts | 4 + .../dist-types/ts3.4/isValidHostname.d.ts | 1 + .../@aws-sdk/protocol-http/package.json | 54 + .../@aws-sdk/querystring-builder/LICENSE | 201 + .../@aws-sdk/querystring-builder/README.md | 10 + .../querystring-builder/dist-cjs/index.js | 25 + .../querystring-builder/dist-es/index.js | 21 + .../querystring-builder/dist-types/index.d.ts | 2 + .../dist-types/ts3.4/index.d.ts | 2 + .../@aws-sdk/querystring-builder/package.json | 54 + .../@aws-sdk/querystring-parser/LICENSE | 201 + .../@aws-sdk/querystring-parser/README.md | 10 + .../querystring-parser/dist-cjs/index.js | 27 + .../querystring-parser/dist-es/index.js | 23 + .../querystring-parser/dist-types/index.d.ts | 2 + .../dist-types/ts3.4/index.d.ts | 4 + .../@aws-sdk/querystring-parser/package.json | 53 + .../service-error-classification/LICENSE | 201 + .../service-error-classification/README.md | 4 + .../dist-cjs/constants.js | 30 + .../dist-cjs/index.js | 34 + .../dist-es/constants.js | 27 + .../dist-es/index.js | 19 + .../dist-types/constants.d.ts | 26 + .../dist-types/index.d.ts | 12 + .../dist-types/ts3.4/constants.d.ts | 5 + .../dist-types/ts3.4/index.d.ts | 6 + .../service-error-classification/package.json | 50 + .../@aws-sdk/shared-ini-file-loader/LICENSE | 201 + .../@aws-sdk/shared-ini-file-loader/README.md | 102 + .../dist-cjs/getConfigFilepath.js | 8 + .../dist-cjs/getCredentialsFilepath.js | 8 + .../dist-cjs/getHomeDir.js | 16 + .../dist-cjs/getProfileData.js | 10 + .../dist-cjs/getProfileName.js | 7 + .../dist-cjs/getSSOTokenFilepath.js | 12 + .../dist-cjs/getSSOTokenFromFile.js | 12 + .../dist-cjs/getSsoSessionData.js | 8 + .../shared-ini-file-loader/dist-cjs/index.js | 11 + .../dist-cjs/loadSharedConfigFiles.js | 21 + .../dist-cjs/loadSsoSessionData.js | 16 + .../dist-cjs/parseIni.js | 34 + .../dist-cjs/parseKnownFiles.js | 12 + .../dist-cjs/slurpFile.js | 13 + .../shared-ini-file-loader/dist-cjs/types.js | 2 + .../dist-es/getConfigFilepath.js | 4 + .../dist-es/getCredentialsFilepath.js | 4 + .../dist-es/getHomeDir.js | 12 + .../dist-es/getProfileData.js | 6 + .../dist-es/getProfileName.js | 3 + .../dist-es/getSSOTokenFilepath.js | 8 + .../dist-es/getSSOTokenFromFile.js | 8 + .../dist-es/getSsoSessionData.js | 4 + .../shared-ini-file-loader/dist-es/index.js | 8 + .../dist-es/loadSharedConfigFiles.js | 17 + .../dist-es/loadSsoSessionData.js | 9 + .../dist-es/parseIni.js | 30 + .../dist-es/parseKnownFiles.js | 8 + .../dist-es/slurpFile.js | 9 + .../shared-ini-file-loader/dist-es/types.js | 1 + .../dist-types/getConfigFilepath.d.ts | 2 + .../dist-types/getCredentialsFilepath.d.ts | 2 + .../dist-types/getHomeDir.d.ts | 6 + .../dist-types/getProfileData.d.ts | 7 + .../dist-types/getProfileName.d.ts | 5 + .../dist-types/getSSOTokenFilepath.d.ts | 4 + .../dist-types/getSSOTokenFromFile.d.ts | 44 + .../dist-types/getSsoSessionData.d.ts | 6 + .../dist-types/index.d.ts | 8 + .../dist-types/loadSharedConfigFiles.d.ts | 16 + .../dist-types/loadSsoSessionData.d.ts | 10 + .../dist-types/parseIni.d.ts | 2 + .../dist-types/parseKnownFiles.d.ts | 15 + .../dist-types/slurpFile.d.ts | 1 + .../dist-types/ts3.4/getConfigFilepath.d.ts | 2 + .../ts3.4/getCredentialsFilepath.d.ts | 2 + .../dist-types/ts3.4/getHomeDir.d.ts | 1 + .../dist-types/ts3.4/getProfileData.d.ts | 2 + .../dist-types/ts3.4/getProfileName.d.ts | 3 + .../dist-types/ts3.4/getSSOTokenFilepath.d.ts | 1 + .../dist-types/ts3.4/getSSOTokenFromFile.d.ts | 11 + .../dist-types/ts3.4/getSsoSessionData.d.ts | 2 + .../dist-types/ts3.4/index.d.ts | 8 + .../ts3.4/loadSharedConfigFiles.d.ts | 8 + .../dist-types/ts3.4/loadSsoSessionData.d.ts | 7 + .../dist-types/ts3.4/parseIni.d.ts | 2 + .../dist-types/ts3.4/parseKnownFiles.d.ts | 8 + .../dist-types/ts3.4/slurpFile.d.ts | 1 + .../dist-types/ts3.4/types.d.ts | 8 + .../dist-types/types.d.ts | 13 + .../shared-ini-file-loader/package.json | 54 + .../@aws-sdk/signature-v4/LICENSE | 201 + .../@aws-sdk/signature-v4/README.md | 4 + .../signature-v4/dist-cjs/SignatureV4.js | 175 + .../signature-v4/dist-cjs/cloneRequest.js | 17 + .../signature-v4/dist-cjs/constants.js | 46 + .../dist-cjs/credentialDerivation.js | 39 + .../dist-cjs/getCanonicalHeaders.js | 24 + .../dist-cjs/getCanonicalQuery.js | 31 + .../signature-v4/dist-cjs/getPayloadHash.js | 24 + .../signature-v4/dist-cjs/headerUtil.js | 32 + .../@aws-sdk/signature-v4/dist-cjs/index.js | 16 + .../dist-cjs/moveHeadersToQuery.js | 21 + .../signature-v4/dist-cjs/prepareRequest.js | 15 + .../signature-v4/dist-cjs/suite.fixture.js | 402 + .../signature-v4/dist-cjs/utilDate.js | 20 + .../signature-v4/dist-es/SignatureV4.js | 171 + .../signature-v4/dist-es/cloneRequest.js | 12 + .../signature-v4/dist-es/constants.js | 43 + .../dist-es/credentialDerivation.js | 33 + .../dist-es/getCanonicalHeaders.js | 20 + .../signature-v4/dist-es/getCanonicalQuery.js | 27 + .../signature-v4/dist-es/getPayloadHash.js | 20 + .../signature-v4/dist-es/headerUtil.js | 26 + .../@aws-sdk/signature-v4/dist-es/index.js | 7 + .../dist-es/moveHeadersToQuery.js | 16 + .../signature-v4/dist-es/prepareRequest.js | 11 + .../signature-v4/dist-es/suite.fixture.js | 399 + .../@aws-sdk/signature-v4/dist-es/utilDate.js | 15 + .../signature-v4/dist-types/SignatureV4.d.ts | 64 + .../signature-v4/dist-types/cloneRequest.d.ts | 6 + .../signature-v4/dist-types/constants.d.ts | 43 + .../dist-types/credentialDerivation.d.ts | 26 + .../dist-types/getCanonicalHeaders.d.ts | 5 + .../dist-types/getCanonicalQuery.d.ts | 5 + .../dist-types/getPayloadHash.d.ts | 5 + .../signature-v4/dist-types/headerUtil.d.ts | 4 + .../signature-v4/dist-types/index.d.ts | 7 + .../dist-types/moveHeadersToQuery.d.ts | 9 + .../dist-types/prepareRequest.d.ts | 5 + .../dist-types/suite.fixture.d.ts | 14 + .../dist-types/ts3.4/SignatureV4.d.ts | 64 + .../dist-types/ts3.4/cloneRequest.d.ts | 9 + .../dist-types/ts3.4/constants.d.ts | 43 + .../ts3.4/credentialDerivation.d.ts | 18 + .../dist-types/ts3.4/getCanonicalHeaders.d.ts | 6 + .../dist-types/ts3.4/getCanonicalQuery.d.ts | 2 + .../dist-types/ts3.4/getPayloadHash.d.ts | 9 + .../dist-types/ts3.4/headerUtil.d.ts | 13 + .../signature-v4/dist-types/ts3.4/index.d.ts | 7 + .../dist-types/ts3.4/moveHeadersToQuery.d.ts | 9 + .../dist-types/ts3.4/prepareRequest.d.ts | 2 + .../dist-types/ts3.4/suite.fixture.d.ts | 14 + .../dist-types/ts3.4/utilDate.d.ts | 2 + .../signature-v4/dist-types/utilDate.d.ts | 2 + .../@aws-sdk/signature-v4/package.json | 62 + .../@aws-sdk/smithy-client/LICENSE | 201 + .../@aws-sdk/smithy-client/README.md | 10 + .../smithy-client/dist-cjs/NoOpLogger.js | 11 + .../@aws-sdk/smithy-client/dist-cjs/client.js | 28 + .../smithy-client/dist-cjs/command.js | 10 + .../smithy-client/dist-cjs/constants.js | 4 + .../smithy-client/dist-cjs/date-utils.js | 195 + .../dist-cjs/default-error-handler.js | 24 + .../smithy-client/dist-cjs/defaults-mode.js | 30 + .../emitWarningIfUnsupportedVersion.js | 10 + .../smithy-client/dist-cjs/exceptions.js | 27 + .../dist-cjs/extended-encode-uri-component.js | 9 + .../dist-cjs/get-array-if-single-item.js | 5 + .../dist-cjs/get-value-from-text-node.js | 16 + .../@aws-sdk/smithy-client/dist-cjs/index.js | 21 + .../smithy-client/dist-cjs/lazy-json.js | 38 + .../smithy-client/dist-cjs/object-mapping.js | 74 + .../smithy-client/dist-cjs/parse-utils.js | 253 + .../smithy-client/dist-cjs/resolve-path.js | 23 + .../smithy-client/dist-cjs/ser-utils.js | 17 + .../smithy-client/dist-cjs/split-every.js | 31 + .../smithy-client/dist-es/NoOpLogger.js | 7 + .../@aws-sdk/smithy-client/dist-es/client.js | 24 + .../@aws-sdk/smithy-client/dist-es/command.js | 6 + .../smithy-client/dist-es/constants.js | 1 + .../smithy-client/dist-es/date-utils.js | 187 + .../dist-es/default-error-handler.js | 17 + .../smithy-client/dist-es/defaults-mode.js | 26 + .../emitWarningIfUnsupportedVersion.js | 6 + .../smithy-client/dist-es/exceptions.js | 22 + .../dist-es/extended-encode-uri-component.js | 5 + .../dist-es/get-array-if-single-item.js | 1 + .../dist-es/get-value-from-text-node.js | 12 + .../@aws-sdk/smithy-client/dist-es/index.js | 18 + .../smithy-client/dist-es/lazy-json.js | 33 + .../smithy-client/dist-es/object-mapping.js | 69 + .../smithy-client/dist-es/parse-utils.js | 230 + .../smithy-client/dist-es/resolve-path.js | 19 + .../smithy-client/dist-es/ser-utils.js | 13 + .../smithy-client/dist-es/split-every.js | 27 + .../smithy-client/dist-types/NoOpLogger.d.ts | 8 + .../smithy-client/dist-types/client.d.ts | 20 + .../smithy-client/dist-types/command.d.ts | 6 + .../smithy-client/dist-types/constants.d.ts | 1 + .../smithy-client/dist-types/date-utils.d.ts | 63 + .../dist-types/default-error-handler.d.ts | 7 + .../dist-types/defaults-mode.d.ts | 28 + .../emitWarningIfUnsupportedVersion.d.ts | 6 + .../smithy-client/dist-types/exceptions.d.ts | 29 + .../extended-encode-uri-component.d.ts | 5 + .../dist-types/get-array-if-single-item.d.ts | 5 + .../dist-types/get-value-from-text-node.d.ts | 5 + .../smithy-client/dist-types/index.d.ts | 19 + .../smithy-client/dist-types/lazy-json.d.ts | 19 + .../dist-types/object-mapping.d.ts | 104 + .../smithy-client/dist-types/parse-utils.d.ts | 220 + .../dist-types/resolve-path.d.ts | 1 + .../smithy-client/dist-types/ser-utils.d.ts | 7 + .../smithy-client/dist-types/split-every.d.ts | 9 + .../dist-types/ts3.4/NoOpLogger.d.ts | 8 + .../dist-types/ts3.4/client.d.ts | 56 + .../dist-types/ts3.4/command.d.ts | 29 + .../dist-types/ts3.4/constants.d.ts | 1 + .../dist-types/ts3.4/date-utils.d.ts | 7 + .../ts3.4/default-error-handler.d.ts | 6 + .../dist-types/ts3.4/defaults-mode.d.ts | 16 + .../emitWarningIfUnsupportedVersion.d.ts | 1 + .../dist-types/ts3.4/exceptions.d.ts | 36 + .../ts3.4/extended-encode-uri-component.d.ts | 1 + .../ts3.4/get-array-if-single-item.d.ts | 1 + .../ts3.4/get-value-from-text-node.d.ts | 1 + .../smithy-client/dist-types/ts3.4/index.d.ts | 19 + .../dist-types/ts3.4/lazy-json.d.ts | 10 + .../dist-types/ts3.4/object-mapping.d.ts | 39 + .../dist-types/ts3.4/parse-utils.d.ts | 62 + .../dist-types/ts3.4/resolve-path.d.ts | 8 + .../dist-types/ts3.4/ser-utils.d.ts | 1 + .../dist-types/ts3.4/split-every.d.ts | 5 + .../@aws-sdk/smithy-client/package.json | 55 + .../@aws-sdk/token-providers/LICENSE | 201 + .../@aws-sdk/token-providers/README.md | 39 + .../token-providers/dist-cjs/constants.js | 5 + .../token-providers/dist-cjs/fromSso.js | 82 + .../token-providers/dist-cjs/fromStatic.js | 11 + .../dist-cjs/getNewSsoOidcToken.js | 15 + .../dist-cjs/getSsoOidcClient.js | 14 + .../token-providers/dist-cjs/index.js | 6 + .../token-providers/dist-cjs/nodeProvider.js | 9 + .../dist-cjs/validateTokenExpiry.js | 11 + .../dist-cjs/validateTokenKey.js | 11 + .../dist-cjs/writeSSOTokenToFile.js | 12 + .../token-providers/dist-es/constants.js | 2 + .../token-providers/dist-es/fromSso.js | 78 + .../token-providers/dist-es/fromStatic.js | 7 + .../dist-es/getNewSsoOidcToken.js | 11 + .../dist-es/getSsoOidcClient.js | 10 + .../@aws-sdk/token-providers/dist-es/index.js | 3 + .../token-providers/dist-es/nodeProvider.js | 5 + .../dist-es/validateTokenExpiry.js | 7 + .../dist-es/validateTokenKey.js | 7 + .../dist-es/writeSSOTokenToFile.js | 8 + .../token-providers/dist-types/constants.d.ts | 8 + .../token-providers/dist-types/fromSso.d.ts | 8 + .../dist-types/fromStatic.d.ts | 8 + .../dist-types/getNewSsoOidcToken.d.ts | 5 + .../dist-types/getSsoOidcClient.d.ts | 6 + .../token-providers/dist-types/index.d.ts | 3 + .../dist-types/nodeProvider.d.ts | 18 + .../dist-types/ts3.4/constants.d.ts | 3 + .../dist-types/ts3.4/fromSso.d.ts | 4 + .../dist-types/ts3.4/fromStatic.d.ts | 7 + .../dist-types/ts3.4/getNewSsoOidcToken.d.ts | 5 + .../dist-types/ts3.4/getSsoOidcClient.d.ts | 2 + .../dist-types/ts3.4/index.d.ts | 3 + .../dist-types/ts3.4/nodeProvider.d.ts | 5 + .../dist-types/ts3.4/validateTokenExpiry.d.ts | 2 + .../dist-types/ts3.4/validateTokenKey.d.ts | 5 + .../dist-types/ts3.4/writeSSOTokenToFile.d.ts | 5 + .../dist-types/validateTokenExpiry.d.ts | 5 + .../dist-types/validateTokenKey.d.ts | 4 + .../dist-types/writeSSOTokenToFile.d.ts | 5 + .../@aws-sdk/token-providers/package.json | 63 + server/node_modules/@aws-sdk/types/LICENSE | 201 + server/node_modules/@aws-sdk/types/README.md | 4 + .../@aws-sdk/types/dist-cjs/abort.js | 2 + .../@aws-sdk/types/dist-cjs/auth.js | 8 + .../@aws-sdk/types/dist-cjs/checksum.js | 2 + .../@aws-sdk/types/dist-cjs/client.js | 2 + .../@aws-sdk/types/dist-cjs/command.js | 2 + .../@aws-sdk/types/dist-cjs/credentials.js | 2 + .../@aws-sdk/types/dist-cjs/crypto.js | 2 + .../@aws-sdk/types/dist-cjs/endpoint.js | 8 + .../@aws-sdk/types/dist-cjs/eventStream.js | 2 + .../@aws-sdk/types/dist-cjs/http.js | 2 + .../dist-cjs/identity/AnonymousIdentity.js | 2 + .../identity/AwsCredentialIdentity.js | 2 + .../types/dist-cjs/identity/Identity.js | 3 + .../types/dist-cjs/identity/LoginIdentity.js | 2 + .../types/dist-cjs/identity/TokenIdentity.js | 2 + .../@aws-sdk/types/dist-cjs/identity/index.js | 8 + .../@aws-sdk/types/dist-cjs/index.js | 28 + .../@aws-sdk/types/dist-cjs/logger.js | 2 + .../@aws-sdk/types/dist-cjs/middleware.js | 2 + .../@aws-sdk/types/dist-cjs/pagination.js | 2 + .../@aws-sdk/types/dist-cjs/profile.js | 2 + .../@aws-sdk/types/dist-cjs/response.js | 2 + .../@aws-sdk/types/dist-cjs/retry.js | 2 + .../@aws-sdk/types/dist-cjs/serde.js | 2 + .../@aws-sdk/types/dist-cjs/shapes.js | 2 + .../@aws-sdk/types/dist-cjs/signature.js | 2 + .../@aws-sdk/types/dist-cjs/stream.js | 2 + .../@aws-sdk/types/dist-cjs/token.js | 2 + .../@aws-sdk/types/dist-cjs/transfer.js | 2 + .../@aws-sdk/types/dist-cjs/util.js | 2 + .../@aws-sdk/types/dist-cjs/waiter.js | 2 + .../@aws-sdk/types/dist-es/abort.js | 1 + .../@aws-sdk/types/dist-es/auth.js | 5 + .../@aws-sdk/types/dist-es/checksum.js | 1 + .../@aws-sdk/types/dist-es/client.js | 1 + .../@aws-sdk/types/dist-es/command.js | 1 + .../@aws-sdk/types/dist-es/credentials.js | 1 + .../@aws-sdk/types/dist-es/crypto.js | 1 + .../@aws-sdk/types/dist-es/endpoint.js | 5 + .../@aws-sdk/types/dist-es/eventStream.js | 1 + .../@aws-sdk/types/dist-es/http.js | 1 + .../dist-es/identity/AnonymousIdentity.js | 1 + .../dist-es/identity/AwsCredentialIdentity.js | 1 + .../types/dist-es/identity/Identity.js | 2 + .../types/dist-es/identity/LoginIdentity.js | 1 + .../types/dist-es/identity/TokenIdentity.js | 1 + .../@aws-sdk/types/dist-es/identity/index.js | 5 + .../@aws-sdk/types/dist-es/index.js | 25 + .../@aws-sdk/types/dist-es/logger.js | 1 + .../@aws-sdk/types/dist-es/middleware.js | 1 + .../@aws-sdk/types/dist-es/pagination.js | 1 + .../@aws-sdk/types/dist-es/profile.js | 1 + .../@aws-sdk/types/dist-es/response.js | 1 + .../@aws-sdk/types/dist-es/retry.js | 1 + .../@aws-sdk/types/dist-es/serde.js | 1 + .../@aws-sdk/types/dist-es/shapes.js | 1 + .../@aws-sdk/types/dist-es/signature.js | 1 + .../@aws-sdk/types/dist-es/stream.js | 1 + .../@aws-sdk/types/dist-es/token.js | 1 + .../@aws-sdk/types/dist-es/transfer.js | 1 + .../@aws-sdk/types/dist-es/util.js | 1 + .../@aws-sdk/types/dist-es/waiter.js | 1 + .../@aws-sdk/types/dist-types/abort.d.ts | 42 + .../@aws-sdk/types/dist-types/auth.d.ts | 47 + .../@aws-sdk/types/dist-types/checksum.d.ts | 59 + .../@aws-sdk/types/dist-types/client.d.ts | 23 + .../@aws-sdk/types/dist-types/command.d.ts | 7 + .../types/dist-types/credentials.d.ts | 13 + .../@aws-sdk/types/dist-types/crypto.d.ts | 49 + .../@aws-sdk/types/dist-types/endpoint.d.ts | 56 + .../types/dist-types/eventStream.d.ts | 96 + .../@aws-sdk/types/dist-types/http.d.ts | 91 + .../identity/AnonymousIdentity.d.ts | 3 + .../identity/AwsCredentialIdentity.d.ts | 17 + .../types/dist-types/identity/Identity.d.ts | 9 + .../dist-types/identity/LoginIdentity.d.ts | 12 + .../dist-types/identity/TokenIdentity.d.ts | 8 + .../types/dist-types/identity/index.d.ts | 5 + .../@aws-sdk/types/dist-types/index.d.ts | 25 + .../@aws-sdk/types/dist-types/logger.d.ts | 27 + .../@aws-sdk/types/dist-types/middleware.d.ts | 367 + .../@aws-sdk/types/dist-types/pagination.d.ts | 22 + .../@aws-sdk/types/dist-types/profile.d.ts | 11 + .../@aws-sdk/types/dist-types/response.d.ts | 34 + .../@aws-sdk/types/dist-types/retry.d.ts | 112 + .../@aws-sdk/types/dist-types/serde.d.ts | 100 + .../@aws-sdk/types/dist-types/shapes.d.ts | 54 + .../@aws-sdk/types/dist-types/signature.d.ts | 100 + .../@aws-sdk/types/dist-types/stream.d.ts | 17 + .../@aws-sdk/types/dist-types/token.d.ts | 13 + .../@aws-sdk/types/dist-types/transfer.d.ts | 16 + .../types/dist-types/ts3.4/abort.d.ts | 11 + .../@aws-sdk/types/dist-types/ts3.4/auth.d.ts | 17 + .../types/dist-types/ts3.4/checksum.d.ts | 12 + .../types/dist-types/ts3.4/client.d.ts | 52 + .../types/dist-types/ts3.4/command.d.ts | 17 + .../types/dist-types/ts3.4/credentials.d.ts | 4 + .../types/dist-types/ts3.4/crypto.d.ts | 14 + .../types/dist-types/ts3.4/endpoint.d.ts | 43 + .../types/dist-types/ts3.4/eventStream.d.ts | 99 + .../@aws-sdk/types/dist-types/ts3.4/http.d.ts | 33 + .../ts3.4/identity/AnonymousIdentity.d.ts | 2 + .../ts3.4/identity/AwsCredentialIdentity.d.ts | 8 + .../dist-types/ts3.4/identity/Identity.d.ts | 6 + .../ts3.4/identity/LoginIdentity.d.ts | 6 + .../ts3.4/identity/TokenIdentity.d.ts | 5 + .../dist-types/ts3.4/identity/index.d.ts | 5 + .../types/dist-types/ts3.4/index.d.ts | 25 + .../types/dist-types/ts3.4/logger.d.ts | 20 + .../types/dist-types/ts3.4/middleware.d.ts | 214 + .../types/dist-types/ts3.4/pagination.d.ts | 8 + .../types/dist-types/ts3.4/profile.d.ts | 7 + .../types/dist-types/ts3.4/response.d.ts | 11 + .../types/dist-types/ts3.4/retry.d.ts | 46 + .../types/dist-types/ts3.4/serde.d.ts | 49 + .../types/dist-types/ts3.4/shapes.d.ts | 24 + .../types/dist-types/ts3.4/signature.d.ts | 40 + .../types/dist-types/ts3.4/stream.d.ts | 16 + .../types/dist-types/ts3.4/token.d.ts | 4 + .../types/dist-types/ts3.4/transfer.d.ts | 18 + .../@aws-sdk/types/dist-types/ts3.4/util.d.ts | 50 + .../types/dist-types/ts3.4/waiter.d.ts | 9 + .../@aws-sdk/types/dist-types/util.d.ts | 131 + .../@aws-sdk/types/dist-types/waiter.d.ts | 32 + .../node_modules/@aws-sdk/types/package.json | 53 + .../node_modules/@aws-sdk/url-parser/LICENSE | 201 + .../@aws-sdk/url-parser/README.md | 10 + .../@aws-sdk/url-parser/dist-cjs/index.js | 22 + .../@aws-sdk/url-parser/dist-es/index.js | 18 + .../@aws-sdk/url-parser/dist-types/index.d.ts | 2 + .../url-parser/dist-types/ts3.4/index.d.ts | 2 + .../@aws-sdk/url-parser/package.json | 51 + .../node_modules/@aws-sdk/util-base64/LICENSE | 201 + .../@aws-sdk/util-base64/README.md | 4 + .../util-base64/dist-cjs/constants.browser.js | 35 + .../dist-cjs/fromBase64.browser.js | 40 + .../util-base64/dist-cjs/fromBase64.js | 16 + .../@aws-sdk/util-base64/dist-cjs/index.js | 5 + .../util-base64/dist-cjs/toBase64.browser.js | 24 + .../@aws-sdk/util-base64/dist-cjs/toBase64.js | 6 + .../util-base64/dist-es/constants.browser.js | 28 + .../util-base64/dist-es/fromBase64.browser.js | 36 + .../util-base64/dist-es/fromBase64.js | 12 + .../@aws-sdk/util-base64/dist-es/index.js | 2 + .../util-base64/dist-es/toBase64.browser.js | 20 + .../@aws-sdk/util-base64/dist-es/toBase64.js | 2 + .../dist-types/constants.browser.d.ts | 6 + .../dist-types/fromBase64.browser.d.ts | 8 + .../util-base64/dist-types/fromBase64.d.ts | 7 + .../util-base64/dist-types/index.d.ts | 2 + .../dist-types/toBase64.browser.d.ts | 8 + .../util-base64/dist-types/toBase64.d.ts | 7 + .../dist-types/ts3.4/constants.browser.d.ts | 12 + .../dist-types/ts3.4/fromBase64.browser.d.ts | 1 + .../dist-types/ts3.4/fromBase64.d.ts | 1 + .../util-base64/dist-types/ts3.4/index.d.ts | 2 + .../dist-types/ts3.4/toBase64.browser.d.ts | 1 + .../dist-types/ts3.4/toBase64.d.ts | 1 + .../@aws-sdk/util-base64/package.json | 63 + .../util-body-length-browser/CHANGELOG.md | 681 ++ .../@aws-sdk/util-body-length-browser/LICENSE | 201 + .../util-body-length-browser/README.md | 12 + .../dist-cjs/calculateBodyLength.js | 26 + .../dist-cjs/index.js | 4 + .../dist-es/calculateBodyLength.js | 22 + .../util-body-length-browser/dist-es/index.js | 1 + .../dist-types/calculateBodyLength.d.ts | 1 + .../dist-types/index.d.ts | 1 + .../dist-types/ts3.4/calculateBodyLength.d.ts | 1 + .../dist-types/ts3.4/index.d.ts | 1 + .../util-body-length-browser/package.json | 50 + .../@aws-sdk/util-body-length-node/LICENSE | 201 + .../@aws-sdk/util-body-length-node/README.md | 12 + .../dist-cjs/calculateBodyLength.js | 26 + .../util-body-length-node/dist-cjs/index.js | 4 + .../dist-es/calculateBodyLength.js | 22 + .../util-body-length-node/dist-es/index.js | 1 + .../dist-types/calculateBodyLength.d.ts | 1 + .../dist-types/index.d.ts | 1 + .../dist-types/ts3.4/calculateBodyLength.d.ts | 1 + .../dist-types/ts3.4/index.d.ts | 1 + .../util-body-length-node/package.json | 54 + .../@aws-sdk/util-buffer-from/LICENSE | 201 + .../@aws-sdk/util-buffer-from/README.md | 10 + .../util-buffer-from/dist-cjs/index.js | 19 + .../util-buffer-from/dist-es/index.js | 14 + .../util-buffer-from/dist-types/index.d.ts | 4 + .../dist-types/ts3.4/index.d.ts | 19 + .../@aws-sdk/util-buffer-from/package.json | 54 + .../@aws-sdk/util-config-provider/LICENSE | 201 + .../@aws-sdk/util-config-provider/README.md | 4 + .../dist-cjs/booleanSelector.js | 18 + .../util-config-provider/dist-cjs/index.js | 4 + .../dist-es/booleanSelector.js | 14 + .../util-config-provider/dist-es/index.js | 1 + .../dist-types/booleanSelector.d.ts | 13 + .../dist-types/index.d.ts | 1 + .../dist-types/ts3.4/booleanSelector.d.ts | 9 + .../dist-types/ts3.4/index.d.ts | 1 + .../util-config-provider/package.json | 55 + .../util-defaults-mode-browser/LICENSE | 201 + .../util-defaults-mode-browser/README.md | 10 + .../dist-cjs/constants.js | 4 + .../dist-cjs/index.js | 4 + .../dist-cjs/resolveDefaultsModeConfig.js | 33 + .../resolveDefaultsModeConfig.native.js | 23 + .../dist-es/constants.js | 1 + .../dist-es/index.js | 1 + .../dist-es/resolveDefaultsModeConfig.js | 27 + .../resolveDefaultsModeConfig.native.js | 19 + .../dist-types/constants.d.ts | 9 + .../dist-types/index.d.ts | 1 + .../dist-types/resolveDefaultsModeConfig.d.ts | 17 + .../resolveDefaultsModeConfig.native.d.ts | 16 + .../dist-types/ts3.4/constants.d.ts | 6 + .../dist-types/ts3.4/index.d.ts | 1 + .../ts3.4/resolveDefaultsModeConfig.d.ts | 8 + .../resolveDefaultsModeConfig.native.d.ts | 8 + .../util-defaults-mode-browser/package.json | 59 + .../@aws-sdk/util-defaults-mode-node/LICENSE | 201 + .../util-defaults-mode-node/README.md | 10 + .../dist-cjs/constants.js | 9 + .../dist-cjs/defaultsModeConfig.js | 14 + .../util-defaults-mode-node/dist-cjs/index.js | 4 + .../dist-cjs/resolveDefaultsModeConfig.js | 57 + .../dist-es/constants.js | 6 + .../dist-es/defaultsModeConfig.js | 11 + .../util-defaults-mode-node/dist-es/index.js | 1 + .../dist-es/resolveDefaultsModeConfig.js | 52 + .../dist-types/constants.d.ts | 6 + .../dist-types/defaultsModeConfig.d.ts | 3 + .../dist-types/index.d.ts | 1 + .../dist-types/resolveDefaultsModeConfig.d.ts | 17 + .../dist-types/ts3.4/constants.d.ts | 6 + .../dist-types/ts3.4/defaultsModeConfig.d.ts | 3 + .../dist-types/ts3.4/index.d.ts | 1 + .../ts3.4/resolveDefaultsModeConfig.d.ts | 10 + .../util-defaults-mode-node/package.json | 58 + .../@aws-sdk/util-endpoints/LICENSE | 201 + .../@aws-sdk/util-endpoints/README.md | 6 + .../util-endpoints/dist-cjs/debug/debugId.js | 4 + .../util-endpoints/dist-cjs/debug/index.js | 5 + .../dist-cjs/debug/toDebugString.js | 16 + .../@aws-sdk/util-endpoints/dist-cjs/index.js | 6 + .../util-endpoints/dist-cjs/lib/aws/index.js | 6 + .../lib/aws/isVirtualHostableS3Bucket.js | 29 + .../dist-cjs/lib/aws/parseArn.js | 19 + .../dist-cjs/lib/aws/partition.js | 36 + .../dist-cjs/lib/aws/partitions.json | 181 + .../dist-cjs/lib/booleanEquals.js | 5 + .../util-endpoints/dist-cjs/lib/getAttr.js | 15 + .../dist-cjs/lib/getAttrPathList.js | 29 + .../util-endpoints/dist-cjs/lib/index.js | 14 + .../dist-cjs/lib/isIpAddress.js | 6 + .../util-endpoints/dist-cjs/lib/isSet.js | 5 + .../dist-cjs/lib/isValidHostLabel.js | 17 + .../util-endpoints/dist-cjs/lib/not.js | 5 + .../util-endpoints/dist-cjs/lib/parseURL.js | 55 + .../dist-cjs/lib/stringEquals.js | 5 + .../util-endpoints/dist-cjs/lib/substring.js | 13 + .../util-endpoints/dist-cjs/lib/uriEncode.js | 5 + .../dist-cjs/resolveEndpoint.js | 42 + .../dist-cjs/types/EndpointError.js | 10 + .../dist-cjs/types/EndpointRuleObject.js | 2 + .../dist-cjs/types/ErrorRuleObject.js | 2 + .../dist-cjs/types/RuleSetObject.js | 2 + .../dist-cjs/types/TreeRuleObject.js | 2 + .../util-endpoints/dist-cjs/types/index.js | 9 + .../util-endpoints/dist-cjs/types/shared.js | 2 + .../dist-cjs/utils/callFunction.js | 11 + .../dist-cjs/utils/evaluateCondition.js | 19 + .../dist-cjs/utils/evaluateConditions.js | 27 + .../dist-cjs/utils/evaluateEndpointRule.js | 32 + .../dist-cjs/utils/evaluateErrorRule.js | 18 + .../dist-cjs/utils/evaluateExpression.js | 20 + .../dist-cjs/utils/evaluateRules.js | 31 + .../dist-cjs/utils/evaluateTemplate.js | 40 + .../dist-cjs/utils/evaluateTreeRule.js | 17 + .../dist-cjs/utils/getEndpointHeaders.js | 16 + .../dist-cjs/utils/getEndpointProperties.js | 9 + .../dist-cjs/utils/getEndpointProperty.js | 25 + .../dist-cjs/utils/getEndpointUrl.js | 19 + .../dist-cjs/utils/getReferenceValue.js | 11 + .../util-endpoints/dist-cjs/utils/index.js | 4 + .../util-endpoints/dist-es/debug/debugId.js | 1 + .../util-endpoints/dist-es/debug/index.js | 2 + .../dist-es/debug/toDebugString.js | 12 + .../@aws-sdk/util-endpoints/dist-es/index.js | 3 + .../util-endpoints/dist-es/lib/aws/index.js | 3 + .../lib/aws/isVirtualHostableS3Bucket.js | 25 + .../dist-es/lib/aws/parseArn.js | 15 + .../dist-es/lib/aws/partition.js | 31 + .../dist-es/lib/aws/partitions.json | 181 + .../dist-es/lib/booleanEquals.js | 1 + .../util-endpoints/dist-es/lib/getAttr.js | 11 + .../dist-es/lib/getAttrPathList.js | 25 + .../util-endpoints/dist-es/lib/index.js | 10 + .../util-endpoints/dist-es/lib/isIpAddress.js | 2 + .../util-endpoints/dist-es/lib/isSet.js | 1 + .../dist-es/lib/isValidHostLabel.js | 13 + .../util-endpoints/dist-es/lib/not.js | 1 + .../util-endpoints/dist-es/lib/parseURL.js | 51 + .../dist-es/lib/stringEquals.js | 1 + .../util-endpoints/dist-es/lib/substring.js | 9 + .../util-endpoints/dist-es/lib/uriEncode.js | 1 + .../util-endpoints/dist-es/resolveEndpoint.js | 37 + .../dist-es/types/EndpointError.js | 6 + .../dist-es/types/EndpointRuleObject.js | 1 + .../dist-es/types/ErrorRuleObject.js | 1 + .../dist-es/types/RuleSetObject.js | 1 + .../dist-es/types/TreeRuleObject.js | 1 + .../util-endpoints/dist-es/types/index.js | 6 + .../util-endpoints/dist-es/types/shared.js | 1 + .../dist-es/utils/callFunction.js | 6 + .../dist-es/utils/evaluateCondition.js | 14 + .../dist-es/utils/evaluateConditions.js | 22 + .../dist-es/utils/evaluateEndpointRule.js | 27 + .../dist-es/utils/evaluateErrorRule.js | 14 + .../dist-es/utils/evaluateExpression.js | 16 + .../dist-es/utils/evaluateRules.js | 27 + .../dist-es/utils/evaluateTemplate.js | 36 + .../dist-es/utils/evaluateTreeRule.js | 13 + .../dist-es/utils/getEndpointHeaders.js | 12 + .../dist-es/utils/getEndpointProperties.js | 5 + .../dist-es/utils/getEndpointProperty.js | 21 + .../dist-es/utils/getEndpointUrl.js | 15 + .../dist-es/utils/getReferenceValue.js | 7 + .../util-endpoints/dist-es/utils/index.js | 1 + .../dist-types/debug/debugId.d.ts | 1 + .../dist-types/debug/index.d.ts | 2 + .../dist-types/debug/toDebugString.d.ts | 9 + .../util-endpoints/dist-types/index.d.ts | 3 + .../dist-types/lib/aws/index.d.ts | 3 + .../lib/aws/isVirtualHostableS3Bucket.d.ts | 5 + .../dist-types/lib/aws/parseArn.d.ts | 7 + .../dist-types/lib/aws/partition.d.ts | 8 + .../dist-types/lib/booleanEquals.d.ts | 5 + .../dist-types/lib/getAttr.d.ts | 7 + .../dist-types/lib/getAttrPathList.d.ts | 4 + .../util-endpoints/dist-types/lib/index.d.ts | 10 + .../dist-types/lib/isIpAddress.d.ts | 4 + .../util-endpoints/dist-types/lib/isSet.d.ts | 5 + .../dist-types/lib/isValidHostLabel.d.ts | 7 + .../util-endpoints/dist-types/lib/not.d.ts | 5 + .../dist-types/lib/parseURL.d.ts | 5 + .../dist-types/lib/stringEquals.d.ts | 5 + .../dist-types/lib/substring.d.ts | 7 + .../dist-types/lib/uriEncode.d.ts | 4 + .../dist-types/resolveEndpoint.d.ts | 6 + .../dist-types/ts3.4/debug/debugId.d.ts | 1 + .../dist-types/ts3.4/debug/index.d.ts | 2 + .../dist-types/ts3.4/debug/toDebugString.d.ts | 9 + .../dist-types/ts3.4/index.d.ts | 3 + .../dist-types/ts3.4/lib/aws/index.d.ts | 3 + .../lib/aws/isVirtualHostableS3Bucket.d.ts | 4 + .../dist-types/ts3.4/lib/aws/parseArn.d.ts | 2 + .../dist-types/ts3.4/lib/aws/partition.d.ts | 2 + .../dist-types/ts3.4/lib/booleanEquals.d.ts | 4 + .../dist-types/ts3.4/lib/getAttr.d.ts | 11 + .../dist-types/ts3.4/lib/getAttrPathList.d.ts | 1 + .../dist-types/ts3.4/lib/index.d.ts | 11 + .../dist-types/ts3.4/lib/isIpAddress.d.ts | 1 + .../dist-types/ts3.4/lib/isSet.d.ts | 1 + .../ts3.4/lib/isValidHostLabel.d.ts | 4 + .../dist-types/ts3.4/lib/not.d.ts | 1 + .../dist-types/ts3.4/lib/parseURL.d.ts | 4 + .../dist-types/ts3.4/lib/stringEquals.d.ts | 1 + .../dist-types/ts3.4/lib/substring.d.ts | 6 + .../dist-types/ts3.4/lib/uriEncode.d.ts | 1 + .../dist-types/ts3.4/resolveEndpoint.d.ts | 6 + .../dist-types/ts3.4/types/EndpointError.d.ts | 3 + .../ts3.4/types/EndpointRuleObject.d.ts | 18 + .../ts3.4/types/ErrorRuleObject.d.ts | 7 + .../dist-types/ts3.4/types/RuleSetObject.d.ts | 19 + .../ts3.4/types/TreeRuleObject.d.ts | 12 + .../dist-types/ts3.4/types/index.d.ts | 6 + .../dist-types/ts3.4/types/shared.d.ts | 29 + .../dist-types/ts3.4/utils/callFunction.d.ts | 5 + .../ts3.4/utils/evaluateCondition.d.ts | 13 + .../ts3.4/utils/evaluateConditions.d.ts | 13 + .../ts3.4/utils/evaluateEndpointRule.d.ts | 6 + .../ts3.4/utils/evaluateErrorRule.d.ts | 5 + .../ts3.4/utils/evaluateExpression.d.ts | 6 + .../dist-types/ts3.4/utils/evaluateRules.d.ts | 6 + .../ts3.4/utils/evaluateTemplate.d.ts | 5 + .../ts3.4/utils/evaluateTreeRule.d.ts | 6 + .../ts3.4/utils/getEndpointHeaders.d.ts | 5 + .../ts3.4/utils/getEndpointProperties.d.ts | 5 + .../ts3.4/utils/getEndpointProperty.d.ts | 6 + .../ts3.4/utils/getEndpointUrl.d.ts | 5 + .../ts3.4/utils/getReferenceValue.d.ts | 5 + .../dist-types/ts3.4/utils/index.d.ts | 1 + .../dist-types/types/EndpointError.d.ts | 3 + .../dist-types/types/EndpointRuleObject.d.ts | 15 + .../dist-types/types/ErrorRuleObject.d.ts | 7 + .../dist-types/types/RuleSetObject.d.ts | 19 + .../dist-types/types/TreeRuleObject.d.ts | 10 + .../dist-types/types/index.d.ts | 6 + .../dist-types/types/shared.d.ts | 25 + .../dist-types/utils/callFunction.d.ts | 2 + .../dist-types/utils/evaluateCondition.d.ts | 8 + .../dist-types/utils/evaluateConditions.d.ts | 8 + .../utils/evaluateEndpointRule.d.ts | 3 + .../dist-types/utils/evaluateErrorRule.d.ts | 2 + .../dist-types/utils/evaluateExpression.d.ts | 2 + .../dist-types/utils/evaluateRules.d.ts | 3 + .../dist-types/utils/evaluateTemplate.d.ts | 2 + .../dist-types/utils/evaluateTreeRule.d.ts | 3 + .../dist-types/utils/getEndpointHeaders.d.ts | 2 + .../utils/getEndpointProperties.d.ts | 2 + .../dist-types/utils/getEndpointProperty.d.ts | 3 + .../dist-types/utils/getEndpointUrl.d.ts | 2 + .../dist-types/utils/getReferenceValue.d.ts | 2 + .../dist-types/utils/index.d.ts | 1 + .../@aws-sdk/util-endpoints/package.json | 54 + .../@aws-sdk/util-hex-encoding/CHANGELOG.md | 676 ++ .../@aws-sdk/util-hex-encoding/LICENSE | 201 + .../@aws-sdk/util-hex-encoding/README.md | 4 + .../util-hex-encoding/dist-cjs/index.js | 38 + .../util-hex-encoding/dist-es/index.js | 33 + .../util-hex-encoding/dist-types/index.d.ts | 12 + .../dist-types/ts3.4/index.d.ts | 2 + .../@aws-sdk/util-hex-encoding/package.json | 53 + .../@aws-sdk/util-locate-window/LICENSE | 201 + .../@aws-sdk/util-locate-window/README.md | 4 + .../util-locate-window/dist-cjs/index.js | 13 + .../util-locate-window/dist-es/index.js | 10 + .../util-locate-window/dist-types/index.d.ts | 6 + .../dist-types/ts3.4/index.d.ts | 1 + .../@aws-sdk/util-locate-window/package.json | 53 + .../@aws-sdk/util-middleware/LICENSE | 201 + .../@aws-sdk/util-middleware/README.md | 12 + .../util-middleware/dist-cjs/index.js | 4 + .../dist-cjs/normalizeProvider.js | 10 + .../@aws-sdk/util-middleware/dist-es/index.js | 1 + .../dist-es/normalizeProvider.js | 6 + .../util-middleware/dist-types/index.d.ts | 1 + .../dist-types/normalizeProvider.d.ts | 5 + .../dist-types/ts3.4/index.d.ts | 1 + .../dist-types/ts3.4/normalizeProvider.d.ts | 4 + .../@aws-sdk/util-middleware/package.json | 59 + .../node_modules/@aws-sdk/util-retry/LICENSE | 201 + .../@aws-sdk/util-retry/README.md | 12 + .../dist-cjs/AdaptiveRetryStrategy.js | 28 + .../util-retry/dist-cjs/DefaultRateLimiter.js | 104 + .../dist-cjs/StandardRetryStrategy.js | 48 + .../@aws-sdk/util-retry/dist-cjs/config.js | 10 + .../@aws-sdk/util-retry/dist-cjs/constants.js | 12 + .../dist-cjs/defaultRetryBackoffStrategy.js | 18 + .../util-retry/dist-cjs/defaultRetryToken.js | 55 + .../@aws-sdk/util-retry/dist-cjs/index.js | 9 + .../@aws-sdk/util-retry/dist-cjs/types.js | 2 + .../dist-es/AdaptiveRetryStrategy.js | 24 + .../util-retry/dist-es/DefaultRateLimiter.js | 99 + .../dist-es/StandardRetryStrategy.js | 44 + .../@aws-sdk/util-retry/dist-es/config.js | 7 + .../@aws-sdk/util-retry/dist-es/constants.js | 9 + .../dist-es/defaultRetryBackoffStrategy.js | 14 + .../util-retry/dist-es/defaultRetryToken.js | 50 + .../@aws-sdk/util-retry/dist-es/index.js | 6 + .../@aws-sdk/util-retry/dist-es/types.js | 1 + .../dist-types/AdaptiveRetryStrategy.d.ts | 29 + .../dist-types/DefaultRateLimiter.d.ts | 39 + .../dist-types/StandardRetryStrategy.d.ts | 13 + .../util-retry/dist-types/config.d.ts | 13 + .../util-retry/dist-types/constants.d.ts | 41 + .../defaultRetryBackoffStrategy.d.ts | 2 + .../dist-types/defaultRetryToken.d.ts | 17 + .../@aws-sdk/util-retry/dist-types/index.d.ts | 6 + .../ts3.4/AdaptiveRetryStrategy.d.ts | 27 + .../dist-types/ts3.4/DefaultRateLimiter.d.ts | 39 + .../ts3.4/StandardRetryStrategy.d.ts | 23 + .../util-retry/dist-types/ts3.4/config.d.ts | 6 + .../dist-types/ts3.4/constants.d.ts | 9 + .../ts3.4/defaultRetryBackoffStrategy.d.ts | 2 + .../dist-types/ts3.4/defaultRetryToken.d.ts | 15 + .../util-retry/dist-types/ts3.4/index.d.ts | 6 + .../util-retry/dist-types/ts3.4/types.d.ts | 4 + .../@aws-sdk/util-retry/dist-types/types.d.ts | 16 + .../@aws-sdk/util-retry/package.json | 60 + .../@aws-sdk/util-uri-escape/CHANGELOG.md | 768 ++ .../@aws-sdk/util-uri-escape/LICENSE | 201 + .../@aws-sdk/util-uri-escape/README.md | 10 + .../dist-cjs/escape-uri-path.js | 6 + .../util-uri-escape/dist-cjs/escape-uri.js | 6 + .../util-uri-escape/dist-cjs/index.js | 5 + .../dist-es/escape-uri-path.js | 2 + .../util-uri-escape/dist-es/escape-uri.js | 2 + .../@aws-sdk/util-uri-escape/dist-es/index.js | 2 + .../dist-types/escape-uri-path.d.ts | 1 + .../dist-types/escape-uri.d.ts | 1 + .../util-uri-escape/dist-types/index.d.ts | 2 + .../dist-types/ts3.4/escape-uri-path.d.ts | 1 + .../dist-types/ts3.4/escape-uri.d.ts | 1 + .../dist-types/ts3.4/index.d.ts | 2 + .../@aws-sdk/util-uri-escape/package.json | 52 + .../@aws-sdk/util-user-agent-browser/LICENSE | 201 + .../util-user-agent-browser/README.md | 10 + .../dist-cjs/configurations.js | 2 + .../util-user-agent-browser/dist-cjs/index.js | 22 + .../dist-cjs/index.native.js | 16 + .../dist-es/configurations.js | 1 + .../util-user-agent-browser/dist-es/index.js | 16 + .../dist-es/index.native.js | 12 + .../dist-types/configurations.d.ts | 4 + .../dist-types/index.d.ts | 7 + .../dist-types/index.native.d.ts | 7 + .../dist-types/ts3.4/configurations.d.ts | 4 + .../dist-types/ts3.4/index.d.ts | 6 + .../dist-types/ts3.4/index.native.d.ts | 6 + .../util-user-agent-browser/package.json | 53 + .../@aws-sdk/util-user-agent-node/LICENSE | 201 + .../@aws-sdk/util-user-agent-node/README.md | 10 + .../util-user-agent-node/dist-cjs/index.js | 41 + .../dist-cjs/is-crt-available.js | 15 + .../util-user-agent-node/dist-es/index.js | 37 + .../dist-es/is-crt-available.js | 11 + .../dist-types/index.d.ts | 12 + .../dist-types/is-crt-available.d.ts | 2 + .../dist-types/ts3.4/index.d.ts | 12 + .../dist-types/ts3.4/is-crt-available.d.ts | 2 + .../util-user-agent-node/package.json | 64 + .../@aws-sdk/util-utf8-browser/LICENSE | 201 + .../@aws-sdk/util-utf8-browser/README.md | 8 + .../util-utf8-browser/dist-cjs/index.js | 9 + .../util-utf8-browser/dist-cjs/pureJs.js | 47 + .../dist-cjs/whatwgEncodingApi.js | 11 + .../util-utf8-browser/dist-es/index.js | 4 + .../util-utf8-browser/dist-es/pureJs.js | 42 + .../dist-es/whatwgEncodingApi.js | 6 + .../util-utf8-browser/dist-types/index.d.ts | 2 + .../util-utf8-browser/dist-types/pureJs.d.ts | 17 + .../dist-types/ts3.4/index.d.ts | 2 + .../dist-types/ts3.4/pureJs.d.ts | 2 + .../dist-types/ts3.4/whatwgEncodingApi.d.ts | 2 + .../dist-types/whatwgEncodingApi.d.ts | 2 + .../@aws-sdk/util-utf8-browser/package.json | 50 + .../node_modules/@aws-sdk/util-utf8/LICENSE | 201 + .../node_modules/@aws-sdk/util-utf8/README.md | 4 + .../util-utf8/dist-cjs/fromUtf8.browser.js | 5 + .../@aws-sdk/util-utf8/dist-cjs/fromUtf8.js | 9 + .../@aws-sdk/util-utf8/dist-cjs/index.js | 6 + .../util-utf8/dist-cjs/toUint8Array.js | 14 + .../util-utf8/dist-cjs/toUtf8.browser.js | 5 + .../@aws-sdk/util-utf8/dist-cjs/toUtf8.js | 6 + .../util-utf8/dist-es/fromUtf8.browser.js | 1 + .../@aws-sdk/util-utf8/dist-es/fromUtf8.js | 5 + .../@aws-sdk/util-utf8/dist-es/index.js | 3 + .../util-utf8/dist-es/toUint8Array.js | 10 + .../util-utf8/dist-es/toUtf8.browser.js | 1 + .../@aws-sdk/util-utf8/dist-es/toUtf8.js | 2 + .../dist-types/fromUtf8.browser.d.ts | 1 + .../util-utf8/dist-types/fromUtf8.d.ts | 1 + .../@aws-sdk/util-utf8/dist-types/index.d.ts | 3 + .../util-utf8/dist-types/toUint8Array.d.ts | 1 + .../util-utf8/dist-types/toUtf8.browser.d.ts | 1 + .../@aws-sdk/util-utf8/dist-types/toUtf8.d.ts | 1 + .../dist-types/ts3.4/fromUtf8.browser.d.ts | 1 + .../util-utf8/dist-types/ts3.4/fromUtf8.d.ts | 1 + .../util-utf8/dist-types/ts3.4/index.d.ts | 3 + .../dist-types/ts3.4/toUint8Array.d.ts | 3 + .../dist-types/ts3.4/toUtf8.browser.d.ts | 1 + .../util-utf8/dist-types/ts3.4/toUtf8.d.ts | 1 + .../@aws-sdk/util-utf8/package.json | 62 + .../@sindresorhus/is/dist/index.d.ts | 132 - .../@sindresorhus/is/dist/index.js | 245 - .../@sindresorhus/is/dist/index.js.map | 1 - server/node_modules/@sindresorhus/is/license | 9 - .../@sindresorhus/is/package.json | 96 - .../node_modules/@sindresorhus/is/readme.md | 451 - .../@szmarczak/http-timer/LICENSE | 21 - .../@szmarczak/http-timer/README.md | 70 - .../@szmarczak/http-timer/package.json | 75 - .../@szmarczak/http-timer/source/index.js | 99 - server/node_modules/@types/node/LICENSE | 21 + server/node_modules/@types/node/README.md | 16 + server/node_modules/@types/node/assert.d.ts | 961 +++ .../@types/node/assert/strict.d.ts | 8 + .../node_modules/@types/node/async_hooks.d.ts | 501 ++ server/node_modules/@types/node/buffer.d.ts | 2258 +++++ .../@types/node/child_process.d.ts | 1369 +++ server/node_modules/@types/node/cluster.d.ts | 410 + server/node_modules/@types/node/console.d.ts | 412 + .../node_modules/@types/node/constants.d.ts | 18 + server/node_modules/@types/node/crypto.d.ts | 3964 +++++++++ server/node_modules/@types/node/dgram.d.ts | 545 ++ .../@types/node/diagnostics_channel.d.ts | 153 + server/node_modules/@types/node/dns.d.ts | 659 ++ .../@types/node/dns/promises.d.ts | 370 + .../node_modules/@types/node/dom-events.d.ts | 126 + server/node_modules/@types/node/domain.d.ts | 170 + server/node_modules/@types/node/events.d.ts | 678 ++ server/node_modules/@types/node/fs.d.ts | 3872 +++++++++ .../node_modules/@types/node/fs/promises.d.ts | 1138 +++ server/node_modules/@types/node/globals.d.ts | 300 + .../@types/node/globals.global.d.ts | 1 + server/node_modules/@types/node/http.d.ts | 1651 ++++ server/node_modules/@types/node/http2.d.ts | 2134 +++++ server/node_modules/@types/node/https.d.ts | 542 ++ server/node_modules/@types/node/index.d.ts | 134 + .../node_modules/@types/node/inspector.d.ts | 2741 ++++++ server/node_modules/@types/node/module.d.ts | 114 + server/node_modules/@types/node/net.d.ts | 869 ++ server/node_modules/@types/node/os.d.ts | 466 + server/node_modules/@types/node/package.json | 237 + server/node_modules/@types/node/path.d.ts | 191 + .../node_modules/@types/node/perf_hooks.d.ts | 625 ++ server/node_modules/@types/node/process.d.ts | 1482 ++++ server/node_modules/@types/node/punycode.d.ts | 117 + .../node_modules/@types/node/querystring.d.ts | 131 + server/node_modules/@types/node/readline.d.ts | 653 ++ .../@types/node/readline/promises.d.ts | 143 + server/node_modules/@types/node/repl.d.ts | 424 + server/node_modules/@types/node/stream.d.ts | 1340 +++ .../@types/node/stream/consumers.d.ts | 12 + .../@types/node/stream/promises.d.ts | 42 + .../node_modules/@types/node/stream/web.d.ts | 330 + .../@types/node/string_decoder.d.ts | 67 + server/node_modules/@types/node/test.d.ts | 446 + server/node_modules/@types/node/timers.d.ts | 94 + .../@types/node/timers/promises.d.ts | 93 + server/node_modules/@types/node/tls.d.ts | 1028 +++ .../@types/node/trace_events.d.ts | 171 + .../@types/node/ts4.8/assert.d.ts | 961 +++ .../@types/node/ts4.8/assert/strict.d.ts | 8 + .../@types/node/ts4.8/async_hooks.d.ts | 501 ++ .../@types/node/ts4.8/buffer.d.ts | 2259 +++++ .../@types/node/ts4.8/child_process.d.ts | 1369 +++ .../@types/node/ts4.8/cluster.d.ts | 410 + .../@types/node/ts4.8/console.d.ts | 412 + .../@types/node/ts4.8/constants.d.ts | 18 + .../@types/node/ts4.8/crypto.d.ts | 3964 +++++++++ .../node_modules/@types/node/ts4.8/dgram.d.ts | 545 ++ .../node/ts4.8/diagnostics_channel.d.ts | 153 + .../node_modules/@types/node/ts4.8/dns.d.ts | 659 ++ .../@types/node/ts4.8/dns/promises.d.ts | 370 + .../@types/node/ts4.8/dom-events.d.ts | 126 + .../@types/node/ts4.8/domain.d.ts | 170 + .../@types/node/ts4.8/events.d.ts | 678 ++ server/node_modules/@types/node/ts4.8/fs.d.ts | 3872 +++++++++ .../@types/node/ts4.8/fs/promises.d.ts | 1138 +++ .../@types/node/ts4.8/globals.d.ts | 294 + .../@types/node/ts4.8/globals.global.d.ts | 1 + .../node_modules/@types/node/ts4.8/http.d.ts | 1651 ++++ .../node_modules/@types/node/ts4.8/http2.d.ts | 2134 +++++ .../node_modules/@types/node/ts4.8/https.d.ts | 542 ++ .../node_modules/@types/node/ts4.8/index.d.ts | 88 + .../@types/node/ts4.8/inspector.d.ts | 2741 ++++++ .../@types/node/ts4.8/module.d.ts | 114 + .../node_modules/@types/node/ts4.8/net.d.ts | 869 ++ server/node_modules/@types/node/ts4.8/os.d.ts | 466 + .../node_modules/@types/node/ts4.8/path.d.ts | 191 + .../@types/node/ts4.8/perf_hooks.d.ts | 625 ++ .../@types/node/ts4.8/process.d.ts | 1482 ++++ .../@types/node/ts4.8/punycode.d.ts | 117 + .../@types/node/ts4.8/querystring.d.ts | 131 + .../@types/node/ts4.8/readline.d.ts | 653 ++ .../@types/node/ts4.8/readline/promises.d.ts | 143 + .../node_modules/@types/node/ts4.8/repl.d.ts | 424 + .../@types/node/ts4.8/stream.d.ts | 1340 +++ .../@types/node/ts4.8/stream/consumers.d.ts | 12 + .../@types/node/ts4.8/stream/promises.d.ts | 42 + .../@types/node/ts4.8/stream/web.d.ts | 330 + .../@types/node/ts4.8/string_decoder.d.ts | 67 + .../node_modules/@types/node/ts4.8/test.d.ts | 446 + .../@types/node/ts4.8/timers.d.ts | 94 + .../@types/node/ts4.8/timers/promises.d.ts | 93 + .../node_modules/@types/node/ts4.8/tls.d.ts | 1028 +++ .../@types/node/ts4.8/trace_events.d.ts | 171 + .../node_modules/@types/node/ts4.8/tty.d.ts | 206 + .../node_modules/@types/node/ts4.8/url.d.ts | 897 ++ .../node_modules/@types/node/ts4.8/util.d.ts | 1926 +++++ server/node_modules/@types/node/ts4.8/v8.d.ts | 396 + server/node_modules/@types/node/ts4.8/vm.d.ts | 509 ++ .../node_modules/@types/node/ts4.8/wasi.d.ts | 158 + .../@types/node/ts4.8/worker_threads.d.ts | 689 ++ .../node_modules/@types/node/ts4.8/zlib.d.ts | 517 ++ server/node_modules/@types/node/tty.d.ts | 206 + server/node_modules/@types/node/url.d.ts | 897 ++ server/node_modules/@types/node/util.d.ts | 1926 +++++ server/node_modules/@types/node/v8.d.ts | 396 + server/node_modules/@types/node/vm.d.ts | 509 ++ server/node_modules/@types/node/wasi.d.ts | 158 + .../@types/node/worker_threads.d.ts | 689 ++ server/node_modules/@types/node/zlib.d.ts | 517 ++ .../@types/webidl-conversions/LICENSE | 21 + .../@types/webidl-conversions/README.md | 16 + .../@types/webidl-conversions/index.d.ts | 97 + .../@types/webidl-conversions/package.json | 30 + server/node_modules/@types/whatwg-url/LICENSE | 21 + .../node_modules/@types/whatwg-url/README.md | 16 + .../@types/whatwg-url/dist/URL-impl.d.ts | 23 + .../@types/whatwg-url/dist/URL.d.ts | 76 + .../whatwg-url/dist/URLSearchParams-impl.d.ts | 23 + .../whatwg-url/dist/URLSearchParams.d.ts | 91 + .../node_modules/@types/whatwg-url/index.d.ts | 162 + .../@types/whatwg-url/package.json | 33 + .../@types/whatwg-url/webidl2js-wrapper.d.ts | 4 + server/node_modules/ansi-align/CHANGELOG.md | 51 - server/node_modules/ansi-align/LICENSE | 13 - server/node_modules/ansi-align/README.md | 80 - server/node_modules/ansi-align/index.js | 61 - .../node_modules/string-width/index.js | 39 - .../node_modules/string-width/license | 9 - .../node_modules/string-width/package.json | 88 - .../node_modules/string-width/readme.md | 45 - server/node_modules/ansi-align/package.json | 74 - server/node_modules/ansi-regex/index.js | 14 - server/node_modules/ansi-regex/license | 9 - server/node_modules/ansi-regex/package.json | 85 - server/node_modules/ansi-regex/readme.md | 87 - server/node_modules/ansi-styles/index.d.ts | 345 - server/node_modules/ansi-styles/index.js | 163 - server/node_modules/ansi-styles/license | 9 - server/node_modules/ansi-styles/package.json | 88 - server/node_modules/ansi-styles/readme.md | 152 - server/node_modules/anymatch/index.d.ts | 1 + server/node_modules/anymatch/index.js | 2 +- server/node_modules/anymatch/package.json | 74 +- server/node_modules/base64-js/LICENSE | 21 + server/node_modules/base64-js/README.md | 34 + server/node_modules/base64-js/base64js.min.js | 1 + server/node_modules/base64-js/index.d.ts | 3 + server/node_modules/base64-js/index.js | 150 + server/node_modules/base64-js/package.json | 47 + server/node_modules/bowser/CHANGELOG.md | 218 + server/node_modules/bowser/LICENSE | 39 + server/node_modules/bowser/README.md | 179 + server/node_modules/bowser/bundled.js | 1 + server/node_modules/bowser/es5.js | 1 + server/node_modules/bowser/index.d.ts | 250 + server/node_modules/bowser/package.json | 83 + server/node_modules/bowser/src/bowser.js | 77 + server/node_modules/bowser/src/constants.js | 116 + .../bowser/src/parser-browsers.js | 700 ++ .../node_modules/bowser/src/parser-engines.js | 120 + server/node_modules/bowser/src/parser-os.js | 199 + .../bowser/src/parser-platforms.js | 266 + server/node_modules/bowser/src/parser.js | 496 ++ server/node_modules/bowser/src/utils.js | 309 + server/node_modules/boxen/index.d.ts | 175 - server/node_modules/boxen/index.js | 139 - server/node_modules/boxen/license | 9 - server/node_modules/boxen/package.json | 83 - server/node_modules/boxen/readme.md | 187 - server/node_modules/bson/LICENSE.md | 201 + server/node_modules/bson/README.md | 376 + server/node_modules/bson/bower.json | 26 + server/node_modules/bson/bson.d.ts | 1228 +++ .../bson/dist/bson.browser.esm.js | 7462 ++++++++++++++++ .../bson/dist/bson.browser.esm.js.map | 1 + .../bson/dist/bson.browser.umd.js | 7529 +++++++++++++++++ .../bson/dist/bson.browser.umd.js.map | 1 + server/node_modules/bson/dist/bson.bundle.js | 7528 ++++++++++++++++ .../node_modules/bson/dist/bson.bundle.js.map | 1 + server/node_modules/bson/dist/bson.esm.js | 5428 ++++++++++++ server/node_modules/bson/dist/bson.esm.js.map | 1 + server/node_modules/bson/etc/prepare.js | 19 + server/node_modules/bson/lib/binary.js | 426 + server/node_modules/bson/lib/binary.js.map | 1 + server/node_modules/bson/lib/bson.js | 251 + server/node_modules/bson/lib/bson.js.map | 1 + server/node_modules/bson/lib/code.js | 46 + server/node_modules/bson/lib/code.js.map | 1 + server/node_modules/bson/lib/constants.js | 82 + server/node_modules/bson/lib/constants.js.map | 1 + server/node_modules/bson/lib/db_ref.js | 97 + server/node_modules/bson/lib/db_ref.js.map | 1 + server/node_modules/bson/lib/decimal128.js | 669 ++ .../node_modules/bson/lib/decimal128.js.map | 1 + server/node_modules/bson/lib/double.js | 68 + server/node_modules/bson/lib/double.js.map | 1 + server/node_modules/bson/lib/ensure_buffer.js | 25 + .../bson/lib/ensure_buffer.js.map | 1 + server/node_modules/bson/lib/error.js | 55 + server/node_modules/bson/lib/error.js.map | 1 + server/node_modules/bson/lib/extended_json.js | 390 + .../bson/lib/extended_json.js.map | 1 + server/node_modules/bson/lib/int_32.js | 58 + server/node_modules/bson/lib/int_32.js.map | 1 + server/node_modules/bson/lib/long.js | 900 ++ server/node_modules/bson/lib/long.js.map | 1 + server/node_modules/bson/lib/map.js | 123 + server/node_modules/bson/lib/map.js.map | 1 + server/node_modules/bson/lib/max_key.js | 33 + server/node_modules/bson/lib/max_key.js.map | 1 + server/node_modules/bson/lib/min_key.js | 33 + server/node_modules/bson/lib/min_key.js.map | 1 + server/node_modules/bson/lib/objectid.js | 299 + server/node_modules/bson/lib/objectid.js.map | 1 + .../bson/lib/parser/calculate_size.js | 194 + .../bson/lib/parser/calculate_size.js.map | 1 + .../bson/lib/parser/deserializer.js | 665 ++ .../bson/lib/parser/deserializer.js.map | 1 + .../bson/lib/parser/serializer.js | 867 ++ .../bson/lib/parser/serializer.js.map | 1 + server/node_modules/bson/lib/parser/utils.js | 115 + .../node_modules/bson/lib/parser/utils.js.map | 1 + server/node_modules/bson/lib/regexp.js | 74 + server/node_modules/bson/lib/regexp.js.map | 1 + server/node_modules/bson/lib/symbol.js | 48 + server/node_modules/bson/lib/symbol.js.map | 1 + server/node_modules/bson/lib/timestamp.js | 102 + server/node_modules/bson/lib/timestamp.js.map | 1 + server/node_modules/bson/lib/utils/global.js | 18 + .../node_modules/bson/lib/utils/global.js.map | 1 + server/node_modules/bson/lib/uuid_utils.js | 35 + .../node_modules/bson/lib/uuid_utils.js.map | 1 + server/node_modules/bson/lib/validate_utf8.js | 47 + .../bson/lib/validate_utf8.js.map | 1 + server/node_modules/bson/package.json | 116 + server/node_modules/bson/src/binary.ts | 481 ++ server/node_modules/bson/src/bson.ts | 330 + server/node_modules/bson/src/code.ts | 61 + server/node_modules/bson/src/constants.ts | 110 + server/node_modules/bson/src/db_ref.ts | 124 + server/node_modules/bson/src/decimal128.ts | 773 ++ server/node_modules/bson/src/double.ts | 83 + server/node_modules/bson/src/ensure_buffer.ts | 27 + server/node_modules/bson/src/error.ts | 23 + server/node_modules/bson/src/extended_json.ts | 462 + server/node_modules/bson/src/int_32.ts | 70 + server/node_modules/bson/src/long.ts | 1040 +++ server/node_modules/bson/src/map.ts | 119 + server/node_modules/bson/src/max_key.ts | 38 + server/node_modules/bson/src/min_key.ts | 38 + server/node_modules/bson/src/objectid.ts | 354 + .../bson/src/parser/calculate_size.ts | 228 + .../bson/src/parser/deserializer.ts | 782 ++ .../bson/src/parser/serializer.ts | 1076 +++ server/node_modules/bson/src/parser/utils.ts | 127 + server/node_modules/bson/src/regexp.ts | 105 + server/node_modules/bson/src/symbol.ts | 58 + server/node_modules/bson/src/timestamp.ts | 119 + server/node_modules/bson/src/utils/global.ts | 22 + server/node_modules/bson/src/uuid_utils.ts | 33 + server/node_modules/bson/src/validate_utf8.ts | 47 + server/node_modules/buffer/AUTHORS.md | 70 + server/node_modules/buffer/LICENSE | 21 + server/node_modules/buffer/README.md | 410 + server/node_modules/buffer/index.d.ts | 186 + server/node_modules/buffer/index.js | 1817 ++++ server/node_modules/buffer/package.json | 96 + server/node_modules/cacheable-request/LICENSE | 21 - .../node_modules/cacheable-request/README.md | 206 - .../node_modules/get-stream/buffer-stream.js | 52 - .../node_modules/get-stream/index.d.ts | 108 - .../node_modules/get-stream/index.js | 60 - .../node_modules/get-stream/license | 9 - .../node_modules/get-stream/package.json | 82 - .../node_modules/get-stream/readme.md | 124 - .../node_modules/lowercase-keys/index.d.ts | 16 - .../node_modules/lowercase-keys/index.js | 10 - .../node_modules/lowercase-keys/license | 9 - .../node_modules/lowercase-keys/package.json | 70 - .../node_modules/lowercase-keys/readme.md | 32 - .../cacheable-request/package.json | 94 - .../cacheable-request/src/index.js | 251 - server/node_modules/camelcase/index.d.ts | 63 - server/node_modules/camelcase/index.js | 76 - server/node_modules/camelcase/license | 9 - server/node_modules/camelcase/package.json | 75 - server/node_modules/camelcase/readme.md | 99 - server/node_modules/chalk/index.d.ts | 411 - server/node_modules/chalk/license | 9 - .../chalk/node_modules/has-flag/index.d.ts | 39 - .../chalk/node_modules/has-flag/index.js | 8 - .../chalk/node_modules/has-flag/license | 9 - .../chalk/node_modules/has-flag/package.json | 78 - .../chalk/node_modules/has-flag/readme.md | 89 - .../node_modules/supports-color/browser.js | 5 - .../node_modules/supports-color/index.js | 135 - .../chalk/node_modules/supports-color/license | 9 - .../node_modules/supports-color/package.json | 85 - .../node_modules/supports-color/readme.md | 76 - server/node_modules/chalk/package.json | 96 - server/node_modules/chalk/readme.md | 304 - server/node_modules/chalk/source/index.js | 233 - server/node_modules/chalk/source/templates.js | 134 - server/node_modules/chalk/source/util.js | 39 - server/node_modules/chokidar/README.md | 9 +- server/node_modules/chokidar/index.js | 8 +- server/node_modules/chokidar/lib/constants.js | 2 + .../chokidar/lib/fsevents-handler.js | 3 +- .../chokidar/lib/nodefs-handler.js | 10 +- server/node_modules/chokidar/package.json | 107 +- server/node_modules/chokidar/types/index.d.ts | 7 +- server/node_modules/ci-info/CHANGELOG.md | 78 - server/node_modules/ci-info/LICENSE | 21 - server/node_modules/ci-info/README.md | 108 - server/node_modules/ci-info/index.js | 66 - server/node_modules/ci-info/package.json | 65 - server/node_modules/ci-info/vendors.json | 153 - server/node_modules/cli-boxes/boxes.json | 58 - server/node_modules/cli-boxes/index.d.ts | 113 - server/node_modules/cli-boxes/index.js | 6 - server/node_modules/cli-boxes/license | 9 - server/node_modules/cli-boxes/package.json | 74 - server/node_modules/cli-boxes/readme.md | 105 - server/node_modules/clone-response/LICENSE | 21 - server/node_modules/clone-response/README.md | 62 - .../node_modules/clone-response/package.json | 73 - .../node_modules/clone-response/src/index.js | 17 - .../node_modules/color-convert/CHANGELOG.md | 54 - server/node_modules/color-convert/LICENSE | 21 - server/node_modules/color-convert/README.md | 68 - .../node_modules/color-convert/conversions.js | 839 -- server/node_modules/color-convert/index.js | 81 - .../node_modules/color-convert/package.json | 83 - server/node_modules/color-convert/route.js | 97 - server/node_modules/color-name/LICENSE | 8 - server/node_modules/color-name/README.md | 11 - server/node_modules/color-name/index.js | 152 - server/node_modules/color-name/package.json | 56 - server/node_modules/concat-map/package.json | 125 +- server/node_modules/configstore/index.js | 109 - server/node_modules/configstore/license | 25 - server/node_modules/configstore/package.json | 78 - server/node_modules/configstore/readme.md | 141 - server/node_modules/cors/package.json | 71 +- .../crypto-random-string/index.d.ts | 17 - .../crypto-random-string/index.js | 10 - .../node_modules/crypto-random-string/license | 9 - .../crypto-random-string/package.json | 72 - .../crypto-random-string/readme.md | 51 - .../node_modules/decompress-response/index.js | 29 - .../node_modules/decompress-response/license | 21 - .../decompress-response/package.json | 85 - .../decompress-response/readme.md | 31 - server/node_modules/deep-extend/CHANGELOG.md | 46 - server/node_modules/deep-extend/LICENSE | 20 - server/node_modules/deep-extend/README.md | 91 - server/node_modules/deep-extend/index.js | 1 - .../deep-extend/lib/deep-extend.js | 150 - server/node_modules/deep-extend/package.json | 92 - server/node_modules/defer-to-connect/LICENSE | 21 - .../node_modules/defer-to-connect/README.md | 38 - .../defer-to-connect/dist/index.d.ts | 10 - .../defer-to-connect/dist/index.js | 45 - .../defer-to-connect/package.json | 101 - server/node_modules/dot-prop/index.d.ts | 101 - server/node_modules/dot-prop/index.js | 142 - server/node_modules/dot-prop/license | 9 - server/node_modules/dot-prop/package.json | 77 - server/node_modules/dot-prop/readme.md | 117 - server/node_modules/duplexer3/LICENSE.md | 26 - server/node_modules/duplexer3/README.md | 115 - server/node_modules/duplexer3/index.js | 76 - server/node_modules/duplexer3/package.json | 64 - server/node_modules/emoji-regex/README.md | 73 - .../node_modules/emoji-regex/es2015/index.js | 6 - .../node_modules/emoji-regex/es2015/text.js | 6 - server/node_modules/emoji-regex/index.d.ts | 5 - server/node_modules/emoji-regex/index.js | 6 - server/node_modules/emoji-regex/package.json | 78 - server/node_modules/emoji-regex/text.js | 6 - server/node_modules/end-of-stream/LICENSE | 21 - server/node_modules/end-of-stream/README.md | 54 - server/node_modules/end-of-stream/index.js | 94 - .../node_modules/end-of-stream/package.json | 65 - server/node_modules/escape-goat/index.d.ts | 62 - server/node_modules/escape-goat/index.js | 33 - server/node_modules/escape-goat/license | 9 - server/node_modules/escape-goat/package.json | 77 - server/node_modules/escape-goat/readme.md | 76 - .../node_modules/fast-xml-parser/CHANGELOG.md | 504 ++ server/node_modules/fast-xml-parser/LICENSE | 21 + server/node_modules/fast-xml-parser/README.md | 193 + .../node_modules/fast-xml-parser/package.json | 68 + .../fast-xml-parser/src/cli/cli.js | 93 + .../fast-xml-parser/src/cli/man.js | 12 + .../fast-xml-parser/src/cli/read.js | 92 + .../node_modules/fast-xml-parser/src/fxp.d.ts | 97 + .../node_modules/fast-xml-parser/src/fxp.js | 11 + .../node_modules/fast-xml-parser/src/util.js | 72 + .../fast-xml-parser/src/validator.js | 423 + .../src/xmlbuilder/json2xml.js | 258 + .../src/xmlbuilder/orderedJs2Xml.js | 109 + .../src/xmlbuilder/prettifyJs2Xml.js | 0 .../src/xmlparser/DocTypeReader.js | 117 + .../src/xmlparser/OptionsBuilder.js | 42 + .../src/xmlparser/OrderedObjParser.js | 561 ++ .../src/xmlparser/XMLParser.js | 58 + .../src/xmlparser/node2json.js | 101 + .../fast-xml-parser/src/xmlparser/xmlNode.js | 23 + .../node_modules/get-stream/buffer-stream.js | 51 - server/node_modules/get-stream/index.js | 50 - server/node_modules/get-stream/license | 9 - server/node_modules/get-stream/package.json | 78 - server/node_modules/get-stream/readme.md | 123 - server/node_modules/global-dirs/index.d.ts | 60 - server/node_modules/global-dirs/index.js | 118 - server/node_modules/global-dirs/license | 9 - server/node_modules/global-dirs/package.json | 88 - server/node_modules/global-dirs/readme.md | 72 - server/node_modules/got/license | 9 - server/node_modules/got/package.json | 106 - server/node_modules/got/readme.md | 1237 --- server/node_modules/got/source/as-promise.js | 108 - server/node_modules/got/source/as-stream.js | 93 - server/node_modules/got/source/create.js | 79 - server/node_modules/got/source/errors.js | 107 - .../node_modules/got/source/get-response.js | 31 - server/node_modules/got/source/index.js | 60 - .../got/source/known-hook-events.js | 10 - server/node_modules/got/source/merge.js | 73 - .../got/source/normalize-arguments.js | 265 - server/node_modules/got/source/progress.js | 96 - .../got/source/request-as-event-emitter.js | 312 - .../got/source/utils/deep-freeze.js | 12 - .../got/source/utils/get-body-size.js | 32 - .../got/source/utils/is-form-data.js | 4 - .../got/source/utils/timed-out.js | 160 - .../got/source/utils/url-to-options.js | 25 - server/node_modules/graceful-fs/LICENSE | 15 - server/node_modules/graceful-fs/README.md | 133 - server/node_modules/graceful-fs/clone.js | 23 - .../node_modules/graceful-fs/graceful-fs.js | 373 - .../graceful-fs/legacy-streams.js | 118 - server/node_modules/graceful-fs/package.json | 79 - server/node_modules/graceful-fs/polyfills.js | 346 - server/node_modules/has-yarn/index.d.ts | 16 - server/node_modules/has-yarn/index.js | 9 - server/node_modules/has-yarn/license | 9 - server/node_modules/has-yarn/package.json | 71 - server/node_modules/has-yarn/readme.md | 60 - .../node_modules/http-cache-semantics/LICENSE | 9 - .../http-cache-semantics/README.md | 203 - .../http-cache-semantics/index.js | 673 -- .../http-cache-semantics/package.json | 60 - server/node_modules/ieee754/LICENSE | 11 + server/node_modules/ieee754/README.md | 51 + server/node_modules/ieee754/index.d.ts | 10 + server/node_modules/ieee754/index.js | 85 + server/node_modules/ieee754/package.json | 52 + server/node_modules/import-lazy/index.js | 53 - server/node_modules/import-lazy/license | 21 - server/node_modules/import-lazy/package.json | 76 - server/node_modules/import-lazy/readme.md | 64 - server/node_modules/imurmurhash/README.md | 122 - .../node_modules/imurmurhash/imurmurhash.js | 138 - .../imurmurhash/imurmurhash.min.js | 12 - server/node_modules/imurmurhash/package.json | 63 - server/node_modules/ini/README.md | 102 - server/node_modules/ini/ini.js | 206 - server/node_modules/ini/package.json | 67 - server/node_modules/ip/README.md | 90 + server/node_modules/ip/lib/ip.js | 422 + server/node_modules/ip/package.json | 25 + server/node_modules/is-ci/CHANGELOG.md | 14 - server/node_modules/is-ci/LICENSE | 21 - server/node_modules/is-ci/README.md | 50 - server/node_modules/is-ci/bin.js | 4 - server/node_modules/is-ci/index.js | 3 - server/node_modules/is-ci/package.json | 69 - server/node_modules/is-extglob/package.json | 65 +- .../is-fullwidth-code-point/index.js | 46 - .../is-fullwidth-code-point/license | 21 - .../is-fullwidth-code-point/package.json | 77 - .../is-fullwidth-code-point/readme.md | 39 - server/node_modules/is-glob/README.md | 2 +- server/node_modules/is-glob/index.js | 150 +- server/node_modules/is-glob/package.json | 83 +- .../is-installed-globally/index.d.ts | 19 - .../is-installed-globally/index.js | 15 - .../is-installed-globally/license | 9 - .../is-installed-globally/package.json | 86 - .../is-installed-globally/readme.md | 34 - server/node_modules/is-npm/index.d.ts | 41 - server/node_modules/is-npm/index.js | 9 - server/node_modules/is-npm/license | 9 - server/node_modules/is-npm/package.json | 69 - server/node_modules/is-npm/readme.md | 59 - server/node_modules/is-obj/index.d.ts | 22 - server/node_modules/is-obj/index.js | 6 - server/node_modules/is-obj/license | 9 - server/node_modules/is-obj/package.json | 66 - server/node_modules/is-obj/readme.md | 39 - server/node_modules/is-path-inside/index.d.ts | 27 - server/node_modules/is-path-inside/index.js | 12 - server/node_modules/is-path-inside/license | 9 - .../node_modules/is-path-inside/package.json | 68 - server/node_modules/is-path-inside/readme.md | 63 - server/node_modules/is-typedarray/LICENSE.md | 18 - server/node_modules/is-typedarray/README.md | 16 - server/node_modules/is-typedarray/index.js | 41 - .../node_modules/is-typedarray/package.json | 60 - server/node_modules/is-typedarray/test.js | 34 - .../node_modules/is-yarn-global/.travis.yml | 4 - server/node_modules/is-yarn-global/LICENSE | 21 - server/node_modules/is-yarn-global/README.md | 28 - server/node_modules/is-yarn-global/index.js | 12 - .../node_modules/is-yarn-global/package.json | 50 - server/node_modules/json-buffer/.npmignore | 3 - server/node_modules/json-buffer/.travis.yml | 3 - server/node_modules/json-buffer/LICENSE | 22 - server/node_modules/json-buffer/README.md | 24 - server/node_modules/json-buffer/index.js | 58 - server/node_modules/json-buffer/package.json | 66 - server/node_modules/json-buffer/test/index.js | 63 - server/node_modules/kareem/LICENSE | 202 + server/node_modules/kareem/README.md | 420 + server/node_modules/kareem/index.js | 668 ++ server/node_modules/kareem/package.json | 31 + server/node_modules/keyv/LICENSE | 21 - server/node_modules/keyv/README.md | 276 - server/node_modules/keyv/package.json | 78 - server/node_modules/keyv/src/index.js | 103 - server/node_modules/latest-version/index.d.ts | 42 - server/node_modules/latest-version/index.js | 11 - server/node_modules/latest-version/license | 9 - .../node_modules/latest-version/package.json | 74 - server/node_modules/latest-version/readme.md | 42 - server/node_modules/lowercase-keys/index.js | 11 - server/node_modules/lowercase-keys/license | 21 - .../node_modules/lowercase-keys/package.json | 68 - server/node_modules/lowercase-keys/readme.md | 33 - server/node_modules/make-dir/index.d.ts | 66 - server/node_modules/make-dir/index.js | 156 - server/node_modules/make-dir/license | 9 - .../make-dir/node_modules/.bin/semver | 15 - .../make-dir/node_modules/.bin/semver.cmd | 7 - .../make-dir/node_modules/semver/CHANGELOG.md | 70 - .../make-dir/node_modules/semver/LICENSE | 15 - .../make-dir/node_modules/semver/README.md | 443 - .../node_modules/semver/bin/semver.js | 174 - .../make-dir/node_modules/semver/package.json | 60 - .../make-dir/node_modules/semver/semver.js | 1596 ---- server/node_modules/make-dir/package.json | 91 - server/node_modules/make-dir/readme.md | 125 - server/node_modules/memory-pager/.travis.yml | 4 + server/node_modules/memory-pager/LICENSE | 21 + server/node_modules/memory-pager/README.md | 65 + server/node_modules/memory-pager/index.js | 160 + server/node_modules/memory-pager/package.json | 24 + server/node_modules/memory-pager/test.js | 80 + server/node_modules/mimic-response/index.js | 32 - server/node_modules/mimic-response/license | 9 - .../node_modules/mimic-response/package.json | 71 - server/node_modules/mimic-response/readme.md | 54 - server/node_modules/minimatch/README.md | 23 +- server/node_modules/minimatch/minimatch.js | 162 +- server/node_modules/minimatch/package.json | 72 +- server/node_modules/minimist/.travis.yml | 8 - server/node_modules/minimist/LICENSE | 18 - server/node_modules/minimist/example/parse.js | 2 - server/node_modules/minimist/index.js | 245 - server/node_modules/minimist/package.json | 73 - server/node_modules/minimist/readme.markdown | 95 - server/node_modules/minimist/test/all_bool.js | 32 - server/node_modules/minimist/test/bool.js | 178 - server/node_modules/minimist/test/dash.js | 31 - .../minimist/test/default_bool.js | 35 - server/node_modules/minimist/test/dotted.js | 22 - server/node_modules/minimist/test/kv_short.js | 16 - server/node_modules/minimist/test/long.js | 31 - server/node_modules/minimist/test/num.js | 36 - server/node_modules/minimist/test/parse.js | 197 - .../minimist/test/parse_modified.js | 9 - server/node_modules/minimist/test/proto.js | 44 - server/node_modules/minimist/test/short.js | 67 - .../node_modules/minimist/test/stop_early.js | 15 - server/node_modules/minimist/test/unknown.js | 102 - .../node_modules/minimist/test/whitespace.js | 8 - .../.esm-wrapper.mjs | 6 + .../mongodb-connection-string-url/LICENSE | 192 + .../mongodb-connection-string-url/README.md | 25 + .../lib/index.d.ts | 62 + .../lib/index.js | 213 + .../lib/index.js.map | 1 + .../lib/redact.d.ts | 7 + .../lib/redact.js | 86 + .../lib/redact.js.map | 1 + .../package.json | 62 + server/node_modules/mongodb/LICENSE.md | 201 + server/node_modules/mongodb/README.md | 280 + server/node_modules/mongodb/etc/prepare.js | 12 + server/node_modules/mongodb/lib/admin.js | 112 + server/node_modules/mongodb/lib/admin.js.map | 1 + server/node_modules/mongodb/lib/bson.js | 71 + server/node_modules/mongodb/lib/bson.js.map | 1 + .../node_modules/mongodb/lib/bulk/common.js | 975 +++ .../mongodb/lib/bulk/common.js.map | 1 + .../node_modules/mongodb/lib/bulk/ordered.js | 67 + .../mongodb/lib/bulk/ordered.js.map | 1 + .../mongodb/lib/bulk/unordered.js | 92 + .../mongodb/lib/bulk/unordered.js.map | 1 + .../node_modules/mongodb/lib/change_stream.js | 403 + .../mongodb/lib/change_stream.js.map | 1 + .../mongodb/lib/cmap/auth/auth_provider.js | 36 + .../lib/cmap/auth/auth_provider.js.map | 1 + .../mongodb/lib/cmap/auth/gssapi.js | 190 + .../mongodb/lib/cmap/auth/gssapi.js.map | 1 + .../lib/cmap/auth/mongo_credentials.js | 134 + .../lib/cmap/auth/mongo_credentials.js.map | 1 + .../mongodb/lib/cmap/auth/mongocr.js | 44 + .../mongodb/lib/cmap/auth/mongocr.js.map | 1 + .../mongodb/lib/cmap/auth/mongodb_aws.js | 235 + .../mongodb/lib/cmap/auth/mongodb_aws.js.map | 1 + .../mongodb/lib/cmap/auth/plain.js | 27 + .../mongodb/lib/cmap/auth/plain.js.map | 1 + .../mongodb/lib/cmap/auth/providers.js | 21 + .../mongodb/lib/cmap/auth/providers.js.map | 1 + .../mongodb/lib/cmap/auth/scram.js | 288 + .../mongodb/lib/cmap/auth/scram.js.map | 1 + .../mongodb/lib/cmap/auth/x509.js | 39 + .../mongodb/lib/cmap/auth/x509.js.map | 1 + .../lib/cmap/command_monitoring_events.js | 243 + .../lib/cmap/command_monitoring_events.js.map | 1 + .../node_modules/mongodb/lib/cmap/commands.js | 481 ++ .../mongodb/lib/cmap/commands.js.map | 1 + .../node_modules/mongodb/lib/cmap/connect.js | 398 + .../mongodb/lib/cmap/connect.js.map | 1 + .../mongodb/lib/cmap/connection.js | 480 ++ .../mongodb/lib/cmap/connection.js.map | 1 + .../mongodb/lib/cmap/connection_pool.js | 598 ++ .../mongodb/lib/cmap/connection_pool.js.map | 1 + .../lib/cmap/connection_pool_events.js | 160 + .../lib/cmap/connection_pool_events.js.map | 1 + .../node_modules/mongodb/lib/cmap/errors.js | 65 + .../mongodb/lib/cmap/errors.js.map | 1 + .../mongodb/lib/cmap/message_stream.js | 158 + .../mongodb/lib/cmap/message_stream.js.map | 1 + .../node_modules/mongodb/lib/cmap/metrics.js | 62 + .../mongodb/lib/cmap/metrics.js.map | 1 + .../mongodb/lib/cmap/stream_description.js | 51 + .../lib/cmap/stream_description.js.map | 1 + .../lib/cmap/wire_protocol/compression.js | 96 + .../lib/cmap/wire_protocol/compression.js.map | 1 + .../lib/cmap/wire_protocol/constants.js | 15 + .../lib/cmap/wire_protocol/constants.js.map | 1 + .../mongodb/lib/cmap/wire_protocol/shared.js | 55 + .../lib/cmap/wire_protocol/shared.js.map | 1 + server/node_modules/mongodb/lib/collection.js | 535 ++ .../mongodb/lib/collection.js.map | 1 + .../mongodb/lib/connection_string.js | 1118 +++ .../mongodb/lib/connection_string.js.map | 1 + server/node_modules/mongodb/lib/constants.js | 131 + .../node_modules/mongodb/lib/constants.js.map | 1 + .../mongodb/lib/cursor/abstract_cursor.js | 665 ++ .../mongodb/lib/cursor/abstract_cursor.js.map | 1 + .../mongodb/lib/cursor/aggregation_cursor.js | 171 + .../lib/cursor/aggregation_cursor.js.map | 1 + .../lib/cursor/change_stream_cursor.js | 115 + .../lib/cursor/change_stream_cursor.js.map | 1 + .../mongodb/lib/cursor/find_cursor.js | 382 + .../mongodb/lib/cursor/find_cursor.js.map | 1 + .../lib/cursor/list_collections_cursor.js | 37 + .../lib/cursor/list_collections_cursor.js.map | 1 + .../mongodb/lib/cursor/list_indexes_cursor.js | 36 + .../lib/cursor/list_indexes_cursor.js.map | 1 + server/node_modules/mongodb/lib/db.js | 337 + server/node_modules/mongodb/lib/db.js.map | 1 + server/node_modules/mongodb/lib/deps.js | 75 + server/node_modules/mongodb/lib/deps.js.map | 1 + server/node_modules/mongodb/lib/encrypter.js | 108 + .../node_modules/mongodb/lib/encrypter.js.map | 1 + server/node_modules/mongodb/lib/error.js | 803 ++ server/node_modules/mongodb/lib/error.js.map | 1 + server/node_modules/mongodb/lib/explain.js | 35 + .../node_modules/mongodb/lib/explain.js.map | 1 + .../mongodb/lib/gridfs/download.js | 316 + .../mongodb/lib/gridfs/download.js.map | 1 + .../node_modules/mongodb/lib/gridfs/index.js | 129 + .../mongodb/lib/gridfs/index.js.map | 1 + .../node_modules/mongodb/lib/gridfs/upload.js | 377 + .../mongodb/lib/gridfs/upload.js.map | 1 + server/node_modules/mongodb/lib/index.js | 175 + server/node_modules/mongodb/lib/index.js.map | 1 + server/node_modules/mongodb/lib/logger.js | 218 + server/node_modules/mongodb/lib/logger.js.map | 1 + .../node_modules/mongodb/lib/mongo_client.js | 305 + .../mongodb/lib/mongo_client.js.map | 1 + .../node_modules/mongodb/lib/mongo_logger.js | 114 + .../mongodb/lib/mongo_logger.js.map | 1 + .../node_modules/mongodb/lib/mongo_types.js | 41 + .../mongodb/lib/mongo_types.js.map | 1 + .../mongodb/lib/operations/add_user.js | 72 + .../mongodb/lib/operations/add_user.js.map | 1 + .../mongodb/lib/operations/aggregate.js | 88 + .../mongodb/lib/operations/aggregate.js.map | 1 + .../mongodb/lib/operations/bulk_write.js | 43 + .../mongodb/lib/operations/bulk_write.js.map | 1 + .../mongodb/lib/operations/collections.js | 29 + .../mongodb/lib/operations/collections.js.map | 1 + .../mongodb/lib/operations/command.js | 82 + .../mongodb/lib/operations/command.js.map | 1 + .../lib/operations/common_functions.js | 71 + .../lib/operations/common_functions.js.map | 1 + .../mongodb/lib/operations/count.js | 39 + .../mongodb/lib/operations/count.js.map | 1 + .../mongodb/lib/operations/count_documents.js | 37 + .../lib/operations/count_documents.js.map | 1 + .../lib/operations/create_collection.js | 100 + .../lib/operations/create_collection.js.map | 1 + .../mongodb/lib/operations/delete.js | 125 + .../mongodb/lib/operations/delete.js.map | 1 + .../mongodb/lib/operations/distinct.js | 67 + .../mongodb/lib/operations/distinct.js.map | 1 + .../mongodb/lib/operations/drop.js | 84 + .../mongodb/lib/operations/drop.js.map | 1 + .../operations/estimated_document_count.js | 38 + .../estimated_document_count.js.map | 1 + .../mongodb/lib/operations/eval.js | 55 + .../mongodb/lib/operations/eval.js.map | 1 + .../lib/operations/execute_operation.js | 182 + .../lib/operations/execute_operation.js.map | 1 + .../mongodb/lib/operations/find.js | 155 + .../mongodb/lib/operations/find.js.map | 1 + .../mongodb/lib/operations/find_and_modify.js | 152 + .../lib/operations/find_and_modify.js.map | 1 + .../mongodb/lib/operations/get_more.js | 58 + .../mongodb/lib/operations/get_more.js.map | 1 + .../mongodb/lib/operations/indexes.js | 270 + .../mongodb/lib/operations/indexes.js.map | 1 + .../mongodb/lib/operations/insert.js | 99 + .../mongodb/lib/operations/insert.js.map | 1 + .../mongodb/lib/operations/is_capped.js | 30 + .../mongodb/lib/operations/is_capped.js.map | 1 + .../mongodb/lib/operations/kill_cursors.js | 32 + .../lib/operations/kill_cursors.js.map | 1 + .../lib/operations/list_collections.js | 46 + .../lib/operations/list_collections.js.map | 1 + .../mongodb/lib/operations/list_databases.js | 35 + .../lib/operations/list_databases.js.map | 1 + .../mongodb/lib/operations/map_reduce.js | 166 + .../mongodb/lib/operations/map_reduce.js.map | 1 + .../mongodb/lib/operations/operation.js | 74 + .../mongodb/lib/operations/operation.js.map | 1 + .../lib/operations/options_operation.js | 29 + .../lib/operations/options_operation.js.map | 1 + .../mongodb/lib/operations/profiling_level.js | 33 + .../lib/operations/profiling_level.js.map | 1 + .../mongodb/lib/operations/remove_user.js | 21 + .../mongodb/lib/operations/remove_user.js.map | 1 + .../mongodb/lib/operations/rename.js | 46 + .../mongodb/lib/operations/rename.js.map | 1 + .../mongodb/lib/operations/run_command.js | 26 + .../mongodb/lib/operations/run_command.js.map | 1 + .../lib/operations/set_profiling_level.js | 51 + .../lib/operations/set_profiling_level.js.map | 1 + .../mongodb/lib/operations/stats.js | 48 + .../mongodb/lib/operations/stats.js.map | 1 + .../mongodb/lib/operations/update.js | 187 + .../mongodb/lib/operations/update.js.map | 1 + .../lib/operations/validate_collection.js | 41 + .../lib/operations/validate_collection.js.map | 1 + .../mongodb/lib/promise_provider.js | 51 + .../mongodb/lib/promise_provider.js.map | 1 + .../node_modules/mongodb/lib/read_concern.js | 74 + .../mongodb/lib/read_concern.js.map | 1 + .../mongodb/lib/read_preference.js | 204 + .../mongodb/lib/read_preference.js.map | 1 + .../node_modules/mongodb/lib/sdam/common.js | 56 + .../mongodb/lib/sdam/common.js.map | 1 + .../node_modules/mongodb/lib/sdam/events.js | 125 + .../mongodb/lib/sdam/events.js.map | 1 + .../node_modules/mongodb/lib/sdam/monitor.js | 424 + .../mongodb/lib/sdam/monitor.js.map | 1 + .../node_modules/mongodb/lib/sdam/server.js | 374 + .../mongodb/lib/sdam/server.js.map | 1 + .../mongodb/lib/sdam/server_description.js | 190 + .../lib/sdam/server_description.js.map | 1 + .../mongodb/lib/sdam/server_selection.js | 228 + .../mongodb/lib/sdam/server_selection.js.map | 1 + .../mongodb/lib/sdam/srv_polling.js | 128 + .../mongodb/lib/sdam/srv_polling.js.map | 1 + .../node_modules/mongodb/lib/sdam/topology.js | 650 ++ .../mongodb/lib/sdam/topology.js.map | 1 + .../mongodb/lib/sdam/topology_description.js | 362 + .../lib/sdam/topology_description.js.map | 1 + server/node_modules/mongodb/lib/sessions.js | 737 ++ .../node_modules/mongodb/lib/sessions.js.map | 1 + server/node_modules/mongodb/lib/sort.js | 97 + server/node_modules/mongodb/lib/sort.js.map | 1 + .../node_modules/mongodb/lib/transactions.js | 138 + .../mongodb/lib/transactions.js.map | 1 + server/node_modules/mongodb/lib/utils.js | 1118 +++ server/node_modules/mongodb/lib/utils.js.map | 1 + .../node_modules/mongodb/lib/write_concern.js | 71 + .../mongodb/lib/write_concern.js.map | 1 + server/node_modules/mongodb/mongodb.d.ts | 6961 +++++++++++++++ server/node_modules/mongodb/package.json | 138 + server/node_modules/mongodb/src/admin.ts | 325 + server/node_modules/mongodb/src/bson.ts | 135 + .../node_modules/mongodb/src/bulk/common.ts | 1397 +++ .../node_modules/mongodb/src/bulk/ordered.ts | 83 + .../mongodb/src/bulk/unordered.ts | 110 + .../node_modules/mongodb/src/change_stream.ts | 980 +++ .../mongodb/src/cmap/auth/auth_provider.ts | 60 + .../mongodb/src/cmap/auth/gssapi.ts | 241 + .../src/cmap/auth/mongo_credentials.ts | 190 + .../mongodb/src/cmap/auth/mongocr.ts | 47 + .../mongodb/src/cmap/auth/mongodb_aws.ts | 332 + .../mongodb/src/cmap/auth/plain.ts | 25 + .../mongodb/src/cmap/auth/providers.ts | 21 + .../mongodb/src/cmap/auth/scram.ts | 384 + .../mongodb/src/cmap/auth/x509.ts | 53 + .../src/cmap/command_monitoring_events.ts | 301 + .../node_modules/mongodb/src/cmap/commands.ts | 702 ++ .../node_modules/mongodb/src/cmap/connect.ts | 523 ++ .../mongodb/src/cmap/connection.ts | 741 ++ .../mongodb/src/cmap/connection_pool.ts | 847 ++ .../src/cmap/connection_pool_events.ts | 201 + .../node_modules/mongodb/src/cmap/errors.ts | 75 + .../mongodb/src/cmap/message_stream.ts | 229 + .../node_modules/mongodb/src/cmap/metrics.ts | 58 + .../mongodb/src/cmap/stream_description.ts | 76 + .../src/cmap/wire_protocol/compression.ts | 130 + .../src/cmap/wire_protocol/constants.ts | 11 + .../mongodb/src/cmap/wire_protocol/shared.ts | 76 + server/node_modules/mongodb/src/collection.ts | 1760 ++++ .../mongodb/src/connection_string.ts | 1307 +++ server/node_modules/mongodb/src/constants.ts | 136 + .../mongodb/src/cursor/abstract_cursor.ts | 971 +++ .../mongodb/src/cursor/aggregation_cursor.ts | 219 + .../src/cursor/change_stream_cursor.ts | 194 + .../mongodb/src/cursor/find_cursor.ts | 481 ++ .../src/cursor/list_collections_cursor.ts | 52 + .../mongodb/src/cursor/list_indexes_cursor.ts | 41 + server/node_modules/mongodb/src/db.ts | 801 ++ server/node_modules/mongodb/src/deps.ts | 400 + server/node_modules/mongodb/src/encrypter.ts | 133 + server/node_modules/mongodb/src/error.ts | 932 ++ server/node_modules/mongodb/src/explain.ts | 52 + .../mongodb/src/gridfs/download.ts | 462 + .../node_modules/mongodb/src/gridfs/index.ts | 233 + .../node_modules/mongodb/src/gridfs/upload.ts | 567 ++ server/node_modules/mongodb/src/index.ts | 490 ++ server/node_modules/mongodb/src/logger.ts | 266 + .../node_modules/mongodb/src/mongo_client.ts | 813 ++ .../node_modules/mongodb/src/mongo_logger.ts | 201 + .../node_modules/mongodb/src/mongo_types.ts | 557 ++ .../mongodb/src/operations/add_user.ts | 118 + .../mongodb/src/operations/aggregate.ts | 142 + .../mongodb/src/operations/bulk_write.ts | 67 + .../mongodb/src/operations/collections.ts | 48 + .../mongodb/src/operations/command.ts | 169 + .../src/operations/common_functions.ts | 102 + .../mongodb/src/operations/count.ts | 68 + .../mongodb/src/operations/count_documents.ts | 57 + .../src/operations/create_collection.ts | 200 + .../mongodb/src/operations/delete.ts | 181 + .../mongodb/src/operations/distinct.ts | 90 + .../mongodb/src/operations/drop.ts | 120 + .../operations/estimated_document_count.ts | 62 + .../mongodb/src/operations/eval.ts | 82 + .../src/operations/execute_operation.ts | 287 + .../mongodb/src/operations/find.ts | 263 + .../mongodb/src/operations/find_and_modify.ts | 286 + .../mongodb/src/operations/get_more.ts | 106 + .../mongodb/src/operations/indexes.ts | 509 ++ .../mongodb/src/operations/insert.ts | 158 + .../mongodb/src/operations/is_capped.ts | 42 + .../mongodb/src/operations/kill_cursors.ts | 53 + .../src/operations/list_collections.ts | 91 + .../mongodb/src/operations/list_databases.ts | 65 + .../mongodb/src/operations/map_reduce.ts | 250 + .../mongodb/src/operations/operation.ts | 139 + .../src/operations/options_operation.ts | 42 + .../mongodb/src/operations/profiling_level.ts | 39 + .../mongodb/src/operations/remove_user.ts | 33 + .../mongodb/src/operations/rename.ts | 67 + .../mongodb/src/operations/run_command.ts | 36 + .../src/operations/set_profiling_level.ts | 74 + .../mongodb/src/operations/stats.ts | 271 + .../mongodb/src/operations/update.ts | 306 + .../src/operations/validate_collection.ts | 59 + .../mongodb/src/promise_provider.ts | 56 + .../node_modules/mongodb/src/read_concern.ts | 88 + .../mongodb/src/read_preference.ts | 271 + .../node_modules/mongodb/src/sdam/common.ts | 79 + .../node_modules/mongodb/src/sdam/events.ts | 182 + .../node_modules/mongodb/src/sdam/monitor.ts | 594 ++ .../node_modules/mongodb/src/sdam/server.ts | 565 ++ .../mongodb/src/sdam/server_description.ts | 262 + .../mongodb/src/sdam/server_selection.ts | 324 + .../mongodb/src/sdam/srv_polling.ts | 171 + .../node_modules/mongodb/src/sdam/topology.ts | 1036 +++ .../mongodb/src/sdam/topology_description.ts | 511 ++ server/node_modules/mongodb/src/sessions.ts | 1070 +++ server/node_modules/mongodb/src/sort.ts | 132 + .../node_modules/mongodb/src/transactions.ts | 188 + server/node_modules/mongodb/src/utils.ts | 1436 ++++ .../node_modules/mongodb/src/write_concern.ts | 114 + server/node_modules/mongodb/tsconfig.json | 40 + server/node_modules/mongoose/.eslintrc.json | 194 + server/node_modules/mongoose/.mocharc.yml | 4 + server/node_modules/mongoose/LICENSE.md | 22 + server/node_modules/mongoose/README.md | 387 + server/node_modules/mongoose/SECURITY.md | 1 + server/node_modules/mongoose/browser.js | 8 + .../node_modules/mongoose/dist/browser.umd.js | 2 + server/node_modules/mongoose/index.js | 63 + server/node_modules/mongoose/lgtm.yml | 12 + server/node_modules/mongoose/lib/aggregate.js | 1165 +++ server/node_modules/mongoose/lib/browser.js | 158 + .../mongoose/lib/browserDocument.js | 101 + server/node_modules/mongoose/lib/cast.js | 411 + .../node_modules/mongoose/lib/cast/boolean.js | 32 + server/node_modules/mongoose/lib/cast/date.js | 41 + .../mongoose/lib/cast/decimal128.js | 36 + .../node_modules/mongoose/lib/cast/number.js | 42 + .../mongoose/lib/cast/objectid.js | 29 + .../node_modules/mongoose/lib/cast/string.js | 37 + .../node_modules/mongoose/lib/collection.js | 311 + .../node_modules/mongoose/lib/connection.js | 1564 ++++ .../mongoose/lib/connectionstate.js | 26 + .../mongoose/lib/cursor/AggregationCursor.js | 380 + .../mongoose/lib/cursor/ChangeStream.js | 151 + .../mongoose/lib/cursor/QueryCursor.js | 537 ++ server/node_modules/mongoose/lib/document.js | 4693 ++++++++++ .../mongoose/lib/document_provider.js | 30 + server/node_modules/mongoose/lib/driver.js | 15 + .../node_modules/mongoose/lib/drivers/SPEC.md | 4 + .../lib/drivers/browser/ReadPreference.js | 7 + .../mongoose/lib/drivers/browser/binary.js | 14 + .../lib/drivers/browser/decimal128.js | 7 + .../mongoose/lib/drivers/browser/index.js | 16 + .../mongoose/lib/drivers/browser/objectid.js | 29 + .../node-mongodb-native/ReadPreference.js | 47 + .../lib/drivers/node-mongodb-native/binary.js | 10 + .../drivers/node-mongodb-native/collection.js | 441 + .../drivers/node-mongodb-native/connection.js | 166 + .../drivers/node-mongodb-native/decimal128.js | 7 + .../lib/drivers/node-mongodb-native/index.js | 12 + .../drivers/node-mongodb-native/objectid.js | 16 + .../lib/error/browserMissingSchema.js | 28 + .../node_modules/mongoose/lib/error/cast.js | 158 + .../mongoose/lib/error/disconnected.js | 33 + .../mongoose/lib/error/divergentArray.js | 38 + .../mongoose/lib/error/eachAsyncMultiError.js | 41 + .../node_modules/mongoose/lib/error/index.js | 217 + .../mongoose/lib/error/messages.js | 47 + .../mongoose/lib/error/missingSchema.js | 31 + .../mongoose/lib/error/mongooseError.js | 13 + .../mongoose/lib/error/notFound.js | 45 + .../mongoose/lib/error/objectExpected.js | 30 + .../mongoose/lib/error/objectParameter.js | 30 + .../mongoose/lib/error/overwriteModel.js | 30 + .../mongoose/lib/error/parallelSave.js | 30 + .../mongoose/lib/error/parallelValidate.js | 31 + .../mongoose/lib/error/serverSelection.js | 61 + .../mongoose/lib/error/setOptionError.js | 101 + .../node_modules/mongoose/lib/error/strict.js | 33 + .../mongoose/lib/error/strictPopulate.js | 29 + .../mongoose/lib/error/syncIndexes.js | 30 + .../mongoose/lib/error/validation.js | 103 + .../mongoose/lib/error/validator.js | 99 + .../mongoose/lib/error/version.js | 36 + .../aggregate/prepareDiscriminatorPipeline.js | 39 + .../aggregate/stringifyFunctionOperators.js | 50 + .../mongoose/lib/helpers/arrayDepth.js | 33 + .../mongoose/lib/helpers/clone.js | 177 + .../mongoose/lib/helpers/common.js | 127 + .../mongoose/lib/helpers/cursor/eachAsync.js | 222 + .../areDiscriminatorValuesEqual.js | 16 + ...checkEmbeddedDiscriminatorKeyProjection.js | 12 + .../helpers/discriminator/getConstructor.js | 26 + .../discriminator/getDiscriminatorByValue.js | 28 + .../getSchemaDiscriminatorByValue.js | 27 + .../discriminator/mergeDiscriminatorSchema.js | 63 + .../lib/helpers/document/applyDefaults.js | 115 + .../helpers/document/cleanModifiedSubpaths.js | 35 + .../mongoose/lib/helpers/document/compile.js | 227 + .../document/getEmbeddedDiscriminatorPath.js | 50 + .../lib/helpers/document/handleSpreadDoc.js | 35 + .../node_modules/mongoose/lib/helpers/each.js | 25 + .../lib/helpers/error/combinePathErrors.js | 22 + .../mongoose/lib/helpers/firstKey.js | 8 + .../node_modules/mongoose/lib/helpers/get.js | 65 + .../lib/helpers/getConstructorName.js | 16 + .../lib/helpers/getDefaultBulkwriteResult.js | 27 + .../mongoose/lib/helpers/getFunctionName.js | 10 + .../mongoose/lib/helpers/immediate.js | 16 + .../helpers/indexes/applySchemaCollation.js | 13 + .../decorateDiscriminatorIndexOptions.js | 14 + .../lib/helpers/indexes/getRelatedIndexes.js | 59 + .../lib/helpers/indexes/isDefaultIdIndex.js | 18 + .../lib/helpers/indexes/isIndexEqual.js | 96 + .../lib/helpers/indexes/isTextIndex.js | 16 + .../mongoose/lib/helpers/isAsyncFunction.js | 9 + .../mongoose/lib/helpers/isBsonType.js | 16 + .../mongoose/lib/helpers/isMongooseObject.js | 22 + .../mongoose/lib/helpers/isObject.js | 16 + .../mongoose/lib/helpers/isPromise.js | 6 + .../mongoose/lib/helpers/isSimpleValidator.js | 22 + .../lib/helpers/model/applyDefaultsToPOJO.js | 52 + .../mongoose/lib/helpers/model/applyHooks.js | 149 + .../lib/helpers/model/applyMethods.js | 70 + .../lib/helpers/model/applyStaticHooks.js | 71 + .../lib/helpers/model/applyStatics.js | 13 + .../lib/helpers/model/castBulkWrite.js | 240 + .../lib/helpers/model/discriminator.js | 218 + .../lib/helpers/model/pushNestedArrayPaths.js | 15 + .../node_modules/mongoose/lib/helpers/once.js | 12 + .../mongoose/lib/helpers/parallelLimit.js | 55 + .../path/flattenObjectWithDottedPaths.js | 39 + .../mongoose/lib/helpers/path/parentPaths.js | 18 + .../lib/helpers/path/setDottedPath.js | 33 + .../mongoose/lib/helpers/pluralize.js | 94 + .../lib/helpers/populate/SkipPopulateValue.js | 10 + .../populate/assignRawDocsToIdStructure.js | 124 + .../lib/helpers/populate/assignVals.js | 341 + .../populate/createPopulateQueryFilter.js | 97 + .../populate/getModelsMapForPopulate.js | 732 ++ .../lib/helpers/populate/getSchemaTypes.js | 233 + .../lib/helpers/populate/getVirtual.js | 72 + .../lib/helpers/populate/leanPopulateMap.js | 7 + .../lib/helpers/populate/lookupLocalFields.js | 40 + .../populate/markArraySubdocsPopulated.js | 47 + .../helpers/populate/modelNamesFromRefPath.js | 68 + .../populate/removeDeselectedForeignField.js | 31 + .../lib/helpers/populate/validateRef.js | 19 + .../mongoose/lib/helpers/printJestWarning.js | 17 + .../lib/helpers/printStrictQueryWarning.js | 11 + .../lib/helpers/processConnectionOptions.js | 64 + .../lib/helpers/projection/applyProjection.js | 77 + .../helpers/projection/hasIncludedChildren.js | 40 + .../projection/isDefiningProjection.js | 18 + .../lib/helpers/projection/isExclusive.js | 35 + .../lib/helpers/projection/isInclusive.js | 38 + .../lib/helpers/projection/isPathExcluded.js | 40 + .../projection/isPathSelectedInclusive.js | 28 + .../lib/helpers/projection/isSubpath.js | 14 + .../lib/helpers/projection/parseProjection.js | 33 + .../mongoose/lib/helpers/promiseOrCallback.js | 55 + .../lib/helpers/query/applyGlobalOption.js | 29 + .../lib/helpers/query/applyQueryMiddleware.js | 79 + .../mongoose/lib/helpers/query/cast$expr.js | 282 + .../lib/helpers/query/castFilterPath.js | 54 + .../mongoose/lib/helpers/query/castUpdate.js | 571 ++ .../lib/helpers/query/completeMany.js | 52 + .../query/getEmbeddedDiscriminatorPath.js | 90 + .../lib/helpers/query/handleImmutable.js | 28 + .../lib/helpers/query/hasDollarKeys.js | 23 + .../mongoose/lib/helpers/query/isOperator.js | 14 + .../lib/helpers/query/sanitizeFilter.js | 38 + .../lib/helpers/query/sanitizeProjection.js | 14 + .../helpers/query/selectPopulatedFields.js | 49 + .../mongoose/lib/helpers/query/trusted.js | 13 + .../mongoose/lib/helpers/query/validOps.js | 24 + .../mongoose/lib/helpers/query/wrapThunk.js | 31 + .../mongoose/lib/helpers/schema/addAutoId.js | 7 + .../lib/helpers/schema/applyBuiltinPlugins.js | 12 + .../lib/helpers/schema/applyPlugins.js | 55 + .../lib/helpers/schema/applyWriteConcern.js | 30 + .../schema/cleanPositionalOperators.js | 12 + .../mongoose/lib/helpers/schema/getIndexes.js | 164 + .../helpers/schema/getKeysInSchemaOrder.js | 28 + .../mongoose/lib/helpers/schema/getPath.js | 38 + .../lib/helpers/schema/handleIdOption.js | 20 + .../helpers/schema/handleTimestampOption.js | 24 + .../mongoose/lib/helpers/schema/idGetter.js | 32 + .../mongoose/lib/helpers/schema/merge.js | 28 + .../lib/helpers/schematype/handleImmutable.js | 50 + .../lib/helpers/setDefaultsOnInsert.js | 132 + .../mongoose/lib/helpers/specialProperties.js | 3 + .../mongoose/lib/helpers/symbols.js | 20 + .../mongoose/lib/helpers/timers.js | 3 + .../timestamps/setDocumentTimestamps.js | 26 + .../lib/helpers/timestamps/setupTimestamps.js | 101 + .../lib/helpers/topology/allServersUnknown.js | 12 + .../mongoose/lib/helpers/topology/isAtlas.js | 31 + .../lib/helpers/topology/isSSLError.js | 16 + .../update/applyTimestampsToChildren.js | 193 + .../helpers/update/applyTimestampsToUpdate.js | 117 + .../lib/helpers/update/castArrayFilters.js | 109 + .../lib/helpers/update/modifiedPaths.js | 33 + .../helpers/update/moveImmutableProperties.js | 53 + .../update/removeUnusedArrayFilters.js | 32 + .../update/updatedPathsByArrayFilter.js | 27 + .../mongoose/lib/helpers/updateValidators.js | 249 + server/node_modules/mongoose/lib/index.js | 1310 +++ server/node_modules/mongoose/lib/internal.js | 46 + server/node_modules/mongoose/lib/model.js | 5327 ++++++++++++ server/node_modules/mongoose/lib/options.js | 15 + .../mongoose/lib/options/PopulateOptions.js | 36 + .../lib/options/SchemaArrayOptions.js | 78 + .../lib/options/SchemaBufferOptions.js | 38 + .../mongoose/lib/options/SchemaDateOptions.js | 71 + .../lib/options/SchemaDocumentArrayOptions.js | 68 + .../mongoose/lib/options/SchemaMapOptions.js | 43 + .../lib/options/SchemaNumberOptions.js | 101 + .../lib/options/SchemaObjectIdOptions.js | 64 + .../lib/options/SchemaStringOptions.js | 138 + .../lib/options/SchemaSubdocumentOptions.js | 42 + .../mongoose/lib/options/SchemaTypeOptions.js | 244 + .../mongoose/lib/options/VirtualOptions.js | 164 + .../mongoose/lib/options/propertyOptions.js | 8 + .../mongoose/lib/options/removeOptions.js | 14 + .../mongoose/lib/options/saveOptions.js | 14 + .../mongoose/lib/plugins/index.js | 7 + .../mongoose/lib/plugins/removeSubdocs.js | 31 + .../mongoose/lib/plugins/saveSubdocs.js | 66 + .../mongoose/lib/plugins/sharding.js | 83 + .../mongoose/lib/plugins/trackTransaction.js | 92 + .../lib/plugins/validateBeforeSave.js | 45 + .../mongoose/lib/promise_provider.js | 49 + server/node_modules/mongoose/lib/query.js | 5974 +++++++++++++ .../node_modules/mongoose/lib/queryhelpers.js | 353 + server/node_modules/mongoose/lib/schema.js | 2593 ++++++ .../mongoose/lib/schema/SubdocumentPath.js | 367 + .../node_modules/mongoose/lib/schema/array.js | 663 ++ .../mongoose/lib/schema/boolean.js | 267 + .../mongoose/lib/schema/buffer.js | 269 + .../node_modules/mongoose/lib/schema/date.js | 404 + .../mongoose/lib/schema/decimal128.js | 210 + .../mongoose/lib/schema/documentarray.js | 617 ++ .../node_modules/mongoose/lib/schema/index.js | 39 + .../node_modules/mongoose/lib/schema/map.js | 84 + .../node_modules/mongoose/lib/schema/mixed.js | 132 + .../mongoose/lib/schema/number.js | 438 + .../mongoose/lib/schema/objectid.js | 295 + .../mongoose/lib/schema/operators/bitwise.js | 38 + .../mongoose/lib/schema/operators/exists.js | 12 + .../lib/schema/operators/geospatial.js | 107 + .../mongoose/lib/schema/operators/helpers.js | 32 + .../mongoose/lib/schema/operators/text.js | 39 + .../mongoose/lib/schema/operators/type.js | 20 + .../mongoose/lib/schema/string.js | 694 ++ .../mongoose/lib/schema/symbols.js | 5 + .../node_modules/mongoose/lib/schema/uuid.js | 329 + .../node_modules/mongoose/lib/schematype.js | 1724 ++++ .../node_modules/mongoose/lib/statemachine.js | 207 + .../mongoose/lib/types/ArraySubdocument.js | 189 + .../mongoose/lib/types/DocumentArray/index.js | 113 + .../DocumentArray/isMongooseDocumentArray.js | 5 + .../lib/types/DocumentArray/methods/index.js | 383 + .../mongoose/lib/types/array/index.js | 116 + .../lib/types/array/isMongooseArray.js | 5 + .../mongoose/lib/types/array/methods/index.js | 1015 +++ .../node_modules/mongoose/lib/types/buffer.js | 277 + .../mongoose/lib/types/decimal128.js | 13 + .../node_modules/mongoose/lib/types/index.js | 20 + server/node_modules/mongoose/lib/types/map.js | 340 + .../mongoose/lib/types/objectid.js | 41 + .../mongoose/lib/types/subdocument.js | 432 + server/node_modules/mongoose/lib/utils.js | 1009 +++ .../node_modules/mongoose/lib/validoptions.js | 36 + .../node_modules/mongoose/lib/virtualtype.js | 175 + .../mongoose/node_modules/ms/index.js | 162 + .../mongoose/node_modules/ms/license.md | 21 + .../mongoose/node_modules/ms/package.json | 38 + .../mongoose/node_modules/ms/readme.md | 59 + server/node_modules/mongoose/package.json | 148 + .../mongoose/scripts/build-browser.js | 18 + .../mongoose/scripts/create-tarball.js | 7 + .../mongoose/scripts/tsc-diagnostics-check.js | 15 + server/node_modules/mongoose/tools/auth.js | 31 + server/node_modules/mongoose/tools/repl.js | 35 + server/node_modules/mongoose/tools/sharded.js | 46 + server/node_modules/mongoose/tsconfig.json | 9 + .../mongoose/types/aggregate.d.ts | 237 + .../node_modules/mongoose/types/callback.d.ts | 8 + .../mongoose/types/collection.d.ts | 44 + .../mongoose/types/connection.d.ts | 242 + .../node_modules/mongoose/types/cursor.d.ts | 62 + .../node_modules/mongoose/types/document.d.ts | 266 + server/node_modules/mongoose/types/error.d.ts | 133 + .../mongoose/types/expressions.d.ts | 2935 +++++++ .../node_modules/mongoose/types/helpers.d.ts | 32 + server/node_modules/mongoose/types/index.d.ts | 624 ++ .../node_modules/mongoose/types/indexes.d.ts | 98 + .../mongoose/types/inferschematype.d.ts | 228 + .../mongoose/types/middlewares.d.ts | 32 + .../node_modules/mongoose/types/models.d.ts | 459 + .../mongoose/types/mongooseoptions.d.ts | 199 + .../mongoose/types/pipelinestage.d.ts | 293 + .../node_modules/mongoose/types/populate.d.ts | 45 + server/node_modules/mongoose/types/query.d.ts | 659 ++ .../mongoose/types/schemaoptions.d.ts | 231 + .../mongoose/types/schematypes.d.ts | 478 ++ .../node_modules/mongoose/types/session.d.ts | 36 + server/node_modules/mongoose/types/types.d.ts | 104 + .../node_modules/mongoose/types/utility.d.ts | 43 + .../mongoose/types/validation.d.ts | 33 + .../node_modules/mongoose/types/virtuals.d.ts | 14 + server/node_modules/mpath/.travis.yml | 9 + server/node_modules/mpath/History.md | 88 + server/node_modules/mpath/LICENSE | 22 + server/node_modules/mpath/README.md | 278 + server/node_modules/mpath/SECURITY.md | 5 + server/node_modules/mpath/index.js | 3 + server/node_modules/mpath/lib/index.js | 336 + .../node_modules/mpath/lib/stringToParts.js | 48 + server/node_modules/mpath/package.json | 144 + server/node_modules/mpath/test/.eslintrc.yml | 4 + server/node_modules/mpath/test/index.js | 1879 ++++ .../node_modules/mpath/test/stringToParts.js | 30 + server/node_modules/mquery/.eslintignore | 1 + server/node_modules/mquery/.eslintrc.json | 123 + server/node_modules/mquery/.travis.yml | 15 + server/node_modules/mquery/History.md | 376 + server/node_modules/mquery/LICENSE | 22 + server/node_modules/mquery/Makefile | 26 + server/node_modules/mquery/README.md | 1373 +++ server/node_modules/mquery/SECURITY.md | 1 + .../mquery/lib/collection/collection.js | 47 + .../mquery/lib/collection/index.js | 13 + .../mquery/lib/collection/node.js | 132 + server/node_modules/mquery/lib/env.js | 22 + server/node_modules/mquery/lib/mquery.js | 3198 +++++++ server/node_modules/mquery/lib/permissions.js | 84 + server/node_modules/mquery/lib/utils.js | 335 + .../mquery/node_modules/debug/LICENSE | 20 + .../mquery/node_modules/debug/README.md | 481 ++ .../mquery/node_modules/debug/package.json | 59 + .../mquery/node_modules/debug/src/browser.js | 269 + .../mquery/node_modules/debug/src/common.js | 274 + .../mquery/node_modules/debug/src/index.js | 10 + .../mquery/node_modules/debug/src/node.js | 263 + .../mquery/node_modules/ms/index.js | 162 + .../mquery/node_modules/ms/license.md | 21 + .../mquery/node_modules/ms/package.json | 37 + .../mquery/node_modules/ms/readme.md | 60 + server/node_modules/mquery/package.json | 38 + server/node_modules/mquery/test/.eslintrc.yml | 2 + .../mquery/test/collection/browser.js | 0 .../mquery/test/collection/mongo.js | 0 .../mquery/test/collection/node.js | 29 + server/node_modules/mquery/test/env.js | 22 + server/node_modules/mquery/test/index.js | 2925 +++++++ server/node_modules/mquery/test/utils.test.js | 182 + server/node_modules/nodemon/.eslintrc.json | 19 - server/node_modules/nodemon/.jshintrc | 16 - server/node_modules/nodemon/.travis.yml | 17 - server/node_modules/nodemon/README.md | 76 +- server/node_modules/nodemon/bin/nodemon.js | 2 +- .../node_modules/nodemon/bin/postinstall.js | 29 - .../node_modules/nodemon/bin/windows-kill.exe | Bin 0 -> 80384 bytes .../node_modules/nodemon/commitlint.config.js | 3 - .../node_modules/nodemon/lib/monitor/run.js | 145 +- server/node_modules/nodemon/lib/spawn.js | 40 +- server/node_modules/nodemon/package.json | 119 +- server/node_modules/normalize-url/index.d.ts | 216 - server/node_modules/normalize-url/index.js | 221 - server/node_modules/normalize-url/license | 9 - .../node_modules/normalize-url/package.json | 76 - server/node_modules/normalize-url/readme.md | 232 - .../node_modules/object-assign/package.json | 62 +- server/node_modules/once/LICENSE | 15 - server/node_modules/once/README.md | 79 - server/node_modules/once/once.js | 42 - server/node_modules/once/package.json | 67 - server/node_modules/p-cancelable/index.d.ts | 168 - server/node_modules/p-cancelable/index.js | 103 - server/node_modules/p-cancelable/license | 9 - server/node_modules/p-cancelable/package.json | 81 - server/node_modules/p-cancelable/readme.md | 155 - server/node_modules/package-json/index.d.ts | 199 - server/node_modules/package-json/index.js | 115 - server/node_modules/package-json/license | 9 - .../package-json/node_modules/.bin/semver | 15 - .../package-json/node_modules/.bin/semver.cmd | 7 - .../node_modules/semver/CHANGELOG.md | 70 - .../package-json/node_modules/semver/LICENSE | 15 - .../node_modules/semver/README.md | 443 - .../node_modules/semver/bin/semver.js | 174 - .../node_modules/semver/package.json | 60 - .../node_modules/semver/range.bnf | 16 - .../node_modules/semver/semver.js | 1596 ---- server/node_modules/package-json/package.json | 78 - server/node_modules/package-json/readme.md | 118 - server/node_modules/picomatch/CHANGELOG.md | 16 + server/node_modules/picomatch/README.md | 51 +- server/node_modules/picomatch/lib/parse.js | 25 +- .../node_modules/picomatch/lib/picomatch.js | 65 +- server/node_modules/picomatch/lib/scan.js | 10 +- server/node_modules/picomatch/package.json | 78 +- server/node_modules/prepend-http/index.js | 15 - server/node_modules/prepend-http/license | 9 - server/node_modules/prepend-http/package.json | 67 - server/node_modules/prepend-http/readme.md | 56 - server/node_modules/pump/.travis.yml | 5 - server/node_modules/pump/LICENSE | 21 - server/node_modules/pump/README.md | 65 - server/node_modules/pump/index.js | 82 - server/node_modules/pump/package.json | 60 - server/node_modules/pump/test-browser.js | 66 - server/node_modules/pump/test-node.js | 53 - .../{emoji-regex => punycode}/LICENSE-MIT.txt | 0 server/node_modules/punycode/README.md | 126 + server/node_modules/punycode/package.json | 58 + server/node_modules/punycode/punycode.es6.js | 444 + server/node_modules/punycode/punycode.js | 443 + server/node_modules/pupa/index.d.ts | 32 - server/node_modules/pupa/index.js | 39 - server/node_modules/pupa/license | 9 - server/node_modules/pupa/package.json | 79 - server/node_modules/pupa/readme.md | 63 - server/node_modules/rc/LICENSE.APACHE2 | 15 - server/node_modules/rc/LICENSE.BSD | 26 - server/node_modules/rc/LICENSE.MIT | 24 - server/node_modules/rc/README.md | 227 - server/node_modules/rc/browser.js | 7 - server/node_modules/rc/cli.js | 4 - server/node_modules/rc/index.js | 53 - server/node_modules/rc/lib/utils.js | 104 - server/node_modules/rc/package.json | 65 - server/node_modules/rc/test/ini.js | 16 - .../node_modules/rc/test/nested-env-vars.js | 50 - server/node_modules/rc/test/test.js | 59 - server/node_modules/readdirp/index.js | 17 +- server/node_modules/readdirp/package.json | 120 +- .../registry-auth-token/CHANGELOG.md | 134 - .../node_modules/registry-auth-token/LICENSE | 21 - .../registry-auth-token/README.md | 65 - .../registry-auth-token/base64.js | 12 - .../node_modules/registry-auth-token/index.js | 142 - .../registry-auth-token/package.json | 76 - .../registry-auth-token/registry-url.js | 5 - server/node_modules/registry-url/index.d.ts | 33 - server/node_modules/registry-url/index.js | 12 - server/node_modules/registry-url/license | 9 - server/node_modules/registry-url/package.json | 76 - server/node_modules/registry-url/readme.md | 50 - server/node_modules/responselike/LICENSE | 19 - server/node_modules/responselike/README.md | 77 - server/node_modules/responselike/package.json | 69 - server/node_modules/responselike/src/index.js | 34 - server/node_modules/saslprep/.editorconfig | 10 + server/node_modules/saslprep/.gitattributes | 1 + server/node_modules/saslprep/.travis.yml | 10 + server/node_modules/saslprep/CHANGELOG.md | 19 + server/node_modules/saslprep/LICENSE | 22 + server/node_modules/saslprep/code-points.mem | Bin 0 -> 419864 bytes .../saslprep/generate-code-points.js | 51 + server/node_modules/saslprep/index.js | 157 + .../node_modules/saslprep/lib/code-points.js | 996 +++ .../saslprep/lib/memory-code-points.js | 39 + server/node_modules/saslprep/lib/util.js | 21 + server/node_modules/saslprep/package.json | 72 + server/node_modules/saslprep/readme.md | 31 + server/node_modules/saslprep/test/index.js | 76 + server/node_modules/saslprep/test/util.js | 16 + server/node_modules/semver-diff/index.d.ts | 58 - server/node_modules/semver-diff/index.js | 13 - server/node_modules/semver-diff/license | 9 - .../semver-diff/node_modules/.bin/semver | 15 - .../semver-diff/node_modules/.bin/semver.cmd | 7 - .../node_modules/semver/CHANGELOG.md | 70 - .../semver-diff/node_modules/semver/LICENSE | 15 - .../semver-diff/node_modules/semver/README.md | 443 - .../node_modules/semver/bin/semver.js | 174 - .../node_modules/semver/package.json | 60 - .../semver-diff/node_modules/semver/range.bnf | 16 - .../semver-diff/node_modules/semver/semver.js | 1596 ---- server/node_modules/semver-diff/package.json | 69 - server/node_modules/semver-diff/readme.md | 77 - server/node_modules/sift/MIT-LICENSE.txt | 20 + server/node_modules/sift/README.md | 465 + server/node_modules/sift/es/index.js | 626 ++ server/node_modules/sift/es/index.js.map | 1 + server/node_modules/sift/es5m/index.js | 729 ++ server/node_modules/sift/es5m/index.js.map | 1 + server/node_modules/sift/index.d.ts | 4 + server/node_modules/sift/index.js | 4 + server/node_modules/sift/lib/core.d.ts | 120 + server/node_modules/sift/lib/index.d.ts | 6 + server/node_modules/sift/lib/index.js | 766 ++ server/node_modules/sift/lib/index.js.map | 1 + server/node_modules/sift/lib/operations.d.ts | 88 + server/node_modules/sift/lib/utils.d.ts | 9 + server/node_modules/sift/package.json | 62 + server/node_modules/sift/sift.csp.min.js | 763 ++ server/node_modules/sift/sift.csp.min.js.map | 1 + server/node_modules/sift/sift.min.js | 16 + server/node_modules/sift/sift.min.js.map | 1 + server/node_modules/sift/src/core.d.ts | 120 + server/node_modules/sift/src/core.js | 267 + server/node_modules/sift/src/core.js.map | 1 + server/node_modules/sift/src/core.ts | 481 ++ server/node_modules/sift/src/index.d.ts | 6 + server/node_modules/sift/src/index.js | 38 + server/node_modules/sift/src/index.js.map | 1 + server/node_modules/sift/src/index.ts | 54 + server/node_modules/sift/src/operations.d.ts | 88 + server/node_modules/sift/src/operations.js | 297 + .../node_modules/sift/src/operations.js.map | 1 + server/node_modules/sift/src/operations.ts | 411 + server/node_modules/sift/src/utils.d.ts | 9 + server/node_modules/sift/src/utils.js | 70 + server/node_modules/sift/src/utils.js.map | 1 + server/node_modules/sift/src/utils.ts | 68 + server/node_modules/signal-exit/CHANGELOG.md | 35 - server/node_modules/signal-exit/LICENSE.txt | 16 - server/node_modules/signal-exit/README.md | 39 - server/node_modules/signal-exit/index.js | 163 - server/node_modules/signal-exit/package.json | 66 - server/node_modules/signal-exit/signals.js | 53 - .../simple-update-notifier/LICENSE | 21 + .../simple-update-notifier/README.md | 82 + .../simple-update-notifier/build/index.d.ts | 13 + .../simple-update-notifier/build/index.js | 217 + .../node_modules/.bin/semver | 1 + .../node_modules/semver/CHANGELOG.md | 74 + .../node_modules/semver}/LICENSE | 0 .../node_modules/semver/README.md | 499 ++ .../node_modules/semver/bin/semver.js | 173 + .../node_modules/semver/classes/comparator.js | 139 + .../node_modules/semver/classes/index.js | 5 + .../node_modules/semver/classes/range.js | 448 + .../node_modules/semver/classes/semver.js | 290 + .../node_modules/semver/functions/clean.js | 6 + .../node_modules/semver/functions/cmp.js | 48 + .../node_modules/semver/functions/coerce.js | 51 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + .../node_modules/semver/functions/compare.js | 5 + .../node_modules/semver/functions/diff.js | 25 + .../node_modules/semver/functions/eq.js | 3 + .../node_modules/semver/functions/gt.js | 3 + .../node_modules/semver/functions/gte.js | 3 + .../node_modules/semver/functions/inc.js | 15 + .../node_modules/semver/functions/lt.js | 3 + .../node_modules/semver/functions/lte.js | 3 + .../node_modules/semver/functions/major.js | 3 + .../node_modules/semver/functions/minor.js | 3 + .../node_modules/semver/functions/neq.js | 3 + .../node_modules/semver/functions/parse.js | 37 + .../node_modules/semver/functions/patch.js | 3 + .../semver/functions/prerelease.js | 6 + .../node_modules/semver/functions/rcompare.js | 3 + .../node_modules/semver/functions/rsort.js | 3 + .../semver/functions/satisfies.js | 10 + .../node_modules/semver/functions/sort.js | 3 + .../node_modules/semver/functions/valid.js | 6 + .../node_modules/semver/index.js | 64 + .../node_modules/semver/internal/constants.js | 17 + .../node_modules/semver/internal/debug.js | 9 + .../semver/internal/identifiers.js | 23 + .../node_modules/semver/internal/re.js | 179 + .../node_modules/semver/package.json | 34 + .../node_modules/semver/range.bnf | 0 .../node_modules/semver/ranges/gtr.js | 4 + .../node_modules/semver/ranges/intersects.js | 7 + .../node_modules/semver/ranges/ltr.js | 4 + .../semver/ranges/max-satisfying.js | 25 + .../semver/ranges/min-satisfying.js | 24 + .../node_modules/semver/ranges/min-version.js | 57 + .../node_modules/semver/ranges/outside.js | 80 + .../semver/ranges/to-comparators.js | 8 + .../node_modules/semver/ranges/valid.js | 11 + .../simple-update-notifier/package.json | 97 + .../src/borderedText.ts | 12 + .../simple-update-notifier/src/cache.spec.ts | 17 + .../simple-update-notifier/src/cache.ts | 44 + .../src/getDistVersion.spec.ts | 35 + .../src/getDistVersion.ts | 29 + .../src/hasNewVersion.spec.ts | 82 + .../src/hasNewVersion.ts | 40 + .../simple-update-notifier/src/index.spec.ts | 27 + .../simple-update-notifier/src/index.ts | 34 + .../simple-update-notifier/src/isNpmOrYarn.ts | 12 + .../simple-update-notifier/src/types.ts | 8 + .../smart-buffer/.prettierrc.yaml | 5 + server/node_modules/smart-buffer/.travis.yml | 13 + server/node_modules/smart-buffer/LICENSE | 20 + server/node_modules/smart-buffer/README.md | 633 ++ .../smart-buffer/build/smartbuffer.js | 1233 +++ .../smart-buffer/build/smartbuffer.js.map | 1 + .../node_modules/smart-buffer/build/utils.js | 108 + .../smart-buffer/build/utils.js.map | 1 + .../smart-buffer/docs/CHANGELOG.md | 70 + .../smart-buffer/docs/README_v3.md | 367 + .../node_modules/smart-buffer/docs/ROADMAP.md | 0 server/node_modules/smart-buffer/package.json | 79 + .../smart-buffer/typings/smartbuffer.d.ts | 755 ++ .../smart-buffer/typings/utils.d.ts | 66 + server/node_modules/socks/.eslintrc.cjs | 11 + server/node_modules/socks/.prettierrc.yaml | 7 + server/node_modules/socks/LICENSE | 20 + server/node_modules/socks/README.md | 686 ++ .../socks/build/client/socksclient.js | 793 ++ .../socks/build/client/socksclient.js.map | 1 + .../socks/build/common/constants.js | 114 + .../socks/build/common/constants.js.map | 1 + .../socks/build/common/helpers.js | 128 + .../socks/build/common/helpers.js.map | 1 + .../socks/build/common/receivebuffer.js | 43 + .../socks/build/common/receivebuffer.js.map | 1 + .../node_modules/socks/build/common/util.js | 25 + .../socks/build/common/util.js.map | 1 + server/node_modules/socks/build/index.js | 18 + server/node_modules/socks/build/index.js.map | 1 + .../node_modules/socks/docs/examples/index.md | 17 + .../examples/javascript/associateExample.md | 90 + .../docs/examples/javascript/bindExample.md | 83 + .../examples/javascript/connectExample.md | 258 + .../examples/typescript/associateExample.md | 93 + .../docs/examples/typescript/bindExample.md | 86 + .../examples/typescript/connectExample.md | 265 + server/node_modules/socks/docs/index.md | 5 + .../socks/docs/migratingFromV1.md | 86 + server/node_modules/socks/package.json | 58 + .../socks/typings/client/socksclient.d.ts | 162 + .../socks/typings/common/constants.d.ts | 152 + .../socks/typings/common/helpers.d.ts | 13 + .../socks/typings/common/receivebuffer.d.ts | 12 + .../socks/typings/common/util.d.ts | 17 + server/node_modules/socks/typings/index.d.ts | 1 + .../node_modules/sparse-bitfield/.npmignore | 1 + .../node_modules/sparse-bitfield/.travis.yml | 6 + server/node_modules/sparse-bitfield/LICENSE | 21 + server/node_modules/sparse-bitfield/README.md | 62 + server/node_modules/sparse-bitfield/index.js | 95 + .../node_modules/sparse-bitfield/package.json | 27 + server/node_modules/sparse-bitfield/test.js | 79 + server/node_modules/string-width/index.d.ts | 29 - server/node_modules/string-width/index.js | 47 - server/node_modules/string-width/license | 9 - .../node_modules/ansi-regex/index.d.ts | 37 - .../node_modules/ansi-regex/index.js | 10 - .../node_modules/ansi-regex/license | 9 - .../node_modules/ansi-regex/package.json | 87 - .../node_modules/ansi-regex/readme.md | 78 - .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 - .../node_modules/emoji-regex/README.md | 73 - .../node_modules/emoji-regex/es2015/index.js | 6 - .../node_modules/emoji-regex/es2015/text.js | 6 - .../node_modules/emoji-regex/index.d.ts | 23 - .../node_modules/emoji-regex/index.js | 6 - .../node_modules/emoji-regex/package.json | 77 - .../node_modules/emoji-regex/text.js | 6 - .../is-fullwidth-code-point/index.d.ts | 17 - .../is-fullwidth-code-point/index.js | 50 - .../is-fullwidth-code-point/license | 9 - .../is-fullwidth-code-point/package.json | 74 - .../is-fullwidth-code-point/readme.md | 39 - .../node_modules/strip-ansi/index.d.ts | 17 - .../node_modules/strip-ansi/index.js | 4 - .../node_modules/strip-ansi/license | 9 - .../node_modules/strip-ansi/package.json | 86 - .../node_modules/strip-ansi/readme.md | 46 - server/node_modules/string-width/package.json | 89 - server/node_modules/string-width/readme.md | 50 - server/node_modules/strip-ansi/index.d.ts | 15 - server/node_modules/strip-ansi/index.js | 7 - server/node_modules/strip-ansi/license | 9 - server/node_modules/strip-ansi/package.json | 86 - server/node_modules/strip-ansi/readme.md | 61 - .../node_modules/strip-json-comments/index.js | 70 - .../node_modules/strip-json-comments/license | 21 - .../strip-json-comments/package.json | 74 - .../strip-json-comments/readme.md | 64 - .../node_modules/strnum/.vscode/launch.json | 25 + server/node_modules/strnum/LICENSE | 21 + server/node_modules/strnum/README.md | 86 + server/node_modules/strnum/package.json | 24 + server/node_modules/strnum/strnum.js | 124 + server/node_modules/strnum/strnum.test.js | 150 + server/node_modules/term-size/index.d.ts | 21 - server/node_modules/term-size/index.js | 72 - server/node_modules/term-size/license | 9 - server/node_modules/term-size/package.json | 75 - server/node_modules/term-size/readme.md | 48 - .../node_modules/term-size/vendor/.DS_Store | Bin 8196 -> 0 bytes .../term-size/vendor/macos/.DS_Store | Bin 6148 -> 0 bytes .../term-size/vendor/macos/term-size | Bin 27264 -> 0 bytes .../term-size/vendor/windows/term-size.exe | Bin 17408 -> 0 bytes .../node_modules/to-readable-stream/index.js | 11 - .../node_modules/to-readable-stream/license | 9 - .../to-readable-stream/package.json | 72 - .../node_modules/to-readable-stream/readme.md | 42 - server/node_modules/tr46/LICENSE.md | 21 + server/node_modules/tr46/README.md | 78 + server/node_modules/tr46/index.js | 298 + .../node_modules/tr46/lib/mappingTable.json | 1 + server/node_modules/tr46/lib/regexes.js | 29 + server/node_modules/tr46/lib/statusMapping.js | 11 + server/node_modules/tr46/package.json | 47 + server/node_modules/tslib/CopyrightNotice.txt | 15 + server/node_modules/tslib/LICENSE.txt | 12 + server/node_modules/tslib/README.md | 164 + server/node_modules/tslib/SECURITY.md | 41 + server/node_modules/tslib/modules/index.js | 63 + .../node_modules/tslib/modules/package.json | 3 + server/node_modules/tslib/package.json | 38 + server/node_modules/tslib/tslib.d.ts | 430 + server/node_modules/tslib/tslib.es6.html | 1 + server/node_modules/tslib/tslib.es6.js | 293 + server/node_modules/tslib/tslib.html | 1 + server/node_modules/tslib/tslib.js | 370 + server/node_modules/type-fest/index.d.ts | 20 - server/node_modules/type-fest/license | 9 - server/node_modules/type-fest/package.json | 83 - server/node_modules/type-fest/readme.md | 635 -- .../node_modules/type-fest/source/basic.d.ts | 67 - .../node_modules/type-fest/source/except.d.ts | 22 - .../type-fest/source/literal-union.d.ts | 33 - .../type-fest/source/merge-exclusive.d.ts | 39 - .../node_modules/type-fest/source/merge.d.ts | 22 - .../type-fest/source/mutable.d.ts | 22 - .../node_modules/type-fest/source/opaque.d.ts | 40 - .../type-fest/source/package-json.d.ts | 501 -- .../type-fest/source/partial-deep.d.ts | 72 - .../type-fest/source/promisable.d.ts | 23 - .../type-fest/source/readonly-deep.d.ts | 59 - .../source/require-at-least-one.d.ts | 32 - .../type-fest/source/require-exactly-one.d.ts | 36 - .../type-fest/source/set-optional.d.ts | 32 - .../type-fest/source/set-required.d.ts | 32 - .../typedarray-to-buffer/.airtap.yml | 15 - .../typedarray-to-buffer/.travis.yml | 11 - .../node_modules/typedarray-to-buffer/LICENSE | 21 - .../typedarray-to-buffer/README.md | 85 - .../typedarray-to-buffer/index.js | 25 - .../typedarray-to-buffer/package.json | 75 - .../typedarray-to-buffer/test/basic.js | 50 - .../undefsafe/.github/workflows/release.yml | 25 + server/node_modules/undefsafe/.npmignore | 2 - server/node_modules/undefsafe/package.json | 73 +- server/node_modules/unique-string/index.d.ts | 16 - server/node_modules/unique-string/index.js | 4 - server/node_modules/unique-string/license | 9 - .../node_modules/unique-string/package.json | 72 - server/node_modules/unique-string/readme.md | 32 - server/node_modules/update-notifier/check.js | 28 - server/node_modules/update-notifier/index.js | 187 - server/node_modules/update-notifier/license | 9 - .../node_modules/update-notifier/package.json | 96 - server/node_modules/update-notifier/readme.md | 223 - server/node_modules/url-parse-lax/index.js | 12 - server/node_modules/url-parse-lax/license | 9 - .../node_modules/url-parse-lax/package.json | 74 - server/node_modules/url-parse-lax/readme.md | 127 - server/node_modules/uuid/CHANGELOG.md | 229 + server/node_modules/uuid/CONTRIBUTING.md | 18 + server/node_modules/uuid/LICENSE.md | 9 + server/node_modules/uuid/README.md | 505 ++ server/node_modules/uuid/dist/bin/uuid | 2 + .../uuid/dist/esm-browser/index.js | 9 + .../node_modules/uuid/dist/esm-browser/md5.js | 215 + .../node_modules/uuid/dist/esm-browser/nil.js | 1 + .../uuid/dist/esm-browser/parse.js | 35 + .../uuid/dist/esm-browser/regex.js | 1 + .../node_modules/uuid/dist/esm-browser/rng.js | 19 + .../uuid/dist/esm-browser/sha1.js | 96 + .../uuid/dist/esm-browser/stringify.js | 30 + .../node_modules/uuid/dist/esm-browser/v1.js | 95 + .../node_modules/uuid/dist/esm-browser/v3.js | 4 + .../node_modules/uuid/dist/esm-browser/v35.js | 64 + .../node_modules/uuid/dist/esm-browser/v4.js | 24 + .../node_modules/uuid/dist/esm-browser/v5.js | 4 + .../uuid/dist/esm-browser/validate.js | 7 + .../uuid/dist/esm-browser/version.js | 11 + .../node_modules/uuid/dist/esm-node/index.js | 9 + server/node_modules/uuid/dist/esm-node/md5.js | 13 + server/node_modules/uuid/dist/esm-node/nil.js | 1 + .../node_modules/uuid/dist/esm-node/parse.js | 35 + .../node_modules/uuid/dist/esm-node/regex.js | 1 + server/node_modules/uuid/dist/esm-node/rng.js | 12 + .../node_modules/uuid/dist/esm-node/sha1.js | 13 + .../uuid/dist/esm-node/stringify.js | 29 + server/node_modules/uuid/dist/esm-node/v1.js | 95 + server/node_modules/uuid/dist/esm-node/v3.js | 4 + server/node_modules/uuid/dist/esm-node/v35.js | 64 + server/node_modules/uuid/dist/esm-node/v4.js | 24 + server/node_modules/uuid/dist/esm-node/v5.js | 4 + .../uuid/dist/esm-node/validate.js | 7 + .../uuid/dist/esm-node/version.js | 11 + server/node_modules/uuid/dist/index.js | 79 + server/node_modules/uuid/dist/md5-browser.js | 223 + server/node_modules/uuid/dist/md5.js | 23 + server/node_modules/uuid/dist/nil.js | 8 + server/node_modules/uuid/dist/parse.js | 45 + server/node_modules/uuid/dist/regex.js | 8 + server/node_modules/uuid/dist/rng-browser.js | 26 + server/node_modules/uuid/dist/rng.js | 24 + server/node_modules/uuid/dist/sha1-browser.js | 104 + server/node_modules/uuid/dist/sha1.js | 23 + server/node_modules/uuid/dist/stringify.js | 39 + server/node_modules/uuid/dist/umd/uuid.min.js | 1 + .../node_modules/uuid/dist/umd/uuidNIL.min.js | 1 + .../uuid/dist/umd/uuidParse.min.js | 1 + .../uuid/dist/umd/uuidStringify.min.js | 1 + .../uuid/dist/umd/uuidValidate.min.js | 1 + .../uuid/dist/umd/uuidVersion.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv1.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv3.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv4.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv5.min.js | 1 + server/node_modules/uuid/dist/uuid-bin.js | 85 + server/node_modules/uuid/dist/v1.js | 107 + server/node_modules/uuid/dist/v3.js | 16 + server/node_modules/uuid/dist/v35.js | 78 + server/node_modules/uuid/dist/v4.js | 37 + server/node_modules/uuid/dist/v5.js | 16 + server/node_modules/uuid/dist/validate.js | 17 + server/node_modules/uuid/dist/version.js | 21 + server/node_modules/uuid/package.json | 135 + server/node_modules/uuid/wrapper.mjs | 10 + .../webidl-conversions/LICENSE.md | 12 + .../node_modules/webidl-conversions/README.md | 99 + .../webidl-conversions/lib/index.js | 450 + .../webidl-conversions/package.json | 35 + server/node_modules/whatwg-url/LICENSE.txt | 21 + server/node_modules/whatwg-url/README.md | 106 + server/node_modules/whatwg-url/index.js | 27 + .../node_modules/whatwg-url/lib/Function.js | 42 + .../node_modules/whatwg-url/lib/URL-impl.js | 209 + server/node_modules/whatwg-url/lib/URL.js | 442 + .../whatwg-url/lib/URLSearchParams-impl.js | 130 + .../whatwg-url/lib/URLSearchParams.js | 472 ++ .../whatwg-url/lib/VoidFunction.js | 26 + .../node_modules/whatwg-url/lib/encoding.js | 16 + server/node_modules/whatwg-url/lib/infra.js | 26 + .../whatwg-url/lib/percent-encoding.js | 142 + .../whatwg-url/lib/url-state-machine.js | 1244 +++ .../node_modules/whatwg-url/lib/urlencoded.js | 106 + server/node_modules/whatwg-url/lib/utils.js | 190 + server/node_modules/whatwg-url/package.json | 58 + .../whatwg-url/webidl2js-wrapper.js | 7 + server/node_modules/widest-line/index.d.ts | 21 - server/node_modules/widest-line/index.js | 16 - server/node_modules/widest-line/license | 9 - server/node_modules/widest-line/package.json | 86 - server/node_modules/widest-line/readme.md | 34 - server/node_modules/wrappy/LICENSE | 15 - server/node_modules/wrappy/README.md | 36 - server/node_modules/wrappy/package.json | 58 - server/node_modules/wrappy/wrappy.js | 33 - .../write-file-atomic/CHANGELOG.md | 32 - server/node_modules/write-file-atomic/LICENSE | 6 - .../node_modules/write-file-atomic/README.md | 72 - .../node_modules/write-file-atomic/index.js | 259 - .../write-file-atomic/package.json | 77 - server/node_modules/xdg-basedir/index.d.ts | 81 - server/node_modules/xdg-basedir/index.js | 28 - server/node_modules/xdg-basedir/license | 9 - server/node_modules/xdg-basedir/package.json | 74 - server/node_modules/xdg-basedir/readme.md | 60 - server/package-lock.json | 4173 +++++++-- server/package.json | 8 +- server/server.js | 73 +- server/video-data.js | 63 + 4037 files changed, 379940 insertions(+), 41983 deletions(-) create mode 100644 package-lock.json create mode 120000 server/node_modules/.bin/fxparser delete mode 100644 server/node_modules/.bin/is-ci mode change 100644 => 120000 server/node_modules/.bin/nodemon delete mode 100644 server/node_modules/.bin/rc create mode 120000 server/node_modules/.bin/uuid create mode 100644 server/node_modules/.package-lock.json create mode 100644 server/node_modules/@aws-crypto/ie11-detection/CHANGELOG.md create mode 100644 server/node_modules/@aws-crypto/ie11-detection/LICENSE create mode 100644 server/node_modules/@aws-crypto/ie11-detection/README.md create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.d.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js.map create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/Key.d.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/Key.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/Key.js.map create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.d.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.js.map create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.d.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.js.map create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.d.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.js.map create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/index.d.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/index.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/build/index.js.map create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/CopyrightNotice.txt create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/LICENSE.txt create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/README.md create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/modules/index.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/modules/package.json create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/package.json create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.d.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.html create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.html create mode 100644 server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.js create mode 100644 server/node_modules/@aws-crypto/ie11-detection/package.json create mode 100644 server/node_modules/@aws-crypto/ie11-detection/src/CryptoOperation.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/src/Key.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/src/KeyOperation.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/src/MsSubtleCrypto.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/src/MsWindow.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/src/index.ts create mode 100644 server/node_modules/@aws-crypto/ie11-detection/tsconfig.json create mode 100644 server/node_modules/@aws-crypto/sha256-browser/CHANGELOG.md create mode 100644 server/node_modules/@aws-crypto/sha256-browser/LICENSE create mode 100644 server/node_modules/@aws-crypto/sha256-browser/README.md create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/constants.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/constants.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/constants.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/index.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/index.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/index.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/CopyrightNotice.txt create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/LICENSE.txt create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/README.md create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/modules/index.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/modules/package.json create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/package.json create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.html create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.html create mode 100644 server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.js create mode 100644 server/node_modules/@aws-crypto/sha256-browser/package.json create mode 100644 server/node_modules/@aws-crypto/sha256-browser/src/constants.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/src/crossPlatformSha256.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/src/ie11Sha256.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/src/index.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/src/isEmptyData.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/src/webCryptoSha256.ts create mode 100644 server/node_modules/@aws-crypto/sha256-browser/tsconfig.json create mode 100644 server/node_modules/@aws-crypto/sha256-js/CHANGELOG.md create mode 100644 server/node_modules/@aws-crypto/sha256-js/LICENSE create mode 100644 server/node_modules/@aws-crypto/sha256-js/README.md create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/RawSha256.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/RawSha256.js create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/RawSha256.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/constants.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/constants.js create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/constants.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/index.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/index.js create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/index.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/jsSha256.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/jsSha256.js create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/jsSha256.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.js create mode 100644 server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.js.map create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/CopyrightNotice.txt create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/LICENSE.txt create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/README.md create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/modules/index.js create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/modules/package.json create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/package.json create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.d.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.html create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.js create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.html create mode 100644 server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.js create mode 100644 server/node_modules/@aws-crypto/sha256-js/package.json create mode 100644 server/node_modules/@aws-crypto/sha256-js/src/RawSha256.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/src/constants.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/src/index.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/src/jsSha256.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/src/knownHashes.fixture.ts create mode 100644 server/node_modules/@aws-crypto/sha256-js/tsconfig.json create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/CHANGELOG.md create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/LICENSE create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/README.md create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/build/index.d.ts create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/build/index.js create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/build/supportsWebCrypto.d.ts create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/build/supportsWebCrypto.js create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/CopyrightNotice.txt create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/LICENSE.txt create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/README.md create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/modules/index.js create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/modules/package.json create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/package.json create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.d.ts create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.html create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.js create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.html create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.js create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/package.json create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/src/index.ts create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/src/supportsWebCrypto.ts create mode 100644 server/node_modules/@aws-crypto/supports-web-crypto/tsconfig.json create mode 100644 server/node_modules/@aws-crypto/util/CHANGELOG.md create mode 100644 server/node_modules/@aws-crypto/util/LICENSE create mode 100644 server/node_modules/@aws-crypto/util/README.md create mode 100644 server/node_modules/@aws-crypto/util/build/convertToBuffer.d.ts create mode 100644 server/node_modules/@aws-crypto/util/build/convertToBuffer.js create mode 100644 server/node_modules/@aws-crypto/util/build/convertToBuffer.js.map create mode 100644 server/node_modules/@aws-crypto/util/build/index.d.ts create mode 100644 server/node_modules/@aws-crypto/util/build/index.js create mode 100644 server/node_modules/@aws-crypto/util/build/index.js.map create mode 100644 server/node_modules/@aws-crypto/util/build/isEmptyData.d.ts create mode 100644 server/node_modules/@aws-crypto/util/build/isEmptyData.js create mode 100644 server/node_modules/@aws-crypto/util/build/isEmptyData.js.map create mode 100644 server/node_modules/@aws-crypto/util/build/numToUint8.d.ts create mode 100644 server/node_modules/@aws-crypto/util/build/numToUint8.js create mode 100644 server/node_modules/@aws-crypto/util/build/numToUint8.js.map create mode 100644 server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.d.ts create mode 100644 server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js create mode 100644 server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js.map create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/CopyrightNotice.txt create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/LICENSE.txt create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/README.md create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/modules/index.js create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/modules/package.json create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/package.json create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.d.ts create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.es6.html create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.es6.js create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.html create mode 100644 server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.js create mode 100644 server/node_modules/@aws-crypto/util/package.json create mode 100644 server/node_modules/@aws-crypto/util/src/convertToBuffer.ts create mode 100644 server/node_modules/@aws-crypto/util/src/index.ts create mode 100644 server/node_modules/@aws-crypto/util/src/isEmptyData.ts create mode 100644 server/node_modules/@aws-crypto/util/src/numToUint8.ts create mode 100644 server/node_modules/@aws-crypto/util/src/uint32ArrayFrom.ts create mode 100644 server/node_modules/@aws-crypto/util/tsconfig.json create mode 100644 server/node_modules/@aws-sdk/abort-controller/LICENSE create mode 100644 server/node_modules/@aws-sdk/abort-controller/README.md create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-cjs/AbortController.js create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-cjs/AbortSignal.js create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-es/AbortController.js create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-es/AbortSignal.js create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-types/AbortController.d.ts create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-types/AbortSignal.d.ts create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/AbortController.d.ts create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/AbortSignal.d.ts create mode 100644 server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/abort-controller/package.json create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/LICENSE create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/README.md create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentity.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentityClient.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/CreateIdentityPoolCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentitiesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentityPoolCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityPoolCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetCredentialsForIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdentityPoolRolesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenForDeveloperIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetPrincipalTagAttributeMapCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentitiesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentityPoolsCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListTagsForResourceCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/LookupDeveloperIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/MergeDeveloperIdentitiesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetIdentityPoolRolesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetPrincipalTagAttributeMapCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/TagResourceCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkDeveloperIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UntagResourceCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UpdateIdentityPoolCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/index.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/EndpointParameters.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/endpointResolver.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/ruleset.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/CognitoIdentityServiceException.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/index.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/models_0.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/Interfaces.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/ListIdentityPoolsPaginator.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/index.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/protocols/Aws_json1_1.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.browser.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.shared.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentity.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentityClient.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/CreateIdentityPoolCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentitiesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentityPoolCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityPoolCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetCredentialsForIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdentityPoolRolesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenForDeveloperIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetPrincipalTagAttributeMapCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentitiesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentityPoolsCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListTagsForResourceCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/LookupDeveloperIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/MergeDeveloperIdentitiesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetIdentityPoolRolesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetPrincipalTagAttributeMapCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/TagResourceCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkDeveloperIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UntagResourceCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UpdateIdentityPoolCommand.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/index.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/EndpointParameters.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/endpointResolver.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/ruleset.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/CognitoIdentityServiceException.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/index.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/models_0.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/Interfaces.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/ListIdentityPoolsPaginator.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/index.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/protocols/Aws_json1_1.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.browser.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.shared.js create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentityClient.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/CreateIdentityPoolCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentitiesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentityPoolCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityPoolCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetCredentialsForIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdentityPoolRolesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetPrincipalTagAttributeMapCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentitiesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentityPoolsCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListTagsForResourceCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/LookupDeveloperIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/MergeDeveloperIdentitiesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetIdentityPoolRolesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetPrincipalTagAttributeMapCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/TagResourceCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkDeveloperIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UntagResourceCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UpdateIdentityPoolCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/EndpointParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/endpointResolver.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/ruleset.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/CognitoIdentityServiceException.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/models_0.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/Interfaces.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/ListIdentityPoolsPaginator.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/protocols/Aws_json1_1.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.shared.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentityClient.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/CreateIdentityPoolCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentitiesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentityPoolCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityPoolCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetCredentialsForIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdentityPoolRolesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetPrincipalTagAttributeMapCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentitiesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentityPoolsCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/LookupDeveloperIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/MergeDeveloperIdentitiesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetIdentityPoolRolesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetPrincipalTagAttributeMapCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/TagResourceCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkDeveloperIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UntagResourceCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UpdateIdentityPoolCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/EndpointParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/endpointResolver.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/ruleset.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/CognitoIdentityServiceException.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/models_0.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/Interfaces.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/ListIdentityPoolsPaginator.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/protocols/Aws_json1_1.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.shared.d.ts create mode 100644 server/node_modules/@aws-sdk/client-cognito-identity/package.json create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/LICENSE create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/README.md create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/SSOOIDC.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/SSOOIDCClient.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/CreateTokenCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/RegisterClientCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/StartDeviceAuthorizationCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/EndpointParameters.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/SSOOIDCServiceException.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/models_0.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/protocols/Aws_restJson1.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.browser.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDC.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/RegisterClientCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/StartDeviceAuthorizationCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/EndpointParameters.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/endpointResolver.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/ruleset.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/SSOOIDCServiceException.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/models_0.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.browser.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDC.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDCClient.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/CreateTokenCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/RegisterClientCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/StartDeviceAuthorizationCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/EndpointParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/endpointResolver.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/ruleset.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/SSOOIDCServiceException.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/models_0.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/protocols/Aws_restJson1.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.shared.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDC.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDCClient.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/CreateTokenCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/RegisterClientCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/StartDeviceAuthorizationCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/EndpointParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/endpointResolver.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/ruleset.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/SSOOIDCServiceException.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/models_0.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/protocols/Aws_restJson1.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.shared.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso-oidc/package.json create mode 100644 server/node_modules/@aws-sdk/client-sso/LICENSE create mode 100644 server/node_modules/@aws-sdk/client-sso/README.md create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/SSO.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/SSOClient.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/GetRoleCredentialsCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/ListAccountRolesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/ListAccountsCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/LogoutCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/EndpointParameters.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/models/SSOServiceException.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/models/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/models/models_0.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/Interfaces.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/ListAccountRolesPaginator.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/ListAccountsPaginator.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/protocols/Aws_restJson1.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.browser.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/SSO.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountRolesCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountsCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/commands/LogoutCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/commands/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/models/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/pagination/Interfaces.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountRolesPaginator.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountsPaginator.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/pagination/index.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.browser.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/SSO.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/SSOClient.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/commands/GetRoleCredentialsCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/commands/ListAccountRolesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/commands/ListAccountsCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/commands/LogoutCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/commands/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/EndpointParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/endpointResolver.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/ruleset.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/models/SSOServiceException.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/models/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/models/models_0.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/pagination/Interfaces.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/pagination/ListAccountRolesPaginator.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/pagination/ListAccountsPaginator.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/pagination/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/protocols/Aws_restJson1.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.shared.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSO.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSOClient.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/GetRoleCredentialsCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/ListAccountRolesCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/ListAccountsCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/LogoutCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/EndpointParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/endpointResolver.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/ruleset.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/SSOServiceException.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/models_0.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/Interfaces.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/ListAccountRolesPaginator.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/ListAccountsPaginator.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/protocols/Aws_restJson1.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.shared.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sso/package.json create mode 100644 server/node_modules/@aws-sdk/client-sts/LICENSE create mode 100644 server/node_modules/@aws-sdk/client-sts/README.md create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/STS.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleWithSAMLCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleWithWebIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/DecodeAuthorizationMessageCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetAccessKeyInfoCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetCallerIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetFederationTokenCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetSessionTokenCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/index.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/defaultRoleAssumers.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/defaultStsRoleAssumers.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/models/STSServiceException.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/models/index.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/models/models_0.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/protocols/Aws_query.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.browser.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/STS.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithSAMLCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithWebIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/commands/index.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/defaultRoleAssumers.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/EndpointParameters.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/endpointResolver.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/ruleset.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/models/STSServiceException.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/models/index.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/models/models_0.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.browser.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/STS.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/STSClient.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithSAMLCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithWebIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/commands/DecodeAuthorizationMessageCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetAccessKeyInfoCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetCallerIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetFederationTokenCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetSessionTokenCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/commands/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/defaultRoleAssumers.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/defaultStsRoleAssumers.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/EndpointParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/endpointResolver.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/ruleset.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/models/STSServiceException.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/models/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/models/models_0.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/protocols/Aws_query.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.shared.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STS.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STSClient.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetCallerIdentityCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetFederationTokenCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetSessionTokenCommand.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultRoleAssumers.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultStsRoleAssumers.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/EndpointParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/endpointResolver.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/ruleset.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/STSServiceException.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/index.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/models_0.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/protocols/Aws_query.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.shared.d.ts create mode 100644 server/node_modules/@aws-sdk/client-sts/package.json create mode 100644 server/node_modules/@aws-sdk/config-resolver/LICENSE create mode 100644 server/node_modules/@aws-sdk/config-resolver/README.md create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/NodeUseFipsEndpointConfigOptions.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/index.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/resolveCustomEndpointsConfig.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/resolveEndpointsConfig.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/utils/getEndpointFromRegion.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/config.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/getRealRegion.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/index.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/isFipsRegion.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/resolveRegionConfig.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/EndpointVariant.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/EndpointVariantTag.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/PartitionHash.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/RegionHash.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getHostnameFromVariants.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getRegionInfo.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedHostname.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedPartition.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedSigningRegion.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/index.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/index.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/utils/getEndpointFromRegion.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/config.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/getRealRegion.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/index.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/isFipsRegion.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/resolveRegionConfig.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/EndpointVariant.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/EndpointVariantTag.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/PartitionHash.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/RegionHash.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getHostnameFromVariants.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getRegionInfo.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedHostname.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedPartition.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedSigningRegion.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/index.js create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/index.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/resolveCustomEndpointsConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/resolveEndpointsConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/utils/getEndpointFromRegion.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/config.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/getRealRegion.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/index.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/isFipsRegion.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/resolveRegionConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/EndpointVariant.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/EndpointVariantTag.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/PartitionHash.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/RegionHash.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getHostnameFromVariants.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getRegionInfo.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedHostname.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedPartition.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedSigningRegion.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/index.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/index.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/resolveCustomEndpointsConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/resolveEndpointsConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/utils/getEndpointFromRegion.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/config.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/getRealRegion.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/index.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/isFipsRegion.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/resolveRegionConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariant.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariantTag.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/PartitionHash.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/RegionHash.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getHostnameFromVariants.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getRegionInfo.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedHostname.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedPartition.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedSigningRegion.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/index.d.ts create mode 100644 server/node_modules/@aws-sdk/config-resolver/package.json create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/LICENSE create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/README.md create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/CognitoProviderParameters.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/InMemoryStorage.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/IndexedDbStorage.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Logins.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Storage.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentity.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentityPool.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/localStorage.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/resolveLogins.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/CognitoProviderParameters.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/InMemoryStorage.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/IndexedDbStorage.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Logins.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Storage.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentityPool.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/localStorage.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/resolveLogins.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/CognitoProviderParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/InMemoryStorage.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/IndexedDbStorage.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Logins.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Storage.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentityPool.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/localStorage.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/resolveLogins.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/CognitoProviderParameters.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/InMemoryStorage.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/IndexedDbStorage.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Logins.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Storage.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentityPool.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/localStorage.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/resolveLogins.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-cognito-identity/package.json create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/LICENSE create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/README.md create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/dist-cjs/fromEnv.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/dist-types/fromEnv.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/dist-types/ts3.4/fromEnv.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-env/package.json create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/LICENSE create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/README.md create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/Endpoint.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointConfigOptions.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointMode.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointModeConfigOptions.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/fromContainerMetadata.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/fromInstanceMetadata.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/ImdsCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/RemoteProviderInit.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/retry.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/types.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/getExtendedInstanceMetadataCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/getInstanceMetadataEndpoint.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/staticStabilityProvider.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/Endpoint.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointConfigOptions.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointMode.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/fromContainerMetadata.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/fromInstanceMetadata.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/httpRequest.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/retry.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/types.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/staticStabilityProvider.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/Endpoint.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointConfigOptions.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointMode.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointModeConfigOptions.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/fromContainerMetadata.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/fromInstanceMetadata.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/ImdsCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/RemoteProviderInit.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/httpRequest.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/retry.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/Endpoint.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointConfigOptions.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointMode.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointModeConfigOptions.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/fromContainerMetadata.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/fromInstanceMetadata.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/ImdsCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/RemoteProviderInit.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/httpRequest.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/retry.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/types.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/getExtendedInstanceMetadataCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/getInstanceMetadataEndpoint.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/staticStabilityProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/types.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/getExtendedInstanceMetadataCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/getInstanceMetadataEndpoint.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/staticStabilityProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-imds/package.json create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/LICENSE create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/README.md create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/fromIni.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveAssumeRoleCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveCredentialSource.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProcessCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProfileData.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveSsoCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveStaticCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveWebIdentityCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/fromIni.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveAssumeRoleCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveCredentialSource.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveProcessCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveProfileData.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveSsoCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveStaticCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveWebIdentityCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/fromIni.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveAssumeRoleCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveCredentialSource.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveProcessCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveProfileData.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveSsoCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveStaticCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveWebIdentityCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-ini/package.json create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/LICENSE create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/README.md create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/defaultProvider.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/remoteProvider.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-types/defaultProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-types/remoteProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/defaultProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/remoteProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-node/package.json create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/LICENSE create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/README.md create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/ProcessCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/fromProcess.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/getValidatedProcessCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/resolveProcessCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-es/ProcessCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/ProcessCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/fromProcess.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/getValidatedProcessCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/resolveProcessCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/ProcessCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/fromProcess.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/getValidatedProcessCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/resolveProcessCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-process/package.json create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/LICENSE create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/README.md create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/fromSSO.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/isSsoProfile.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/resolveSSOCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/types.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/validateSsoProfile.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/fromSSO.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/isSsoProfile.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/resolveSSOCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/fromSSO.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/isSsoProfile.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/resolveSSOCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/types.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/validateSsoProfile.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/types.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/dist-types/validateSsoProfile.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-sso/package.json create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/LICENSE create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/README.md create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromTokenFile.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromTokenFile.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromWebToken.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-provider-web-identity/package.json create mode 100644 server/node_modules/@aws-sdk/credential-providers/LICENSE create mode 100644 server/node_modules/@aws-sdk/credential-providers/README.md create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentity.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentityPool.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromContainerMetadata.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromEnv.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromIni.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromInstanceMetadata.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromNodeProviderChain.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromProcess.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromSSO.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-cjs/index.web.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentity.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentityPool.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromContainerMetadata.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromEnv.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromIni.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromInstanceMetadata.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromNodeProviderChain.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromProcess.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromSSO.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromTemporaryCredentials.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromTokenFile.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/fromWebToken.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-es/index.web.js create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentityPool.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromContainerMetadata.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromEnv.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromIni.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromInstanceMetadata.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromNodeProviderChain.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromProcess.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromSSO.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromTemporaryCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromTokenFile.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/fromWebToken.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/index.web.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentityPool.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromContainerMetadata.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromEnv.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromIni.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromInstanceMetadata.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromNodeProviderChain.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromProcess.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromSSO.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTemporaryCredentials.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTokenFile.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromWebToken.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.web.d.ts create mode 100644 server/node_modules/@aws-sdk/credential-providers/package.json create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/LICENSE create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/README.md create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/fetch-http-handler.js create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/request-timeout.js create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/stream-collector.js create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-es/fetch-http-handler.js create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-es/request-timeout.js create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-es/stream-collector.js create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-types/fetch-http-handler.d.ts create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-types/request-timeout.d.ts create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-types/stream-collector.d.ts create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/fetch-http-handler.d.ts create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/request-timeout.d.ts create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/stream-collector.d.ts create mode 100644 server/node_modules/@aws-sdk/fetch-http-handler/package.json create mode 100644 server/node_modules/@aws-sdk/hash-node/LICENSE create mode 100644 server/node_modules/@aws-sdk/hash-node/README.md create mode 100644 server/node_modules/@aws-sdk/hash-node/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/hash-node/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/hash-node/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/hash-node/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/hash-node/package.json create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/LICENSE create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/README.md create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/invalidFunction.js create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/invalidProvider.js create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-es/invalidFunction.js create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-es/invalidProvider.js create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-types/invalidFunction.d.ts create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-types/invalidProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/invalidFunction.d.ts create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/invalidProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/invalid-dependency/package.json create mode 100644 server/node_modules/@aws-sdk/is-array-buffer/CHANGELOG.md create mode 100644 server/node_modules/@aws-sdk/is-array-buffer/LICENSE create mode 100644 server/node_modules/@aws-sdk/is-array-buffer/README.md create mode 100644 server/node_modules/@aws-sdk/is-array-buffer/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/is-array-buffer/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/is-array-buffer/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/is-array-buffer/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/is-array-buffer/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-content-length/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-content-length/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-content-length/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-content-length/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-content-length/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-content-length/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-content-length/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/createConfigValueProvider.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/getEndpointFromInstructions.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/toEndpointV1.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/endpointMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/getEndpointPlugin.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/resolveEndpointConfig.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/service-customizations/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/service-customizations/s3.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/types.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/toEndpointV1.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/endpointMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/getEndpointPlugin.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/resolveEndpointConfig.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/service-customizations/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/service-customizations/s3.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-es/types.js create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/createConfigValueProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/getEndpointFromInstructions.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/toEndpointV1.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/endpointMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/getEndpointPlugin.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/service-customizations/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/service-customizations/s3.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/createConfigValueProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/getEndpointFromInstructions.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/toEndpointV1.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/endpointMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/getEndpointPlugin.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/service-customizations/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/service-customizations/s3.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/types.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/dist-types/types.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-endpoint/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-host-header/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-host-header/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-host-header/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-host-header/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-host-header/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-logger/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-logger/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-logger/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-logger/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-logger/dist-types/loggerMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/loggerMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-logger/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-recursion-detection/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-recursion-detection/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-recursion-detection/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-retry/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-retry/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/AdaptiveRetryStrategy.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/StandardRetryStrategy.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/configurations.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/defaultRetryQuota.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/delayDecider.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/omitRetryHeadersMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/retryDecider.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/retryMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/types.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-cjs/util.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/AdaptiveRetryStrategy.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/StandardRetryStrategy.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/configurations.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/defaultRetryQuota.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/delayDecider.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/omitRetryHeadersMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/retryDecider.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/retryMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/types.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-es/util.js create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/AdaptiveRetryStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/StandardRetryStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/configurations.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/defaultRetryQuota.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/delayDecider.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/omitRetryHeadersMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/retryDecider.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/retryMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/AdaptiveRetryStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/configurations.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/defaultRetryQuota.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/delayDecider.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/omitRetryHeadersMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/retryDecider.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/retryMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/types.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/util.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/types.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/dist-types/util.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-retry/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-sdk-sts/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-sdk-sts/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-sdk-sts/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-sdk-sts/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-sdk-sts/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-serde/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-serde/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-cjs/deserializerMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-cjs/serdePlugin.js create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-cjs/serializerMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-es/deserializerMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-es/serdePlugin.js create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-es/serializerMiddleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-types/deserializerMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-types/serdePlugin.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-types/serializerMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/deserializerMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/serdePlugin.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/serializerMiddleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-serde/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-signing/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-signing/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-cjs/configurations.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-cjs/middleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/getSkewCorrectedDate.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/getUpdatedSystemClockOffset.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/isClockSkewed.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-es/configurations.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-es/middleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getSkewCorrectedDate.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getUpdatedSystemClockOffset.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/isClockSkewed.js create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/configurations.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/middleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/configurations.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/middleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getSkewCorrectedDate.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getUpdatedSystemClockOffset.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/isClockSkewed.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getSkewCorrectedDate.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getUpdatedSystemClockOffset.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/isClockSkewed.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-signing/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-stack/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-stack/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-cjs/MiddlewareStack.js create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-cjs/types.js create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-es/MiddlewareStack.js create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-es/types.js create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-types/MiddlewareStack.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/MiddlewareStack.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/types.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-stack/dist-types/types.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-stack/package.json create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/LICENSE create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/README.md create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/configurations.js create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/constants.js create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/user-agent-middleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-types/configurations.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-types/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/configurations.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/user-agent-middleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/dist-types/user-agent-middleware.d.ts create mode 100644 server/node_modules/@aws-sdk/middleware-user-agent/package.json create mode 100644 server/node_modules/@aws-sdk/node-config-provider/LICENSE create mode 100644 server/node_modules/@aws-sdk/node-config-provider/README.md create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-cjs/configLoader.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromEnv.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromSharedConfigFiles.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromStatic.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-es/configLoader.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-es/fromEnv.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-es/fromSharedConfigFiles.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-es/fromStatic.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/configLoader.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/fromEnv.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/fromSharedConfigFiles.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/fromStatic.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/configLoader.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromEnv.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromSharedConfigFiles.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromStatic.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/node-config-provider/package.json create mode 100644 server/node_modules/@aws-sdk/node-http-handler/LICENSE create mode 100644 server/node_modules/@aws-sdk/node-http-handler/README.md create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/constants.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/get-transformed-headers.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http-handler.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/readable.mock.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/server.mock.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/set-connection-timeout.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/set-socket-timeout.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/collector.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/index.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/readable.mock.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-cjs/write-request-body.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/constants.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/get-transformed-headers.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/node-http-handler.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/node-http2-handler.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/readable.mock.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/server.mock.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/set-connection-timeout.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/set-socket-timeout.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/collector.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/index.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/readable.mock.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-es/write-request-body.js create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/get-transformed-headers.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/node-http-handler.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/node-http2-handler.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/readable.mock.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/server.mock.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/set-connection-timeout.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/set-socket-timeout.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/collector.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/index.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/readable.mock.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/readable.mock.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/server.mock.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/write-request-body.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/dist-types/write-request-body.d.ts create mode 100644 server/node_modules/@aws-sdk/node-http-handler/package.json create mode 100644 server/node_modules/@aws-sdk/property-provider/LICENSE create mode 100644 server/node_modules/@aws-sdk/property-provider/README.md create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-cjs/CredentialsProviderError.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-cjs/ProviderError.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-cjs/TokenProviderError.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-cjs/chain.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-cjs/fromStatic.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-cjs/memoize.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-es/CredentialsProviderError.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-es/ProviderError.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-es/TokenProviderError.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-es/chain.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-es/fromStatic.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-es/memoize.js create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/CredentialsProviderError.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/ProviderError.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/TokenProviderError.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/chain.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/fromStatic.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/memoize.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/CredentialsProviderError.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/ProviderError.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/TokenProviderError.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/chain.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/fromStatic.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/memoize.d.ts create mode 100644 server/node_modules/@aws-sdk/property-provider/package.json create mode 100644 server/node_modules/@aws-sdk/protocol-http/LICENSE create mode 100644 server/node_modules/@aws-sdk/protocol-http/README.md create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpHandler.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpRequest.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpResponse.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-cjs/isValidHostname.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-es/httpHandler.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-es/httpRequest.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-es/httpResponse.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-es/isValidHostname.js create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/httpHandler.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/httpRequest.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/httpResponse.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/isValidHostname.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpHandler.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpRequest.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpResponse.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/isValidHostname.d.ts create mode 100644 server/node_modules/@aws-sdk/protocol-http/package.json create mode 100644 server/node_modules/@aws-sdk/querystring-builder/LICENSE create mode 100644 server/node_modules/@aws-sdk/querystring-builder/README.md create mode 100644 server/node_modules/@aws-sdk/querystring-builder/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/querystring-builder/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/querystring-builder/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/querystring-builder/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/querystring-builder/package.json create mode 100644 server/node_modules/@aws-sdk/querystring-parser/LICENSE create mode 100644 server/node_modules/@aws-sdk/querystring-parser/README.md create mode 100644 server/node_modules/@aws-sdk/querystring-parser/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/querystring-parser/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/querystring-parser/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/querystring-parser/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/querystring-parser/package.json create mode 100644 server/node_modules/@aws-sdk/service-error-classification/LICENSE create mode 100644 server/node_modules/@aws-sdk/service-error-classification/README.md create mode 100644 server/node_modules/@aws-sdk/service-error-classification/dist-cjs/constants.js create mode 100644 server/node_modules/@aws-sdk/service-error-classification/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/service-error-classification/dist-es/constants.js create mode 100644 server/node_modules/@aws-sdk/service-error-classification/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/service-error-classification/dist-types/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/service-error-classification/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/service-error-classification/dist-types/ts3.4/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/service-error-classification/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/service-error-classification/package.json create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/LICENSE create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/README.md create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getConfigFilepath.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getHomeDir.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getProfileData.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getProfileName.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSsoSessionData.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/parseIni.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/parseKnownFiles.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/slurpFile.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/types.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getConfigFilepath.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getCredentialsFilepath.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getHomeDir.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getProfileData.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getProfileName.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSsoSessionData.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSsoSessionData.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/parseIni.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/parseKnownFiles.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/slurpFile.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/types.js create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getConfigFilepath.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getCredentialsFilepath.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getHomeDir.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getProfileData.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getProfileName.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSSOTokenFilepath.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSSOTokenFromFile.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSsoSessionData.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/loadSharedConfigFiles.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/loadSsoSessionData.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/parseIni.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/parseKnownFiles.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/slurpFile.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getConfigFilepath.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getCredentialsFilepath.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getHomeDir.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getProfileData.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getProfileName.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFilepath.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFromFile.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSsoSessionData.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/loadSharedConfigFiles.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/loadSsoSessionData.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/parseIni.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/parseKnownFiles.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/slurpFile.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/types.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/types.d.ts create mode 100644 server/node_modules/@aws-sdk/shared-ini-file-loader/package.json create mode 100644 server/node_modules/@aws-sdk/signature-v4/LICENSE create mode 100644 server/node_modules/@aws-sdk/signature-v4/README.md create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/SignatureV4.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/cloneRequest.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/constants.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/credentialDerivation.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/getCanonicalHeaders.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/getCanonicalQuery.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/getPayloadHash.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/headerUtil.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/moveHeadersToQuery.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/prepareRequest.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/suite.fixture.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-cjs/utilDate.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/SignatureV4.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/cloneRequest.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/constants.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/credentialDerivation.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/getCanonicalHeaders.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/getCanonicalQuery.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/getPayloadHash.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/headerUtil.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/moveHeadersToQuery.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/prepareRequest.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/suite.fixture.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-es/utilDate.js create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/SignatureV4.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/cloneRequest.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/credentialDerivation.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/getCanonicalHeaders.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/getCanonicalQuery.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/getPayloadHash.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/headerUtil.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/moveHeadersToQuery.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/prepareRequest.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/suite.fixture.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/SignatureV4.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/cloneRequest.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/credentialDerivation.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getCanonicalHeaders.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getCanonicalQuery.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getPayloadHash.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/headerUtil.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/moveHeadersToQuery.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/prepareRequest.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/suite.fixture.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/utilDate.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/dist-types/utilDate.d.ts create mode 100644 server/node_modules/@aws-sdk/signature-v4/package.json create mode 100644 server/node_modules/@aws-sdk/smithy-client/LICENSE create mode 100644 server/node_modules/@aws-sdk/smithy-client/README.md create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/NoOpLogger.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/client.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/command.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/constants.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/date-utils.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/default-error-handler.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/defaults-mode.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/emitWarningIfUnsupportedVersion.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/exceptions.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/extended-encode-uri-component.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/get-array-if-single-item.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/get-value-from-text-node.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/lazy-json.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/object-mapping.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/parse-utils.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/resolve-path.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/ser-utils.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-cjs/split-every.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/NoOpLogger.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/client.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/command.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/constants.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/date-utils.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/default-error-handler.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/defaults-mode.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/exceptions.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/extended-encode-uri-component.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/get-array-if-single-item.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/get-value-from-text-node.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/lazy-json.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/object-mapping.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/parse-utils.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/resolve-path.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/ser-utils.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-es/split-every.js create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/NoOpLogger.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/client.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/command.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/date-utils.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/default-error-handler.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/defaults-mode.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/emitWarningIfUnsupportedVersion.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/exceptions.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/extended-encode-uri-component.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/get-array-if-single-item.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/get-value-from-text-node.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/lazy-json.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/object-mapping.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/parse-utils.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/resolve-path.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ser-utils.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/split-every.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/NoOpLogger.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/client.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/command.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/date-utils.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/default-error-handler.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/defaults-mode.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/emitWarningIfUnsupportedVersion.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/exceptions.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/extended-encode-uri-component.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/get-array-if-single-item.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/get-value-from-text-node.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/lazy-json.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/object-mapping.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/parse-utils.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/resolve-path.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/ser-utils.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/split-every.d.ts create mode 100644 server/node_modules/@aws-sdk/smithy-client/package.json create mode 100644 server/node_modules/@aws-sdk/token-providers/LICENSE create mode 100644 server/node_modules/@aws-sdk/token-providers/README.md create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/constants.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/fromSso.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/fromStatic.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/getNewSsoOidcToken.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/getSsoOidcClient.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/nodeProvider.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/validateTokenExpiry.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/validateTokenKey.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-cjs/writeSSOTokenToFile.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/constants.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts create mode 100644 server/node_modules/@aws-sdk/token-providers/package.json create mode 100644 server/node_modules/@aws-sdk/types/LICENSE create mode 100644 server/node_modules/@aws-sdk/types/README.md create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/abort.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/auth.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/checksum.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/client.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/command.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/credentials.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/crypto.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/endpoint.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/eventStream.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/http.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/identity/AnonymousIdentity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/identity/AwsCredentialIdentity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/identity/Identity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/identity/LoginIdentity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/identity/TokenIdentity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/identity/index.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/logger.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/middleware.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/pagination.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/profile.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/response.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/retry.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/serde.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/shapes.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/signature.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/stream.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/token.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/transfer.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/util.js create mode 100644 server/node_modules/@aws-sdk/types/dist-cjs/waiter.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/abort.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/auth.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/checksum.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/client.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/command.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/credentials.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/crypto.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/endpoint.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/eventStream.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/http.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/identity/AnonymousIdentity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/identity/AwsCredentialIdentity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/identity/Identity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/identity/LoginIdentity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/identity/TokenIdentity.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/identity/index.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/logger.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/middleware.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/pagination.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/profile.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/response.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/retry.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/serde.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/shapes.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/signature.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/stream.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/token.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/transfer.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/util.js create mode 100644 server/node_modules/@aws-sdk/types/dist-es/waiter.js create mode 100644 server/node_modules/@aws-sdk/types/dist-types/abort.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/auth.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/checksum.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/client.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/command.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/credentials.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/crypto.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/endpoint.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/eventStream.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/http.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/identity/AnonymousIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/identity/AwsCredentialIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/identity/Identity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/identity/LoginIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/identity/TokenIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/identity/index.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/logger.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/middleware.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/pagination.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/profile.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/response.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/retry.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/serde.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/shapes.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/signature.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/stream.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/token.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/transfer.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/abort.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/auth.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/checksum.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/client.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/command.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/credentials.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/crypto.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/endpoint.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/eventStream.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/http.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AnonymousIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AwsCredentialIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/Identity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/LoginIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/TokenIdentity.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/index.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/logger.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/middleware.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/pagination.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/profile.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/response.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/retry.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/serde.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/shapes.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/signature.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/stream.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/token.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/transfer.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/util.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/ts3.4/waiter.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/util.d.ts create mode 100644 server/node_modules/@aws-sdk/types/dist-types/waiter.d.ts create mode 100755 server/node_modules/@aws-sdk/types/package.json create mode 100644 server/node_modules/@aws-sdk/url-parser/LICENSE create mode 100644 server/node_modules/@aws-sdk/url-parser/README.md create mode 100644 server/node_modules/@aws-sdk/url-parser/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/url-parser/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/url-parser/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/url-parser/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/url-parser/package.json create mode 100644 server/node_modules/@aws-sdk/util-base64/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-base64/README.md create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-cjs/constants.browser.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-cjs/fromBase64.browser.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-cjs/fromBase64.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-cjs/toBase64.browser.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-cjs/toBase64.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-es/constants.browser.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-es/fromBase64.browser.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-es/fromBase64.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-es/toBase64.browser.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-es/toBase64.js create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/constants.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/fromBase64.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/fromBase64.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/toBase64.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/toBase64.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/constants.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/fromBase64.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/fromBase64.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/toBase64.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/toBase64.d.ts create mode 100644 server/node_modules/@aws-sdk/util-base64/package.json create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/CHANGELOG.md create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/README.md create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/dist-cjs/calculateBodyLength.js create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/dist-es/calculateBodyLength.js create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/dist-types/calculateBodyLength.d.ts create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/dist-types/ts3.4/calculateBodyLength.d.ts create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-body-length-browser/package.json create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/README.md create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/dist-cjs/calculateBodyLength.js create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/dist-es/calculateBodyLength.js create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/dist-types/calculateBodyLength.d.ts create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/dist-types/ts3.4/calculateBodyLength.d.ts create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-body-length-node/package.json create mode 100644 server/node_modules/@aws-sdk/util-buffer-from/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-buffer-from/README.md create mode 100644 server/node_modules/@aws-sdk/util-buffer-from/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-buffer-from/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-buffer-from/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-buffer-from/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-buffer-from/package.json create mode 100644 server/node_modules/@aws-sdk/util-config-provider/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-config-provider/README.md create mode 100644 server/node_modules/@aws-sdk/util-config-provider/dist-cjs/booleanSelector.js create mode 100644 server/node_modules/@aws-sdk/util-config-provider/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-config-provider/dist-es/booleanSelector.js create mode 100644 server/node_modules/@aws-sdk/util-config-provider/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-config-provider/dist-types/booleanSelector.d.ts create mode 100644 server/node_modules/@aws-sdk/util-config-provider/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-config-provider/dist-types/ts3.4/booleanSelector.d.ts create mode 100644 server/node_modules/@aws-sdk/util-config-provider/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-config-provider/package.json create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/README.md create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/constants.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/constants.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.native.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/resolveDefaultsModeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/resolveDefaultsModeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/resolveDefaultsModeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/resolveDefaultsModeConfig.native.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-browser/package.json create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/README.md create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/constants.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/defaultsModeConfig.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/resolveDefaultsModeConfig.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/constants.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/defaultsModeConfig.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/defaultsModeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/resolveDefaultsModeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/defaultsModeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/resolveDefaultsModeConfig.d.ts create mode 100644 server/node_modules/@aws-sdk/util-defaults-mode-node/package.json create mode 100644 server/node_modules/@aws-sdk/util-endpoints/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-endpoints/README.md create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/debugId.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/toDebugString.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/isVirtualHostableS3Bucket.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/parseArn.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partition.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/booleanEquals.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/getAttr.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/getAttrPathList.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isIpAddress.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isSet.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isValidHostLabel.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/not.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/parseURL.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/stringEquals.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/substring.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/uriEncode.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/resolveEndpoint.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/EndpointError.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/EndpointRuleObject.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/ErrorRuleObject.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/RuleSetObject.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/TreeRuleObject.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/shared.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/callFunction.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateCondition.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateConditions.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateEndpointRule.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateErrorRule.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateExpression.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateRules.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTemplate.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTreeRule.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointHeaders.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointProperties.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointProperty.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointUrl.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getReferenceValue.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/debugId.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/toDebugString.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/booleanEquals.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/getAttr.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/getAttrPathList.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isSet.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isValidHostLabel.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/not.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/parseURL.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/stringEquals.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/substring.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/uriEncode.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/callFunction.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateCondition.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateConditions.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateEndpointRule.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateErrorRule.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateExpression.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateRules.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateTemplate.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateTreeRule.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointHeaders.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointProperties.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointProperty.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointUrl.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getReferenceValue.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/index.js create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/debugId.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/toDebugString.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/isVirtualHostableS3Bucket.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/parseArn.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/partition.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/booleanEquals.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/getAttr.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/getAttrPathList.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isIpAddress.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isSet.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isValidHostLabel.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/not.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/parseURL.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/stringEquals.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/substring.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/uriEncode.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/resolveEndpoint.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/debugId.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/toDebugString.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/isVirtualHostableS3Bucket.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/parseArn.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/partition.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/booleanEquals.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/getAttr.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/getAttrPathList.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isIpAddress.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isSet.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isValidHostLabel.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/not.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/parseURL.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/stringEquals.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/substring.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/uriEncode.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/resolveEndpoint.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointError.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointRuleObject.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/ErrorRuleObject.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/RuleSetObject.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/TreeRuleObject.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/shared.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/callFunction.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateCondition.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateConditions.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateEndpointRule.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateErrorRule.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateExpression.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateRules.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateTemplate.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateTreeRule.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointHeaders.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointProperties.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointProperty.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointUrl.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getReferenceValue.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointError.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointRuleObject.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/types/ErrorRuleObject.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/types/RuleSetObject.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/types/TreeRuleObject.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/types/shared.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/callFunction.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateCondition.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateConditions.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateEndpointRule.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateErrorRule.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateExpression.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateRules.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateTemplate.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateTreeRule.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointHeaders.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointProperties.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointProperty.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointUrl.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getReferenceValue.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-endpoints/package.json create mode 100644 server/node_modules/@aws-sdk/util-hex-encoding/CHANGELOG.md create mode 100644 server/node_modules/@aws-sdk/util-hex-encoding/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-hex-encoding/README.md create mode 100644 server/node_modules/@aws-sdk/util-hex-encoding/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-hex-encoding/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-hex-encoding/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-hex-encoding/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-hex-encoding/package.json create mode 100644 server/node_modules/@aws-sdk/util-locate-window/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-locate-window/README.md create mode 100644 server/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-locate-window/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-locate-window/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-locate-window/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-locate-window/package.json create mode 100644 server/node_modules/@aws-sdk/util-middleware/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-middleware/README.md create mode 100644 server/node_modules/@aws-sdk/util-middleware/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-middleware/dist-cjs/normalizeProvider.js create mode 100644 server/node_modules/@aws-sdk/util-middleware/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-middleware/dist-es/normalizeProvider.js create mode 100644 server/node_modules/@aws-sdk/util-middleware/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-middleware/dist-types/normalizeProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/util-middleware/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-middleware/dist-types/ts3.4/normalizeProvider.d.ts create mode 100644 server/node_modules/@aws-sdk/util-middleware/package.json create mode 100644 server/node_modules/@aws-sdk/util-retry/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-retry/README.md create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-cjs/AdaptiveRetryStrategy.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-cjs/DefaultRateLimiter.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-cjs/StandardRetryStrategy.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-cjs/config.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-cjs/constants.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-cjs/defaultRetryBackoffStrategy.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-cjs/defaultRetryToken.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-cjs/types.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-es/AdaptiveRetryStrategy.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-es/DefaultRateLimiter.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-es/StandardRetryStrategy.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-es/config.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-es/constants.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-es/defaultRetryBackoffStrategy.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-es/defaultRetryToken.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-es/types.js create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/AdaptiveRetryStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/DefaultRateLimiter.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/StandardRetryStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/config.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/defaultRetryBackoffStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/defaultRetryToken.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/AdaptiveRetryStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/DefaultRateLimiter.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/config.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/constants.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/defaultRetryBackoffStrategy.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/defaultRetryToken.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/types.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/dist-types/types.d.ts create mode 100644 server/node_modules/@aws-sdk/util-retry/package.json create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/CHANGELOG.md create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/README.md create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/escape-uri-path.js create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/escape-uri.js create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-es/escape-uri-path.js create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-es/escape-uri.js create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-types/escape-uri-path.d.ts create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-types/escape-uri.d.ts create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/escape-uri-path.d.ts create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/escape-uri.d.ts create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-uri-escape/package.json create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/README.md create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/configurations.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.native.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/configurations.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.native.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/configurations.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.native.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/configurations.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.native.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-browser/package.json create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/README.md create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/dist-types/is-crt-available.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/is-crt-available.d.ts create mode 100644 server/node_modules/@aws-sdk/util-user-agent-node/package.json create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/README.md create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/pureJs.js create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/whatwgEncodingApi.js create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-types/pureJs.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/pureJs.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/whatwgEncodingApi.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/dist-types/whatwgEncodingApi.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8-browser/package.json create mode 100644 server/node_modules/@aws-sdk/util-utf8/LICENSE create mode 100644 server/node_modules/@aws-sdk/util-utf8/README.md create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-cjs/fromUtf8.browser.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-cjs/fromUtf8.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-cjs/index.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUint8Array.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUtf8.browser.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUtf8.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-es/fromUtf8.browser.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-es/fromUtf8.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-es/index.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-es/toUint8Array.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-es/toUtf8.browser.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-es/toUtf8.js create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/fromUtf8.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/fromUtf8.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/toUint8Array.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/toUtf8.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/toUtf8.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/fromUtf8.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/fromUtf8.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/index.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUint8Array.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUtf8.browser.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUtf8.d.ts create mode 100644 server/node_modules/@aws-sdk/util-utf8/package.json delete mode 100644 server/node_modules/@sindresorhus/is/dist/index.d.ts delete mode 100644 server/node_modules/@sindresorhus/is/dist/index.js delete mode 100644 server/node_modules/@sindresorhus/is/dist/index.js.map delete mode 100644 server/node_modules/@sindresorhus/is/license delete mode 100644 server/node_modules/@sindresorhus/is/package.json delete mode 100644 server/node_modules/@sindresorhus/is/readme.md delete mode 100644 server/node_modules/@szmarczak/http-timer/LICENSE delete mode 100644 server/node_modules/@szmarczak/http-timer/README.md delete mode 100644 server/node_modules/@szmarczak/http-timer/package.json delete mode 100644 server/node_modules/@szmarczak/http-timer/source/index.js create mode 100755 server/node_modules/@types/node/LICENSE create mode 100755 server/node_modules/@types/node/README.md create mode 100755 server/node_modules/@types/node/assert.d.ts create mode 100755 server/node_modules/@types/node/assert/strict.d.ts create mode 100755 server/node_modules/@types/node/async_hooks.d.ts create mode 100755 server/node_modules/@types/node/buffer.d.ts create mode 100755 server/node_modules/@types/node/child_process.d.ts create mode 100755 server/node_modules/@types/node/cluster.d.ts create mode 100755 server/node_modules/@types/node/console.d.ts create mode 100755 server/node_modules/@types/node/constants.d.ts create mode 100755 server/node_modules/@types/node/crypto.d.ts create mode 100755 server/node_modules/@types/node/dgram.d.ts create mode 100755 server/node_modules/@types/node/diagnostics_channel.d.ts create mode 100755 server/node_modules/@types/node/dns.d.ts create mode 100755 server/node_modules/@types/node/dns/promises.d.ts create mode 100755 server/node_modules/@types/node/dom-events.d.ts create mode 100755 server/node_modules/@types/node/domain.d.ts create mode 100755 server/node_modules/@types/node/events.d.ts create mode 100755 server/node_modules/@types/node/fs.d.ts create mode 100755 server/node_modules/@types/node/fs/promises.d.ts create mode 100755 server/node_modules/@types/node/globals.d.ts create mode 100755 server/node_modules/@types/node/globals.global.d.ts create mode 100755 server/node_modules/@types/node/http.d.ts create mode 100755 server/node_modules/@types/node/http2.d.ts create mode 100755 server/node_modules/@types/node/https.d.ts create mode 100755 server/node_modules/@types/node/index.d.ts create mode 100755 server/node_modules/@types/node/inspector.d.ts create mode 100755 server/node_modules/@types/node/module.d.ts create mode 100755 server/node_modules/@types/node/net.d.ts create mode 100755 server/node_modules/@types/node/os.d.ts create mode 100755 server/node_modules/@types/node/package.json create mode 100755 server/node_modules/@types/node/path.d.ts create mode 100755 server/node_modules/@types/node/perf_hooks.d.ts create mode 100755 server/node_modules/@types/node/process.d.ts create mode 100755 server/node_modules/@types/node/punycode.d.ts create mode 100755 server/node_modules/@types/node/querystring.d.ts create mode 100755 server/node_modules/@types/node/readline.d.ts create mode 100755 server/node_modules/@types/node/readline/promises.d.ts create mode 100755 server/node_modules/@types/node/repl.d.ts create mode 100755 server/node_modules/@types/node/stream.d.ts create mode 100755 server/node_modules/@types/node/stream/consumers.d.ts create mode 100755 server/node_modules/@types/node/stream/promises.d.ts create mode 100755 server/node_modules/@types/node/stream/web.d.ts create mode 100755 server/node_modules/@types/node/string_decoder.d.ts create mode 100755 server/node_modules/@types/node/test.d.ts create mode 100755 server/node_modules/@types/node/timers.d.ts create mode 100755 server/node_modules/@types/node/timers/promises.d.ts create mode 100755 server/node_modules/@types/node/tls.d.ts create mode 100755 server/node_modules/@types/node/trace_events.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/assert.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/assert/strict.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/async_hooks.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/buffer.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/child_process.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/cluster.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/console.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/constants.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/crypto.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/dgram.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/dns.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/dns/promises.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/dom-events.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/domain.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/events.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/fs.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/fs/promises.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/globals.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/globals.global.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/http.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/http2.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/https.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/index.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/inspector.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/module.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/net.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/os.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/path.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/perf_hooks.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/process.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/punycode.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/querystring.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/readline.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/readline/promises.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/repl.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/stream.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/stream/consumers.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/stream/promises.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/stream/web.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/string_decoder.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/test.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/timers.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/timers/promises.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/tls.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/trace_events.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/tty.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/url.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/util.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/v8.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/vm.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/wasi.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/worker_threads.d.ts create mode 100755 server/node_modules/@types/node/ts4.8/zlib.d.ts create mode 100755 server/node_modules/@types/node/tty.d.ts create mode 100755 server/node_modules/@types/node/url.d.ts create mode 100755 server/node_modules/@types/node/util.d.ts create mode 100755 server/node_modules/@types/node/v8.d.ts create mode 100755 server/node_modules/@types/node/vm.d.ts create mode 100755 server/node_modules/@types/node/wasi.d.ts create mode 100755 server/node_modules/@types/node/worker_threads.d.ts create mode 100755 server/node_modules/@types/node/zlib.d.ts create mode 100755 server/node_modules/@types/webidl-conversions/LICENSE create mode 100755 server/node_modules/@types/webidl-conversions/README.md create mode 100755 server/node_modules/@types/webidl-conversions/index.d.ts create mode 100755 server/node_modules/@types/webidl-conversions/package.json create mode 100755 server/node_modules/@types/whatwg-url/LICENSE create mode 100755 server/node_modules/@types/whatwg-url/README.md create mode 100755 server/node_modules/@types/whatwg-url/dist/URL-impl.d.ts create mode 100755 server/node_modules/@types/whatwg-url/dist/URL.d.ts create mode 100755 server/node_modules/@types/whatwg-url/dist/URLSearchParams-impl.d.ts create mode 100755 server/node_modules/@types/whatwg-url/dist/URLSearchParams.d.ts create mode 100755 server/node_modules/@types/whatwg-url/index.d.ts create mode 100755 server/node_modules/@types/whatwg-url/package.json create mode 100755 server/node_modules/@types/whatwg-url/webidl2js-wrapper.d.ts delete mode 100644 server/node_modules/ansi-align/CHANGELOG.md delete mode 100644 server/node_modules/ansi-align/LICENSE delete mode 100644 server/node_modules/ansi-align/README.md delete mode 100644 server/node_modules/ansi-align/index.js delete mode 100644 server/node_modules/ansi-align/node_modules/string-width/index.js delete mode 100644 server/node_modules/ansi-align/node_modules/string-width/license delete mode 100644 server/node_modules/ansi-align/node_modules/string-width/package.json delete mode 100644 server/node_modules/ansi-align/node_modules/string-width/readme.md delete mode 100644 server/node_modules/ansi-align/package.json delete mode 100644 server/node_modules/ansi-regex/index.js delete mode 100644 server/node_modules/ansi-regex/license delete mode 100644 server/node_modules/ansi-regex/package.json delete mode 100644 server/node_modules/ansi-regex/readme.md delete mode 100644 server/node_modules/ansi-styles/index.d.ts delete mode 100644 server/node_modules/ansi-styles/index.js delete mode 100644 server/node_modules/ansi-styles/license delete mode 100644 server/node_modules/ansi-styles/package.json delete mode 100644 server/node_modules/ansi-styles/readme.md create mode 100644 server/node_modules/base64-js/LICENSE create mode 100644 server/node_modules/base64-js/README.md create mode 100644 server/node_modules/base64-js/base64js.min.js create mode 100644 server/node_modules/base64-js/index.d.ts create mode 100644 server/node_modules/base64-js/index.js create mode 100644 server/node_modules/base64-js/package.json create mode 100644 server/node_modules/bowser/CHANGELOG.md create mode 100644 server/node_modules/bowser/LICENSE create mode 100644 server/node_modules/bowser/README.md create mode 100644 server/node_modules/bowser/bundled.js create mode 100644 server/node_modules/bowser/es5.js create mode 100644 server/node_modules/bowser/index.d.ts create mode 100644 server/node_modules/bowser/package.json create mode 100644 server/node_modules/bowser/src/bowser.js create mode 100644 server/node_modules/bowser/src/constants.js create mode 100644 server/node_modules/bowser/src/parser-browsers.js create mode 100644 server/node_modules/bowser/src/parser-engines.js create mode 100644 server/node_modules/bowser/src/parser-os.js create mode 100644 server/node_modules/bowser/src/parser-platforms.js create mode 100644 server/node_modules/bowser/src/parser.js create mode 100644 server/node_modules/bowser/src/utils.js delete mode 100644 server/node_modules/boxen/index.d.ts delete mode 100644 server/node_modules/boxen/index.js delete mode 100644 server/node_modules/boxen/license delete mode 100644 server/node_modules/boxen/package.json delete mode 100644 server/node_modules/boxen/readme.md create mode 100644 server/node_modules/bson/LICENSE.md create mode 100644 server/node_modules/bson/README.md create mode 100644 server/node_modules/bson/bower.json create mode 100644 server/node_modules/bson/bson.d.ts create mode 100644 server/node_modules/bson/dist/bson.browser.esm.js create mode 100644 server/node_modules/bson/dist/bson.browser.esm.js.map create mode 100644 server/node_modules/bson/dist/bson.browser.umd.js create mode 100644 server/node_modules/bson/dist/bson.browser.umd.js.map create mode 100644 server/node_modules/bson/dist/bson.bundle.js create mode 100644 server/node_modules/bson/dist/bson.bundle.js.map create mode 100644 server/node_modules/bson/dist/bson.esm.js create mode 100644 server/node_modules/bson/dist/bson.esm.js.map create mode 100755 server/node_modules/bson/etc/prepare.js create mode 100644 server/node_modules/bson/lib/binary.js create mode 100644 server/node_modules/bson/lib/binary.js.map create mode 100644 server/node_modules/bson/lib/bson.js create mode 100644 server/node_modules/bson/lib/bson.js.map create mode 100644 server/node_modules/bson/lib/code.js create mode 100644 server/node_modules/bson/lib/code.js.map create mode 100644 server/node_modules/bson/lib/constants.js create mode 100644 server/node_modules/bson/lib/constants.js.map create mode 100644 server/node_modules/bson/lib/db_ref.js create mode 100644 server/node_modules/bson/lib/db_ref.js.map create mode 100644 server/node_modules/bson/lib/decimal128.js create mode 100644 server/node_modules/bson/lib/decimal128.js.map create mode 100644 server/node_modules/bson/lib/double.js create mode 100644 server/node_modules/bson/lib/double.js.map create mode 100644 server/node_modules/bson/lib/ensure_buffer.js create mode 100644 server/node_modules/bson/lib/ensure_buffer.js.map create mode 100644 server/node_modules/bson/lib/error.js create mode 100644 server/node_modules/bson/lib/error.js.map create mode 100644 server/node_modules/bson/lib/extended_json.js create mode 100644 server/node_modules/bson/lib/extended_json.js.map create mode 100644 server/node_modules/bson/lib/int_32.js create mode 100644 server/node_modules/bson/lib/int_32.js.map create mode 100644 server/node_modules/bson/lib/long.js create mode 100644 server/node_modules/bson/lib/long.js.map create mode 100644 server/node_modules/bson/lib/map.js create mode 100644 server/node_modules/bson/lib/map.js.map create mode 100644 server/node_modules/bson/lib/max_key.js create mode 100644 server/node_modules/bson/lib/max_key.js.map create mode 100644 server/node_modules/bson/lib/min_key.js create mode 100644 server/node_modules/bson/lib/min_key.js.map create mode 100644 server/node_modules/bson/lib/objectid.js create mode 100644 server/node_modules/bson/lib/objectid.js.map create mode 100644 server/node_modules/bson/lib/parser/calculate_size.js create mode 100644 server/node_modules/bson/lib/parser/calculate_size.js.map create mode 100644 server/node_modules/bson/lib/parser/deserializer.js create mode 100644 server/node_modules/bson/lib/parser/deserializer.js.map create mode 100644 server/node_modules/bson/lib/parser/serializer.js create mode 100644 server/node_modules/bson/lib/parser/serializer.js.map create mode 100644 server/node_modules/bson/lib/parser/utils.js create mode 100644 server/node_modules/bson/lib/parser/utils.js.map create mode 100644 server/node_modules/bson/lib/regexp.js create mode 100644 server/node_modules/bson/lib/regexp.js.map create mode 100644 server/node_modules/bson/lib/symbol.js create mode 100644 server/node_modules/bson/lib/symbol.js.map create mode 100644 server/node_modules/bson/lib/timestamp.js create mode 100644 server/node_modules/bson/lib/timestamp.js.map create mode 100644 server/node_modules/bson/lib/utils/global.js create mode 100644 server/node_modules/bson/lib/utils/global.js.map create mode 100644 server/node_modules/bson/lib/uuid_utils.js create mode 100644 server/node_modules/bson/lib/uuid_utils.js.map create mode 100644 server/node_modules/bson/lib/validate_utf8.js create mode 100644 server/node_modules/bson/lib/validate_utf8.js.map create mode 100644 server/node_modules/bson/package.json create mode 100644 server/node_modules/bson/src/binary.ts create mode 100644 server/node_modules/bson/src/bson.ts create mode 100644 server/node_modules/bson/src/code.ts create mode 100644 server/node_modules/bson/src/constants.ts create mode 100644 server/node_modules/bson/src/db_ref.ts create mode 100644 server/node_modules/bson/src/decimal128.ts create mode 100644 server/node_modules/bson/src/double.ts create mode 100644 server/node_modules/bson/src/ensure_buffer.ts create mode 100644 server/node_modules/bson/src/error.ts create mode 100644 server/node_modules/bson/src/extended_json.ts create mode 100644 server/node_modules/bson/src/int_32.ts create mode 100644 server/node_modules/bson/src/long.ts create mode 100644 server/node_modules/bson/src/map.ts create mode 100644 server/node_modules/bson/src/max_key.ts create mode 100644 server/node_modules/bson/src/min_key.ts create mode 100644 server/node_modules/bson/src/objectid.ts create mode 100644 server/node_modules/bson/src/parser/calculate_size.ts create mode 100644 server/node_modules/bson/src/parser/deserializer.ts create mode 100644 server/node_modules/bson/src/parser/serializer.ts create mode 100644 server/node_modules/bson/src/parser/utils.ts create mode 100644 server/node_modules/bson/src/regexp.ts create mode 100644 server/node_modules/bson/src/symbol.ts create mode 100644 server/node_modules/bson/src/timestamp.ts create mode 100644 server/node_modules/bson/src/utils/global.ts create mode 100644 server/node_modules/bson/src/uuid_utils.ts create mode 100644 server/node_modules/bson/src/validate_utf8.ts create mode 100644 server/node_modules/buffer/AUTHORS.md create mode 100644 server/node_modules/buffer/LICENSE create mode 100644 server/node_modules/buffer/README.md create mode 100644 server/node_modules/buffer/index.d.ts create mode 100644 server/node_modules/buffer/index.js create mode 100644 server/node_modules/buffer/package.json delete mode 100644 server/node_modules/cacheable-request/LICENSE delete mode 100644 server/node_modules/cacheable-request/README.md delete mode 100644 server/node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js delete mode 100644 server/node_modules/cacheable-request/node_modules/get-stream/index.d.ts delete mode 100644 server/node_modules/cacheable-request/node_modules/get-stream/index.js delete mode 100644 server/node_modules/cacheable-request/node_modules/get-stream/license delete mode 100644 server/node_modules/cacheable-request/node_modules/get-stream/package.json delete mode 100644 server/node_modules/cacheable-request/node_modules/get-stream/readme.md delete mode 100644 server/node_modules/cacheable-request/node_modules/lowercase-keys/index.d.ts delete mode 100644 server/node_modules/cacheable-request/node_modules/lowercase-keys/index.js delete mode 100644 server/node_modules/cacheable-request/node_modules/lowercase-keys/license delete mode 100644 server/node_modules/cacheable-request/node_modules/lowercase-keys/package.json delete mode 100644 server/node_modules/cacheable-request/node_modules/lowercase-keys/readme.md delete mode 100644 server/node_modules/cacheable-request/package.json delete mode 100644 server/node_modules/cacheable-request/src/index.js delete mode 100644 server/node_modules/camelcase/index.d.ts delete mode 100644 server/node_modules/camelcase/index.js delete mode 100644 server/node_modules/camelcase/license delete mode 100644 server/node_modules/camelcase/package.json delete mode 100644 server/node_modules/camelcase/readme.md delete mode 100644 server/node_modules/chalk/index.d.ts delete mode 100644 server/node_modules/chalk/license delete mode 100644 server/node_modules/chalk/node_modules/has-flag/index.d.ts delete mode 100644 server/node_modules/chalk/node_modules/has-flag/index.js delete mode 100644 server/node_modules/chalk/node_modules/has-flag/license delete mode 100644 server/node_modules/chalk/node_modules/has-flag/package.json delete mode 100644 server/node_modules/chalk/node_modules/has-flag/readme.md delete mode 100644 server/node_modules/chalk/node_modules/supports-color/browser.js delete mode 100644 server/node_modules/chalk/node_modules/supports-color/index.js delete mode 100644 server/node_modules/chalk/node_modules/supports-color/license delete mode 100644 server/node_modules/chalk/node_modules/supports-color/package.json delete mode 100644 server/node_modules/chalk/node_modules/supports-color/readme.md delete mode 100644 server/node_modules/chalk/package.json delete mode 100644 server/node_modules/chalk/readme.md delete mode 100644 server/node_modules/chalk/source/index.js delete mode 100644 server/node_modules/chalk/source/templates.js delete mode 100644 server/node_modules/chalk/source/util.js delete mode 100644 server/node_modules/ci-info/CHANGELOG.md delete mode 100644 server/node_modules/ci-info/LICENSE delete mode 100644 server/node_modules/ci-info/README.md delete mode 100644 server/node_modules/ci-info/index.js delete mode 100644 server/node_modules/ci-info/package.json delete mode 100644 server/node_modules/ci-info/vendors.json delete mode 100644 server/node_modules/cli-boxes/boxes.json delete mode 100644 server/node_modules/cli-boxes/index.d.ts delete mode 100644 server/node_modules/cli-boxes/index.js delete mode 100644 server/node_modules/cli-boxes/license delete mode 100644 server/node_modules/cli-boxes/package.json delete mode 100644 server/node_modules/cli-boxes/readme.md delete mode 100644 server/node_modules/clone-response/LICENSE delete mode 100644 server/node_modules/clone-response/README.md delete mode 100644 server/node_modules/clone-response/package.json delete mode 100644 server/node_modules/clone-response/src/index.js delete mode 100644 server/node_modules/color-convert/CHANGELOG.md delete mode 100644 server/node_modules/color-convert/LICENSE delete mode 100644 server/node_modules/color-convert/README.md delete mode 100644 server/node_modules/color-convert/conversions.js delete mode 100644 server/node_modules/color-convert/index.js delete mode 100644 server/node_modules/color-convert/package.json delete mode 100644 server/node_modules/color-convert/route.js delete mode 100644 server/node_modules/color-name/LICENSE delete mode 100644 server/node_modules/color-name/README.md delete mode 100644 server/node_modules/color-name/index.js delete mode 100644 server/node_modules/color-name/package.json delete mode 100644 server/node_modules/configstore/index.js delete mode 100644 server/node_modules/configstore/license delete mode 100644 server/node_modules/configstore/package.json delete mode 100644 server/node_modules/configstore/readme.md delete mode 100644 server/node_modules/crypto-random-string/index.d.ts delete mode 100644 server/node_modules/crypto-random-string/index.js delete mode 100644 server/node_modules/crypto-random-string/license delete mode 100644 server/node_modules/crypto-random-string/package.json delete mode 100644 server/node_modules/crypto-random-string/readme.md delete mode 100644 server/node_modules/decompress-response/index.js delete mode 100644 server/node_modules/decompress-response/license delete mode 100644 server/node_modules/decompress-response/package.json delete mode 100644 server/node_modules/decompress-response/readme.md delete mode 100644 server/node_modules/deep-extend/CHANGELOG.md delete mode 100644 server/node_modules/deep-extend/LICENSE delete mode 100644 server/node_modules/deep-extend/README.md delete mode 100644 server/node_modules/deep-extend/index.js delete mode 100644 server/node_modules/deep-extend/lib/deep-extend.js delete mode 100644 server/node_modules/deep-extend/package.json delete mode 100644 server/node_modules/defer-to-connect/LICENSE delete mode 100644 server/node_modules/defer-to-connect/README.md delete mode 100644 server/node_modules/defer-to-connect/dist/index.d.ts delete mode 100644 server/node_modules/defer-to-connect/dist/index.js delete mode 100644 server/node_modules/defer-to-connect/package.json delete mode 100644 server/node_modules/dot-prop/index.d.ts delete mode 100644 server/node_modules/dot-prop/index.js delete mode 100644 server/node_modules/dot-prop/license delete mode 100644 server/node_modules/dot-prop/package.json delete mode 100644 server/node_modules/dot-prop/readme.md delete mode 100644 server/node_modules/duplexer3/LICENSE.md delete mode 100644 server/node_modules/duplexer3/README.md delete mode 100644 server/node_modules/duplexer3/index.js delete mode 100644 server/node_modules/duplexer3/package.json delete mode 100644 server/node_modules/emoji-regex/README.md delete mode 100644 server/node_modules/emoji-regex/es2015/index.js delete mode 100644 server/node_modules/emoji-regex/es2015/text.js delete mode 100644 server/node_modules/emoji-regex/index.d.ts delete mode 100644 server/node_modules/emoji-regex/index.js delete mode 100644 server/node_modules/emoji-regex/package.json delete mode 100644 server/node_modules/emoji-regex/text.js delete mode 100644 server/node_modules/end-of-stream/LICENSE delete mode 100644 server/node_modules/end-of-stream/README.md delete mode 100644 server/node_modules/end-of-stream/index.js delete mode 100644 server/node_modules/end-of-stream/package.json delete mode 100644 server/node_modules/escape-goat/index.d.ts delete mode 100644 server/node_modules/escape-goat/index.js delete mode 100644 server/node_modules/escape-goat/license delete mode 100644 server/node_modules/escape-goat/package.json delete mode 100644 server/node_modules/escape-goat/readme.md create mode 100644 server/node_modules/fast-xml-parser/CHANGELOG.md create mode 100644 server/node_modules/fast-xml-parser/LICENSE create mode 100644 server/node_modules/fast-xml-parser/README.md create mode 100644 server/node_modules/fast-xml-parser/package.json create mode 100755 server/node_modules/fast-xml-parser/src/cli/cli.js create mode 100644 server/node_modules/fast-xml-parser/src/cli/man.js create mode 100644 server/node_modules/fast-xml-parser/src/cli/read.js create mode 100644 server/node_modules/fast-xml-parser/src/fxp.d.ts create mode 100644 server/node_modules/fast-xml-parser/src/fxp.js create mode 100644 server/node_modules/fast-xml-parser/src/util.js create mode 100644 server/node_modules/fast-xml-parser/src/validator.js create mode 100644 server/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js create mode 100644 server/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js create mode 100644 server/node_modules/fast-xml-parser/src/xmlbuilder/prettifyJs2Xml.js create mode 100644 server/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js create mode 100644 server/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js create mode 100644 server/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js create mode 100644 server/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js create mode 100644 server/node_modules/fast-xml-parser/src/xmlparser/node2json.js create mode 100644 server/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js delete mode 100644 server/node_modules/get-stream/buffer-stream.js delete mode 100644 server/node_modules/get-stream/index.js delete mode 100644 server/node_modules/get-stream/license delete mode 100644 server/node_modules/get-stream/package.json delete mode 100644 server/node_modules/get-stream/readme.md delete mode 100644 server/node_modules/global-dirs/index.d.ts delete mode 100644 server/node_modules/global-dirs/index.js delete mode 100644 server/node_modules/global-dirs/license delete mode 100644 server/node_modules/global-dirs/package.json delete mode 100644 server/node_modules/global-dirs/readme.md delete mode 100644 server/node_modules/got/license delete mode 100644 server/node_modules/got/package.json delete mode 100644 server/node_modules/got/readme.md delete mode 100644 server/node_modules/got/source/as-promise.js delete mode 100644 server/node_modules/got/source/as-stream.js delete mode 100644 server/node_modules/got/source/create.js delete mode 100644 server/node_modules/got/source/errors.js delete mode 100644 server/node_modules/got/source/get-response.js delete mode 100644 server/node_modules/got/source/index.js delete mode 100644 server/node_modules/got/source/known-hook-events.js delete mode 100644 server/node_modules/got/source/merge.js delete mode 100644 server/node_modules/got/source/normalize-arguments.js delete mode 100644 server/node_modules/got/source/progress.js delete mode 100644 server/node_modules/got/source/request-as-event-emitter.js delete mode 100644 server/node_modules/got/source/utils/deep-freeze.js delete mode 100644 server/node_modules/got/source/utils/get-body-size.js delete mode 100644 server/node_modules/got/source/utils/is-form-data.js delete mode 100644 server/node_modules/got/source/utils/timed-out.js delete mode 100644 server/node_modules/got/source/utils/url-to-options.js delete mode 100644 server/node_modules/graceful-fs/LICENSE delete mode 100644 server/node_modules/graceful-fs/README.md delete mode 100644 server/node_modules/graceful-fs/clone.js delete mode 100644 server/node_modules/graceful-fs/graceful-fs.js delete mode 100644 server/node_modules/graceful-fs/legacy-streams.js delete mode 100644 server/node_modules/graceful-fs/package.json delete mode 100644 server/node_modules/graceful-fs/polyfills.js delete mode 100644 server/node_modules/has-yarn/index.d.ts delete mode 100644 server/node_modules/has-yarn/index.js delete mode 100644 server/node_modules/has-yarn/license delete mode 100644 server/node_modules/has-yarn/package.json delete mode 100644 server/node_modules/has-yarn/readme.md delete mode 100644 server/node_modules/http-cache-semantics/LICENSE delete mode 100644 server/node_modules/http-cache-semantics/README.md delete mode 100644 server/node_modules/http-cache-semantics/index.js delete mode 100644 server/node_modules/http-cache-semantics/package.json create mode 100644 server/node_modules/ieee754/LICENSE create mode 100644 server/node_modules/ieee754/README.md create mode 100644 server/node_modules/ieee754/index.d.ts create mode 100644 server/node_modules/ieee754/index.js create mode 100644 server/node_modules/ieee754/package.json delete mode 100644 server/node_modules/import-lazy/index.js delete mode 100644 server/node_modules/import-lazy/license delete mode 100644 server/node_modules/import-lazy/package.json delete mode 100644 server/node_modules/import-lazy/readme.md delete mode 100644 server/node_modules/imurmurhash/README.md delete mode 100644 server/node_modules/imurmurhash/imurmurhash.js delete mode 100644 server/node_modules/imurmurhash/imurmurhash.min.js delete mode 100644 server/node_modules/imurmurhash/package.json delete mode 100644 server/node_modules/ini/README.md delete mode 100644 server/node_modules/ini/ini.js delete mode 100644 server/node_modules/ini/package.json create mode 100644 server/node_modules/ip/README.md create mode 100644 server/node_modules/ip/lib/ip.js create mode 100644 server/node_modules/ip/package.json delete mode 100644 server/node_modules/is-ci/CHANGELOG.md delete mode 100644 server/node_modules/is-ci/LICENSE delete mode 100644 server/node_modules/is-ci/README.md delete mode 100644 server/node_modules/is-ci/bin.js delete mode 100644 server/node_modules/is-ci/index.js delete mode 100644 server/node_modules/is-ci/package.json delete mode 100644 server/node_modules/is-fullwidth-code-point/index.js delete mode 100644 server/node_modules/is-fullwidth-code-point/license delete mode 100644 server/node_modules/is-fullwidth-code-point/package.json delete mode 100644 server/node_modules/is-fullwidth-code-point/readme.md delete mode 100644 server/node_modules/is-installed-globally/index.d.ts delete mode 100644 server/node_modules/is-installed-globally/index.js delete mode 100644 server/node_modules/is-installed-globally/license delete mode 100644 server/node_modules/is-installed-globally/package.json delete mode 100644 server/node_modules/is-installed-globally/readme.md delete mode 100644 server/node_modules/is-npm/index.d.ts delete mode 100644 server/node_modules/is-npm/index.js delete mode 100644 server/node_modules/is-npm/license delete mode 100644 server/node_modules/is-npm/package.json delete mode 100644 server/node_modules/is-npm/readme.md delete mode 100644 server/node_modules/is-obj/index.d.ts delete mode 100644 server/node_modules/is-obj/index.js delete mode 100644 server/node_modules/is-obj/license delete mode 100644 server/node_modules/is-obj/package.json delete mode 100644 server/node_modules/is-obj/readme.md delete mode 100644 server/node_modules/is-path-inside/index.d.ts delete mode 100644 server/node_modules/is-path-inside/index.js delete mode 100644 server/node_modules/is-path-inside/license delete mode 100644 server/node_modules/is-path-inside/package.json delete mode 100644 server/node_modules/is-path-inside/readme.md delete mode 100644 server/node_modules/is-typedarray/LICENSE.md delete mode 100644 server/node_modules/is-typedarray/README.md delete mode 100644 server/node_modules/is-typedarray/index.js delete mode 100644 server/node_modules/is-typedarray/package.json delete mode 100644 server/node_modules/is-typedarray/test.js delete mode 100644 server/node_modules/is-yarn-global/.travis.yml delete mode 100644 server/node_modules/is-yarn-global/LICENSE delete mode 100644 server/node_modules/is-yarn-global/README.md delete mode 100644 server/node_modules/is-yarn-global/index.js delete mode 100644 server/node_modules/is-yarn-global/package.json delete mode 100644 server/node_modules/json-buffer/.npmignore delete mode 100644 server/node_modules/json-buffer/.travis.yml delete mode 100644 server/node_modules/json-buffer/LICENSE delete mode 100644 server/node_modules/json-buffer/README.md delete mode 100644 server/node_modules/json-buffer/index.js delete mode 100644 server/node_modules/json-buffer/package.json delete mode 100644 server/node_modules/json-buffer/test/index.js create mode 100644 server/node_modules/kareem/LICENSE create mode 100644 server/node_modules/kareem/README.md create mode 100644 server/node_modules/kareem/index.js create mode 100644 server/node_modules/kareem/package.json delete mode 100644 server/node_modules/keyv/LICENSE delete mode 100644 server/node_modules/keyv/README.md delete mode 100644 server/node_modules/keyv/package.json delete mode 100644 server/node_modules/keyv/src/index.js delete mode 100644 server/node_modules/latest-version/index.d.ts delete mode 100644 server/node_modules/latest-version/index.js delete mode 100644 server/node_modules/latest-version/license delete mode 100644 server/node_modules/latest-version/package.json delete mode 100644 server/node_modules/latest-version/readme.md delete mode 100644 server/node_modules/lowercase-keys/index.js delete mode 100644 server/node_modules/lowercase-keys/license delete mode 100644 server/node_modules/lowercase-keys/package.json delete mode 100644 server/node_modules/lowercase-keys/readme.md delete mode 100644 server/node_modules/make-dir/index.d.ts delete mode 100644 server/node_modules/make-dir/index.js delete mode 100644 server/node_modules/make-dir/license delete mode 100644 server/node_modules/make-dir/node_modules/.bin/semver delete mode 100644 server/node_modules/make-dir/node_modules/.bin/semver.cmd delete mode 100644 server/node_modules/make-dir/node_modules/semver/CHANGELOG.md delete mode 100644 server/node_modules/make-dir/node_modules/semver/LICENSE delete mode 100644 server/node_modules/make-dir/node_modules/semver/README.md delete mode 100644 server/node_modules/make-dir/node_modules/semver/bin/semver.js delete mode 100644 server/node_modules/make-dir/node_modules/semver/package.json delete mode 100644 server/node_modules/make-dir/node_modules/semver/semver.js delete mode 100644 server/node_modules/make-dir/package.json delete mode 100644 server/node_modules/make-dir/readme.md create mode 100644 server/node_modules/memory-pager/.travis.yml create mode 100644 server/node_modules/memory-pager/LICENSE create mode 100644 server/node_modules/memory-pager/README.md create mode 100644 server/node_modules/memory-pager/index.js create mode 100644 server/node_modules/memory-pager/package.json create mode 100644 server/node_modules/memory-pager/test.js delete mode 100644 server/node_modules/mimic-response/index.js delete mode 100644 server/node_modules/mimic-response/license delete mode 100644 server/node_modules/mimic-response/package.json delete mode 100644 server/node_modules/mimic-response/readme.md delete mode 100644 server/node_modules/minimist/.travis.yml delete mode 100644 server/node_modules/minimist/LICENSE delete mode 100644 server/node_modules/minimist/example/parse.js delete mode 100644 server/node_modules/minimist/index.js delete mode 100644 server/node_modules/minimist/package.json delete mode 100644 server/node_modules/minimist/readme.markdown delete mode 100644 server/node_modules/minimist/test/all_bool.js delete mode 100644 server/node_modules/minimist/test/bool.js delete mode 100644 server/node_modules/minimist/test/dash.js delete mode 100644 server/node_modules/minimist/test/default_bool.js delete mode 100644 server/node_modules/minimist/test/dotted.js delete mode 100644 server/node_modules/minimist/test/kv_short.js delete mode 100644 server/node_modules/minimist/test/long.js delete mode 100644 server/node_modules/minimist/test/num.js delete mode 100644 server/node_modules/minimist/test/parse.js delete mode 100644 server/node_modules/minimist/test/parse_modified.js delete mode 100644 server/node_modules/minimist/test/proto.js delete mode 100644 server/node_modules/minimist/test/short.js delete mode 100644 server/node_modules/minimist/test/stop_early.js delete mode 100644 server/node_modules/minimist/test/unknown.js delete mode 100644 server/node_modules/minimist/test/whitespace.js create mode 100644 server/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs create mode 100644 server/node_modules/mongodb-connection-string-url/LICENSE create mode 100644 server/node_modules/mongodb-connection-string-url/README.md create mode 100644 server/node_modules/mongodb-connection-string-url/lib/index.d.ts create mode 100644 server/node_modules/mongodb-connection-string-url/lib/index.js create mode 100644 server/node_modules/mongodb-connection-string-url/lib/index.js.map create mode 100644 server/node_modules/mongodb-connection-string-url/lib/redact.d.ts create mode 100644 server/node_modules/mongodb-connection-string-url/lib/redact.js create mode 100644 server/node_modules/mongodb-connection-string-url/lib/redact.js.map create mode 100644 server/node_modules/mongodb-connection-string-url/package.json create mode 100644 server/node_modules/mongodb/LICENSE.md create mode 100644 server/node_modules/mongodb/README.md create mode 100755 server/node_modules/mongodb/etc/prepare.js create mode 100644 server/node_modules/mongodb/lib/admin.js create mode 100644 server/node_modules/mongodb/lib/admin.js.map create mode 100644 server/node_modules/mongodb/lib/bson.js create mode 100644 server/node_modules/mongodb/lib/bson.js.map create mode 100644 server/node_modules/mongodb/lib/bulk/common.js create mode 100644 server/node_modules/mongodb/lib/bulk/common.js.map create mode 100644 server/node_modules/mongodb/lib/bulk/ordered.js create mode 100644 server/node_modules/mongodb/lib/bulk/ordered.js.map create mode 100644 server/node_modules/mongodb/lib/bulk/unordered.js create mode 100644 server/node_modules/mongodb/lib/bulk/unordered.js.map create mode 100644 server/node_modules/mongodb/lib/change_stream.js create mode 100644 server/node_modules/mongodb/lib/change_stream.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/auth/auth_provider.js create mode 100644 server/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/auth/gssapi.js create mode 100644 server/node_modules/mongodb/lib/cmap/auth/gssapi.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js create mode 100644 server/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/auth/mongocr.js create mode 100644 server/node_modules/mongodb/lib/cmap/auth/mongocr.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js create mode 100644 server/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/auth/plain.js create mode 100644 server/node_modules/mongodb/lib/cmap/auth/plain.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/auth/providers.js create mode 100644 server/node_modules/mongodb/lib/cmap/auth/providers.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/auth/scram.js create mode 100644 server/node_modules/mongodb/lib/cmap/auth/scram.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/auth/x509.js create mode 100644 server/node_modules/mongodb/lib/cmap/auth/x509.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/command_monitoring_events.js create mode 100644 server/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/commands.js create mode 100644 server/node_modules/mongodb/lib/cmap/commands.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/connect.js create mode 100644 server/node_modules/mongodb/lib/cmap/connect.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/connection.js create mode 100644 server/node_modules/mongodb/lib/cmap/connection.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/connection_pool.js create mode 100644 server/node_modules/mongodb/lib/cmap/connection_pool.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/connection_pool_events.js create mode 100644 server/node_modules/mongodb/lib/cmap/connection_pool_events.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/errors.js create mode 100644 server/node_modules/mongodb/lib/cmap/errors.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/message_stream.js create mode 100644 server/node_modules/mongodb/lib/cmap/message_stream.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/metrics.js create mode 100644 server/node_modules/mongodb/lib/cmap/metrics.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/stream_description.js create mode 100644 server/node_modules/mongodb/lib/cmap/stream_description.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/wire_protocol/compression.js create mode 100644 server/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/wire_protocol/constants.js create mode 100644 server/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map create mode 100644 server/node_modules/mongodb/lib/cmap/wire_protocol/shared.js create mode 100644 server/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map create mode 100644 server/node_modules/mongodb/lib/collection.js create mode 100644 server/node_modules/mongodb/lib/collection.js.map create mode 100644 server/node_modules/mongodb/lib/connection_string.js create mode 100644 server/node_modules/mongodb/lib/connection_string.js.map create mode 100644 server/node_modules/mongodb/lib/constants.js create mode 100644 server/node_modules/mongodb/lib/constants.js.map create mode 100644 server/node_modules/mongodb/lib/cursor/abstract_cursor.js create mode 100644 server/node_modules/mongodb/lib/cursor/abstract_cursor.js.map create mode 100644 server/node_modules/mongodb/lib/cursor/aggregation_cursor.js create mode 100644 server/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map create mode 100644 server/node_modules/mongodb/lib/cursor/change_stream_cursor.js create mode 100644 server/node_modules/mongodb/lib/cursor/change_stream_cursor.js.map create mode 100644 server/node_modules/mongodb/lib/cursor/find_cursor.js create mode 100644 server/node_modules/mongodb/lib/cursor/find_cursor.js.map create mode 100644 server/node_modules/mongodb/lib/cursor/list_collections_cursor.js create mode 100644 server/node_modules/mongodb/lib/cursor/list_collections_cursor.js.map create mode 100644 server/node_modules/mongodb/lib/cursor/list_indexes_cursor.js create mode 100644 server/node_modules/mongodb/lib/cursor/list_indexes_cursor.js.map create mode 100644 server/node_modules/mongodb/lib/db.js create mode 100644 server/node_modules/mongodb/lib/db.js.map create mode 100644 server/node_modules/mongodb/lib/deps.js create mode 100644 server/node_modules/mongodb/lib/deps.js.map create mode 100644 server/node_modules/mongodb/lib/encrypter.js create mode 100644 server/node_modules/mongodb/lib/encrypter.js.map create mode 100644 server/node_modules/mongodb/lib/error.js create mode 100644 server/node_modules/mongodb/lib/error.js.map create mode 100644 server/node_modules/mongodb/lib/explain.js create mode 100644 server/node_modules/mongodb/lib/explain.js.map create mode 100644 server/node_modules/mongodb/lib/gridfs/download.js create mode 100644 server/node_modules/mongodb/lib/gridfs/download.js.map create mode 100644 server/node_modules/mongodb/lib/gridfs/index.js create mode 100644 server/node_modules/mongodb/lib/gridfs/index.js.map create mode 100644 server/node_modules/mongodb/lib/gridfs/upload.js create mode 100644 server/node_modules/mongodb/lib/gridfs/upload.js.map create mode 100644 server/node_modules/mongodb/lib/index.js create mode 100644 server/node_modules/mongodb/lib/index.js.map create mode 100644 server/node_modules/mongodb/lib/logger.js create mode 100644 server/node_modules/mongodb/lib/logger.js.map create mode 100644 server/node_modules/mongodb/lib/mongo_client.js create mode 100644 server/node_modules/mongodb/lib/mongo_client.js.map create mode 100644 server/node_modules/mongodb/lib/mongo_logger.js create mode 100644 server/node_modules/mongodb/lib/mongo_logger.js.map create mode 100644 server/node_modules/mongodb/lib/mongo_types.js create mode 100644 server/node_modules/mongodb/lib/mongo_types.js.map create mode 100644 server/node_modules/mongodb/lib/operations/add_user.js create mode 100644 server/node_modules/mongodb/lib/operations/add_user.js.map create mode 100644 server/node_modules/mongodb/lib/operations/aggregate.js create mode 100644 server/node_modules/mongodb/lib/operations/aggregate.js.map create mode 100644 server/node_modules/mongodb/lib/operations/bulk_write.js create mode 100644 server/node_modules/mongodb/lib/operations/bulk_write.js.map create mode 100644 server/node_modules/mongodb/lib/operations/collections.js create mode 100644 server/node_modules/mongodb/lib/operations/collections.js.map create mode 100644 server/node_modules/mongodb/lib/operations/command.js create mode 100644 server/node_modules/mongodb/lib/operations/command.js.map create mode 100644 server/node_modules/mongodb/lib/operations/common_functions.js create mode 100644 server/node_modules/mongodb/lib/operations/common_functions.js.map create mode 100644 server/node_modules/mongodb/lib/operations/count.js create mode 100644 server/node_modules/mongodb/lib/operations/count.js.map create mode 100644 server/node_modules/mongodb/lib/operations/count_documents.js create mode 100644 server/node_modules/mongodb/lib/operations/count_documents.js.map create mode 100644 server/node_modules/mongodb/lib/operations/create_collection.js create mode 100644 server/node_modules/mongodb/lib/operations/create_collection.js.map create mode 100644 server/node_modules/mongodb/lib/operations/delete.js create mode 100644 server/node_modules/mongodb/lib/operations/delete.js.map create mode 100644 server/node_modules/mongodb/lib/operations/distinct.js create mode 100644 server/node_modules/mongodb/lib/operations/distinct.js.map create mode 100644 server/node_modules/mongodb/lib/operations/drop.js create mode 100644 server/node_modules/mongodb/lib/operations/drop.js.map create mode 100644 server/node_modules/mongodb/lib/operations/estimated_document_count.js create mode 100644 server/node_modules/mongodb/lib/operations/estimated_document_count.js.map create mode 100644 server/node_modules/mongodb/lib/operations/eval.js create mode 100644 server/node_modules/mongodb/lib/operations/eval.js.map create mode 100644 server/node_modules/mongodb/lib/operations/execute_operation.js create mode 100644 server/node_modules/mongodb/lib/operations/execute_operation.js.map create mode 100644 server/node_modules/mongodb/lib/operations/find.js create mode 100644 server/node_modules/mongodb/lib/operations/find.js.map create mode 100644 server/node_modules/mongodb/lib/operations/find_and_modify.js create mode 100644 server/node_modules/mongodb/lib/operations/find_and_modify.js.map create mode 100644 server/node_modules/mongodb/lib/operations/get_more.js create mode 100644 server/node_modules/mongodb/lib/operations/get_more.js.map create mode 100644 server/node_modules/mongodb/lib/operations/indexes.js create mode 100644 server/node_modules/mongodb/lib/operations/indexes.js.map create mode 100644 server/node_modules/mongodb/lib/operations/insert.js create mode 100644 server/node_modules/mongodb/lib/operations/insert.js.map create mode 100644 server/node_modules/mongodb/lib/operations/is_capped.js create mode 100644 server/node_modules/mongodb/lib/operations/is_capped.js.map create mode 100644 server/node_modules/mongodb/lib/operations/kill_cursors.js create mode 100644 server/node_modules/mongodb/lib/operations/kill_cursors.js.map create mode 100644 server/node_modules/mongodb/lib/operations/list_collections.js create mode 100644 server/node_modules/mongodb/lib/operations/list_collections.js.map create mode 100644 server/node_modules/mongodb/lib/operations/list_databases.js create mode 100644 server/node_modules/mongodb/lib/operations/list_databases.js.map create mode 100644 server/node_modules/mongodb/lib/operations/map_reduce.js create mode 100644 server/node_modules/mongodb/lib/operations/map_reduce.js.map create mode 100644 server/node_modules/mongodb/lib/operations/operation.js create mode 100644 server/node_modules/mongodb/lib/operations/operation.js.map create mode 100644 server/node_modules/mongodb/lib/operations/options_operation.js create mode 100644 server/node_modules/mongodb/lib/operations/options_operation.js.map create mode 100644 server/node_modules/mongodb/lib/operations/profiling_level.js create mode 100644 server/node_modules/mongodb/lib/operations/profiling_level.js.map create mode 100644 server/node_modules/mongodb/lib/operations/remove_user.js create mode 100644 server/node_modules/mongodb/lib/operations/remove_user.js.map create mode 100644 server/node_modules/mongodb/lib/operations/rename.js create mode 100644 server/node_modules/mongodb/lib/operations/rename.js.map create mode 100644 server/node_modules/mongodb/lib/operations/run_command.js create mode 100644 server/node_modules/mongodb/lib/operations/run_command.js.map create mode 100644 server/node_modules/mongodb/lib/operations/set_profiling_level.js create mode 100644 server/node_modules/mongodb/lib/operations/set_profiling_level.js.map create mode 100644 server/node_modules/mongodb/lib/operations/stats.js create mode 100644 server/node_modules/mongodb/lib/operations/stats.js.map create mode 100644 server/node_modules/mongodb/lib/operations/update.js create mode 100644 server/node_modules/mongodb/lib/operations/update.js.map create mode 100644 server/node_modules/mongodb/lib/operations/validate_collection.js create mode 100644 server/node_modules/mongodb/lib/operations/validate_collection.js.map create mode 100644 server/node_modules/mongodb/lib/promise_provider.js create mode 100644 server/node_modules/mongodb/lib/promise_provider.js.map create mode 100644 server/node_modules/mongodb/lib/read_concern.js create mode 100644 server/node_modules/mongodb/lib/read_concern.js.map create mode 100644 server/node_modules/mongodb/lib/read_preference.js create mode 100644 server/node_modules/mongodb/lib/read_preference.js.map create mode 100644 server/node_modules/mongodb/lib/sdam/common.js create mode 100644 server/node_modules/mongodb/lib/sdam/common.js.map create mode 100644 server/node_modules/mongodb/lib/sdam/events.js create mode 100644 server/node_modules/mongodb/lib/sdam/events.js.map create mode 100644 server/node_modules/mongodb/lib/sdam/monitor.js create mode 100644 server/node_modules/mongodb/lib/sdam/monitor.js.map create mode 100644 server/node_modules/mongodb/lib/sdam/server.js create mode 100644 server/node_modules/mongodb/lib/sdam/server.js.map create mode 100644 server/node_modules/mongodb/lib/sdam/server_description.js create mode 100644 server/node_modules/mongodb/lib/sdam/server_description.js.map create mode 100644 server/node_modules/mongodb/lib/sdam/server_selection.js create mode 100644 server/node_modules/mongodb/lib/sdam/server_selection.js.map create mode 100644 server/node_modules/mongodb/lib/sdam/srv_polling.js create mode 100644 server/node_modules/mongodb/lib/sdam/srv_polling.js.map create mode 100644 server/node_modules/mongodb/lib/sdam/topology.js create mode 100644 server/node_modules/mongodb/lib/sdam/topology.js.map create mode 100644 server/node_modules/mongodb/lib/sdam/topology_description.js create mode 100644 server/node_modules/mongodb/lib/sdam/topology_description.js.map create mode 100644 server/node_modules/mongodb/lib/sessions.js create mode 100644 server/node_modules/mongodb/lib/sessions.js.map create mode 100644 server/node_modules/mongodb/lib/sort.js create mode 100644 server/node_modules/mongodb/lib/sort.js.map create mode 100644 server/node_modules/mongodb/lib/transactions.js create mode 100644 server/node_modules/mongodb/lib/transactions.js.map create mode 100644 server/node_modules/mongodb/lib/utils.js create mode 100644 server/node_modules/mongodb/lib/utils.js.map create mode 100644 server/node_modules/mongodb/lib/write_concern.js create mode 100644 server/node_modules/mongodb/lib/write_concern.js.map create mode 100644 server/node_modules/mongodb/mongodb.d.ts create mode 100644 server/node_modules/mongodb/package.json create mode 100644 server/node_modules/mongodb/src/admin.ts create mode 100644 server/node_modules/mongodb/src/bson.ts create mode 100644 server/node_modules/mongodb/src/bulk/common.ts create mode 100644 server/node_modules/mongodb/src/bulk/ordered.ts create mode 100644 server/node_modules/mongodb/src/bulk/unordered.ts create mode 100644 server/node_modules/mongodb/src/change_stream.ts create mode 100644 server/node_modules/mongodb/src/cmap/auth/auth_provider.ts create mode 100644 server/node_modules/mongodb/src/cmap/auth/gssapi.ts create mode 100644 server/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts create mode 100644 server/node_modules/mongodb/src/cmap/auth/mongocr.ts create mode 100644 server/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts create mode 100644 server/node_modules/mongodb/src/cmap/auth/plain.ts create mode 100644 server/node_modules/mongodb/src/cmap/auth/providers.ts create mode 100644 server/node_modules/mongodb/src/cmap/auth/scram.ts create mode 100644 server/node_modules/mongodb/src/cmap/auth/x509.ts create mode 100644 server/node_modules/mongodb/src/cmap/command_monitoring_events.ts create mode 100644 server/node_modules/mongodb/src/cmap/commands.ts create mode 100644 server/node_modules/mongodb/src/cmap/connect.ts create mode 100644 server/node_modules/mongodb/src/cmap/connection.ts create mode 100644 server/node_modules/mongodb/src/cmap/connection_pool.ts create mode 100644 server/node_modules/mongodb/src/cmap/connection_pool_events.ts create mode 100644 server/node_modules/mongodb/src/cmap/errors.ts create mode 100644 server/node_modules/mongodb/src/cmap/message_stream.ts create mode 100644 server/node_modules/mongodb/src/cmap/metrics.ts create mode 100644 server/node_modules/mongodb/src/cmap/stream_description.ts create mode 100644 server/node_modules/mongodb/src/cmap/wire_protocol/compression.ts create mode 100644 server/node_modules/mongodb/src/cmap/wire_protocol/constants.ts create mode 100644 server/node_modules/mongodb/src/cmap/wire_protocol/shared.ts create mode 100644 server/node_modules/mongodb/src/collection.ts create mode 100644 server/node_modules/mongodb/src/connection_string.ts create mode 100644 server/node_modules/mongodb/src/constants.ts create mode 100644 server/node_modules/mongodb/src/cursor/abstract_cursor.ts create mode 100644 server/node_modules/mongodb/src/cursor/aggregation_cursor.ts create mode 100644 server/node_modules/mongodb/src/cursor/change_stream_cursor.ts create mode 100644 server/node_modules/mongodb/src/cursor/find_cursor.ts create mode 100644 server/node_modules/mongodb/src/cursor/list_collections_cursor.ts create mode 100644 server/node_modules/mongodb/src/cursor/list_indexes_cursor.ts create mode 100644 server/node_modules/mongodb/src/db.ts create mode 100644 server/node_modules/mongodb/src/deps.ts create mode 100644 server/node_modules/mongodb/src/encrypter.ts create mode 100644 server/node_modules/mongodb/src/error.ts create mode 100644 server/node_modules/mongodb/src/explain.ts create mode 100644 server/node_modules/mongodb/src/gridfs/download.ts create mode 100644 server/node_modules/mongodb/src/gridfs/index.ts create mode 100644 server/node_modules/mongodb/src/gridfs/upload.ts create mode 100644 server/node_modules/mongodb/src/index.ts create mode 100644 server/node_modules/mongodb/src/logger.ts create mode 100644 server/node_modules/mongodb/src/mongo_client.ts create mode 100644 server/node_modules/mongodb/src/mongo_logger.ts create mode 100644 server/node_modules/mongodb/src/mongo_types.ts create mode 100644 server/node_modules/mongodb/src/operations/add_user.ts create mode 100644 server/node_modules/mongodb/src/operations/aggregate.ts create mode 100644 server/node_modules/mongodb/src/operations/bulk_write.ts create mode 100644 server/node_modules/mongodb/src/operations/collections.ts create mode 100644 server/node_modules/mongodb/src/operations/command.ts create mode 100644 server/node_modules/mongodb/src/operations/common_functions.ts create mode 100644 server/node_modules/mongodb/src/operations/count.ts create mode 100644 server/node_modules/mongodb/src/operations/count_documents.ts create mode 100644 server/node_modules/mongodb/src/operations/create_collection.ts create mode 100644 server/node_modules/mongodb/src/operations/delete.ts create mode 100644 server/node_modules/mongodb/src/operations/distinct.ts create mode 100644 server/node_modules/mongodb/src/operations/drop.ts create mode 100644 server/node_modules/mongodb/src/operations/estimated_document_count.ts create mode 100644 server/node_modules/mongodb/src/operations/eval.ts create mode 100644 server/node_modules/mongodb/src/operations/execute_operation.ts create mode 100644 server/node_modules/mongodb/src/operations/find.ts create mode 100644 server/node_modules/mongodb/src/operations/find_and_modify.ts create mode 100644 server/node_modules/mongodb/src/operations/get_more.ts create mode 100644 server/node_modules/mongodb/src/operations/indexes.ts create mode 100644 server/node_modules/mongodb/src/operations/insert.ts create mode 100644 server/node_modules/mongodb/src/operations/is_capped.ts create mode 100644 server/node_modules/mongodb/src/operations/kill_cursors.ts create mode 100644 server/node_modules/mongodb/src/operations/list_collections.ts create mode 100644 server/node_modules/mongodb/src/operations/list_databases.ts create mode 100644 server/node_modules/mongodb/src/operations/map_reduce.ts create mode 100644 server/node_modules/mongodb/src/operations/operation.ts create mode 100644 server/node_modules/mongodb/src/operations/options_operation.ts create mode 100644 server/node_modules/mongodb/src/operations/profiling_level.ts create mode 100644 server/node_modules/mongodb/src/operations/remove_user.ts create mode 100644 server/node_modules/mongodb/src/operations/rename.ts create mode 100644 server/node_modules/mongodb/src/operations/run_command.ts create mode 100644 server/node_modules/mongodb/src/operations/set_profiling_level.ts create mode 100644 server/node_modules/mongodb/src/operations/stats.ts create mode 100644 server/node_modules/mongodb/src/operations/update.ts create mode 100644 server/node_modules/mongodb/src/operations/validate_collection.ts create mode 100644 server/node_modules/mongodb/src/promise_provider.ts create mode 100644 server/node_modules/mongodb/src/read_concern.ts create mode 100644 server/node_modules/mongodb/src/read_preference.ts create mode 100644 server/node_modules/mongodb/src/sdam/common.ts create mode 100644 server/node_modules/mongodb/src/sdam/events.ts create mode 100644 server/node_modules/mongodb/src/sdam/monitor.ts create mode 100644 server/node_modules/mongodb/src/sdam/server.ts create mode 100644 server/node_modules/mongodb/src/sdam/server_description.ts create mode 100644 server/node_modules/mongodb/src/sdam/server_selection.ts create mode 100644 server/node_modules/mongodb/src/sdam/srv_polling.ts create mode 100644 server/node_modules/mongodb/src/sdam/topology.ts create mode 100644 server/node_modules/mongodb/src/sdam/topology_description.ts create mode 100644 server/node_modules/mongodb/src/sessions.ts create mode 100644 server/node_modules/mongodb/src/sort.ts create mode 100644 server/node_modules/mongodb/src/transactions.ts create mode 100644 server/node_modules/mongodb/src/utils.ts create mode 100644 server/node_modules/mongodb/src/write_concern.ts create mode 100644 server/node_modules/mongodb/tsconfig.json create mode 100644 server/node_modules/mongoose/.eslintrc.json create mode 100644 server/node_modules/mongoose/.mocharc.yml create mode 100644 server/node_modules/mongoose/LICENSE.md create mode 100644 server/node_modules/mongoose/README.md create mode 100644 server/node_modules/mongoose/SECURITY.md create mode 100644 server/node_modules/mongoose/browser.js create mode 100644 server/node_modules/mongoose/dist/browser.umd.js create mode 100644 server/node_modules/mongoose/index.js create mode 100644 server/node_modules/mongoose/lgtm.yml create mode 100644 server/node_modules/mongoose/lib/aggregate.js create mode 100644 server/node_modules/mongoose/lib/browser.js create mode 100644 server/node_modules/mongoose/lib/browserDocument.js create mode 100644 server/node_modules/mongoose/lib/cast.js create mode 100644 server/node_modules/mongoose/lib/cast/boolean.js create mode 100644 server/node_modules/mongoose/lib/cast/date.js create mode 100644 server/node_modules/mongoose/lib/cast/decimal128.js create mode 100644 server/node_modules/mongoose/lib/cast/number.js create mode 100644 server/node_modules/mongoose/lib/cast/objectid.js create mode 100644 server/node_modules/mongoose/lib/cast/string.js create mode 100644 server/node_modules/mongoose/lib/collection.js create mode 100644 server/node_modules/mongoose/lib/connection.js create mode 100644 server/node_modules/mongoose/lib/connectionstate.js create mode 100644 server/node_modules/mongoose/lib/cursor/AggregationCursor.js create mode 100644 server/node_modules/mongoose/lib/cursor/ChangeStream.js create mode 100644 server/node_modules/mongoose/lib/cursor/QueryCursor.js create mode 100644 server/node_modules/mongoose/lib/document.js create mode 100644 server/node_modules/mongoose/lib/document_provider.js create mode 100644 server/node_modules/mongoose/lib/driver.js create mode 100644 server/node_modules/mongoose/lib/drivers/SPEC.md create mode 100644 server/node_modules/mongoose/lib/drivers/browser/ReadPreference.js create mode 100644 server/node_modules/mongoose/lib/drivers/browser/binary.js create mode 100644 server/node_modules/mongoose/lib/drivers/browser/decimal128.js create mode 100644 server/node_modules/mongoose/lib/drivers/browser/index.js create mode 100644 server/node_modules/mongoose/lib/drivers/browser/objectid.js create mode 100644 server/node_modules/mongoose/lib/drivers/node-mongodb-native/ReadPreference.js create mode 100644 server/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.js create mode 100644 server/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js create mode 100644 server/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js create mode 100644 server/node_modules/mongoose/lib/drivers/node-mongodb-native/decimal128.js create mode 100644 server/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js create mode 100644 server/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js create mode 100644 server/node_modules/mongoose/lib/error/browserMissingSchema.js create mode 100644 server/node_modules/mongoose/lib/error/cast.js create mode 100644 server/node_modules/mongoose/lib/error/disconnected.js create mode 100644 server/node_modules/mongoose/lib/error/divergentArray.js create mode 100644 server/node_modules/mongoose/lib/error/eachAsyncMultiError.js create mode 100644 server/node_modules/mongoose/lib/error/index.js create mode 100644 server/node_modules/mongoose/lib/error/messages.js create mode 100644 server/node_modules/mongoose/lib/error/missingSchema.js create mode 100644 server/node_modules/mongoose/lib/error/mongooseError.js create mode 100644 server/node_modules/mongoose/lib/error/notFound.js create mode 100644 server/node_modules/mongoose/lib/error/objectExpected.js create mode 100644 server/node_modules/mongoose/lib/error/objectParameter.js create mode 100644 server/node_modules/mongoose/lib/error/overwriteModel.js create mode 100644 server/node_modules/mongoose/lib/error/parallelSave.js create mode 100644 server/node_modules/mongoose/lib/error/parallelValidate.js create mode 100644 server/node_modules/mongoose/lib/error/serverSelection.js create mode 100644 server/node_modules/mongoose/lib/error/setOptionError.js create mode 100644 server/node_modules/mongoose/lib/error/strict.js create mode 100644 server/node_modules/mongoose/lib/error/strictPopulate.js create mode 100644 server/node_modules/mongoose/lib/error/syncIndexes.js create mode 100644 server/node_modules/mongoose/lib/error/validation.js create mode 100644 server/node_modules/mongoose/lib/error/validator.js create mode 100644 server/node_modules/mongoose/lib/error/version.js create mode 100644 server/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js create mode 100644 server/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js create mode 100644 server/node_modules/mongoose/lib/helpers/arrayDepth.js create mode 100644 server/node_modules/mongoose/lib/helpers/clone.js create mode 100644 server/node_modules/mongoose/lib/helpers/common.js create mode 100644 server/node_modules/mongoose/lib/helpers/cursor/eachAsync.js create mode 100644 server/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js create mode 100644 server/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js create mode 100644 server/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js create mode 100644 server/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js create mode 100644 server/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js create mode 100644 server/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js create mode 100644 server/node_modules/mongoose/lib/helpers/document/applyDefaults.js create mode 100644 server/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js create mode 100644 server/node_modules/mongoose/lib/helpers/document/compile.js create mode 100644 server/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js create mode 100644 server/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js create mode 100644 server/node_modules/mongoose/lib/helpers/each.js create mode 100644 server/node_modules/mongoose/lib/helpers/error/combinePathErrors.js create mode 100644 server/node_modules/mongoose/lib/helpers/firstKey.js create mode 100644 server/node_modules/mongoose/lib/helpers/get.js create mode 100644 server/node_modules/mongoose/lib/helpers/getConstructorName.js create mode 100644 server/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js create mode 100644 server/node_modules/mongoose/lib/helpers/getFunctionName.js create mode 100644 server/node_modules/mongoose/lib/helpers/immediate.js create mode 100644 server/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js create mode 100644 server/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js create mode 100644 server/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js create mode 100644 server/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js create mode 100644 server/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js create mode 100644 server/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js create mode 100644 server/node_modules/mongoose/lib/helpers/isAsyncFunction.js create mode 100644 server/node_modules/mongoose/lib/helpers/isBsonType.js create mode 100644 server/node_modules/mongoose/lib/helpers/isMongooseObject.js create mode 100644 server/node_modules/mongoose/lib/helpers/isObject.js create mode 100644 server/node_modules/mongoose/lib/helpers/isPromise.js create mode 100644 server/node_modules/mongoose/lib/helpers/isSimpleValidator.js create mode 100644 server/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js create mode 100644 server/node_modules/mongoose/lib/helpers/model/applyHooks.js create mode 100644 server/node_modules/mongoose/lib/helpers/model/applyMethods.js create mode 100644 server/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js create mode 100644 server/node_modules/mongoose/lib/helpers/model/applyStatics.js create mode 100644 server/node_modules/mongoose/lib/helpers/model/castBulkWrite.js create mode 100644 server/node_modules/mongoose/lib/helpers/model/discriminator.js create mode 100644 server/node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js create mode 100644 server/node_modules/mongoose/lib/helpers/once.js create mode 100644 server/node_modules/mongoose/lib/helpers/parallelLimit.js create mode 100644 server/node_modules/mongoose/lib/helpers/path/flattenObjectWithDottedPaths.js create mode 100644 server/node_modules/mongoose/lib/helpers/path/parentPaths.js create mode 100644 server/node_modules/mongoose/lib/helpers/path/setDottedPath.js create mode 100644 server/node_modules/mongoose/lib/helpers/pluralize.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/assignVals.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/getVirtual.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js create mode 100644 server/node_modules/mongoose/lib/helpers/populate/validateRef.js create mode 100644 server/node_modules/mongoose/lib/helpers/printJestWarning.js create mode 100644 server/node_modules/mongoose/lib/helpers/printStrictQueryWarning.js create mode 100644 server/node_modules/mongoose/lib/helpers/processConnectionOptions.js create mode 100644 server/node_modules/mongoose/lib/helpers/projection/applyProjection.js create mode 100644 server/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js create mode 100644 server/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js create mode 100644 server/node_modules/mongoose/lib/helpers/projection/isExclusive.js create mode 100644 server/node_modules/mongoose/lib/helpers/projection/isInclusive.js create mode 100644 server/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js create mode 100644 server/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js create mode 100644 server/node_modules/mongoose/lib/helpers/projection/isSubpath.js create mode 100644 server/node_modules/mongoose/lib/helpers/projection/parseProjection.js create mode 100644 server/node_modules/mongoose/lib/helpers/promiseOrCallback.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/cast$expr.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/castFilterPath.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/castUpdate.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/completeMany.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/handleImmutable.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/isOperator.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/trusted.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/validOps.js create mode 100644 server/node_modules/mongoose/lib/helpers/query/wrapThunk.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/addAutoId.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/applyPlugins.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/getIndexes.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/getPath.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/handleIdOption.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/idGetter.js create mode 100644 server/node_modules/mongoose/lib/helpers/schema/merge.js create mode 100644 server/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js create mode 100644 server/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js create mode 100644 server/node_modules/mongoose/lib/helpers/specialProperties.js create mode 100644 server/node_modules/mongoose/lib/helpers/symbols.js create mode 100644 server/node_modules/mongoose/lib/helpers/timers.js create mode 100644 server/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js create mode 100644 server/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js create mode 100644 server/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js create mode 100644 server/node_modules/mongoose/lib/helpers/topology/isAtlas.js create mode 100644 server/node_modules/mongoose/lib/helpers/topology/isSSLError.js create mode 100644 server/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js create mode 100644 server/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js create mode 100644 server/node_modules/mongoose/lib/helpers/update/castArrayFilters.js create mode 100644 server/node_modules/mongoose/lib/helpers/update/modifiedPaths.js create mode 100644 server/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js create mode 100644 server/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js create mode 100644 server/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js create mode 100644 server/node_modules/mongoose/lib/helpers/updateValidators.js create mode 100644 server/node_modules/mongoose/lib/index.js create mode 100644 server/node_modules/mongoose/lib/internal.js create mode 100644 server/node_modules/mongoose/lib/model.js create mode 100644 server/node_modules/mongoose/lib/options.js create mode 100644 server/node_modules/mongoose/lib/options/PopulateOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaArrayOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaBufferOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaDateOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaMapOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaNumberOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaObjectIdOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaStringOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaSubdocumentOptions.js create mode 100644 server/node_modules/mongoose/lib/options/SchemaTypeOptions.js create mode 100644 server/node_modules/mongoose/lib/options/VirtualOptions.js create mode 100644 server/node_modules/mongoose/lib/options/propertyOptions.js create mode 100644 server/node_modules/mongoose/lib/options/removeOptions.js create mode 100644 server/node_modules/mongoose/lib/options/saveOptions.js create mode 100644 server/node_modules/mongoose/lib/plugins/index.js create mode 100644 server/node_modules/mongoose/lib/plugins/removeSubdocs.js create mode 100644 server/node_modules/mongoose/lib/plugins/saveSubdocs.js create mode 100644 server/node_modules/mongoose/lib/plugins/sharding.js create mode 100644 server/node_modules/mongoose/lib/plugins/trackTransaction.js create mode 100644 server/node_modules/mongoose/lib/plugins/validateBeforeSave.js create mode 100644 server/node_modules/mongoose/lib/promise_provider.js create mode 100644 server/node_modules/mongoose/lib/query.js create mode 100644 server/node_modules/mongoose/lib/queryhelpers.js create mode 100644 server/node_modules/mongoose/lib/schema.js create mode 100644 server/node_modules/mongoose/lib/schema/SubdocumentPath.js create mode 100644 server/node_modules/mongoose/lib/schema/array.js create mode 100644 server/node_modules/mongoose/lib/schema/boolean.js create mode 100644 server/node_modules/mongoose/lib/schema/buffer.js create mode 100644 server/node_modules/mongoose/lib/schema/date.js create mode 100644 server/node_modules/mongoose/lib/schema/decimal128.js create mode 100644 server/node_modules/mongoose/lib/schema/documentarray.js create mode 100644 server/node_modules/mongoose/lib/schema/index.js create mode 100644 server/node_modules/mongoose/lib/schema/map.js create mode 100644 server/node_modules/mongoose/lib/schema/mixed.js create mode 100644 server/node_modules/mongoose/lib/schema/number.js create mode 100644 server/node_modules/mongoose/lib/schema/objectid.js create mode 100644 server/node_modules/mongoose/lib/schema/operators/bitwise.js create mode 100644 server/node_modules/mongoose/lib/schema/operators/exists.js create mode 100644 server/node_modules/mongoose/lib/schema/operators/geospatial.js create mode 100644 server/node_modules/mongoose/lib/schema/operators/helpers.js create mode 100644 server/node_modules/mongoose/lib/schema/operators/text.js create mode 100644 server/node_modules/mongoose/lib/schema/operators/type.js create mode 100644 server/node_modules/mongoose/lib/schema/string.js create mode 100644 server/node_modules/mongoose/lib/schema/symbols.js create mode 100644 server/node_modules/mongoose/lib/schema/uuid.js create mode 100644 server/node_modules/mongoose/lib/schematype.js create mode 100644 server/node_modules/mongoose/lib/statemachine.js create mode 100644 server/node_modules/mongoose/lib/types/ArraySubdocument.js create mode 100644 server/node_modules/mongoose/lib/types/DocumentArray/index.js create mode 100644 server/node_modules/mongoose/lib/types/DocumentArray/isMongooseDocumentArray.js create mode 100644 server/node_modules/mongoose/lib/types/DocumentArray/methods/index.js create mode 100644 server/node_modules/mongoose/lib/types/array/index.js create mode 100644 server/node_modules/mongoose/lib/types/array/isMongooseArray.js create mode 100644 server/node_modules/mongoose/lib/types/array/methods/index.js create mode 100644 server/node_modules/mongoose/lib/types/buffer.js create mode 100644 server/node_modules/mongoose/lib/types/decimal128.js create mode 100644 server/node_modules/mongoose/lib/types/index.js create mode 100644 server/node_modules/mongoose/lib/types/map.js create mode 100644 server/node_modules/mongoose/lib/types/objectid.js create mode 100644 server/node_modules/mongoose/lib/types/subdocument.js create mode 100644 server/node_modules/mongoose/lib/utils.js create mode 100644 server/node_modules/mongoose/lib/validoptions.js create mode 100644 server/node_modules/mongoose/lib/virtualtype.js create mode 100644 server/node_modules/mongoose/node_modules/ms/index.js create mode 100644 server/node_modules/mongoose/node_modules/ms/license.md create mode 100644 server/node_modules/mongoose/node_modules/ms/package.json create mode 100644 server/node_modules/mongoose/node_modules/ms/readme.md create mode 100644 server/node_modules/mongoose/package.json create mode 100644 server/node_modules/mongoose/scripts/build-browser.js create mode 100644 server/node_modules/mongoose/scripts/create-tarball.js create mode 100644 server/node_modules/mongoose/scripts/tsc-diagnostics-check.js create mode 100644 server/node_modules/mongoose/tools/auth.js create mode 100644 server/node_modules/mongoose/tools/repl.js create mode 100644 server/node_modules/mongoose/tools/sharded.js create mode 100644 server/node_modules/mongoose/tsconfig.json create mode 100644 server/node_modules/mongoose/types/aggregate.d.ts create mode 100644 server/node_modules/mongoose/types/callback.d.ts create mode 100644 server/node_modules/mongoose/types/collection.d.ts create mode 100644 server/node_modules/mongoose/types/connection.d.ts create mode 100644 server/node_modules/mongoose/types/cursor.d.ts create mode 100644 server/node_modules/mongoose/types/document.d.ts create mode 100644 server/node_modules/mongoose/types/error.d.ts create mode 100644 server/node_modules/mongoose/types/expressions.d.ts create mode 100644 server/node_modules/mongoose/types/helpers.d.ts create mode 100644 server/node_modules/mongoose/types/index.d.ts create mode 100644 server/node_modules/mongoose/types/indexes.d.ts create mode 100644 server/node_modules/mongoose/types/inferschematype.d.ts create mode 100644 server/node_modules/mongoose/types/middlewares.d.ts create mode 100644 server/node_modules/mongoose/types/models.d.ts create mode 100644 server/node_modules/mongoose/types/mongooseoptions.d.ts create mode 100644 server/node_modules/mongoose/types/pipelinestage.d.ts create mode 100644 server/node_modules/mongoose/types/populate.d.ts create mode 100644 server/node_modules/mongoose/types/query.d.ts create mode 100644 server/node_modules/mongoose/types/schemaoptions.d.ts create mode 100644 server/node_modules/mongoose/types/schematypes.d.ts create mode 100644 server/node_modules/mongoose/types/session.d.ts create mode 100644 server/node_modules/mongoose/types/types.d.ts create mode 100644 server/node_modules/mongoose/types/utility.d.ts create mode 100644 server/node_modules/mongoose/types/validation.d.ts create mode 100644 server/node_modules/mongoose/types/virtuals.d.ts create mode 100644 server/node_modules/mpath/.travis.yml create mode 100644 server/node_modules/mpath/History.md create mode 100644 server/node_modules/mpath/LICENSE create mode 100644 server/node_modules/mpath/README.md create mode 100644 server/node_modules/mpath/SECURITY.md create mode 100644 server/node_modules/mpath/index.js create mode 100644 server/node_modules/mpath/lib/index.js create mode 100644 server/node_modules/mpath/lib/stringToParts.js create mode 100644 server/node_modules/mpath/package.json create mode 100644 server/node_modules/mpath/test/.eslintrc.yml create mode 100644 server/node_modules/mpath/test/index.js create mode 100644 server/node_modules/mpath/test/stringToParts.js create mode 100644 server/node_modules/mquery/.eslintignore create mode 100644 server/node_modules/mquery/.eslintrc.json create mode 100644 server/node_modules/mquery/.travis.yml create mode 100644 server/node_modules/mquery/History.md create mode 100644 server/node_modules/mquery/LICENSE create mode 100644 server/node_modules/mquery/Makefile create mode 100644 server/node_modules/mquery/README.md create mode 100644 server/node_modules/mquery/SECURITY.md create mode 100644 server/node_modules/mquery/lib/collection/collection.js create mode 100644 server/node_modules/mquery/lib/collection/index.js create mode 100644 server/node_modules/mquery/lib/collection/node.js create mode 100644 server/node_modules/mquery/lib/env.js create mode 100644 server/node_modules/mquery/lib/mquery.js create mode 100644 server/node_modules/mquery/lib/permissions.js create mode 100644 server/node_modules/mquery/lib/utils.js create mode 100644 server/node_modules/mquery/node_modules/debug/LICENSE create mode 100644 server/node_modules/mquery/node_modules/debug/README.md create mode 100644 server/node_modules/mquery/node_modules/debug/package.json create mode 100644 server/node_modules/mquery/node_modules/debug/src/browser.js create mode 100644 server/node_modules/mquery/node_modules/debug/src/common.js create mode 100644 server/node_modules/mquery/node_modules/debug/src/index.js create mode 100644 server/node_modules/mquery/node_modules/debug/src/node.js create mode 100644 server/node_modules/mquery/node_modules/ms/index.js create mode 100644 server/node_modules/mquery/node_modules/ms/license.md create mode 100644 server/node_modules/mquery/node_modules/ms/package.json create mode 100644 server/node_modules/mquery/node_modules/ms/readme.md create mode 100644 server/node_modules/mquery/package.json create mode 100644 server/node_modules/mquery/test/.eslintrc.yml create mode 100644 server/node_modules/mquery/test/collection/browser.js create mode 100644 server/node_modules/mquery/test/collection/mongo.js create mode 100644 server/node_modules/mquery/test/collection/node.js create mode 100644 server/node_modules/mquery/test/env.js create mode 100644 server/node_modules/mquery/test/index.js create mode 100644 server/node_modules/mquery/test/utils.test.js delete mode 100644 server/node_modules/nodemon/.eslintrc.json delete mode 100644 server/node_modules/nodemon/.jshintrc delete mode 100644 server/node_modules/nodemon/.travis.yml mode change 100644 => 100755 server/node_modules/nodemon/bin/nodemon.js delete mode 100644 server/node_modules/nodemon/bin/postinstall.js create mode 100644 server/node_modules/nodemon/bin/windows-kill.exe delete mode 100644 server/node_modules/nodemon/commitlint.config.js delete mode 100644 server/node_modules/normalize-url/index.d.ts delete mode 100644 server/node_modules/normalize-url/index.js delete mode 100644 server/node_modules/normalize-url/license delete mode 100644 server/node_modules/normalize-url/package.json delete mode 100644 server/node_modules/normalize-url/readme.md delete mode 100644 server/node_modules/once/LICENSE delete mode 100644 server/node_modules/once/README.md delete mode 100644 server/node_modules/once/once.js delete mode 100644 server/node_modules/once/package.json delete mode 100644 server/node_modules/p-cancelable/index.d.ts delete mode 100644 server/node_modules/p-cancelable/index.js delete mode 100644 server/node_modules/p-cancelable/license delete mode 100644 server/node_modules/p-cancelable/package.json delete mode 100644 server/node_modules/p-cancelable/readme.md delete mode 100644 server/node_modules/package-json/index.d.ts delete mode 100644 server/node_modules/package-json/index.js delete mode 100644 server/node_modules/package-json/license delete mode 100644 server/node_modules/package-json/node_modules/.bin/semver delete mode 100644 server/node_modules/package-json/node_modules/.bin/semver.cmd delete mode 100644 server/node_modules/package-json/node_modules/semver/CHANGELOG.md delete mode 100644 server/node_modules/package-json/node_modules/semver/LICENSE delete mode 100644 server/node_modules/package-json/node_modules/semver/README.md delete mode 100644 server/node_modules/package-json/node_modules/semver/bin/semver.js delete mode 100644 server/node_modules/package-json/node_modules/semver/package.json delete mode 100644 server/node_modules/package-json/node_modules/semver/range.bnf delete mode 100644 server/node_modules/package-json/node_modules/semver/semver.js delete mode 100644 server/node_modules/package-json/package.json delete mode 100644 server/node_modules/package-json/readme.md delete mode 100644 server/node_modules/prepend-http/index.js delete mode 100644 server/node_modules/prepend-http/license delete mode 100644 server/node_modules/prepend-http/package.json delete mode 100644 server/node_modules/prepend-http/readme.md delete mode 100644 server/node_modules/pump/.travis.yml delete mode 100644 server/node_modules/pump/LICENSE delete mode 100644 server/node_modules/pump/README.md delete mode 100644 server/node_modules/pump/index.js delete mode 100644 server/node_modules/pump/package.json delete mode 100644 server/node_modules/pump/test-browser.js delete mode 100644 server/node_modules/pump/test-node.js rename server/node_modules/{emoji-regex => punycode}/LICENSE-MIT.txt (100%) create mode 100644 server/node_modules/punycode/README.md create mode 100644 server/node_modules/punycode/package.json create mode 100644 server/node_modules/punycode/punycode.es6.js create mode 100644 server/node_modules/punycode/punycode.js delete mode 100644 server/node_modules/pupa/index.d.ts delete mode 100644 server/node_modules/pupa/index.js delete mode 100644 server/node_modules/pupa/license delete mode 100644 server/node_modules/pupa/package.json delete mode 100644 server/node_modules/pupa/readme.md delete mode 100644 server/node_modules/rc/LICENSE.APACHE2 delete mode 100644 server/node_modules/rc/LICENSE.BSD delete mode 100644 server/node_modules/rc/LICENSE.MIT delete mode 100644 server/node_modules/rc/README.md delete mode 100644 server/node_modules/rc/browser.js delete mode 100644 server/node_modules/rc/cli.js delete mode 100644 server/node_modules/rc/index.js delete mode 100644 server/node_modules/rc/lib/utils.js delete mode 100644 server/node_modules/rc/package.json delete mode 100644 server/node_modules/rc/test/ini.js delete mode 100644 server/node_modules/rc/test/nested-env-vars.js delete mode 100644 server/node_modules/rc/test/test.js delete mode 100644 server/node_modules/registry-auth-token/CHANGELOG.md delete mode 100644 server/node_modules/registry-auth-token/LICENSE delete mode 100644 server/node_modules/registry-auth-token/README.md delete mode 100644 server/node_modules/registry-auth-token/base64.js delete mode 100644 server/node_modules/registry-auth-token/index.js delete mode 100644 server/node_modules/registry-auth-token/package.json delete mode 100644 server/node_modules/registry-auth-token/registry-url.js delete mode 100644 server/node_modules/registry-url/index.d.ts delete mode 100644 server/node_modules/registry-url/index.js delete mode 100644 server/node_modules/registry-url/license delete mode 100644 server/node_modules/registry-url/package.json delete mode 100644 server/node_modules/registry-url/readme.md delete mode 100644 server/node_modules/responselike/LICENSE delete mode 100644 server/node_modules/responselike/README.md delete mode 100644 server/node_modules/responselike/package.json delete mode 100644 server/node_modules/responselike/src/index.js create mode 100644 server/node_modules/saslprep/.editorconfig create mode 100644 server/node_modules/saslprep/.gitattributes create mode 100644 server/node_modules/saslprep/.travis.yml create mode 100644 server/node_modules/saslprep/CHANGELOG.md create mode 100644 server/node_modules/saslprep/LICENSE create mode 100644 server/node_modules/saslprep/code-points.mem create mode 100644 server/node_modules/saslprep/generate-code-points.js create mode 100644 server/node_modules/saslprep/index.js create mode 100644 server/node_modules/saslprep/lib/code-points.js create mode 100644 server/node_modules/saslprep/lib/memory-code-points.js create mode 100644 server/node_modules/saslprep/lib/util.js create mode 100644 server/node_modules/saslprep/package.json create mode 100644 server/node_modules/saslprep/readme.md create mode 100644 server/node_modules/saslprep/test/index.js create mode 100644 server/node_modules/saslprep/test/util.js delete mode 100644 server/node_modules/semver-diff/index.d.ts delete mode 100644 server/node_modules/semver-diff/index.js delete mode 100644 server/node_modules/semver-diff/license delete mode 100644 server/node_modules/semver-diff/node_modules/.bin/semver delete mode 100644 server/node_modules/semver-diff/node_modules/.bin/semver.cmd delete mode 100644 server/node_modules/semver-diff/node_modules/semver/CHANGELOG.md delete mode 100644 server/node_modules/semver-diff/node_modules/semver/LICENSE delete mode 100644 server/node_modules/semver-diff/node_modules/semver/README.md delete mode 100644 server/node_modules/semver-diff/node_modules/semver/bin/semver.js delete mode 100644 server/node_modules/semver-diff/node_modules/semver/package.json delete mode 100644 server/node_modules/semver-diff/node_modules/semver/range.bnf delete mode 100644 server/node_modules/semver-diff/node_modules/semver/semver.js delete mode 100644 server/node_modules/semver-diff/package.json delete mode 100644 server/node_modules/semver-diff/readme.md create mode 100644 server/node_modules/sift/MIT-LICENSE.txt create mode 100755 server/node_modules/sift/README.md create mode 100644 server/node_modules/sift/es/index.js create mode 100644 server/node_modules/sift/es/index.js.map create mode 100644 server/node_modules/sift/es5m/index.js create mode 100644 server/node_modules/sift/es5m/index.js.map create mode 100644 server/node_modules/sift/index.d.ts create mode 100644 server/node_modules/sift/index.js create mode 100644 server/node_modules/sift/lib/core.d.ts create mode 100644 server/node_modules/sift/lib/index.d.ts create mode 100644 server/node_modules/sift/lib/index.js create mode 100644 server/node_modules/sift/lib/index.js.map create mode 100644 server/node_modules/sift/lib/operations.d.ts create mode 100644 server/node_modules/sift/lib/utils.d.ts create mode 100644 server/node_modules/sift/package.json create mode 100644 server/node_modules/sift/sift.csp.min.js create mode 100644 server/node_modules/sift/sift.csp.min.js.map create mode 100644 server/node_modules/sift/sift.min.js create mode 100644 server/node_modules/sift/sift.min.js.map create mode 100644 server/node_modules/sift/src/core.d.ts create mode 100644 server/node_modules/sift/src/core.js create mode 100644 server/node_modules/sift/src/core.js.map create mode 100644 server/node_modules/sift/src/core.ts create mode 100644 server/node_modules/sift/src/index.d.ts create mode 100644 server/node_modules/sift/src/index.js create mode 100644 server/node_modules/sift/src/index.js.map create mode 100644 server/node_modules/sift/src/index.ts create mode 100644 server/node_modules/sift/src/operations.d.ts create mode 100644 server/node_modules/sift/src/operations.js create mode 100644 server/node_modules/sift/src/operations.js.map create mode 100644 server/node_modules/sift/src/operations.ts create mode 100644 server/node_modules/sift/src/utils.d.ts create mode 100644 server/node_modules/sift/src/utils.js create mode 100644 server/node_modules/sift/src/utils.js.map create mode 100644 server/node_modules/sift/src/utils.ts delete mode 100644 server/node_modules/signal-exit/CHANGELOG.md delete mode 100644 server/node_modules/signal-exit/LICENSE.txt delete mode 100644 server/node_modules/signal-exit/README.md delete mode 100644 server/node_modules/signal-exit/index.js delete mode 100644 server/node_modules/signal-exit/package.json delete mode 100644 server/node_modules/signal-exit/signals.js create mode 100644 server/node_modules/simple-update-notifier/LICENSE create mode 100644 server/node_modules/simple-update-notifier/README.md create mode 100644 server/node_modules/simple-update-notifier/build/index.d.ts create mode 100644 server/node_modules/simple-update-notifier/build/index.js create mode 120000 server/node_modules/simple-update-notifier/node_modules/.bin/semver create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/CHANGELOG.md rename server/node_modules/{ini => simple-update-notifier/node_modules/semver}/LICENSE (100%) create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/README.md create mode 100755 server/node_modules/simple-update-notifier/node_modules/semver/bin/semver.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/classes/comparator.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/classes/index.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/classes/range.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/classes/semver.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/clean.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/cmp.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/coerce.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/compare-build.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/compare-loose.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/compare.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/diff.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/eq.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/gt.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/gte.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/inc.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/lt.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/lte.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/major.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/minor.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/neq.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/parse.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/patch.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/prerelease.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/rcompare.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/rsort.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/satisfies.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/sort.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/functions/valid.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/index.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/internal/constants.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/internal/debug.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/internal/identifiers.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/internal/re.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/package.json rename server/node_modules/{make-dir => simple-update-notifier}/node_modules/semver/range.bnf (100%) create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/ranges/gtr.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/ranges/intersects.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/ranges/ltr.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/ranges/max-satisfying.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/ranges/min-satisfying.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/ranges/min-version.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/ranges/outside.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/ranges/to-comparators.js create mode 100644 server/node_modules/simple-update-notifier/node_modules/semver/ranges/valid.js create mode 100644 server/node_modules/simple-update-notifier/package.json create mode 100644 server/node_modules/simple-update-notifier/src/borderedText.ts create mode 100644 server/node_modules/simple-update-notifier/src/cache.spec.ts create mode 100644 server/node_modules/simple-update-notifier/src/cache.ts create mode 100644 server/node_modules/simple-update-notifier/src/getDistVersion.spec.ts create mode 100644 server/node_modules/simple-update-notifier/src/getDistVersion.ts create mode 100644 server/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts create mode 100644 server/node_modules/simple-update-notifier/src/hasNewVersion.ts create mode 100644 server/node_modules/simple-update-notifier/src/index.spec.ts create mode 100644 server/node_modules/simple-update-notifier/src/index.ts create mode 100644 server/node_modules/simple-update-notifier/src/isNpmOrYarn.ts create mode 100644 server/node_modules/simple-update-notifier/src/types.ts create mode 100644 server/node_modules/smart-buffer/.prettierrc.yaml create mode 100644 server/node_modules/smart-buffer/.travis.yml create mode 100644 server/node_modules/smart-buffer/LICENSE create mode 100644 server/node_modules/smart-buffer/README.md create mode 100644 server/node_modules/smart-buffer/build/smartbuffer.js create mode 100644 server/node_modules/smart-buffer/build/smartbuffer.js.map create mode 100644 server/node_modules/smart-buffer/build/utils.js create mode 100644 server/node_modules/smart-buffer/build/utils.js.map create mode 100644 server/node_modules/smart-buffer/docs/CHANGELOG.md create mode 100644 server/node_modules/smart-buffer/docs/README_v3.md create mode 100644 server/node_modules/smart-buffer/docs/ROADMAP.md create mode 100644 server/node_modules/smart-buffer/package.json create mode 100644 server/node_modules/smart-buffer/typings/smartbuffer.d.ts create mode 100644 server/node_modules/smart-buffer/typings/utils.d.ts create mode 100644 server/node_modules/socks/.eslintrc.cjs create mode 100644 server/node_modules/socks/.prettierrc.yaml create mode 100644 server/node_modules/socks/LICENSE create mode 100644 server/node_modules/socks/README.md create mode 100644 server/node_modules/socks/build/client/socksclient.js create mode 100644 server/node_modules/socks/build/client/socksclient.js.map create mode 100644 server/node_modules/socks/build/common/constants.js create mode 100644 server/node_modules/socks/build/common/constants.js.map create mode 100644 server/node_modules/socks/build/common/helpers.js create mode 100644 server/node_modules/socks/build/common/helpers.js.map create mode 100644 server/node_modules/socks/build/common/receivebuffer.js create mode 100644 server/node_modules/socks/build/common/receivebuffer.js.map create mode 100644 server/node_modules/socks/build/common/util.js create mode 100644 server/node_modules/socks/build/common/util.js.map create mode 100644 server/node_modules/socks/build/index.js create mode 100644 server/node_modules/socks/build/index.js.map create mode 100644 server/node_modules/socks/docs/examples/index.md create mode 100644 server/node_modules/socks/docs/examples/javascript/associateExample.md create mode 100644 server/node_modules/socks/docs/examples/javascript/bindExample.md create mode 100644 server/node_modules/socks/docs/examples/javascript/connectExample.md create mode 100644 server/node_modules/socks/docs/examples/typescript/associateExample.md create mode 100644 server/node_modules/socks/docs/examples/typescript/bindExample.md create mode 100644 server/node_modules/socks/docs/examples/typescript/connectExample.md create mode 100644 server/node_modules/socks/docs/index.md create mode 100644 server/node_modules/socks/docs/migratingFromV1.md create mode 100644 server/node_modules/socks/package.json create mode 100644 server/node_modules/socks/typings/client/socksclient.d.ts create mode 100644 server/node_modules/socks/typings/common/constants.d.ts create mode 100644 server/node_modules/socks/typings/common/helpers.d.ts create mode 100644 server/node_modules/socks/typings/common/receivebuffer.d.ts create mode 100644 server/node_modules/socks/typings/common/util.d.ts create mode 100644 server/node_modules/socks/typings/index.d.ts create mode 100644 server/node_modules/sparse-bitfield/.npmignore create mode 100644 server/node_modules/sparse-bitfield/.travis.yml create mode 100644 server/node_modules/sparse-bitfield/LICENSE create mode 100644 server/node_modules/sparse-bitfield/README.md create mode 100644 server/node_modules/sparse-bitfield/index.js create mode 100644 server/node_modules/sparse-bitfield/package.json create mode 100644 server/node_modules/sparse-bitfield/test.js delete mode 100644 server/node_modules/string-width/index.d.ts delete mode 100644 server/node_modules/string-width/index.js delete mode 100644 server/node_modules/string-width/license delete mode 100644 server/node_modules/string-width/node_modules/ansi-regex/index.d.ts delete mode 100644 server/node_modules/string-width/node_modules/ansi-regex/index.js delete mode 100644 server/node_modules/string-width/node_modules/ansi-regex/license delete mode 100644 server/node_modules/string-width/node_modules/ansi-regex/package.json delete mode 100644 server/node_modules/string-width/node_modules/ansi-regex/readme.md delete mode 100644 server/node_modules/string-width/node_modules/emoji-regex/LICENSE-MIT.txt delete mode 100644 server/node_modules/string-width/node_modules/emoji-regex/README.md delete mode 100644 server/node_modules/string-width/node_modules/emoji-regex/es2015/index.js delete mode 100644 server/node_modules/string-width/node_modules/emoji-regex/es2015/text.js delete mode 100644 server/node_modules/string-width/node_modules/emoji-regex/index.d.ts delete mode 100644 server/node_modules/string-width/node_modules/emoji-regex/index.js delete mode 100644 server/node_modules/string-width/node_modules/emoji-regex/package.json delete mode 100644 server/node_modules/string-width/node_modules/emoji-regex/text.js delete mode 100644 server/node_modules/string-width/node_modules/is-fullwidth-code-point/index.d.ts delete mode 100644 server/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js delete mode 100644 server/node_modules/string-width/node_modules/is-fullwidth-code-point/license delete mode 100644 server/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json delete mode 100644 server/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md delete mode 100644 server/node_modules/string-width/node_modules/strip-ansi/index.d.ts delete mode 100644 server/node_modules/string-width/node_modules/strip-ansi/index.js delete mode 100644 server/node_modules/string-width/node_modules/strip-ansi/license delete mode 100644 server/node_modules/string-width/node_modules/strip-ansi/package.json delete mode 100644 server/node_modules/string-width/node_modules/strip-ansi/readme.md delete mode 100644 server/node_modules/string-width/package.json delete mode 100644 server/node_modules/string-width/readme.md delete mode 100644 server/node_modules/strip-ansi/index.d.ts delete mode 100644 server/node_modules/strip-ansi/index.js delete mode 100644 server/node_modules/strip-ansi/license delete mode 100644 server/node_modules/strip-ansi/package.json delete mode 100644 server/node_modules/strip-ansi/readme.md delete mode 100644 server/node_modules/strip-json-comments/index.js delete mode 100644 server/node_modules/strip-json-comments/license delete mode 100644 server/node_modules/strip-json-comments/package.json delete mode 100644 server/node_modules/strip-json-comments/readme.md create mode 100644 server/node_modules/strnum/.vscode/launch.json create mode 100644 server/node_modules/strnum/LICENSE create mode 100644 server/node_modules/strnum/README.md create mode 100644 server/node_modules/strnum/package.json create mode 100644 server/node_modules/strnum/strnum.js create mode 100644 server/node_modules/strnum/strnum.test.js delete mode 100644 server/node_modules/term-size/index.d.ts delete mode 100644 server/node_modules/term-size/index.js delete mode 100644 server/node_modules/term-size/license delete mode 100644 server/node_modules/term-size/package.json delete mode 100644 server/node_modules/term-size/readme.md delete mode 100644 server/node_modules/term-size/vendor/.DS_Store delete mode 100644 server/node_modules/term-size/vendor/macos/.DS_Store delete mode 100644 server/node_modules/term-size/vendor/macos/term-size delete mode 100644 server/node_modules/term-size/vendor/windows/term-size.exe delete mode 100644 server/node_modules/to-readable-stream/index.js delete mode 100644 server/node_modules/to-readable-stream/license delete mode 100644 server/node_modules/to-readable-stream/package.json delete mode 100644 server/node_modules/to-readable-stream/readme.md create mode 100644 server/node_modules/tr46/LICENSE.md create mode 100644 server/node_modules/tr46/README.md create mode 100644 server/node_modules/tr46/index.js create mode 100644 server/node_modules/tr46/lib/mappingTable.json create mode 100644 server/node_modules/tr46/lib/regexes.js create mode 100644 server/node_modules/tr46/lib/statusMapping.js create mode 100644 server/node_modules/tr46/package.json create mode 100644 server/node_modules/tslib/CopyrightNotice.txt create mode 100644 server/node_modules/tslib/LICENSE.txt create mode 100644 server/node_modules/tslib/README.md create mode 100644 server/node_modules/tslib/SECURITY.md create mode 100644 server/node_modules/tslib/modules/index.js create mode 100644 server/node_modules/tslib/modules/package.json create mode 100644 server/node_modules/tslib/package.json create mode 100644 server/node_modules/tslib/tslib.d.ts create mode 100644 server/node_modules/tslib/tslib.es6.html create mode 100644 server/node_modules/tslib/tslib.es6.js create mode 100644 server/node_modules/tslib/tslib.html create mode 100644 server/node_modules/tslib/tslib.js delete mode 100644 server/node_modules/type-fest/index.d.ts delete mode 100644 server/node_modules/type-fest/license delete mode 100644 server/node_modules/type-fest/package.json delete mode 100644 server/node_modules/type-fest/readme.md delete mode 100644 server/node_modules/type-fest/source/basic.d.ts delete mode 100644 server/node_modules/type-fest/source/except.d.ts delete mode 100644 server/node_modules/type-fest/source/literal-union.d.ts delete mode 100644 server/node_modules/type-fest/source/merge-exclusive.d.ts delete mode 100644 server/node_modules/type-fest/source/merge.d.ts delete mode 100644 server/node_modules/type-fest/source/mutable.d.ts delete mode 100644 server/node_modules/type-fest/source/opaque.d.ts delete mode 100644 server/node_modules/type-fest/source/package-json.d.ts delete mode 100644 server/node_modules/type-fest/source/partial-deep.d.ts delete mode 100644 server/node_modules/type-fest/source/promisable.d.ts delete mode 100644 server/node_modules/type-fest/source/readonly-deep.d.ts delete mode 100644 server/node_modules/type-fest/source/require-at-least-one.d.ts delete mode 100644 server/node_modules/type-fest/source/require-exactly-one.d.ts delete mode 100644 server/node_modules/type-fest/source/set-optional.d.ts delete mode 100644 server/node_modules/type-fest/source/set-required.d.ts delete mode 100644 server/node_modules/typedarray-to-buffer/.airtap.yml delete mode 100644 server/node_modules/typedarray-to-buffer/.travis.yml delete mode 100644 server/node_modules/typedarray-to-buffer/LICENSE delete mode 100644 server/node_modules/typedarray-to-buffer/README.md delete mode 100644 server/node_modules/typedarray-to-buffer/index.js delete mode 100644 server/node_modules/typedarray-to-buffer/package.json delete mode 100644 server/node_modules/typedarray-to-buffer/test/basic.js create mode 100644 server/node_modules/undefsafe/.github/workflows/release.yml delete mode 100644 server/node_modules/undefsafe/.npmignore delete mode 100644 server/node_modules/unique-string/index.d.ts delete mode 100644 server/node_modules/unique-string/index.js delete mode 100644 server/node_modules/unique-string/license delete mode 100644 server/node_modules/unique-string/package.json delete mode 100644 server/node_modules/unique-string/readme.md delete mode 100644 server/node_modules/update-notifier/check.js delete mode 100644 server/node_modules/update-notifier/index.js delete mode 100644 server/node_modules/update-notifier/license delete mode 100644 server/node_modules/update-notifier/package.json delete mode 100644 server/node_modules/update-notifier/readme.md delete mode 100644 server/node_modules/url-parse-lax/index.js delete mode 100644 server/node_modules/url-parse-lax/license delete mode 100644 server/node_modules/url-parse-lax/package.json delete mode 100644 server/node_modules/url-parse-lax/readme.md create mode 100644 server/node_modules/uuid/CHANGELOG.md create mode 100644 server/node_modules/uuid/CONTRIBUTING.md create mode 100644 server/node_modules/uuid/LICENSE.md create mode 100644 server/node_modules/uuid/README.md create mode 100755 server/node_modules/uuid/dist/bin/uuid create mode 100644 server/node_modules/uuid/dist/esm-browser/index.js create mode 100644 server/node_modules/uuid/dist/esm-browser/md5.js create mode 100644 server/node_modules/uuid/dist/esm-browser/nil.js create mode 100644 server/node_modules/uuid/dist/esm-browser/parse.js create mode 100644 server/node_modules/uuid/dist/esm-browser/regex.js create mode 100644 server/node_modules/uuid/dist/esm-browser/rng.js create mode 100644 server/node_modules/uuid/dist/esm-browser/sha1.js create mode 100644 server/node_modules/uuid/dist/esm-browser/stringify.js create mode 100644 server/node_modules/uuid/dist/esm-browser/v1.js create mode 100644 server/node_modules/uuid/dist/esm-browser/v3.js create mode 100644 server/node_modules/uuid/dist/esm-browser/v35.js create mode 100644 server/node_modules/uuid/dist/esm-browser/v4.js create mode 100644 server/node_modules/uuid/dist/esm-browser/v5.js create mode 100644 server/node_modules/uuid/dist/esm-browser/validate.js create mode 100644 server/node_modules/uuid/dist/esm-browser/version.js create mode 100644 server/node_modules/uuid/dist/esm-node/index.js create mode 100644 server/node_modules/uuid/dist/esm-node/md5.js create mode 100644 server/node_modules/uuid/dist/esm-node/nil.js create mode 100644 server/node_modules/uuid/dist/esm-node/parse.js create mode 100644 server/node_modules/uuid/dist/esm-node/regex.js create mode 100644 server/node_modules/uuid/dist/esm-node/rng.js create mode 100644 server/node_modules/uuid/dist/esm-node/sha1.js create mode 100644 server/node_modules/uuid/dist/esm-node/stringify.js create mode 100644 server/node_modules/uuid/dist/esm-node/v1.js create mode 100644 server/node_modules/uuid/dist/esm-node/v3.js create mode 100644 server/node_modules/uuid/dist/esm-node/v35.js create mode 100644 server/node_modules/uuid/dist/esm-node/v4.js create mode 100644 server/node_modules/uuid/dist/esm-node/v5.js create mode 100644 server/node_modules/uuid/dist/esm-node/validate.js create mode 100644 server/node_modules/uuid/dist/esm-node/version.js create mode 100644 server/node_modules/uuid/dist/index.js create mode 100644 server/node_modules/uuid/dist/md5-browser.js create mode 100644 server/node_modules/uuid/dist/md5.js create mode 100644 server/node_modules/uuid/dist/nil.js create mode 100644 server/node_modules/uuid/dist/parse.js create mode 100644 server/node_modules/uuid/dist/regex.js create mode 100644 server/node_modules/uuid/dist/rng-browser.js create mode 100644 server/node_modules/uuid/dist/rng.js create mode 100644 server/node_modules/uuid/dist/sha1-browser.js create mode 100644 server/node_modules/uuid/dist/sha1.js create mode 100644 server/node_modules/uuid/dist/stringify.js create mode 100644 server/node_modules/uuid/dist/umd/uuid.min.js create mode 100644 server/node_modules/uuid/dist/umd/uuidNIL.min.js create mode 100644 server/node_modules/uuid/dist/umd/uuidParse.min.js create mode 100644 server/node_modules/uuid/dist/umd/uuidStringify.min.js create mode 100644 server/node_modules/uuid/dist/umd/uuidValidate.min.js create mode 100644 server/node_modules/uuid/dist/umd/uuidVersion.min.js create mode 100644 server/node_modules/uuid/dist/umd/uuidv1.min.js create mode 100644 server/node_modules/uuid/dist/umd/uuidv3.min.js create mode 100644 server/node_modules/uuid/dist/umd/uuidv4.min.js create mode 100644 server/node_modules/uuid/dist/umd/uuidv5.min.js create mode 100644 server/node_modules/uuid/dist/uuid-bin.js create mode 100644 server/node_modules/uuid/dist/v1.js create mode 100644 server/node_modules/uuid/dist/v3.js create mode 100644 server/node_modules/uuid/dist/v35.js create mode 100644 server/node_modules/uuid/dist/v4.js create mode 100644 server/node_modules/uuid/dist/v5.js create mode 100644 server/node_modules/uuid/dist/validate.js create mode 100644 server/node_modules/uuid/dist/version.js create mode 100644 server/node_modules/uuid/package.json create mode 100644 server/node_modules/uuid/wrapper.mjs create mode 100644 server/node_modules/webidl-conversions/LICENSE.md create mode 100644 server/node_modules/webidl-conversions/README.md create mode 100644 server/node_modules/webidl-conversions/lib/index.js create mode 100644 server/node_modules/webidl-conversions/package.json create mode 100644 server/node_modules/whatwg-url/LICENSE.txt create mode 100644 server/node_modules/whatwg-url/README.md create mode 100644 server/node_modules/whatwg-url/index.js create mode 100644 server/node_modules/whatwg-url/lib/Function.js create mode 100644 server/node_modules/whatwg-url/lib/URL-impl.js create mode 100644 server/node_modules/whatwg-url/lib/URL.js create mode 100644 server/node_modules/whatwg-url/lib/URLSearchParams-impl.js create mode 100644 server/node_modules/whatwg-url/lib/URLSearchParams.js create mode 100644 server/node_modules/whatwg-url/lib/VoidFunction.js create mode 100644 server/node_modules/whatwg-url/lib/encoding.js create mode 100644 server/node_modules/whatwg-url/lib/infra.js create mode 100644 server/node_modules/whatwg-url/lib/percent-encoding.js create mode 100644 server/node_modules/whatwg-url/lib/url-state-machine.js create mode 100644 server/node_modules/whatwg-url/lib/urlencoded.js create mode 100644 server/node_modules/whatwg-url/lib/utils.js create mode 100644 server/node_modules/whatwg-url/package.json create mode 100644 server/node_modules/whatwg-url/webidl2js-wrapper.js delete mode 100644 server/node_modules/widest-line/index.d.ts delete mode 100644 server/node_modules/widest-line/index.js delete mode 100644 server/node_modules/widest-line/license delete mode 100644 server/node_modules/widest-line/package.json delete mode 100644 server/node_modules/widest-line/readme.md delete mode 100644 server/node_modules/wrappy/LICENSE delete mode 100644 server/node_modules/wrappy/README.md delete mode 100644 server/node_modules/wrappy/package.json delete mode 100644 server/node_modules/wrappy/wrappy.js delete mode 100644 server/node_modules/write-file-atomic/CHANGELOG.md delete mode 100644 server/node_modules/write-file-atomic/LICENSE delete mode 100644 server/node_modules/write-file-atomic/README.md delete mode 100644 server/node_modules/write-file-atomic/index.js delete mode 100644 server/node_modules/write-file-atomic/package.json delete mode 100644 server/node_modules/xdg-basedir/index.d.ts delete mode 100644 server/node_modules/xdg-basedir/index.js delete mode 100644 server/node_modules/xdg-basedir/license delete mode 100644 server/node_modules/xdg-basedir/package.json delete mode 100644 server/node_modules/xdg-basedir/readme.md create mode 100644 server/video-data.js diff --git a/client/src/App.js b/client/src/App.js index 864c65a765..77b4f76bd1 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -11,17 +11,23 @@ function App() { const [videos, setVideos] = useState([]); const getVideos = async () => { - let res = await axios.get("http://localhost:8000/videos"); + let res = await axios.get("http://localhost:8000/"); setVideos(res.data); }; + const deleteVideo = async (id)=>{ + let res = await axios.delete(`http://localhost:8000/${id}`); + setVideos(res.data) + } useEffect(() => { getVideos(); }, []); - const addVideo = (video) => { - video.id = videos.length + 1; - setVideos([video, ...videos]); + const addVideo = async (video) => { + + let res = await axios.post("http://localhost:8000/",video) + setVideos([res.data, ...videos]); + }; const upVote = (id) => { @@ -52,7 +58,7 @@ function App() {
- + {/*
*/}
diff --git a/client/src/Cards.js b/client/src/Cards.js index a31d99d66f..ec7ac0ad56 100644 --- a/client/src/Cards.js +++ b/client/src/Cards.js @@ -5,28 +5,34 @@ import { BsFillHandThumbsUpFill, BsHandThumbsDownFill } from "react-icons/bs"; -function Cards({videos, upVote, downVote}) { +function Cards({videos, upVote, downVote, deleteVideo}) { return (
{ videos.map((video)=>{ - return
- -

{video.title}

-

votes: {video.rating}

-
- upVote(video.id)}/> - downVote(video.id)}/> + return ( +
+ +

{video.title}

+

votes: {video.rating}

+
+ upVote(video.id)} /> + downVote(video.id)} /> +
+
+ +
- -
+ ); }) }
) } -export default Cards +export default Cards; diff --git a/client/src/index.css b/client/src/index.css index 42fd941e6f..b7e95f9e5a 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -7,7 +7,7 @@ body{ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; background: #f1f5f8; - color: #222; + color: rgba(34, 34, 34, 0.527); } @@ -60,15 +60,41 @@ body{ gap: 20px; margin-top: 10px; } + +.btn-container > button{ + display: flex; + background-color: yellow; + + +} +.btn-container > button:nth-child(2){ + background-color: green; +} +.btn-add{ +background-color: green; +} + +/* video icons and containers */ + +.video-icons { + color: rgb(247, 247, 24); +} + +.video-icons > .downVote{ + color: rebeccapurple; +} + .videos-container{ display: flex; flex-wrap: wrap; gap: 20px; margin-top: 50px; + border-radius: 10px; + overflow: hidden; } .video{ width: 300px; - box-shadow: 1px 1px 5px rgba(0,0,0,0.2); + box-shadow: 3px 1px 5px rgba(0,0,0,0.2); } .video >h3{ @@ -79,4 +105,18 @@ body{ gap: 20px; margin-bottom: 5px; +} + +/* container for removing videos*/ +.remove-container{ +display: flex; + + +} +.remove-container > button{ + display: inline; + align-content: center; + background-color: rgb(245, 107, 107); + + } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..3a8f2cdff8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,19 @@ +{ + "name": "to-do-server", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "dev": "nodemon server.js", + "server": "node server.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.17.1" + }, + "devDependencies": { + "nodemon": "^2.0.7" + } +} diff --git a/server/node_modules/.bin/fxparser b/server/node_modules/.bin/fxparser new file mode 120000 index 0000000000..75327ed917 --- /dev/null +++ b/server/node_modules/.bin/fxparser @@ -0,0 +1 @@ +../fast-xml-parser/src/cli/cli.js \ No newline at end of file diff --git a/server/node_modules/.bin/is-ci b/server/node_modules/.bin/is-ci deleted file mode 100644 index bc5605a8ec..0000000000 --- a/server/node_modules/.bin/is-ci +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../is-ci/bin.js" "$@" - ret=$? -else - node "$basedir/../is-ci/bin.js" "$@" - ret=$? -fi -exit $ret diff --git a/server/node_modules/.bin/nodemon b/server/node_modules/.bin/nodemon deleted file mode 100644 index 22d2f6aa72..0000000000 --- a/server/node_modules/.bin/nodemon +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../nodemon/bin/nodemon.js" "$@" - ret=$? -else - node "$basedir/../nodemon/bin/nodemon.js" "$@" - ret=$? -fi -exit $ret diff --git a/server/node_modules/.bin/nodemon b/server/node_modules/.bin/nodemon new file mode 120000 index 0000000000..1056ddc18d --- /dev/null +++ b/server/node_modules/.bin/nodemon @@ -0,0 +1 @@ +../nodemon/bin/nodemon.js \ No newline at end of file diff --git a/server/node_modules/.bin/rc b/server/node_modules/.bin/rc deleted file mode 100644 index eb55931654..0000000000 --- a/server/node_modules/.bin/rc +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../rc/cli.js" "$@" - ret=$? -else - node "$basedir/../rc/cli.js" "$@" - ret=$? -fi -exit $ret diff --git a/server/node_modules/.bin/uuid b/server/node_modules/.bin/uuid new file mode 120000 index 0000000000..588f70ecc5 --- /dev/null +++ b/server/node_modules/.bin/uuid @@ -0,0 +1 @@ +../uuid/dist/bin/uuid \ No newline at end of file diff --git a/server/node_modules/.package-lock.json b/server/node_modules/.package-lock.json new file mode 100644 index 0000000000..5ccbeb5fea --- /dev/null +++ b/server/node_modules/.package-lock.json @@ -0,0 +1,2250 @@ +{ + "name": "to-do-server", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "node_modules/@aws-crypto/ie11-detection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-3.0.0.tgz", + "integrity": "sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==", + "optional": true, + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-3.0.0.tgz", + "integrity": "sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==", + "optional": true, + "dependencies": { + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/sha256-js": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-3.0.0.tgz", + "integrity": "sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==", + "optional": true, + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-js/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-3.0.0.tgz", + "integrity": "sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==", + "optional": true, + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-3.0.0.tgz", + "integrity": "sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/util/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-sdk/abort-controller": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/abort-controller/-/abort-controller-3.257.0.tgz", + "integrity": "sha512-ekWy391lOerS0ZECdhp/c+X7AToJIpfNrCPjuj3bKr+GMQYckGsYsdbm6AUD4sxBmfvuaQmVniSXWovaxwcFcQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.264.0.tgz", + "integrity": "sha512-afOpX6/xKLKRjkbgzfuy9fxCVP+LXCiirjBxhEtpUbKjVOwvShbQXfCPDlG40s5HF485mmR9t0KADoy0El5WsA==", + "optional": true, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "3.264.0", + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/credential-provider-node": "3.264.0", + "@aws-sdk/fetch-http-handler": "3.257.0", + "@aws-sdk/hash-node": "3.257.0", + "@aws-sdk/invalid-dependency": "3.257.0", + "@aws-sdk/middleware-content-length": "3.257.0", + "@aws-sdk/middleware-endpoint": "3.264.0", + "@aws-sdk/middleware-host-header": "3.257.0", + "@aws-sdk/middleware-logger": "3.257.0", + "@aws-sdk/middleware-recursion-detection": "3.257.0", + "@aws-sdk/middleware-retry": "3.259.0", + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/middleware-signing": "3.257.0", + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/middleware-user-agent": "3.257.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/node-http-handler": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/smithy-client": "3.261.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.261.0", + "@aws-sdk/util-defaults-mode-node": "3.261.0", + "@aws-sdk/util-endpoints": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "@aws-sdk/util-user-agent-browser": "3.257.0", + "@aws-sdk/util-user-agent-node": "3.259.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.264.0.tgz", + "integrity": "sha512-p+7sYpRcdv9omnnsPhD/vOFuZ1SpfV62ZgistBK/RDsQg2W9SIWQRW1KPt7gOCQ0nwp4efntw4Sle0LjS7ykxg==", + "optional": true, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/fetch-http-handler": "3.257.0", + "@aws-sdk/hash-node": "3.257.0", + "@aws-sdk/invalid-dependency": "3.257.0", + "@aws-sdk/middleware-content-length": "3.257.0", + "@aws-sdk/middleware-endpoint": "3.264.0", + "@aws-sdk/middleware-host-header": "3.257.0", + "@aws-sdk/middleware-logger": "3.257.0", + "@aws-sdk/middleware-recursion-detection": "3.257.0", + "@aws-sdk/middleware-retry": "3.259.0", + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/middleware-user-agent": "3.257.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/node-http-handler": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/smithy-client": "3.261.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.261.0", + "@aws-sdk/util-defaults-mode-node": "3.261.0", + "@aws-sdk/util-endpoints": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "@aws-sdk/util-user-agent-browser": "3.257.0", + "@aws-sdk/util-user-agent-node": "3.259.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.264.0.tgz", + "integrity": "sha512-82hGEbfsD4lBGIF1q8o82jTNSgBCcBpfFsvA+ltZf0bh4ChIWOi4vVvg8G+zVQN1mm/Rj8vWYO/D0tNF8OSyWw==", + "optional": true, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/fetch-http-handler": "3.257.0", + "@aws-sdk/hash-node": "3.257.0", + "@aws-sdk/invalid-dependency": "3.257.0", + "@aws-sdk/middleware-content-length": "3.257.0", + "@aws-sdk/middleware-endpoint": "3.264.0", + "@aws-sdk/middleware-host-header": "3.257.0", + "@aws-sdk/middleware-logger": "3.257.0", + "@aws-sdk/middleware-recursion-detection": "3.257.0", + "@aws-sdk/middleware-retry": "3.259.0", + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/middleware-user-agent": "3.257.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/node-http-handler": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/smithy-client": "3.261.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.261.0", + "@aws-sdk/util-defaults-mode-node": "3.261.0", + "@aws-sdk/util-endpoints": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "@aws-sdk/util-user-agent-browser": "3.257.0", + "@aws-sdk/util-user-agent-node": "3.259.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sts": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.264.0.tgz", + "integrity": "sha512-sco1jREkDdds4Z3V19Vlu/YpBHSzeEt1KFqOPnbjFw7pSakRNzpyWmLLxOwWjwgGKt6pSF3Aw0ZOMYsAUDc5qQ==", + "optional": true, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/credential-provider-node": "3.264.0", + "@aws-sdk/fetch-http-handler": "3.257.0", + "@aws-sdk/hash-node": "3.257.0", + "@aws-sdk/invalid-dependency": "3.257.0", + "@aws-sdk/middleware-content-length": "3.257.0", + "@aws-sdk/middleware-endpoint": "3.264.0", + "@aws-sdk/middleware-host-header": "3.257.0", + "@aws-sdk/middleware-logger": "3.257.0", + "@aws-sdk/middleware-recursion-detection": "3.257.0", + "@aws-sdk/middleware-retry": "3.259.0", + "@aws-sdk/middleware-sdk-sts": "3.257.0", + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/middleware-signing": "3.257.0", + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/middleware-user-agent": "3.257.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/node-http-handler": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/smithy-client": "3.261.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.261.0", + "@aws-sdk/util-defaults-mode-node": "3.261.0", + "@aws-sdk/util-endpoints": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "@aws-sdk/util-user-agent-browser": "3.257.0", + "@aws-sdk/util-user-agent-node": "3.259.0", + "@aws-sdk/util-utf8": "3.254.0", + "fast-xml-parser": "4.0.11", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/config-resolver": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/config-resolver/-/config-resolver-3.259.0.tgz", + "integrity": "sha512-gViMRsc4Ye6+nzJ0OYTZIT8m4glIAdtugN2Sr/t6P2iJW5X0bSL/EcbcHBgsve1lHjeGPeyzVkT7UnyGOZ5Z/A==", + "optional": true, + "dependencies": { + "@aws-sdk/signature-v4": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-config-provider": "3.208.0", + "@aws-sdk/util-middleware": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-cognito-identity": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.264.0.tgz", + "integrity": "sha512-0L4offTpZJrX4PkoUI5KXPlG3uaofbmew+tgPphKd+ns3tzhLsltPMixS/04J5qXEfwMCHwvDgSpCenKsUo/wg==", + "optional": true, + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.264.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.257.0.tgz", + "integrity": "sha512-GsmBi5Di6hk1JAi1iB6/LCY8o+GmlCvJoB7wuoVmXI3VxRVwptUVjuj8EtJbIrVGrF9dSuIRPCzUoSuzEzYGlg==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-imds": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-imds/-/credential-provider-imds-3.259.0.tgz", + "integrity": "sha512-yCxoYWZAaDrCUEWxRfrpB0Mp1cFgJEMYW8T6GIb/+DQ5QLpZmorgaVD/j90QXupqFrR5tlxwuskBIkdD2E9YNg==", + "optional": true, + "dependencies": { + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.264.0.tgz", + "integrity": "sha512-UU5NNlfn+Go+5PLBzyTH1YE3r/pgykpE4QYFon87sCnEQnQH9xmlRTW1f1cBSQ9kivbFZd2/C2X3qhB3fe2JfA==", + "optional": true, + "dependencies": { + "@aws-sdk/credential-provider-env": "3.257.0", + "@aws-sdk/credential-provider-imds": "3.259.0", + "@aws-sdk/credential-provider-process": "3.257.0", + "@aws-sdk/credential-provider-sso": "3.264.0", + "@aws-sdk/credential-provider-web-identity": "3.257.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.264.0.tgz", + "integrity": "sha512-DPzL7oawcILs5Mduim9Z8SVeJaUpaDRVbUIrBHsMBu+N7Zuqtzr+0ckHc1bEi3iYq2QUCk5pH5vpQaZYkMlbtw==", + "optional": true, + "dependencies": { + "@aws-sdk/credential-provider-env": "3.257.0", + "@aws-sdk/credential-provider-imds": "3.259.0", + "@aws-sdk/credential-provider-ini": "3.264.0", + "@aws-sdk/credential-provider-process": "3.257.0", + "@aws-sdk/credential-provider-sso": "3.264.0", + "@aws-sdk/credential-provider-web-identity": "3.257.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.257.0.tgz", + "integrity": "sha512-xK8uYeNXaclaBCGrLi4z2pxPRngqLf5BM5jg2fn57zqvlL9V5gJF972FehrVBL0bfp1/laG0ZJtD2K2sapyWAw==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.264.0.tgz", + "integrity": "sha512-CJuAlqIIJap6LXoqimvEAnYZ7Kb5pTbiS3e+aY+fajO3OPujmQpHuiY8kOmscjwZ4ErJdEskivcTGwXph0dPZQ==", + "optional": true, + "dependencies": { + "@aws-sdk/client-sso": "3.264.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/token-providers": "3.264.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.257.0.tgz", + "integrity": "sha512-Cm0uvRv4JuIbD0Kp3W0J/vwjADIyCx8HoZi5yg+QIi5nilocuTQ3ajvLeuPVSvFvdy+yaxSc5FxNXquWt7Mngw==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.264.0.tgz", + "integrity": "sha512-4iSr1Z7Uf8uDraQ7JYoMotVLhmnGFAGsH559KBPxuxjMjg2lku9GA5V1zw7SNV8FEcj+Sh5HrpJvJ7P1kA+YjA==", + "optional": true, + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.264.0", + "@aws-sdk/client-sso": "3.264.0", + "@aws-sdk/client-sts": "3.264.0", + "@aws-sdk/credential-provider-cognito-identity": "3.264.0", + "@aws-sdk/credential-provider-env": "3.257.0", + "@aws-sdk/credential-provider-imds": "3.259.0", + "@aws-sdk/credential-provider-ini": "3.264.0", + "@aws-sdk/credential-provider-node": "3.264.0", + "@aws-sdk/credential-provider-process": "3.257.0", + "@aws-sdk/credential-provider-sso": "3.264.0", + "@aws-sdk/credential-provider-web-identity": "3.257.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/fetch-http-handler": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.257.0.tgz", + "integrity": "sha512-zOF+RzQ+wfF7tq7tGUdPcqUTh3+k2f8KCVJE07A8kCopVq4nBu4NH6Eq29Tjpwdya3YlKvE+kFssuQRRRRex+Q==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/querystring-builder": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/hash-node": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/hash-node/-/hash-node-3.257.0.tgz", + "integrity": "sha512-W/USUuea5Ep3OJ2U7Ve8/5KN1YsDun2WzOFUxc1PyxXP5pW6OgC15/op0e+bmWPG851clvp5S8ZuroUr3aKi3Q==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-buffer-from": "3.208.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/invalid-dependency": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/invalid-dependency/-/invalid-dependency-3.257.0.tgz", + "integrity": "sha512-T68SAPRNMEhpke0wlxURgogL7q0B8dfqZsSeS20BVR/lksJxLse9+pbmCDxiu1RrXoEIsEwl5rbLN+Hw8BFFYw==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/is-array-buffer": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/is-array-buffer/-/is-array-buffer-3.201.0.tgz", + "integrity": "sha512-UPez5qLh3dNgt0DYnPD/q0mVJY84rA17QE26hVNOW3fAji8W2wrwrxdacWOxyXvlxWsVRcKmr+lay1MDqpAMfg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-content-length": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-content-length/-/middleware-content-length-3.257.0.tgz", + "integrity": "sha512-yiawbV2azm6QnMY1L2ypG8PDRdjOcEIvFmT0T7y0F49rfbKJOu21j1ONAoCkLrINK6kMqcD5JSQLVCoURxiTxQ==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-endpoint": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-endpoint/-/middleware-endpoint-3.264.0.tgz", + "integrity": "sha512-H9JEAug3Oo3IA2wZIplVVF6NtauCIjICXWgbNbA8Im+I2KPe0jWtOdtQv4U+tqHe9T4zIixaCM3gjUBld+FoOA==", + "optional": true, + "dependencies": { + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/signature-v4": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-config-provider": "3.208.0", + "@aws-sdk/util-middleware": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.257.0.tgz", + "integrity": "sha512-gEi9AJdJfRfU8Qr6HK1hfhxTzyV3Giq4B/h7um99hIFAT/GCg9xiPvAOKPo6UeuiKEv3b7RpSL4s6cBvnJMJBA==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.257.0.tgz", + "integrity": "sha512-8RDXW/VbMKBsXDfcCLmROZcWKyrekyiPa3J1aIaBy0tq9o4xpGoXw/lwwIrNVvISAFslb57rteup34bfn6ta6w==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.257.0.tgz", + "integrity": "sha512-rUCih6zHh8k9Edf5N5Er4s508FYbwLM0MWTD2axzlj9TjLqEQ9OKED3wHaLffXSDzodd3oTAfJCLPbWQyoZ3ZQ==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-retry": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-retry/-/middleware-retry-3.259.0.tgz", + "integrity": "sha512-pVh1g8e84MAi7eVtWLiiiCtn82LzxOP7+LxTRHatmgIeN22yGQBZILliPDJypUPvDYlwxI1ekiK+oPTcte0Uww==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/service-error-classification": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-middleware": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "tslib": "^2.3.1", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-sts": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.257.0.tgz", + "integrity": "sha512-d6IJCLRi3O2tm4AFK60WNhIwmMmspj1WzKR1q1TaoPzoREPG2xg+Am18wZBRkCyYuRPPrbizmkvAmAJiUolMAw==", + "optional": true, + "dependencies": { + "@aws-sdk/middleware-signing": "3.257.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/signature-v4": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-serde": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-serde/-/middleware-serde-3.257.0.tgz", + "integrity": "sha512-/JasfXPWFq24mnCrx9fxW/ISBSp07RJwhsF14qzm8Qy3Z0z470C+QRM6otTwAkYuuVt1wuLjja5agq3Jtzq7dQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.257.0.tgz", + "integrity": "sha512-hCH3D83LHmm6nqmtNrGTWZCVjsQXrGHIXbd17/qrw7aPFvcAhsiiCncGFP+XsUXEKa2ZqcSNMUyPrx69ofNRZQ==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/signature-v4": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-middleware": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-stack": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-stack/-/middleware-stack-3.257.0.tgz", + "integrity": "sha512-awg2F0SvwACBaw4HIObK8pQGfSqAc4Vy+YFzWSfZNVC35oRO6RsRdKHVU99lRC0LrT2Ptmfghl2DMPSrRDbvlQ==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.257.0.tgz", + "integrity": "sha512-37rt75LZyD0UWpbcFuxEGqwF3DZKSixQPl7AsDe6q3KtrO5gGQB+diH5vbY0txNNYyv5IK9WMwvY73mVmoWRmw==", + "optional": true, + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/node-config-provider": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-config-provider/-/node-config-provider-3.259.0.tgz", + "integrity": "sha512-DUOqr71oonBvM6yKPdhDBmraqgXHCFrVWFw7hc5ZNxL2wS/EsbKfGPJp+C+SUgpn1upIWPNnh/bNoLAbBkcLsA==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/node-http-handler": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-http-handler/-/node-http-handler-3.257.0.tgz", + "integrity": "sha512-8KnWHVVwaGKyTlkTU9BSOAiSovNDoagxemU2l10QqBbzUCVpljCUMUkABEGRJ1yoQCl6DJ7RtNkAyZ8Ne/E15A==", + "optional": true, + "dependencies": { + "@aws-sdk/abort-controller": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/querystring-builder": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/property-provider": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/property-provider/-/property-provider-3.257.0.tgz", + "integrity": "sha512-3rUbRAcF0GZ5PhDiXhS4yREfZ5hOEtvYEa9S/19OdM5eoypOaLU5XnFcCKfnccSP8SkdgpJujzxOMRWNWadlAQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/protocol-http": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/protocol-http/-/protocol-http-3.257.0.tgz", + "integrity": "sha512-xt7LGOgZIvbLS3418AYQLacOqx+mo5j4mPiIMz7f6AaUg+/fBUgESVsncKDqxbEJVwwCXSka8Ca0cntJmoeMSw==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/querystring-builder": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-builder/-/querystring-builder-3.257.0.tgz", + "integrity": "sha512-mZHWLP7XIkzx1GIXO5WfX/iJ+aY9TWs02RE9FkdL2+by0HEMR65L3brQTbU1mIBJ7BjaPwYH24dljUOSABX7yg==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/querystring-parser": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-parser/-/querystring-parser-3.257.0.tgz", + "integrity": "sha512-UDrE1dEwWrWT8dG2VCrGYrPxCWOkZ1fPTPkjpkR4KZEdQDZBqU5gYZF2xPj8Nz7pjQVHFuW2wFm3XYEk56GEjg==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/service-error-classification": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/service-error-classification/-/service-error-classification-3.257.0.tgz", + "integrity": "sha512-FAyR0XsueGkkqDtkP03cTJQk52NdQ9sZelLynmmlGPUP75LApRPvFe1riKrou6+LsDbwVNVffj6mbDfIcOhaOw==", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/shared-ini-file-loader": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/shared-ini-file-loader/-/shared-ini-file-loader-3.257.0.tgz", + "integrity": "sha512-HNjC1+Wx3xHiJc+CP14GhIdVhfQGSjroAsWseRxAhONocA9Fl1ZX4hx7+sA5c9nOoMVOovi6ivJ/6lCRPTDRrQ==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/signature-v4": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4/-/signature-v4-3.257.0.tgz", + "integrity": "sha512-aLQQN59X/D0+ShzPD3Anj5ntdMA/RFeNLOUCDyDvremViGi6yxUS98usQ/8bG5Rq0sW2GGMdbFUFmrDvqdiqEQ==", + "optional": true, + "dependencies": { + "@aws-sdk/is-array-buffer": "3.201.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-hex-encoding": "3.201.0", + "@aws-sdk/util-middleware": "3.257.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/smithy-client": { + "version": "3.261.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/smithy-client/-/smithy-client-3.261.0.tgz", + "integrity": "sha512-j8XQEa3caZUVFVZfhJjaskw80O/tB+IXu84HMN44N7UkXaCFHirUsNjTDztJhnVXf/gKXzIqUqprfRnOvwLtIg==", + "optional": true, + "dependencies": { + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.264.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.264.0.tgz", + "integrity": "sha512-1N54FCdBJRqrwFWHUoDpGI0rKhI29Or9ZwGjjcBzKzLhz5sEF/DEhuID7h1/KKEkXdQ0+lmXOFGMMrahrMpOow==", + "optional": true, + "dependencies": { + "@aws-sdk/client-sso-oidc": "3.264.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.257.0.tgz", + "integrity": "sha512-LmqXuBQBGeaGi/3Rp7XiEX1B5IPO2UUfBVvu0wwGqVsmstT0SbOVDZGPmxygACbm64n+PRx3uTSDefRfoiWYZg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/url-parser": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/url-parser/-/url-parser-3.257.0.tgz", + "integrity": "sha512-Qe/AcFe/NFZHa6cN2afXEQn9ehXxh57dWGdRjfjd2lQqNV4WW1R2pl2Tm1ZJ1dwuCNLJi4NHLMk8lrD3QQ8rdg==", + "optional": true, + "dependencies": { + "@aws-sdk/querystring-parser": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-base64": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64/-/util-base64-3.208.0.tgz", + "integrity": "sha512-PQniZph5A6N7uuEOQi+1hnMz/FSOK/8kMFyFO+4DgA1dZ5pcKcn5wiFwHkcTb/BsgVqQa3Jx0VHNnvhlS8JyTg==", + "optional": true, + "dependencies": { + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-body-length-browser": { + "version": "3.188.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-browser/-/util-body-length-browser-3.188.0.tgz", + "integrity": "sha512-8VpnwFWXhnZ/iRSl9mTf+VKOX9wDE8QtN4bj9pBfxwf90H1X7E8T6NkiZD3k+HubYf2J94e7DbeHs7fuCPW5Qg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-body-length-node": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-node/-/util-body-length-node-3.208.0.tgz", + "integrity": "sha512-3zj50e5g7t/MQf53SsuuSf0hEELzMtD8RX8C76f12OSRo2Bca4FLLYHe0TZbxcfQHom8/hOaeZEyTyMogMglqg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-buffer-from": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-buffer-from/-/util-buffer-from-3.208.0.tgz", + "integrity": "sha512-7L0XUixNEFcLUGPeBF35enCvB9Xl+K6SQsmbrPk1P3mlV9mguWSDQqbOBwY1Ir0OVbD6H/ZOQU7hI/9RtRI0Zw==", + "optional": true, + "dependencies": { + "@aws-sdk/is-array-buffer": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-config-provider": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-config-provider/-/util-config-provider-3.208.0.tgz", + "integrity": "sha512-DSRqwrERUsT34ug+anlMBIFooBEGwM8GejC7q00Y/9IPrQy50KnG5PW2NiTjuLKNi7pdEOlwTSEocJE15eDZIg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-defaults-mode-browser": { + "version": "3.261.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-browser/-/util-defaults-mode-browser-3.261.0.tgz", + "integrity": "sha512-lX3X1NfzQVV6cakepGV24uRcqevlDnQ8VgaCV8dhnw1FVThueFigyoFaUA02+uRXbV9KIbNWkEvweNtm2wvyDw==", + "optional": true, + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@aws-sdk/util-defaults-mode-node": { + "version": "3.261.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-node/-/util-defaults-mode-node-3.261.0.tgz", + "integrity": "sha512-4AK6yu4bOmHSocUdbGoEHbNXB09UA58ON2HBHY4NxMBuFBAd9XB2tYiyhce+Cm+o+lHbS8oQnw0VZw16WMzzew==", + "optional": true, + "dependencies": { + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/credential-provider-imds": "3.259.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.257.0.tgz", + "integrity": "sha512-3bvmRn5XGYzPPWjLuvHBKdJOb+fijnb8Ungu9bfXnTYFsng/ndHUWeHC22O/p8w3OWoRYUIMaZHxdxe27BFozg==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-hex-encoding": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-hex-encoding/-/util-hex-encoding-3.201.0.tgz", + "integrity": "sha512-7t1vR1pVxKx0motd3X9rI3m/xNp78p3sHtP5yo4NP4ARpxyJ0fokBomY8ScaH2D/B+U5o9ARxldJUdMqyBlJcA==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.208.0.tgz", + "integrity": "sha512-iua1A2+P7JJEDHVgvXrRJSvsnzG7stYSGQnBVphIUlemwl6nN5D+QrgbjECtrbxRz8asYFHSzhdhECqN+tFiBg==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-middleware": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-middleware/-/util-middleware-3.257.0.tgz", + "integrity": "sha512-F9ieon8B8eGVs5tyZtAIG3DZEObDvujkspho0qRbUTHUosM0ylJLsMU800fmC/uRHLRrZvb/RSp59+kNDwSAMw==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-retry": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-retry/-/util-retry-3.257.0.tgz", + "integrity": "sha512-l9TOsOAYtZxwW3q5fQKW4rsD9t2HVaBfQ4zBamHkNTfB4vBVvCnz4oxkvSvA2MlxCA6am+K1K/oj917Tpqk53g==", + "optional": true, + "dependencies": { + "@aws-sdk/service-error-classification": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@aws-sdk/util-uri-escape": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-uri-escape/-/util-uri-escape-3.201.0.tgz", + "integrity": "sha512-TeTWbGx4LU2c5rx0obHeDFeO9HvwYwQtMh1yniBz00pQb6Qt6YVOETVQikRZ+XRQwEyCg/dA375UplIpiy54mA==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.257.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.257.0.tgz", + "integrity": "sha512-YdavWK6/8Cw6mypEgysGGX/dT9p9qnzFbnN5PQsUY+JJk2Nx8fKFydjGiQ+6rWPeW17RAv9mmbboh9uPVWxVlw==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.259.0.tgz", + "integrity": "sha512-R0VTmNs+ySDDebU98BUbsLyeIM5YmAEr9esPpy15XfSy3AWmAeru8nLlztdaLilHZzLIDzvM2t7NGk/FzZFCvA==", + "optional": true, + "dependencies": { + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/util-utf8": { + "version": "3.254.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8/-/util-utf8-3.254.0.tgz", + "integrity": "sha512-14Kso/eIt5/qfIBmhEL9L1IfyUqswjSTqO2mY7KOzUZ9SZbwn3rpxmtkhmATkRjD7XIlLKaxBkI7tU9Zjzj8Kw==", + "optional": true, + "dependencies": { + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-utf8-browser": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz", + "integrity": "sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==", + "optional": true, + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@types/node": { + "version": "18.11.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", + "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-xTE1E+YF4aWPJJeUzaZI5DRntlkY3+BCVJi0axFptnjGmAoWxkyREIh/XMrfxVLejwQxMCfDXdICo0VLxThrog==" + }, + "node_modules/@types/whatwg-url": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", + "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", + "dependencies": { + "@types/node": "*", + "@types/webidl-conversions": "*" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dependencies": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dependencies": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/bowser": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==", + "optional": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bson": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz", + "integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==", + "dependencies": { + "buffer": "^5.6.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dependencies": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/fast-xml-parser": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.11.tgz", + "integrity": "sha512-4aUg3aNRR/WjQAcpceODG1C3x3lFANXRo8+1biqfieHmg9pyMt7qB4lQV/Ta6sJCTbA5vfD8fnA8S54JATiFUA==", + "optional": true, + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/kareem": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", + "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "optional": true + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", + "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.30", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", + "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", + "dependencies": { + "mime-db": "1.47.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mongodb": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.13.0.tgz", + "integrity": "sha512-+taZ/bV8d1pYuHL4U+gSwkhmDrwkWbH1l4aah4YpmpscMwgFBkufIKxgP/G7m87/NUuQzc2Z75ZTI7ZOyqZLbw==", + "dependencies": { + "bson": "^4.7.0", + "mongodb-connection-string-url": "^2.5.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">=12.9.0" + }, + "optionalDependencies": { + "@aws-sdk/credential-providers": "^3.186.0", + "saslprep": "^1.0.3" + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", + "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", + "dependencies": { + "@types/whatwg-url": "^8.2.1", + "whatwg-url": "^11.0.0" + } + }, + "node_modules/mongoose": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.9.0.tgz", + "integrity": "sha512-5tu6+trwjk5TIH6b6iYgAwmzZ0RNOxFoqXQb9h21Oi45DeM1rWM/niHxJ4ROqBISDfQMwRvLSABHTsyn3AzoFQ==", + "dependencies": { + "bson": "^4.7.0", + "kareem": "2.5.1", + "mongodb": "4.13.0", + "mpath": "0.9.0", + "mquery": "4.0.3", + "ms": "2.1.3", + "sift": "16.0.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mongoose/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mquery": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-4.0.3.tgz", + "integrity": "sha512-J5heI+P08I6VJ2Ky3+33IpCdAvlYGTSUjwTPxkAr8i8EoduPMBX2OY/wa3IKZIQl7MU4SbFk8ndgSKyB/cl1zA==", + "dependencies": { + "debug": "4.x" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/mquery/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mquery/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "dependencies": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dependencies": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/saslprep": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", + "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", + "optional": true, + "dependencies": { + "sparse-bitfield": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "dependencies": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "node_modules/serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "node_modules/sift": { + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz", + "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==" + }, + "node_modules/simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", + "dev": true, + "dependencies": { + "semver": "~7.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "optional": true, + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "optional": true + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "optional": true + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + } + } +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/CHANGELOG.md b/server/node_modules/@aws-crypto/ie11-detection/CHANGELOG.md new file mode 100644 index 0000000000..8232cc339a --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/CHANGELOG.md @@ -0,0 +1,46 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.2...v3.0.0) (2023-01-12) + +**Note:** Version bump only for package @aws-crypto/ie11-detection + +## [2.0.2](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.1...v2.0.2) (2022-09-07) + +**Note:** Version bump only for package @aws-crypto/ie11-detection + +# [2.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.2...v2.0.0) (2021-10-25) + +**Note:** Version bump only for package @aws-crypto/ie11-detection + +# [1.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/ie11-detection@1.0.0-alpha.0...@aws-crypto/ie11-detection@1.0.0) (2020-10-22) + +### Bug Fixes + +- replace `sourceRoot` -> `rootDir` in tsconfig ([#169](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/169)) ([d437167](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/d437167b51d1c56a4fcc2bb8a446b74a7e3b7e06)) + +# [1.0.0-alpha.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/ie11-detection@0.1.0-preview.4...@aws-crypto/ie11-detection@1.0.0-alpha.0) (2020-02-07) + +**Note:** Version bump only for package @aws-crypto/ie11-detection + +# [0.1.0-preview.4](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/ie11-detection@0.1.0-preview.2...@aws-crypto/ie11-detection@0.1.0-preview.4) (2020-01-16) + +### Bug Fixes + +- Changed package.json files to point to the right Git repo ([#9](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/9)) ([028245d](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/028245d72e642ca98d82226afb300eb154503c4a)), closes [#8](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/8) +- lerna version maintains package-lock ([#14](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/14)) ([2ef29e1](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/2ef29e13779703a5c9b32e93d18918fcb33b7272)), closes [#13](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/13) + +# [0.1.0-preview.3](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/ie11-detection@0.1.0-preview.2...@aws-crypto/ie11-detection@0.1.0-preview.3) (2019-11-15) + +### Bug Fixes + +- Changed package.json files to point to the right Git repo ([#9](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/9)) ([028245d](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/028245d72e642ca98d82226afb300eb154503c4a)), closes [#8](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/8) +- lerna version maintains package-lock ([#14](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/14)) ([2ef29e1](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/2ef29e13779703a5c9b32e93d18918fcb33b7272)), closes [#13](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/13) + +# [0.1.0-preview.2](https://github.com/aws/aws-javascript-crypto-helpers/compare/@aws-crypto/ie11-detection@0.1.0-preview.1...@aws-crypto/ie11-detection@0.1.0-preview.2) (2019-10-30) + +### Bug Fixes + +- remove /src/ from .npmignore (for sourcemaps) ([#5](https://github.com/aws/aws-javascript-crypto-helpers/issues/5)) ([ec52056](https://github.com/aws/aws-javascript-crypto-helpers/commit/ec52056)) diff --git a/server/node_modules/@aws-crypto/ie11-detection/LICENSE b/server/node_modules/@aws-crypto/ie11-detection/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-crypto/ie11-detection/README.md b/server/node_modules/@aws-crypto/ie11-detection/README.md new file mode 100644 index 0000000000..9e411b0c08 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/README.md @@ -0,0 +1,20 @@ +# @aws-crypto/ie11-detection + +Functions for interact with IE11 browsers Crypto. The IE11 `window.subtle` functions are unique. +This library is used to identify an IE11 `window` and then offering types for crypto functions. +For example see @aws-crypto/random-source-browser + +## Usage + +``` +import {isMsWindow} from '@aws-crypto/ie11-detection' + +if (isMsWindow(window)) { + // use `window.subtle.mscrypto` +} + +``` + +## Test + +`npm test` diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.d.ts b/server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.d.ts new file mode 100644 index 0000000000..c647f80393 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.d.ts @@ -0,0 +1,19 @@ +import { Key } from "./Key"; +/** + * Represents a cryptographic operation that has been instantiated but not + * necessarily fed all data or finalized. + * + * @see https://msdn.microsoft.com/en-us/library/dn280996(v=vs.85).aspx + */ +export interface CryptoOperation { + readonly algorithm: string; + readonly key: Key; + onabort: (event: Event) => void; + oncomplete: (event: Event) => void; + onerror: (event: Event) => void; + onprogress: (event: Event) => void; + readonly result: ArrayBuffer | undefined; + abort(): void; + finish(): void; + process(buffer: ArrayBufferView): void; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js b/server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js new file mode 100644 index 0000000000..ea035c9ee5 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=CryptoOperation.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js.map b/server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js.map new file mode 100644 index 0000000000..95c3ef719c --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CryptoOperation.js","sourceRoot":"","sources":["../src/CryptoOperation.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/Key.d.ts b/server/node_modules/@aws-crypto/ie11-detection/build/Key.d.ts new file mode 100644 index 0000000000..c8bd3b348d --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/Key.d.ts @@ -0,0 +1,12 @@ +/** + * The result of a successful KeyOperation. + * + * @see {KeyOperation} + * @see https://msdn.microsoft.com/en-us/library/dn302313(v=vs.85).aspx + */ +export interface Key { + readonly algorithm: string; + readonly extractable: boolean; + readonly keyUsage: Array; + readonly type: string; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/Key.js b/server/node_modules/@aws-crypto/ie11-detection/build/Key.js new file mode 100644 index 0000000000..b24b9af1e7 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/Key.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Key.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/Key.js.map b/server/node_modules/@aws-crypto/ie11-detection/build/Key.js.map new file mode 100644 index 0000000000..c0454ea278 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/Key.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Key.js","sourceRoot":"","sources":["../src/Key.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.d.ts b/server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.d.ts new file mode 100644 index 0000000000..2e7c9a67d6 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.d.ts @@ -0,0 +1,12 @@ +import { Key } from "./Key"; +/** + * Represents the return of a key-related operation that may or may not have + * been completed. + * + * @see https://msdn.microsoft.com/en-us/library/dn302314(v=vs.85).aspx + */ +export interface KeyOperation { + oncomplete: (event: Event) => void; + onerror: (event: Event) => void; + readonly result: Key | undefined; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.js b/server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.js new file mode 100644 index 0000000000..044709882d --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=KeyOperation.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.js.map b/server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.js.map new file mode 100644 index 0000000000..3b343d34e5 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/KeyOperation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KeyOperation.js","sourceRoot":"","sources":["../src/KeyOperation.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.d.ts b/server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.d.ts new file mode 100644 index 0000000000..f52063a940 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.d.ts @@ -0,0 +1,33 @@ +import { CryptoOperation } from "./CryptoOperation"; +import { Key } from "./Key"; +import { KeyOperation } from "./KeyOperation"; +export type KeyUsage = "encrypt" | "decrypt" | "sign" | "verify" | "derive" | "wrapKey" | "unwrapKey" | "importKey"; +export type EncryptionOrVerificationAlgorithm = "RSAES-PKCS1-v1_5"; +export type Ie11EncryptionAlgorithm = "AES-CBC" | "AES-GCM" | "RSA-OAEP" | EncryptionOrVerificationAlgorithm; +export type Ie11DigestAlgorithm = "SHA-1" | "SHA-256" | "SHA-384"; +export interface HashAlgorithm { + name: Ie11DigestAlgorithm; +} +export interface HmacAlgorithm { + name: "HMAC"; + hash: HashAlgorithm; +} +export type SigningAlgorithm = HmacAlgorithm; +/** + * Represent ths SubtleCrypto interface as implemented in Internet Explorer 11. + * This implementation was based on an earlier version of the WebCrypto API and + * differs from the `window.crypto.subtle` object exposed in Chrome, Safari, + * Firefox, and MS Edge. + * + * @see https://msdn.microsoft.com/en-us/library/dn302325(v=vs.85).aspx + */ +export interface MsSubtleCrypto { + decrypt(algorithm: Ie11EncryptionAlgorithm, key: Key, buffer?: ArrayBufferView): CryptoOperation; + digest(algorithm: Ie11DigestAlgorithm, buffer?: ArrayBufferView): CryptoOperation; + encrypt(algorithm: Ie11EncryptionAlgorithm, key: Key, buffer?: ArrayBufferView): CryptoOperation; + exportKey(format: string, key: Key): KeyOperation; + generateKey(algorithm: SigningAlgorithm | Ie11EncryptionAlgorithm, extractable?: boolean, keyUsages?: Array): KeyOperation; + importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: Array): KeyOperation; + sign(algorithm: SigningAlgorithm, key: Key, buffer?: ArrayBufferView): CryptoOperation; + verify(algorithm: SigningAlgorithm | EncryptionOrVerificationAlgorithm, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.js b/server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.js new file mode 100644 index 0000000000..479b08af2e --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=MsSubtleCrypto.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.js.map b/server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.js.map new file mode 100644 index 0000000000..1955d281b2 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MsSubtleCrypto.js","sourceRoot":"","sources":["../src/MsSubtleCrypto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.d.ts b/server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.d.ts new file mode 100644 index 0000000000..d5aaada854 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.d.ts @@ -0,0 +1,21 @@ +import { MsSubtleCrypto } from "./MsSubtleCrypto"; +/** + * The value accessible as `window.msCrypto` in Internet Explorer 11. + */ +export interface MsCrypto { + getRandomValues: (toFill: Uint8Array) => void; + subtle: MsSubtleCrypto; +} +/** + * The `window` object in Internet Explorer 11. This interface does not + * exhaustively document the prefixed features of `window` in IE11. + */ +export interface MsWindow extends Window { + MSInputMethodContext: any; + msCrypto: MsCrypto; +} +/** + * Determines if the provided window is (or is like) the window object one would + * expect to encounter in Internet Explorer 11. + */ +export declare function isMsWindow(window: Window): window is MsWindow; diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.js b/server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.js new file mode 100644 index 0000000000..ceeb8f5e58 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isMsWindow = void 0; +var msSubtleCryptoMethods = [ + "decrypt", + "digest", + "encrypt", + "exportKey", + "generateKey", + "importKey", + "sign", + "verify" +]; +function quacksLikeAnMsWindow(window) { + return "MSInputMethodContext" in window && "msCrypto" in window; +} +/** + * Determines if the provided window is (or is like) the window object one would + * expect to encounter in Internet Explorer 11. + */ +function isMsWindow(window) { + if (quacksLikeAnMsWindow(window) && window.msCrypto.subtle !== undefined) { + var _a = window.msCrypto, getRandomValues = _a.getRandomValues, subtle_1 = _a.subtle; + return msSubtleCryptoMethods + .map(function (methodName) { return subtle_1[methodName]; }) + .concat(getRandomValues) + .every(function (method) { return typeof method === "function"; }); + } + return false; +} +exports.isMsWindow = isMsWindow; +//# sourceMappingURL=MsWindow.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.js.map b/server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.js.map new file mode 100644 index 0000000000..34223c913c --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/MsWindow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MsWindow.js","sourceRoot":"","sources":["../src/MsWindow.ts"],"names":[],"mappings":";;;AAYA,IAAM,qBAAqB,GAA8B;IACvD,SAAS;IACT,QAAQ;IACR,SAAS;IACT,WAAW;IACX,aAAa;IACb,WAAW;IACX,MAAM;IACN,QAAQ;CACT,CAAC;AAmBF,SAAS,oBAAoB,CAAC,MAAc;IAC1C,OAAO,sBAAsB,IAAI,MAAM,IAAI,UAAU,IAAI,MAAM,CAAC;AAClE,CAAC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,MAAc;IACvC,IAAI,oBAAoB,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;QAClE,IAAA,KAA8B,MAAM,CAAC,QAAQ,EAA3C,eAAe,qBAAA,EAAE,QAAM,YAAoB,CAAC;QACpD,OAAO,qBAAqB;aACzB,GAAG,CAAW,UAAA,UAAU,IAAI,OAAA,QAAM,CAAC,UAAU,CAAC,EAAlB,CAAkB,CAAC;aAC/C,MAAM,CAAC,eAAe,CAAC;aACvB,KAAK,CAAC,UAAA,MAAM,IAAI,OAAA,OAAO,MAAM,KAAK,UAAU,EAA5B,CAA4B,CAAC,CAAC;KAClD;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAVD,gCAUC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/index.d.ts b/server/node_modules/@aws-crypto/ie11-detection/build/index.d.ts new file mode 100644 index 0000000000..1e8c5e3559 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/index.d.ts @@ -0,0 +1,5 @@ +export * from "./CryptoOperation"; +export * from "./Key"; +export * from "./KeyOperation"; +export * from "./MsSubtleCrypto"; +export * from "./MsWindow"; diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/index.js b/server/node_modules/@aws-crypto/ie11-detection/build/index.js new file mode 100644 index 0000000000..2de39c10ed --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./CryptoOperation"), exports); +tslib_1.__exportStar(require("./Key"), exports); +tslib_1.__exportStar(require("./KeyOperation"), exports); +tslib_1.__exportStar(require("./MsSubtleCrypto"), exports); +tslib_1.__exportStar(require("./MsWindow"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/build/index.js.map b/server/node_modules/@aws-crypto/ie11-detection/build/index.js.map new file mode 100644 index 0000000000..8430e7a982 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,gDAAsB;AACtB,yDAA+B;AAC/B,2DAAiC;AACjC,qDAA2B"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/CopyrightNotice.txt b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/CopyrightNotice.txt new file mode 100644 index 0000000000..3d4c82348e --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/LICENSE.txt b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/LICENSE.txt new file mode 100644 index 0000000000..bfe6430cb0 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/README.md b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/README.md new file mode 100644 index 0000000000..a5b2692c8a --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/README.md @@ -0,0 +1,142 @@ +# tslib + +This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. + +This library is primarily used by the `--importHelpers` flag in TypeScript. +When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: + +```ts +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +exports.x = {}; +exports.y = __assign({}, exports.x); + +``` + +will instead be emitted as something like the following: + +```ts +var tslib_1 = require("tslib"); +exports.x = {}; +exports.y = tslib_1.__assign({}, exports.x); +``` + +Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. +For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. + +# Installing + +For the latest stable version, run: + +## npm + +```sh +# TypeScript 2.3.3 or later +npm install tslib + +# TypeScript 2.3.2 or earlier +npm install tslib@1.6.1 +``` + +## yarn + +```sh +# TypeScript 2.3.3 or later +yarn add tslib + +# TypeScript 2.3.2 or earlier +yarn add tslib@1.6.1 +``` + +## bower + +```sh +# TypeScript 2.3.3 or later +bower install tslib + +# TypeScript 2.3.2 or earlier +bower install tslib@1.6.1 +``` + +## JSPM + +```sh +# TypeScript 2.3.3 or later +jspm install tslib + +# TypeScript 2.3.2 or earlier +jspm install tslib@1.6.1 +``` + +# Usage + +Set the `importHelpers` compiler option on the command line: + +``` +tsc --importHelpers file.ts +``` + +or in your tsconfig.json: + +```json +{ + "compilerOptions": { + "importHelpers": true + } +} +``` + +#### For bower and JSPM users + +You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: + +```json +{ + "compilerOptions": { + "module": "amd", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["bower_components/tslib/tslib.d.ts"] + } + } +} +``` + +For JSPM users: + +```json +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@1.[version].0/tslib.d.ts"] + } + } +} +``` + + +# Contribute + +There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. + +* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +# Documentation + +* [Quick tutorial](http://www.typescriptlang.org/Tutorial) +* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Homepage](http://www.typescriptlang.org/) diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/modules/index.js b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/modules/index.js new file mode 100644 index 0000000000..d241d04222 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/modules/index.js @@ -0,0 +1,51 @@ +import tslib from '../tslib.js'; +const { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +} = tslib; +export { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +}; diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/modules/package.json b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/modules/package.json new file mode 100644 index 0000000000..aafa0e4b45 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/modules/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/package.json b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/package.json new file mode 100644 index 0000000000..f8c2a53d0f --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/package.json @@ -0,0 +1,37 @@ +{ + "name": "tslib", + "author": "Microsoft Corp.", + "homepage": "https://www.typescriptlang.org/", + "version": "1.14.1", + "license": "0BSD", + "description": "Runtime library for TypeScript helper functions", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript", + "tslib", + "runtime" + ], + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/tslib.git" + }, + "main": "tslib.js", + "module": "tslib.es6.js", + "jsnext:main": "tslib.es6.js", + "typings": "tslib.d.ts", + "sideEffects": false, + "exports": { + ".": { + "module": "./tslib.es6.js", + "import": "./modules/index.js", + "default": "./tslib.js" + }, + "./": "./" + } +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js new file mode 100644 index 0000000000..0c1b613d8b --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js @@ -0,0 +1,23 @@ +// When on node 14, it validates that all of the commonjs exports +// are correctly re-exported for es modules importers. + +const nodeMajor = Number(process.version.split(".")[0].slice(1)) +if (nodeMajor < 14) { + console.log("Skipping because node does not support module exports.") + process.exit(0) +} + +// ES Modules import via the ./modules folder +import * as esTSLib from "../../modules/index.js" + +// Force a commonjs resolve +import { createRequire } from "module"; +const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js"); + +for (const key in commonJSTSLib) { + if (commonJSTSLib.hasOwnProperty(key)) { + if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`) + } +} + +console.log("All exports in commonjs are available for es module consumers.") diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json new file mode 100644 index 0000000000..166e5095e4 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "scripts": { + "test": "node index.js" + } +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.d.ts b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.d.ts new file mode 100644 index 0000000000..0756b28e76 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.d.ts @@ -0,0 +1,37 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +export declare function __generator(thisArg: any, body: Function): any; +export declare function __exportStar(m: any, exports: any): void; +export declare function __values(o: any): any; +export declare function __read(o: any, n?: number): any[]; +export declare function __spread(...args: any[][]): any[]; +export declare function __spreadArrays(...args: any[][]): any[]; +export declare function __await(v: any): any; +export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; +export declare function __asyncDelegator(o: any): any; +export declare function __asyncValues(o: any): any; +export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; +export declare function __importStar(mod: T): T; +export declare function __importDefault(mod: T): T | { default: T }; +export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; +export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; +export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.html b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.html new file mode 100644 index 0000000000..b122e41b06 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.js b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.js new file mode 100644 index 0000000000..0e0d8d079c --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.js @@ -0,0 +1,218 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + +export function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +export function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +export function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +export function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.html b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.html new file mode 100644 index 0000000000..44c9ba51e3 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.js b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.js new file mode 100644 index 0000000000..e5b7c9b809 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.js @@ -0,0 +1,284 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __createBinding = function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }; + + __exportStar = function (m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; + }; + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); diff --git a/server/node_modules/@aws-crypto/ie11-detection/package.json b/server/node_modules/@aws-crypto/ie11-detection/package.json new file mode 100644 index 0000000000..134997121a --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/package.json @@ -0,0 +1,26 @@ +{ + "name": "@aws-crypto/ie11-detection", + "version": "3.0.0", + "description": "Provides functions and types for detecting if the host environment is IE11", + "scripts": { + "pretest": "tsc -p tsconfig.json", + "test": "mocha --require ts-node/register test/**/*test.ts" + }, + "repository": { + "type": "git", + "url": "git@github.com:aws/aws-sdk-js-crypto-helpers.git" + }, + "author": { + "name": "AWS Crypto Tools Team", + "email": "aws-cryptools@amazon.com", + "url": "https://docs.aws.amazon.com/aws-crypto-tools/index.html?id=docs_gateway#lang/en_us" + }, + "homepage": "https://github.com/aws/aws-sdk-js-crypto-helpers/tree/master/packages/ie11-detection", + "license": "Apache-2.0", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "dependencies": { + "tslib": "^1.11.1" + }, + "gitHead": "7f56cee8f62bd65cd397eeec29c3c997215bd80c" +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/src/CryptoOperation.ts b/server/node_modules/@aws-crypto/ie11-detection/src/CryptoOperation.ts new file mode 100644 index 0000000000..528024b92a --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/src/CryptoOperation.ts @@ -0,0 +1,21 @@ +import { Key } from "./Key"; + +/** + * Represents a cryptographic operation that has been instantiated but not + * necessarily fed all data or finalized. + * + * @see https://msdn.microsoft.com/en-us/library/dn280996(v=vs.85).aspx + */ +export interface CryptoOperation { + readonly algorithm: string; + readonly key: Key; + onabort: (event: Event) => void; + oncomplete: (event: Event) => void; + onerror: (event: Event) => void; + onprogress: (event: Event) => void; + readonly result: ArrayBuffer | undefined; + + abort(): void; + finish(): void; + process(buffer: ArrayBufferView): void; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/src/Key.ts b/server/node_modules/@aws-crypto/ie11-detection/src/Key.ts new file mode 100644 index 0000000000..46d171fb4b --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/src/Key.ts @@ -0,0 +1,12 @@ +/** + * The result of a successful KeyOperation. + * + * @see {KeyOperation} + * @see https://msdn.microsoft.com/en-us/library/dn302313(v=vs.85).aspx + */ +export interface Key { + readonly algorithm: string; + readonly extractable: boolean; + readonly keyUsage: Array; + readonly type: string; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/src/KeyOperation.ts b/server/node_modules/@aws-crypto/ie11-detection/src/KeyOperation.ts new file mode 100644 index 0000000000..87b61fbf26 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/src/KeyOperation.ts @@ -0,0 +1,13 @@ +import { Key } from "./Key"; + +/** + * Represents the return of a key-related operation that may or may not have + * been completed. + * + * @see https://msdn.microsoft.com/en-us/library/dn302314(v=vs.85).aspx + */ +export interface KeyOperation { + oncomplete: (event: Event) => void; + onerror: (event: Event) => void; + readonly result: Key | undefined; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/src/MsSubtleCrypto.ts b/server/node_modules/@aws-crypto/ie11-detection/src/MsSubtleCrypto.ts new file mode 100644 index 0000000000..9d1d656d9d --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/src/MsSubtleCrypto.ts @@ -0,0 +1,88 @@ +import { CryptoOperation } from "./CryptoOperation"; +import { Key } from "./Key"; +import { KeyOperation } from "./KeyOperation"; + +export type KeyUsage = + | "encrypt" + | "decrypt" + | "sign" + | "verify" + | "derive" + | "wrapKey" + | "unwrapKey" + | "importKey"; + +export type EncryptionOrVerificationAlgorithm = "RSAES-PKCS1-v1_5"; +export type Ie11EncryptionAlgorithm = + | "AES-CBC" + | "AES-GCM" + | "RSA-OAEP" + | EncryptionOrVerificationAlgorithm; +export type Ie11DigestAlgorithm = "SHA-1" | "SHA-256" | "SHA-384"; + +export interface HashAlgorithm { + name: Ie11DigestAlgorithm; +} + +export interface HmacAlgorithm { + name: "HMAC"; + hash: HashAlgorithm; +} + +export type SigningAlgorithm = HmacAlgorithm; + +/** + * Represent ths SubtleCrypto interface as implemented in Internet Explorer 11. + * This implementation was based on an earlier version of the WebCrypto API and + * differs from the `window.crypto.subtle` object exposed in Chrome, Safari, + * Firefox, and MS Edge. + * + * @see https://msdn.microsoft.com/en-us/library/dn302325(v=vs.85).aspx + */ +export interface MsSubtleCrypto { + decrypt( + algorithm: Ie11EncryptionAlgorithm, + key: Key, + buffer?: ArrayBufferView + ): CryptoOperation; + + digest( + algorithm: Ie11DigestAlgorithm, + buffer?: ArrayBufferView + ): CryptoOperation; + + encrypt( + algorithm: Ie11EncryptionAlgorithm, + key: Key, + buffer?: ArrayBufferView + ): CryptoOperation; + + exportKey(format: string, key: Key): KeyOperation; + + generateKey( + algorithm: SigningAlgorithm | Ie11EncryptionAlgorithm, + extractable?: boolean, + keyUsages?: Array + ): KeyOperation; + + importKey( + format: string, + keyData: ArrayBufferView, + algorithm: any, + extractable?: boolean, + keyUsages?: Array + ): KeyOperation; + + sign( + algorithm: SigningAlgorithm, + key: Key, + buffer?: ArrayBufferView + ): CryptoOperation; + + verify( + algorithm: SigningAlgorithm | EncryptionOrVerificationAlgorithm, + key: Key, + signature: ArrayBufferView, + buffer?: ArrayBufferView + ): CryptoOperation; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/src/MsWindow.ts b/server/node_modules/@aws-crypto/ie11-detection/src/MsWindow.ts new file mode 100644 index 0000000000..0510cfe7f1 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/src/MsWindow.ts @@ -0,0 +1,59 @@ +import { MsSubtleCrypto } from "./MsSubtleCrypto"; + +type SubtleCryptoMethod = + | "decrypt" + | "digest" + | "encrypt" + | "exportKey" + | "generateKey" + | "importKey" + | "sign" + | "verify"; + +const msSubtleCryptoMethods: Array = [ + "decrypt", + "digest", + "encrypt", + "exportKey", + "generateKey", + "importKey", + "sign", + "verify" +]; + +/** + * The value accessible as `window.msCrypto` in Internet Explorer 11. + */ +export interface MsCrypto { + getRandomValues: (toFill: Uint8Array) => void; + subtle: MsSubtleCrypto; +} + +/** + * The `window` object in Internet Explorer 11. This interface does not + * exhaustively document the prefixed features of `window` in IE11. + */ +export interface MsWindow extends Window { + MSInputMethodContext: any; + msCrypto: MsCrypto; +} + +function quacksLikeAnMsWindow(window: Window): window is MsWindow { + return "MSInputMethodContext" in window && "msCrypto" in window; +} + +/** + * Determines if the provided window is (or is like) the window object one would + * expect to encounter in Internet Explorer 11. + */ +export function isMsWindow(window: Window): window is MsWindow { + if (quacksLikeAnMsWindow(window) && window.msCrypto.subtle !== undefined) { + const { getRandomValues, subtle } = window.msCrypto; + return msSubtleCryptoMethods + .map(methodName => subtle[methodName]) + .concat(getRandomValues) + .every(method => typeof method === "function"); + } + + return false; +} diff --git a/server/node_modules/@aws-crypto/ie11-detection/src/index.ts b/server/node_modules/@aws-crypto/ie11-detection/src/index.ts new file mode 100644 index 0000000000..1e8c5e3559 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/src/index.ts @@ -0,0 +1,5 @@ +export * from "./CryptoOperation"; +export * from "./Key"; +export * from "./KeyOperation"; +export * from "./MsSubtleCrypto"; +export * from "./MsWindow"; diff --git a/server/node_modules/@aws-crypto/ie11-detection/tsconfig.json b/server/node_modules/@aws-crypto/ie11-detection/tsconfig.json new file mode 100644 index 0000000000..501a62f803 --- /dev/null +++ b/server/node_modules/@aws-crypto/ie11-detection/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": ["dom", "es5", "es2015.collection"], + "strict": true, + "sourceMap": true, + "declaration": true, + "stripInternal": true, + "rootDir": "./src", + "outDir": "./build", + "importHelpers": true, + "noEmitHelpers": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules/**"] +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/CHANGELOG.md b/server/node_modules/@aws-crypto/sha256-browser/CHANGELOG.md new file mode 100644 index 0000000000..92148fcc68 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/CHANGELOG.md @@ -0,0 +1,88 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.2...v3.0.0) (2023-01-12) + +### Bug Fixes + +- **docs:** sha256 packages, clarify hmac support ([#455](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/455)) ([1be5043](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/1be5043325991f3f5ccb52a8dd928f004b4d442e)) + +- feat!: replace Hash implementations with Checksum interface (#492) ([da43dc0](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/da43dc0fdf669d9ebb5bfb1b1f7c79e46c4aaae1)), closes [#492](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/492) + +### BREAKING CHANGES + +- All classes that implemented `Hash` now implement `Checksum`. + +## [2.0.2](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.1...v2.0.2) (2022-09-07) + +### Bug Fixes + +- **#337:** update @aws-sdk/types ([#373](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/373)) ([b26a811](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/b26a811a392f5209c7ec7e57251500d4d78f97ff)), closes [#337](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/337) + +## [2.0.1](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.0...v2.0.1) (2021-12-09) + +**Note:** Version bump only for package @aws-crypto/sha256-browser + +# [2.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.2...v2.0.0) (2021-10-25) + +**Note:** Version bump only for package @aws-crypto/sha256-browser + +## [1.2.2](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.1...v1.2.2) (2021-10-12) + +**Note:** Version bump only for package @aws-crypto/sha256-browser + +## [1.2.1](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.0...v1.2.1) (2021-09-17) + +**Note:** Version bump only for package @aws-crypto/sha256-browser + +# [1.2.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.1.1...v1.2.0) (2021-09-17) + +### Features + +- add @aws-crypto/util ([8f489cb](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/8f489cbe4c0e134f826bac66f1bf5172597048b9)) + +## [1.1.1](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-browser@1.1.0...@aws-crypto/sha256-browser@1.1.1) (2021-07-13) + +### Bug Fixes + +- **sha256-browser:** throw errors not string ([#194](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/194)) ([7fa7ac4](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/7fa7ac445ef7a04dfb1ff479e7114aba045b2b2c)) + +# [1.1.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-browser@1.0.0...@aws-crypto/sha256-browser@1.1.0) (2021-01-13) + +### Bug Fixes + +- remove package lock ([6002a5a](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/6002a5ab9218dc8798c19dc205d3eebd3bec5b43)) +- **aws-crypto:** export explicit dependencies on [@aws-types](https://github.com/aws-types) ([6a1873a](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/6a1873a4dcc2aaa4a1338595703cfa7099f17b8c)) +- **deps-dev:** move @aws-sdk/types to devDependencies ([#188](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/188)) ([08efdf4](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/08efdf46dcc612d88c441e29945d787f253ee77d)) + +# [1.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-browser@1.0.0-alpha.0...@aws-crypto/sha256-browser@1.0.0) (2020-10-22) + +**Note:** Version bump only for package @aws-crypto/sha256-browser + +# [1.0.0-alpha.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-browser@0.1.0-preview.4...@aws-crypto/sha256-browser@1.0.0-alpha.0) (2020-02-07) + +**Note:** Version bump only for package @aws-crypto/sha256-browser + +# [0.1.0-preview.4](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-browser@0.1.0-preview.2...@aws-crypto/sha256-browser@0.1.0-preview.4) (2020-01-16) + +### Bug Fixes + +- Changed package.json files to point to the right Git repo ([#9](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/9)) ([028245d](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/028245d72e642ca98d82226afb300eb154503c4a)), closes [#8](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/8) +- es2015.iterable required ([#10](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/10)) ([6e08d83](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/6e08d83c33667ad8cbeeaaa7cedf1bbe05f79ed8)) +- lerna version maintains package-lock ([#14](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/14)) ([2ef29e1](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/2ef29e13779703a5c9b32e93d18918fcb33b7272)), closes [#13](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/13) + +# [0.1.0-preview.3](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-browser@0.1.0-preview.2...@aws-crypto/sha256-browser@0.1.0-preview.3) (2019-11-15) + +### Bug Fixes + +- Changed package.json files to point to the right Git repo ([#9](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/9)) ([028245d](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/028245d72e642ca98d82226afb300eb154503c4a)), closes [#8](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/8) +- es2015.iterable required ([#10](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/10)) ([6e08d83](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/6e08d83c33667ad8cbeeaaa7cedf1bbe05f79ed8)) +- lerna version maintains package-lock ([#14](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/14)) ([2ef29e1](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/2ef29e13779703a5c9b32e93d18918fcb33b7272)), closes [#13](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/13) + +# [0.1.0-preview.2](https://github.com/aws/aws-javascript-crypto-helpers/compare/@aws-crypto/sha256-browser@0.1.0-preview.1...@aws-crypto/sha256-browser@0.1.0-preview.2) (2019-10-30) + +### Bug Fixes + +- remove /src/ from .npmignore (for sourcemaps) ([#5](https://github.com/aws/aws-javascript-crypto-helpers/issues/5)) ([ec52056](https://github.com/aws/aws-javascript-crypto-helpers/commit/ec52056)) diff --git a/server/node_modules/@aws-crypto/sha256-browser/LICENSE b/server/node_modules/@aws-crypto/sha256-browser/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-crypto/sha256-browser/README.md b/server/node_modules/@aws-crypto/sha256-browser/README.md new file mode 100644 index 0000000000..75bf105aa6 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/README.md @@ -0,0 +1,31 @@ +# @aws-crypto/sha256-browser + +SHA256 wrapper for browsers that prefers `window.crypto.subtle` but will +fall back to a pure JS implementation in @aws-crypto/sha256-js +to provide a consistent interface for SHA256. + +## Usage + +- To hash "some data" +``` +import {Sha256} from '@aws-crypto/sha256-browser' + +const hash = new Sha256(); +hash.update('some data'); +const result = await hash.digest(); + +``` + +- To hmac "some data" with "a key" +``` +import {Sha256} from '@aws-crypto/sha256-browser' + +const hash = new Sha256('a key'); +hash.update('some data'); +const result = await hash.digest(); + +``` + +## Test + +`npm test` diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/constants.d.ts b/server/node_modules/@aws-crypto/sha256-browser/build/constants.d.ts new file mode 100644 index 0000000000..fe8def75fd --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/constants.d.ts @@ -0,0 +1,10 @@ +export declare const SHA_256_HASH: { + name: "SHA-256"; +}; +export declare const SHA_256_HMAC_ALGO: { + name: "HMAC"; + hash: { + name: "SHA-256"; + }; +}; +export declare const EMPTY_DATA_SHA_256: Uint8Array; diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/constants.js b/server/node_modules/@aws-crypto/sha256-browser/build/constants.js new file mode 100644 index 0000000000..acb5c55325 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/constants.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EMPTY_DATA_SHA_256 = exports.SHA_256_HMAC_ALGO = exports.SHA_256_HASH = void 0; +exports.SHA_256_HASH = { name: "SHA-256" }; +exports.SHA_256_HMAC_ALGO = { + name: "HMAC", + hash: exports.SHA_256_HASH +}; +exports.EMPTY_DATA_SHA_256 = new Uint8Array([ + 227, + 176, + 196, + 66, + 152, + 252, + 28, + 20, + 154, + 251, + 244, + 200, + 153, + 111, + 185, + 36, + 39, + 174, + 65, + 228, + 100, + 155, + 147, + 76, + 164, + 149, + 153, + 27, + 120, + 82, + 184, + 85 +]); +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/constants.js.map b/server/node_modules/@aws-crypto/sha256-browser/build/constants.js.map new file mode 100644 index 0000000000..d7cd8266b9 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAwB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAExD,QAAA,iBAAiB,GAAgD;IAC5E,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,oBAAY;CACnB,CAAC;AAEW,QAAA,kBAAkB,GAAG,IAAI,UAAU,CAAC;IAC/C,GAAG;IACH,GAAG;IACH,GAAG;IACH,EAAE;IACF,GAAG;IACH,GAAG;IACH,EAAE;IACF,EAAE;IACF,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,EAAE;IACF,EAAE;IACF,GAAG;IACH,EAAE;IACF,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,EAAE;IACF,GAAG;IACH,GAAG;IACH,GAAG;IACH,EAAE;IACF,GAAG;IACH,EAAE;IACF,GAAG;IACH,EAAE;CACH,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.d.ts b/server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.d.ts new file mode 100644 index 0000000000..055d3ef7c0 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.d.ts @@ -0,0 +1,8 @@ +import { Checksum, SourceData } from "@aws-sdk/types"; +export declare class Sha256 implements Checksum { + private hash; + constructor(secret?: SourceData); + update(data: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void; + digest(): Promise; + reset(): void; +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.js b/server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.js new file mode 100644 index 0000000000..f2f74e8f3d --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Sha256 = void 0; +var ie11Sha256_1 = require("./ie11Sha256"); +var webCryptoSha256_1 = require("./webCryptoSha256"); +var sha256_js_1 = require("@aws-crypto/sha256-js"); +var supports_web_crypto_1 = require("@aws-crypto/supports-web-crypto"); +var ie11_detection_1 = require("@aws-crypto/ie11-detection"); +var util_locate_window_1 = require("@aws-sdk/util-locate-window"); +var util_1 = require("@aws-crypto/util"); +var Sha256 = /** @class */ (function () { + function Sha256(secret) { + if ((0, supports_web_crypto_1.supportsWebCrypto)((0, util_locate_window_1.locateWindow)())) { + this.hash = new webCryptoSha256_1.Sha256(secret); + } + else if ((0, ie11_detection_1.isMsWindow)((0, util_locate_window_1.locateWindow)())) { + this.hash = new ie11Sha256_1.Sha256(secret); + } + else { + this.hash = new sha256_js_1.Sha256(secret); + } + } + Sha256.prototype.update = function (data, encoding) { + this.hash.update((0, util_1.convertToBuffer)(data)); + }; + Sha256.prototype.digest = function () { + return this.hash.digest(); + }; + Sha256.prototype.reset = function () { + this.hash.reset(); + }; + return Sha256; +}()); +exports.Sha256 = Sha256; +//# sourceMappingURL=crossPlatformSha256.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.js.map b/server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.js.map new file mode 100644 index 0000000000..204968f358 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.js.map @@ -0,0 +1 @@ +{"version":3,"file":"crossPlatformSha256.js","sourceRoot":"","sources":["../src/crossPlatformSha256.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AACpD,qDAA8D;AAC9D,mDAA2D;AAE3D,uEAAoE;AACpE,6DAAwD;AACxD,kEAA2D;AAC3D,yCAAmD;AAEnD;IAGE,gBAAY,MAAmB;QAC7B,IAAI,IAAA,uCAAiB,EAAC,IAAA,iCAAY,GAAE,CAAC,EAAE;YACrC,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAe,CAAC,MAAM,CAAC,CAAC;SACzC;aAAM,IAAI,IAAA,2BAAU,EAAC,IAAA,iCAAY,GAAE,CAAC,EAAE;YACrC,IAAI,CAAC,IAAI,GAAG,IAAI,mBAAU,CAAC,MAAM,CAAC,CAAC;SACpC;aAAM;YACL,IAAI,CAAC,IAAI,GAAG,IAAI,kBAAQ,CAAC,MAAM,CAAC,CAAC;SAClC;IACH,CAAC;IAED,uBAAM,GAAN,UAAO,IAAgB,EAAE,QAAsC;QAC7D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAA,sBAAe,EAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,uBAAM,GAAN;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;IAED,sBAAK,GAAL;QACE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;IACH,aAAC;AAAD,CAAC,AAxBD,IAwBC;AAxBY,wBAAM"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.d.ts b/server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.d.ts new file mode 100644 index 0000000000..ab0e1bd371 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.d.ts @@ -0,0 +1,9 @@ +import { Checksum, SourceData } from "@aws-sdk/types"; +export declare class Sha256 implements Checksum { + private readonly secret?; + private operation; + constructor(secret?: SourceData); + update(toHash: SourceData): void; + digest(): Promise; + reset(): void; +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.js b/server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.js new file mode 100644 index 0000000000..f84c6300ce --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Sha256 = void 0; +var isEmptyData_1 = require("./isEmptyData"); +var constants_1 = require("./constants"); +var util_utf8_browser_1 = require("@aws-sdk/util-utf8-browser"); +var util_locate_window_1 = require("@aws-sdk/util-locate-window"); +var Sha256 = /** @class */ (function () { + function Sha256(secret) { + this.secret = secret; + this.reset(); + } + Sha256.prototype.update = function (toHash) { + var _this = this; + if ((0, isEmptyData_1.isEmptyData)(toHash)) { + return; + } + this.operation = this.operation.then(function (operation) { + operation.onerror = function () { + _this.operation = Promise.reject(new Error("Error encountered updating hash")); + }; + operation.process(toArrayBufferView(toHash)); + return operation; + }); + this.operation.catch(function () { }); + }; + Sha256.prototype.digest = function () { + return this.operation.then(function (operation) { + return new Promise(function (resolve, reject) { + operation.onerror = function () { + reject(new Error("Error encountered finalizing hash")); + }; + operation.oncomplete = function () { + if (operation.result) { + resolve(new Uint8Array(operation.result)); + } + reject(new Error("Error encountered finalizing hash")); + }; + operation.finish(); + }); + }); + }; + Sha256.prototype.reset = function () { + if (this.secret) { + this.operation = getKeyPromise(this.secret).then(function (keyData) { + return (0, util_locate_window_1.locateWindow)().msCrypto.subtle.sign(constants_1.SHA_256_HMAC_ALGO, keyData); + }); + this.operation.catch(function () { }); + } + else { + this.operation = Promise.resolve((0, util_locate_window_1.locateWindow)().msCrypto.subtle.digest("SHA-256")); + } + }; + return Sha256; +}()); +exports.Sha256 = Sha256; +function getKeyPromise(secret) { + return new Promise(function (resolve, reject) { + var keyOperation = (0, util_locate_window_1.locateWindow)().msCrypto.subtle.importKey("raw", toArrayBufferView(secret), constants_1.SHA_256_HMAC_ALGO, false, ["sign"]); + keyOperation.oncomplete = function () { + if (keyOperation.result) { + resolve(keyOperation.result); + } + reject(new Error("ImportKey completed without importing key.")); + }; + keyOperation.onerror = function () { + reject(new Error("ImportKey failed to import key.")); + }; + }); +} +function toArrayBufferView(data) { + if (typeof data === "string") { + return (0, util_utf8_browser_1.fromUtf8)(data); + } + if (ArrayBuffer.isView(data)) { + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); + } + return new Uint8Array(data); +} +//# sourceMappingURL=ie11Sha256.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.js.map b/server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.js.map new file mode 100644 index 0000000000..cbf50aabfe --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ie11Sha256.js","sourceRoot":"","sources":["../src/ie11Sha256.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,yCAAgD;AAEhD,gEAAsD;AAEtD,kEAA2D;AAE3D;IAIE,gBAAY,MAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,uBAAM,GAAN,UAAO,MAAkB;QAAzB,iBAgBC;QAfC,IAAI,IAAA,yBAAW,EAAC,MAAM,CAAC,EAAE;YACvB,OAAO;SACR;QAED,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,SAAS;YAC5C,SAAS,CAAC,OAAO,GAAG;gBAClB,KAAI,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAC7B,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAC7C,CAAC;YACJ,CAAC,CAAC;YACF,SAAS,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;YAE7C,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,cAAO,CAAC,CAAC,CAAC;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IAAM,YAAY,GAAI,IAAA,iCAAY,GAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CACzE,KAAK,EACL,iBAAiB,CAAC,MAAM,CAAC,EACzB,6BAAiB,EACjB,KAAK,EACL,CAAC,MAAM,CAAC,CACT,CAAC;QAEF,YAAY,CAAC,UAAU,GAAG;YACxB,IAAI,YAAY,CAAC,MAAM,EAAE;gBACvB,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;aAC9B;YAED,MAAM,CAAC,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC,CAAC;QAClE,CAAC,CAAC;QACF,YAAY,CAAC,OAAO,GAAG;YACrB,MAAM,CAAC,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAgB;IACzC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,IAAA,4BAAQ,EAAC,IAAI,CAAC,CAAC;KACvB;IAED,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QAC5B,OAAO,IAAI,UAAU,CACnB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,iBAAiB,CAC/C,CAAC;KACH;IAED,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/index.d.ts b/server/node_modules/@aws-crypto/sha256-browser/build/index.d.ts new file mode 100644 index 0000000000..2e6617e76c --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/index.d.ts @@ -0,0 +1,3 @@ +export * from "./crossPlatformSha256"; +export { Sha256 as Ie11Sha256 } from "./ie11Sha256"; +export { Sha256 as WebCryptoSha256 } from "./webCryptoSha256"; diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/index.js b/server/node_modules/@aws-crypto/sha256-browser/build/index.js new file mode 100644 index 0000000000..220f9812dd --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/index.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebCryptoSha256 = exports.Ie11Sha256 = void 0; +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./crossPlatformSha256"), exports); +var ie11Sha256_1 = require("./ie11Sha256"); +Object.defineProperty(exports, "Ie11Sha256", { enumerable: true, get: function () { return ie11Sha256_1.Sha256; } }); +var webCryptoSha256_1 = require("./webCryptoSha256"); +Object.defineProperty(exports, "WebCryptoSha256", { enumerable: true, get: function () { return webCryptoSha256_1.Sha256; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/index.js.map b/server/node_modules/@aws-crypto/sha256-browser/build/index.js.map new file mode 100644 index 0000000000..810f6f71ad --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,gEAAsC;AACtC,2CAAoD;AAA3C,wGAAA,MAAM,OAAc;AAC7B,qDAA8D;AAArD,kHAAA,MAAM,OAAmB"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.d.ts b/server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.d.ts new file mode 100644 index 0000000000..43ae4a7c44 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.d.ts @@ -0,0 +1,2 @@ +import { SourceData } from "@aws-sdk/types"; +export declare function isEmptyData(data: SourceData): boolean; diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js b/server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js new file mode 100644 index 0000000000..fe91548ae2 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEmptyData = void 0; +function isEmptyData(data) { + if (typeof data === "string") { + return data.length === 0; + } + return data.byteLength === 0; +} +exports.isEmptyData = isEmptyData; +//# sourceMappingURL=isEmptyData.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js.map b/server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js.map new file mode 100644 index 0000000000..d504ac53bb --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isEmptyData.js","sourceRoot":"","sources":["../src/isEmptyData.ts"],"names":[],"mappings":";;;AAEA,SAAgB,WAAW,CAAC,IAAgB;IAC1C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC;KAC1B;IAED,OAAO,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC;AAC/B,CAAC;AAND,kCAMC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.d.ts b/server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.d.ts new file mode 100644 index 0000000000..ec0e214d29 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.d.ts @@ -0,0 +1,10 @@ +import { Checksum, SourceData } from "@aws-sdk/types"; +export declare class Sha256 implements Checksum { + private readonly secret?; + private key; + private toHash; + constructor(secret?: SourceData); + update(data: SourceData): void; + digest(): Promise; + reset(): void; +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.js b/server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.js new file mode 100644 index 0000000000..778fdd9045 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Sha256 = void 0; +var util_1 = require("@aws-crypto/util"); +var constants_1 = require("./constants"); +var util_locate_window_1 = require("@aws-sdk/util-locate-window"); +var Sha256 = /** @class */ (function () { + function Sha256(secret) { + this.toHash = new Uint8Array(0); + this.secret = secret; + this.reset(); + } + Sha256.prototype.update = function (data) { + if ((0, util_1.isEmptyData)(data)) { + return; + } + var update = (0, util_1.convertToBuffer)(data); + var typedArray = new Uint8Array(this.toHash.byteLength + update.byteLength); + typedArray.set(this.toHash, 0); + typedArray.set(update, this.toHash.byteLength); + this.toHash = typedArray; + }; + Sha256.prototype.digest = function () { + var _this = this; + if (this.key) { + return this.key.then(function (key) { + return (0, util_locate_window_1.locateWindow)() + .crypto.subtle.sign(constants_1.SHA_256_HMAC_ALGO, key, _this.toHash) + .then(function (data) { return new Uint8Array(data); }); + }); + } + if ((0, util_1.isEmptyData)(this.toHash)) { + return Promise.resolve(constants_1.EMPTY_DATA_SHA_256); + } + return Promise.resolve() + .then(function () { + return (0, util_locate_window_1.locateWindow)().crypto.subtle.digest(constants_1.SHA_256_HASH, _this.toHash); + }) + .then(function (data) { return Promise.resolve(new Uint8Array(data)); }); + }; + Sha256.prototype.reset = function () { + var _this = this; + this.toHash = new Uint8Array(0); + if (this.secret && this.secret !== void 0) { + this.key = new Promise(function (resolve, reject) { + (0, util_locate_window_1.locateWindow)() + .crypto.subtle.importKey("raw", (0, util_1.convertToBuffer)(_this.secret), constants_1.SHA_256_HMAC_ALGO, false, ["sign"]) + .then(resolve, reject); + }); + this.key.catch(function () { }); + } + }; + return Sha256; +}()); +exports.Sha256 = Sha256; +//# sourceMappingURL=webCryptoSha256.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.js.map b/server/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.js.map new file mode 100644 index 0000000000..bc30e87f8e --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/build/webCryptoS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AAE;YAC5B,OAAO,OAAO,CAAC,OAAO,CAAC,8BAAkB,CAAC,CAAC;SAC5C;QAED,OAAO,OAAO,CAAC,OAAO,EAAE;aACrB,IAAI,CAAC;YACJ,OAAA,IAAA,iCAAY,GAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAY,EAAE,KAAI,CAAC,MAAM,CAAC;QAA9D,CAA8D,CAC/D;aACA,IAAI,CAAC,UAAC,IAAI,IAAK,OAAA,OAAO,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,EAArC,CAAqC,CAAC,CAAC;IAC3D,CAAC;IAED,sBAAK,GAAL;QAAA,iBAgBC;QAfC,IAAI,CAAC,MAAM,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,EAAE;YACzC,IAAI,CAAC,GAAG,GAAG,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;gBACrC,IAAA,iCAAY,GAAE;qBACT,MAAM,CAAC,MAAM,CAAC,SAAS,CACxB,KAAK,EACL,IAAA,sBAAe,EAAC,KAAI,CAAC,MAAoB,CAAC,EAC1C,6BAAiB,EACjB,KAAK,EACL,CAAC,MAAM,CAAC,CACX;qBACI,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,cAAO,CAAC,CAAC,CAAC;SAC1B;IACH,CAAC;IACH,aAAC;AAAD,CAAC,AA7DD,IA6DC;AA7DY,wBAAM"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/CopyrightNotice.txt b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/CopyrightNotice.txt new file mode 100644 index 0000000000..3d4c82348e --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/LICENSE.txt b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/LICENSE.txt new file mode 100644 index 0000000000..bfe6430cb0 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/README.md b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/README.md new file mode 100644 index 0000000000..a5b2692c8a --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/README.md @@ -0,0 +1,142 @@ +# tslib + +This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. + +This library is primarily used by the `--importHelpers` flag in TypeScript. +When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: + +```ts +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +exports.x = {}; +exports.y = __assign({}, exports.x); + +``` + +will instead be emitted as something like the following: + +```ts +var tslib_1 = require("tslib"); +exports.x = {}; +exports.y = tslib_1.__assign({}, exports.x); +``` + +Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. +For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. + +# Installing + +For the latest stable version, run: + +## npm + +```sh +# TypeScript 2.3.3 or later +npm install tslib + +# TypeScript 2.3.2 or earlier +npm install tslib@1.6.1 +``` + +## yarn + +```sh +# TypeScript 2.3.3 or later +yarn add tslib + +# TypeScript 2.3.2 or earlier +yarn add tslib@1.6.1 +``` + +## bower + +```sh +# TypeScript 2.3.3 or later +bower install tslib + +# TypeScript 2.3.2 or earlier +bower install tslib@1.6.1 +``` + +## JSPM + +```sh +# TypeScript 2.3.3 or later +jspm install tslib + +# TypeScript 2.3.2 or earlier +jspm install tslib@1.6.1 +``` + +# Usage + +Set the `importHelpers` compiler option on the command line: + +``` +tsc --importHelpers file.ts +``` + +or in your tsconfig.json: + +```json +{ + "compilerOptions": { + "importHelpers": true + } +} +``` + +#### For bower and JSPM users + +You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: + +```json +{ + "compilerOptions": { + "module": "amd", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["bower_components/tslib/tslib.d.ts"] + } + } +} +``` + +For JSPM users: + +```json +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@1.[version].0/tslib.d.ts"] + } + } +} +``` + + +# Contribute + +There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. + +* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +# Documentation + +* [Quick tutorial](http://www.typescriptlang.org/Tutorial) +* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Homepage](http://www.typescriptlang.org/) diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/modules/index.js b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/modules/index.js new file mode 100644 index 0000000000..d241d04222 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/modules/index.js @@ -0,0 +1,51 @@ +import tslib from '../tslib.js'; +const { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +} = tslib; +export { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +}; diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/modules/package.json b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/modules/package.json new file mode 100644 index 0000000000..aafa0e4b45 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/modules/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/package.json b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/package.json new file mode 100644 index 0000000000..f8c2a53d0f --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/package.json @@ -0,0 +1,37 @@ +{ + "name": "tslib", + "author": "Microsoft Corp.", + "homepage": "https://www.typescriptlang.org/", + "version": "1.14.1", + "license": "0BSD", + "description": "Runtime library for TypeScript helper functions", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript", + "tslib", + "runtime" + ], + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/tslib.git" + }, + "main": "tslib.js", + "module": "tslib.es6.js", + "jsnext:main": "tslib.es6.js", + "typings": "tslib.d.ts", + "sideEffects": false, + "exports": { + ".": { + "module": "./tslib.es6.js", + "import": "./modules/index.js", + "default": "./tslib.js" + }, + "./": "./" + } +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js new file mode 100644 index 0000000000..0c1b613d8b --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js @@ -0,0 +1,23 @@ +// When on node 14, it validates that all of the commonjs exports +// are correctly re-exported for es modules importers. + +const nodeMajor = Number(process.version.split(".")[0].slice(1)) +if (nodeMajor < 14) { + console.log("Skipping because node does not support module exports.") + process.exit(0) +} + +// ES Modules import via the ./modules folder +import * as esTSLib from "../../modules/index.js" + +// Force a commonjs resolve +import { createRequire } from "module"; +const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js"); + +for (const key in commonJSTSLib) { + if (commonJSTSLib.hasOwnProperty(key)) { + if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`) + } +} + +console.log("All exports in commonjs are available for es module consumers.") diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json new file mode 100644 index 0000000000..166e5095e4 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "scripts": { + "test": "node index.js" + } +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.d.ts b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.d.ts new file mode 100644 index 0000000000..0756b28e76 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.d.ts @@ -0,0 +1,37 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +export declare function __generator(thisArg: any, body: Function): any; +export declare function __exportStar(m: any, exports: any): void; +export declare function __values(o: any): any; +export declare function __read(o: any, n?: number): any[]; +export declare function __spread(...args: any[][]): any[]; +export declare function __spreadArrays(...args: any[][]): any[]; +export declare function __await(v: any): any; +export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; +export declare function __asyncDelegator(o: any): any; +export declare function __asyncValues(o: any): any; +export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; +export declare function __importStar(mod: T): T; +export declare function __importDefault(mod: T): T | { default: T }; +export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; +export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; +export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.html b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.html new file mode 100644 index 0000000000..b122e41b06 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.js b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.js new file mode 100644 index 0000000000..0e0d8d079c --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.js @@ -0,0 +1,218 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + +export function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +export function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +export function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +export function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.html b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.html new file mode 100644 index 0000000000..44c9ba51e3 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.js b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.js new file mode 100644 index 0000000000..e5b7c9b809 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.js @@ -0,0 +1,284 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __createBinding = function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }; + + __exportStar = function (m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; + }; + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); diff --git a/server/node_modules/@aws-crypto/sha256-browser/package.json b/server/node_modules/@aws-crypto/sha256-browser/package.json new file mode 100644 index 0000000000..fb4dfd29f7 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/package.json @@ -0,0 +1,33 @@ +{ + "name": "@aws-crypto/sha256-browser", + "version": "3.0.0", + "scripts": { + "prepublishOnly": "tsc", + "pretest": "tsc -p tsconfig.test.json", + "test": "mocha --require ts-node/register test/**/*test.ts" + }, + "repository": { + "type": "git", + "url": "git@github.com:aws/aws-sdk-js-crypto-helpers.git" + }, + "author": { + "name": "AWS Crypto Tools Team", + "email": "aws-cryptools@amazon.com", + "url": "https://docs.aws.amazon.com/aws-crypto-tools/index.html?id=docs_gateway#lang/en_us" + }, + "homepage": "https://github.com/aws/aws-sdk-js-crypto-helpers/tree/master/packages/sha256-browser", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/sha256-js": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + }, + "main": "./build/index.js", + "types": "./build/index.d.ts", + "gitHead": "7f56cee8f62bd65cd397eeec29c3c997215bd80c" +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/src/constants.ts b/server/node_modules/@aws-crypto/sha256-browser/src/constants.ts new file mode 100644 index 0000000000..7f68e2acd3 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/src/constants.ts @@ -0,0 +1,41 @@ +export const SHA_256_HASH: { name: "SHA-256" } = { name: "SHA-256" }; + +export const SHA_256_HMAC_ALGO: { name: "HMAC"; hash: { name: "SHA-256" } } = { + name: "HMAC", + hash: SHA_256_HASH +}; + +export const EMPTY_DATA_SHA_256 = new Uint8Array([ + 227, + 176, + 196, + 66, + 152, + 252, + 28, + 20, + 154, + 251, + 244, + 200, + 153, + 111, + 185, + 36, + 39, + 174, + 65, + 228, + 100, + 155, + 147, + 76, + 164, + 149, + 153, + 27, + 120, + 82, + 184, + 85 +]); diff --git a/server/node_modules/@aws-crypto/sha256-browser/src/crossPlatformSha256.ts b/server/node_modules/@aws-crypto/sha256-browser/src/crossPlatformSha256.ts new file mode 100644 index 0000000000..3014127123 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/src/crossPlatformSha256.ts @@ -0,0 +1,34 @@ +import { Sha256 as Ie11Sha256 } from "./ie11Sha256"; +import { Sha256 as WebCryptoSha256 } from "./webCryptoSha256"; +import { Sha256 as JsSha256 } from "@aws-crypto/sha256-js"; +import { Checksum, SourceData } from "@aws-sdk/types"; +import { supportsWebCrypto } from "@aws-crypto/supports-web-crypto"; +import { isMsWindow } from "@aws-crypto/ie11-detection"; +import { locateWindow } from "@aws-sdk/util-locate-window"; +import { convertToBuffer } from "@aws-crypto/util"; + +export class Sha256 implements Checksum { + private hash: Checksum; + + constructor(secret?: SourceData) { + if (supportsWebCrypto(locateWindow())) { + this.hash = new WebCryptoSha256(secret); + } else if (isMsWindow(locateWindow())) { + this.hash = new Ie11Sha256(secret); + } else { + this.hash = new JsSha256(secret); + } + } + + update(data: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void { + this.hash.update(convertToBuffer(data)); + } + + digest(): Promise { + return this.hash.digest(); + } + + reset(): void { + this.hash.reset(); + } +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/src/ie11Sha256.ts b/server/node_modules/@aws-crypto/sha256-browser/src/ie11Sha256.ts new file mode 100644 index 0000000000..937fb94ea5 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/src/ie11Sha256.ts @@ -0,0 +1,108 @@ +import { isEmptyData } from "./isEmptyData"; +import { SHA_256_HMAC_ALGO } from "./constants"; +import { Checksum, SourceData } from "@aws-sdk/types"; +import { fromUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CryptoOperation, Key, MsWindow } from "@aws-crypto/ie11-detection"; +import { locateWindow } from "@aws-sdk/util-locate-window"; + +export class Sha256 implements Checksum { + private readonly secret?: SourceData; + private operation!: Promise; + + constructor(secret?: SourceData) { + this.secret = secret; + this.reset(); + } + + update(toHash: SourceData): void { + if (isEmptyData(toHash)) { + return; + } + + this.operation = this.operation.then(operation => { + operation.onerror = () => { + this.operation = Promise.reject( + new Error("Error encountered updating hash") + ); + }; + operation.process(toArrayBufferView(toHash)); + + return operation; + }); + this.operation.catch(() => {}); + } + + digest(): Promise { + return this.operation.then( + operation => + new Promise((resolve, reject) => { + operation.onerror = () => { + reject(new Error("Error encountered finalizing hash")); + }; + operation.oncomplete = () => { + if (operation.result) { + resolve(new Uint8Array(operation.result)); + } + reject(new Error("Error encountered finalizing hash")); + }; + + operation.finish(); + }) + ); + } + + reset(): void { + if (this.secret) { + this.operation = getKeyPromise(this.secret).then(keyData => + (locateWindow() as MsWindow).msCrypto.subtle.sign( + SHA_256_HMAC_ALGO, + keyData + ) + ); + this.operation.catch(() => {}); + } else { + this.operation = Promise.resolve( + (locateWindow() as MsWindow).msCrypto.subtle.digest("SHA-256") + ); + } + } +} + +function getKeyPromise(secret: SourceData): Promise { + return new Promise((resolve, reject) => { + const keyOperation = (locateWindow() as MsWindow).msCrypto.subtle.importKey( + "raw", + toArrayBufferView(secret), + SHA_256_HMAC_ALGO, + false, + ["sign"] + ); + + keyOperation.oncomplete = () => { + if (keyOperation.result) { + resolve(keyOperation.result); + } + + reject(new Error("ImportKey completed without importing key.")); + }; + keyOperation.onerror = () => { + reject(new Error("ImportKey failed to import key.")); + }; + }); +} + +function toArrayBufferView(data: SourceData): Uint8Array { + if (typeof data === "string") { + return fromUtf8(data); + } + + if (ArrayBuffer.isView(data)) { + return new Uint8Array( + data.buffer, + data.byteOffset, + data.byteLength / Uint8Array.BYTES_PER_ELEMENT + ); + } + + return new Uint8Array(data); +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/src/index.ts b/server/node_modules/@aws-crypto/sha256-browser/src/index.ts new file mode 100644 index 0000000000..2e6617e76c --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/src/index.ts @@ -0,0 +1,3 @@ +export * from "./crossPlatformSha256"; +export { Sha256 as Ie11Sha256 } from "./ie11Sha256"; +export { Sha256 as WebCryptoSha256 } from "./webCryptoSha256"; diff --git a/server/node_modules/@aws-crypto/sha256-browser/src/isEmptyData.ts b/server/node_modules/@aws-crypto/sha256-browser/src/isEmptyData.ts new file mode 100644 index 0000000000..538971f45a --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/src/isEmptyData.ts @@ -0,0 +1,9 @@ +import { SourceData } from "@aws-sdk/types"; + +export function isEmptyData(data: SourceData): boolean { + if (typeof data === "string") { + return data.length === 0; + } + + return data.byteLength === 0; +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/src/webCryptoSha256.ts b/server/node_modules/@aws-crypto/sha256-browser/src/webCryptoSha256.ts new file mode 100644 index 0000000000..fe4db57174 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/src/webCryptoSha256.ts @@ -0,0 +1,71 @@ +import { Checksum, SourceData } from "@aws-sdk/types"; +import { isEmptyData, convertToBuffer } from "@aws-crypto/util"; +import { + EMPTY_DATA_SHA_256, + SHA_256_HASH, + SHA_256_HMAC_ALGO, +} from "./constants"; +import { locateWindow } from "@aws-sdk/util-locate-window"; + +export class Sha256 implements Checksum { + private readonly secret?: SourceData; + private key: Promise | undefined; + private toHash: Uint8Array = new Uint8Array(0); + + constructor(secret?: SourceData) { + this.secret = secret; + this.reset(); + } + + update(data: SourceData): void { + if (isEmptyData(data)) { + return; + } + + const update = convertToBuffer(data); + const typedArray = new Uint8Array( + this.toHash.byteLength + update.byteLength + ); + typedArray.set(this.toHash, 0); + typedArray.set(update, this.toHash.byteLength); + this.toHash = typedArray; + } + + digest(): Promise { + if (this.key) { + return this.key.then((key) => + locateWindow() + .crypto.subtle.sign(SHA_256_HMAC_ALGO, key, this.toHash) + .then((data) => new Uint8Array(data)) + ); + } + + if (isEmptyData(this.toHash)) { + return Promise.resolve(EMPTY_DATA_SHA_256); + } + + return Promise.resolve() + .then(() => + locateWindow().crypto.subtle.digest(SHA_256_HASH, this.toHash) + ) + .then((data) => Promise.resolve(new Uint8Array(data))); + } + + reset(): void { + this.toHash = new Uint8Array(0); + if (this.secret && this.secret !== void 0) { + this.key = new Promise((resolve, reject) => { + locateWindow() + .crypto.subtle.importKey( + "raw", + convertToBuffer(this.secret as SourceData), + SHA_256_HMAC_ALGO, + false, + ["sign"] + ) + .then(resolve, reject); + }); + this.key.catch(() => {}); + } + } +} diff --git a/server/node_modules/@aws-crypto/sha256-browser/tsconfig.json b/server/node_modules/@aws-crypto/sha256-browser/tsconfig.json new file mode 100644 index 0000000000..9b37394a1d --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-browser/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "lib": [ + "dom", + "es5", + "es2015.promise", + "es2015.collection", + "es2015.iterable" + ], + "declaration": true, + "sourceMap": true, + "strict": true, + "rootDir": "./src", + "outDir": "./build", + "importHelpers": true, + "noEmitHelpers": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules/**"] +} diff --git a/server/node_modules/@aws-crypto/sha256-js/CHANGELOG.md b/server/node_modules/@aws-crypto/sha256-js/CHANGELOG.md new file mode 100644 index 0000000000..45b6d5d5bf --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/CHANGELOG.md @@ -0,0 +1,86 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.2...v3.0.0) (2023-01-12) + +### Bug Fixes + +- **docs:** sha256 packages, clarify hmac support ([#455](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/455)) ([1be5043](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/1be5043325991f3f5ccb52a8dd928f004b4d442e)) + +- feat!: replace Hash implementations with Checksum interface (#492) ([da43dc0](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/da43dc0fdf669d9ebb5bfb1b1f7c79e46c4aaae1)), closes [#492](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/492) + +### BREAKING CHANGES + +- All classes that implemented `Hash` now implement `Checksum`. + +## [2.0.2](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.1...v2.0.2) (2022-09-07) + +### Bug Fixes + +- **#337:** update @aws-sdk/types ([#373](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/373)) ([b26a811](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/b26a811a392f5209c7ec7e57251500d4d78f97ff)), closes [#337](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/337) + +## [2.0.1](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.0...v2.0.1) (2021-12-09) + +**Note:** Version bump only for package @aws-crypto/sha256-js + +# [2.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.2...v2.0.0) (2021-10-25) + +**Note:** Version bump only for package @aws-crypto/sha256-js + +## [1.2.2](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.1...v1.2.2) (2021-10-12) + +**Note:** Version bump only for package @aws-crypto/sha256-js + +## [1.2.1](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.0...v1.2.1) (2021-09-17) + +**Note:** Version bump only for package @aws-crypto/sha256-js + +# [1.2.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.1.1...v1.2.0) (2021-09-17) + +### Features + +- add @aws-crypto/util ([8f489cb](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/8f489cbe4c0e134f826bac66f1bf5172597048b9)) + +# [1.1.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-js@1.0.0...@aws-crypto/sha256-js@1.1.0) (2021-01-13) + +### Bug Fixes + +- remove package lock ([6002a5a](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/6002a5ab9218dc8798c19dc205d3eebd3bec5b43)) +- **aws-crypto:** export explicit dependencies on [@aws-types](https://github.com/aws-types) ([6a1873a](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/6a1873a4dcc2aaa4a1338595703cfa7099f17b8c)) +- **deps-dev:** move @aws-sdk/types to devDependencies ([#188](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/188)) ([08efdf4](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/08efdf46dcc612d88c441e29945d787f253ee77d)) + +# [1.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-js@1.0.0-alpha.0...@aws-crypto/sha256-js@1.0.0) (2020-10-22) + +**Note:** Version bump only for package @aws-crypto/sha256-js + +# [1.0.0-alpha.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-js@0.1.0-preview.4...@aws-crypto/sha256-js@1.0.0-alpha.0) (2020-02-07) + +**Note:** Version bump only for package @aws-crypto/sha256-js + +# [0.1.0-preview.4](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-js@0.1.0-preview.2...@aws-crypto/sha256-js@0.1.0-preview.4) (2020-01-16) + +### Bug Fixes + +- Changed package.json files to point to the right Git repo ([#9](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/9)) ([028245d](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/028245d72e642ca98d82226afb300eb154503c4a)), closes [#8](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/8) +- es2015.iterable required ([#10](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/10)) ([6e08d83](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/6e08d83c33667ad8cbeeaaa7cedf1bbe05f79ed8)) +- lerna version maintains package-lock ([#14](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/14)) ([2ef29e1](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/2ef29e13779703a5c9b32e93d18918fcb33b7272)), closes [#13](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/13) + +# [0.1.0-preview.3](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/sha256-js@0.1.0-preview.2...@aws-crypto/sha256-js@0.1.0-preview.3) (2019-11-15) + +### Bug Fixes + +- Changed package.json files to point to the right Git repo ([#9](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/9)) ([028245d](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/028245d72e642ca98d82226afb300eb154503c4a)), closes [#8](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/8) +- es2015.iterable required ([#10](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/10)) ([6e08d83](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/6e08d83c33667ad8cbeeaaa7cedf1bbe05f79ed8)) +- lerna version maintains package-lock ([#14](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/14)) ([2ef29e1](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/2ef29e13779703a5c9b32e93d18918fcb33b7272)), closes [#13](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/13) + +# [0.1.0-preview.2](https://github.com/aws/aws-javascript-crypto-helpers/compare/@aws-crypto/sha256-js@0.1.0-preview.1...@aws-crypto/sha256-js@0.1.0-preview.2) (2019-10-30) + +### Bug Fixes + +- remove /src/ from .npmignore (for sourcemaps) ([#5](https://github.com/aws/aws-javascript-crypto-helpers/issues/5)) ([ec52056](https://github.com/aws/aws-javascript-crypto-helpers/commit/ec52056)) + +### Features + +- **sha256-js:** expose synchronous digest ([#7](https://github.com/aws/aws-javascript-crypto-helpers/issues/7)) ([9edaef7](https://github.com/aws/aws-javascript-crypto-helpers/commit/9edaef7)), closes [#6](https://github.com/aws/aws-javascript-crypto-helpers/issues/6) diff --git a/server/node_modules/@aws-crypto/sha256-js/LICENSE b/server/node_modules/@aws-crypto/sha256-js/LICENSE new file mode 100644 index 0000000000..ad410e1130 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/README.md b/server/node_modules/@aws-crypto/sha256-js/README.md new file mode 100644 index 0000000000..f769f5b0fb --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/README.md @@ -0,0 +1,29 @@ +# crypto-sha256-js + +A pure JS implementation SHA256. + +## Usage + +- To hash "some data" +``` +import {Sha256} from '@aws-crypto/sha256-js'; + +const hash = new Sha256(); +hash.update('some data'); +const result = await hash.digest(); + +``` + +- To hmac "some data" with "a key" +``` +import {Sha256} from '@aws-crypto/sha256-js'; + +const hash = new Sha256('a key'); +hash.update('some data'); +const result = await hash.digest(); + +``` + +## Test + +`npm test` diff --git a/server/node_modules/@aws-crypto/sha256-js/build/RawSha256.d.ts b/server/node_modules/@aws-crypto/sha256-js/build/RawSha256.d.ts new file mode 100644 index 0000000000..1f580b25a5 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/RawSha256.d.ts @@ -0,0 +1,17 @@ +/** + * @internal + */ +export declare class RawSha256 { + private state; + private temp; + private buffer; + private bufferLength; + private bytesHashed; + /** + * @internal + */ + finished: boolean; + update(data: Uint8Array): void; + digest(): Uint8Array; + private hashBuffer; +} diff --git a/server/node_modules/@aws-crypto/sha256-js/build/RawSha256.js b/server/node_modules/@aws-crypto/sha256-js/build/RawSha256.js new file mode 100644 index 0000000000..68ceaccde2 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/RawSha256.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RawSha256 = void 0; +var constants_1 = require("./constants"); +/** + * @internal + */ +var RawSha256 = /** @class */ (function () { + function RawSha256() { + this.state = Int32Array.from(constants_1.INIT); + this.temp = new Int32Array(64); + this.buffer = new Uint8Array(64); + this.bufferLength = 0; + this.bytesHashed = 0; + /** + * @internal + */ + this.finished = false; + } + RawSha256.prototype.update = function (data) { + if (this.finished) { + throw new Error("Attempted to update an already finished hash."); + } + var position = 0; + var byteLength = data.byteLength; + this.bytesHashed += byteLength; + if (this.bytesHashed * 8 > constants_1.MAX_HASHABLE_LENGTH) { + throw new Error("Cannot hash more than 2^53 - 1 bits"); + } + while (byteLength > 0) { + this.buffer[this.bufferLength++] = data[position++]; + byteLength--; + if (this.bufferLength === constants_1.BLOCK_SIZE) { + this.hashBuffer(); + this.bufferLength = 0; + } + } + }; + RawSha256.prototype.digest = function () { + if (!this.finished) { + var bitsHashed = this.bytesHashed * 8; + var bufferView = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength); + var undecoratedLength = this.bufferLength; + bufferView.setUint8(this.bufferLength++, 0x80); + // Ensure the final block has enough room for the hashed length + if (undecoratedLength % constants_1.BLOCK_SIZE >= constants_1.BLOCK_SIZE - 8) { + for (var i = this.bufferLength; i < constants_1.BLOCK_SIZE; i++) { + bufferView.setUint8(i, 0); + } + this.hashBuffer(); + this.bufferLength = 0; + } + for (var i = this.bufferLength; i < constants_1.BLOCK_SIZE - 8; i++) { + bufferView.setUint8(i, 0); + } + bufferView.setUint32(constants_1.BLOCK_SIZE - 8, Math.floor(bitsHashed / 0x100000000), true); + bufferView.setUint32(constants_1.BLOCK_SIZE - 4, bitsHashed); + this.hashBuffer(); + this.finished = true; + } + // The value in state is little-endian rather than big-endian, so flip + // each word into a new Uint8Array + var out = new Uint8Array(constants_1.DIGEST_LENGTH); + for (var i = 0; i < 8; i++) { + out[i * 4] = (this.state[i] >>> 24) & 0xff; + out[i * 4 + 1] = (this.state[i] >>> 16) & 0xff; + out[i * 4 + 2] = (this.state[i] >>> 8) & 0xff; + out[i * 4 + 3] = (this.state[i] >>> 0) & 0xff; + } + return out; + }; + RawSha256.prototype.hashBuffer = function () { + var _a = this, buffer = _a.buffer, state = _a.state; + var state0 = state[0], state1 = state[1], state2 = state[2], state3 = state[3], state4 = state[4], state5 = state[5], state6 = state[6], state7 = state[7]; + for (var i = 0; i < constants_1.BLOCK_SIZE; i++) { + if (i < 16) { + this.temp[i] = + ((buffer[i * 4] & 0xff) << 24) | + ((buffer[i * 4 + 1] & 0xff) << 16) | + ((buffer[i * 4 + 2] & 0xff) << 8) | + (buffer[i * 4 + 3] & 0xff); + } + else { + var u = this.temp[i - 2]; + var t1_1 = ((u >>> 17) | (u << 15)) ^ ((u >>> 19) | (u << 13)) ^ (u >>> 10); + u = this.temp[i - 15]; + var t2_1 = ((u >>> 7) | (u << 25)) ^ ((u >>> 18) | (u << 14)) ^ (u >>> 3); + this.temp[i] = + ((t1_1 + this.temp[i - 7]) | 0) + ((t2_1 + this.temp[i - 16]) | 0); + } + var t1 = ((((((state4 >>> 6) | (state4 << 26)) ^ + ((state4 >>> 11) | (state4 << 21)) ^ + ((state4 >>> 25) | (state4 << 7))) + + ((state4 & state5) ^ (~state4 & state6))) | + 0) + + ((state7 + ((constants_1.KEY[i] + this.temp[i]) | 0)) | 0)) | + 0; + var t2 = ((((state0 >>> 2) | (state0 << 30)) ^ + ((state0 >>> 13) | (state0 << 19)) ^ + ((state0 >>> 22) | (state0 << 10))) + + ((state0 & state1) ^ (state0 & state2) ^ (state1 & state2))) | + 0; + state7 = state6; + state6 = state5; + state5 = state4; + state4 = (state3 + t1) | 0; + state3 = state2; + state2 = state1; + state1 = state0; + state0 = (t1 + t2) | 0; + } + state[0] += state0; + state[1] += state1; + state[2] += state2; + state[3] += state3; + state[4] += state4; + state[5] += state5; + state[6] += state6; + state[7] += state7; + }; + return RawSha256; +}()); +exports.RawSha256 = RawSha256; +//# sourceMappingURL=RawSha256.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/build/RawSha256.js.map b/server/node_modules/@aws-crypto/sha256-js/build/RawSha256.js.map new file mode 100644 index 0000000000..10677173d6 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/RawSha256.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RawSha256.js","sourceRoot":"","sources":["../src/RawSha256.ts"],"names":[],"mappings":";;;AAAA,yCAMqB;AAErB;;GAEG;AACH;IAAA;QACU,UAAK,GAAe,UAAU,C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AK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;QACnB,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;IACrB,CAAC;IACH,gBAAC;AAAD,CAAC,AAxJD,IAwJC;AAxJY,8BAAS"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/build/constants.d.ts b/server/node_modules/@aws-crypto/sha256-js/build/constants.d.ts new file mode 100644 index 0000000000..63bd764ee0 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/constants.d.ts @@ -0,0 +1,20 @@ +/** + * @internal + */ +export declare const BLOCK_SIZE: number; +/** + * @internal + */ +export declare const DIGEST_LENGTH: number; +/** + * @internal + */ +export declare const KEY: Uint32Array; +/** + * @internal + */ +export declare const INIT: number[]; +/** + * @internal + */ +export declare const MAX_HASHABLE_LENGTH: number; diff --git a/server/node_modules/@aws-crypto/sha256-js/build/constants.js b/server/node_modules/@aws-crypto/sha256-js/build/constants.js new file mode 100644 index 0000000000..c83aa0991f --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/constants.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MAX_HASHABLE_LENGTH = exports.INIT = exports.KEY = exports.DIGEST_LENGTH = exports.BLOCK_SIZE = void 0; +/** + * @internal + */ +exports.BLOCK_SIZE = 64; +/** + * @internal + */ +exports.DIGEST_LENGTH = 32; +/** + * @internal + */ +exports.KEY = new Uint32Array([ + 0x428a2f98, + 0x71374491, + 0xb5c0fbcf, + 0xe9b5dba5, + 0x3956c25b, + 0x59f111f1, + 0x923f82a4, + 0xab1c5ed5, + 0xd807aa98, + 0x12835b01, + 0x243185be, + 0x550c7dc3, + 0x72be5d74, + 0x80deb1fe, + 0x9bdc06a7, + 0xc19bf174, + 0xe49b69c1, + 0xefbe4786, + 0x0fc19dc6, + 0x240ca1cc, + 0x2de92c6f, + 0x4a7484aa, + 0x5cb0a9dc, + 0x76f988da, + 0x983e5152, + 0xa831c66d, + 0xb00327c8, + 0xbf597fc7, + 0xc6e00bf3, + 0xd5a79147, + 0x06ca6351, + 0x14292967, + 0x27b70a85, + 0x2e1b2138, + 0x4d2c6dfc, + 0x53380d13, + 0x650a7354, + 0x766a0abb, + 0x81c2c92e, + 0x92722c85, + 0xa2bfe8a1, + 0xa81a664b, + 0xc24b8b70, + 0xc76c51a3, + 0xd192e819, + 0xd6990624, + 0xf40e3585, + 0x106aa070, + 0x19a4c116, + 0x1e376c08, + 0x2748774c, + 0x34b0bcb5, + 0x391c0cb3, + 0x4ed8aa4a, + 0x5b9cca4f, + 0x682e6ff3, + 0x748f82ee, + 0x78a5636f, + 0x84c87814, + 0x8cc70208, + 0x90befffa, + 0xa4506ceb, + 0xbef9a3f7, + 0xc67178f2 +]); +/** + * @internal + */ +exports.INIT = [ + 0x6a09e667, + 0xbb67ae85, + 0x3c6ef372, + 0xa54ff53a, + 0x510e527f, + 0x9b05688c, + 0x1f83d9ab, + 0x5be0cd19 +]; +/** + * @internal + */ +exports.MAX_HASHABLE_LENGTH = Math.pow(2, 53) - 1; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/build/constants.js.map b/server/node_modules/@aws-crypto/sha256-js/build/constants.js.map new file mode 100644 index 0000000000..409d2b160a --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,UAAU,GAAW,EAAE,CAAC;AAErC;;GAEG;AACU,QAAA,aAAa,GAAW,EAAE,CAAC;AAExC;;GAEG;AACU,QAAA,GAAG,GAAG,IAAI,WAAW,CAAC;IACjC,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;CACX,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,IAAI,GAAG;IAClB,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;CACX,CAAC;AAEF;;GAEG;AACU,QAAA,mBAAmB,GAAG,SAAA,CAAC,EAAI,EAAE,CAAA,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/build/index.d.ts b/server/node_modules/@aws-crypto/sha256-js/build/index.d.ts new file mode 100644 index 0000000000..4554d8a3bd --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/index.d.ts @@ -0,0 +1 @@ +export * from "./jsSha256"; diff --git a/server/node_modules/@aws-crypto/sha256-js/build/index.js b/server/node_modules/@aws-crypto/sha256-js/build/index.js new file mode 100644 index 0000000000..4329f10945 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./jsSha256"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/build/index.js.map b/server/node_modules/@aws-crypto/sha256-js/build/index.js.map new file mode 100644 index 0000000000..518010f0ba --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/build/jsSha256.d.ts b/server/node_modules/@aws-crypto/sha256-js/build/jsSha256.d.ts new file mode 100644 index 0000000000..d813b25654 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/jsSha256.d.ts @@ -0,0 +1,12 @@ +import { Checksum, SourceData } from "@aws-sdk/types"; +export declare class Sha256 implements Checksum { + private readonly secret?; + private hash; + private outer?; + private error; + constructor(secret?: SourceData); + update(toHash: SourceData): void; + digestSync(): Uint8Array; + digest(): Promise; + reset(): void; +} diff --git a/server/node_modules/@aws-crypto/sha256-js/build/jsSha256.js b/server/node_modules/@aws-crypto/sha256-js/build/jsSha256.js new file mode 100644 index 0000000000..2a4f2f19b4 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/jsSha256.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Sha256 = void 0; +var tslib_1 = require("tslib"); +var constants_1 = require("./constants"); +var RawSha256_1 = require("./RawSha256"); +var util_1 = require("@aws-crypto/util"); +var Sha256 = /** @class */ (function () { + function Sha256(secret) { + this.secret = secret; + this.hash = new RawSha256_1.RawSha256(); + this.reset(); + } + Sha256.prototype.update = function (toHash) { + if ((0, util_1.isEmptyData)(toHash) || this.error) { + return; + } + try { + this.hash.update((0, util_1.convertToBuffer)(toHash)); + } + catch (e) { + this.error = e; + } + }; + /* This synchronous method keeps compatibility + * with the v2 aws-sdk. + */ + Sha256.prototype.digestSync = function () { + if (this.error) { + throw this.error; + } + if (this.outer) { + if (!this.outer.finished) { + this.outer.update(this.hash.digest()); + } + return this.outer.digest(); + } + return this.hash.digest(); + }; + /* The underlying digest method here is synchronous. + * To keep the same interface with the other hash functions + * the default is to expose this as an async method. + * However, it can sometimes be useful to have a sync method. + */ + Sha256.prototype.digest = function () { + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + return [2 /*return*/, this.digestSync()]; + }); + }); + }; + Sha256.prototype.reset = function () { + this.hash = new RawSha256_1.RawSha256(); + if (this.secret) { + this.outer = new RawSha256_1.RawSha256(); + var inner = bufferFromSecret(this.secret); + var outer = new Uint8Array(constants_1.BLOCK_SIZE); + outer.set(inner); + for (var i = 0; i < constants_1.BLOCK_SIZE; i++) { + inner[i] ^= 0x36; + outer[i] ^= 0x5c; + } + this.hash.update(inner); + this.outer.update(outer); + // overwrite the copied key in memory + for (var i = 0; i < inner.byteLength; i++) { + inner[i] = 0; + } + } + }; + return Sha256; +}()); +exports.Sha256 = Sha256; +function bufferFromSecret(secret) { + var input = (0, util_1.convertToBuffer)(secret); + if (input.byteLength > constants_1.BLOCK_SIZE) { + var bufferHash = new RawSha256_1.RawSha256(); + bufferHash.update(input); + input = bufferHash.digest(); + } + var buffer = new Uint8Array(constants_1.BLOCK_SIZE); + buffer.set(input); + return buffer; +} +//# sourceMappingURL=jsSha256.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/build/jsSha256.js.map b/server/node_modules/@aws-crypto/sha256-js/build/jsSha256.js.map new file mode 100644 index 0000000000..1a90ca4b84 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/jsSha256.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jsSha256.js","sourceRoot":"","sources":["../src/jsSha256.ts"],"names":[],"mappings":";;;;AAAA,yCAAyC;AACzC,yCAAwC;AAExC,yCAAgE;AAEhE;IAME,gBAAY,MAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,qBAAS,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,uBAAM,GAAN,UAAO,MAAkB;QACvB,IAAI,IAAA,kBAAW,EAAC,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE;YACrC,OAAO;SACR;QAED,IAAI;YACF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAA,sBAAe,EAAC,MAAM,CAAC,CAAC,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;SAChB;IACH,CAAC;IAED;;OAEG;IACH,2BAAU,GAAV;QACE,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,IAAI,CAAC,KAAK,CAAC;SAClB;QAED,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACxB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;aACvC;YAED,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;SAC5B;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACG,uBAAM,GAAZ;;;gBACE,sBAAO,IAAI,CAAC,UAAU,EAAE,EAAC;;;KAC1B;IAED,sBAAK,GAAL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;IAC1C,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClB,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.d.ts b/server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.d.ts new file mode 100644 index 0000000000..d880343254 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.d.ts @@ -0,0 +1,5 @@ +export declare const hashTestVectors: Array<[Uint8Array, Uint8Array]>; +/** + * @see https://tools.ietf.org/html/rfc4231 + */ +export declare const hmacTestVectors: Array<[Uint8Array, Uint8Array, Uint8Array]>; diff --git a/server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.js b/server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.js new file mode 100644 index 0000000000..3f0dd2f7e8 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.js @@ -0,0 +1,322 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hmacTestVectors = exports.hashTestVectors = void 0; +var util_hex_encoding_1 = require("@aws-sdk/util-hex-encoding"); +var millionChars = new Uint8Array(1000000); +for (var i = 0; i < 1000000; i++) { + millionChars[i] = 97; +} +exports.hashTestVectors = [ + [ + Uint8Array.from([97, 98, 99]), + (0, util_hex_encoding_1.fromHex)("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad") + ], + [ + new Uint8Array(0), + (0, util_hex_encoding_1.fromHex)("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") + ], + [ + (0, util_hex_encoding_1.fromHex)("61"), + (0, util_hex_encoding_1.fromHex)("ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161"), + (0, util_hex_encoding_1.fromHex)("961b6dd3ede3cb8ecbaacbd68de040cd78eb2ed5889130cceb4c49268ea4d506") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161"), + (0, util_hex_encoding_1.fromHex)("9834876dcfb05cb167a5c24953eba58c4ac89b1adf57f28f2f9d09af107ee8f0") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161"), + (0, util_hex_encoding_1.fromHex)("61be55a8e2f6b4e172338bddf184d6dbee29c98853e0a0485ecee7f27b9af0b4") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161"), + (0, util_hex_encoding_1.fromHex)("ed968e840d10d2d313a870bc131a4e2c311d7ad09bdf32b3418147221f51a6e2") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161"), + (0, util_hex_encoding_1.fromHex)("ed02457b5c41d964dbd2f2a609d63fe1bb7528dbe55e1abf5b52c249cd735797") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161"), + (0, util_hex_encoding_1.fromHex)("e46240714b5db3a23eee60479a623efba4d633d27fe4f03c904b9e219a7fbe60") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161"), + (0, util_hex_encoding_1.fromHex)("1f3ce40415a2081fa3eee75fc39fff8e56c22270d1a978a7249b592dcebd20b4") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161"), + (0, util_hex_encoding_1.fromHex)("f2aca93b80cae681221f0445fa4e2cae8a1f9f8fa1e1741d9639caad222f537d") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161"), + (0, util_hex_encoding_1.fromHex)("bf2cb58a68f684d95a3b78ef8f661c9a4e5b09e82cc8f9cc88cce90528caeb27") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("28cb017dfc99073aa1b47c1b30f413e3ce774c4991eb4158de50f9dbb36d8043") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("f24abc34b13fade76e805799f71187da6cd90b9cac373ae65ed57f143bd664e5") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("a689d786e81340e45511dec6c7ab2d978434e5db123362450fe10cfac70d19d0") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("82cab7df0abfb9d95dca4e5937ce2968c798c726fea48c016bf9763221efda13") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("ef2df0b539c6c23de0f4cbe42648c301ae0e22e887340a4599fb4ef4e2678e48") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("0c0beacef8877bbf2416eb00f2b5dc96354e26dd1df5517320459b1236860f8c") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("b860666ee2966dd8f903be44ee605c6e1366f926d9f17a8f49937d11624eb99d") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("c926defaaa3d13eda2fc63a553bb7fb7326bece6e7cb67ca5296e4727d89bab4") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("a0b4aaab8a966e2193ba172d68162c4656860197f256b5f45f0203397ff3f99c") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("42492da06234ad0ac76f5d5debdb6d1ae027cffbe746a1c13b89bb8bc0139137") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("7df8e299c834de198e264c3e374bc58ecd9382252a705c183beb02f275571e3b") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("ec7c494df6d2a7ea36668d656e6b8979e33641bfea378c15038af3964db057a3") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("897d3e95b65f26676081f8b9f3a98b6ee4424566303e8d4e7c7522ebae219eab") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("09f61f8d9cd65e6a0c258087c485b6293541364e42bd97b2d7936580c8aa3c54") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("2f521e2a7d0bd812cbc035f4ed6806eb8d851793b04ba147e8f66b72f5d1f20f") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("9976d549a25115dab4e36d0c1fb8f31cb07da87dd83275977360eb7dc09e88de") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("cc0616e61cbd6e8e5e34e9fb2d320f37de915820206f5696c31f1fbd24aa16de") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("9c547cb8115a44883b9f70ba68f75117cd55359c92611875e386f8af98c172ab") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("6913c9c7fd42fe23df8b6bcd4dbaf1c17748948d97f2980b432319c39eddcf6c") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("3a54fc0cbc0b0ef48b6507b7788096235d10292dd3ae24e22f5aa062d4f9864a") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("61c60b487d1a921e0bcc9bf853dda0fb159b30bf57b2e2d2c753b00be15b5a09") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("3ba3f5f43b92602683c19aee62a20342b084dd5971ddd33808d81a328879a547") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("852785c805c77e71a22340a54e9d95933ed49121e7d2bf3c2d358854bc1359ea") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("a27c896c4859204843166af66f0e902b9c3b3ed6d2fd13d435abc020065c526f") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("629362afc62c74497caed2272e30f8125ecd0965f8d8d7cfc4e260f7f8dd319d") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("22c1d24bcd03e9aee9832efccd6da613fc702793178e5f12c945c7b67ddda933") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("21ec055b38ce759cd4d0f477e9bdec2c5b8199945db4439bae334a964df6246c") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("365a9c3e2c2af0a56e47a9dac51c2c5381bf8f41273bad3175e0e619126ad087") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("b4d5e56e929ba4cda349e9274e3603d0be246b82016bca20f363963c5f2d6845") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("e33cdf9c7f7120b98e8c78408953e07f2ecd183006b5606df349b4c212acf43e") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("c0f8bd4dbc2b0c03107c1c37913f2a7501f521467f45dd0fef6958e9a4692719") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("7a538607fdaab9296995929f451565bbb8142e1844117322aafd2b3d76b01aff") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("66d34fba71f8f450f7e45598853e53bfc23bbd129027cbb131a2f4ffd7878cd0") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("16849877c6c21ef0bfa68e4f6747300ddb171b170b9f00e189edc4c2fc4db93e") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("52789e3423b72beeb898456a4f49662e46b0cbb960784c5ef4b1399d327e7c27") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("6643110c5628fff59edf76d82d5bf573bf800f16a4d65dfb1e5d6f1a46296d0b") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("11eaed932c6c6fddfc2efc394e609facf4abe814fc6180d03b14fce13a07d0e5") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("97daac0ee9998dfcad6c9c0970da5ca411c86233a944c25b47566f6a7bc1ddd5") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("8f9bec6a62dd28ebd36d1227745592de6658b36974a3bb98a4c582f683ea6c42") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("160b4e433e384e05e537dc59b467f7cb2403f0214db15c5db58862a3f1156d2e") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("bfc5fe0e360152ca98c50fab4ed7e3078c17debc2917740d5000913b686ca129") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("6c1b3dc7a706b9dc81352a6716b9c666c608d8626272c64b914ab05572fc6e84") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("abe346a7259fc90b4c27185419628e5e6af6466b1ae9b5446cac4bfc26cf05c4") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("a3f01b6939256127582ac8ae9fb47a382a244680806a3f613a118851c1ca1d47") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("9f4390f8d30c2dd92ec9f095b65e2b9ae9b0a925a5258e241c9f1e910f734318") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("b35439a4ac6f0948b6d6f9e3c6af0f5f590ce20f1bde7090ef7970686ec6738a") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("f13b2d724659eb3bf47f2dd6af1accc87b81f09f59f2b75e5c0bed6589dfe8c6") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("d5c039b748aa64665782974ec3dc3025c042edf54dcdc2b5de31385b094cb678") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("111bb261277afd65f0744b247cd3e47d386d71563d0ed995517807d5ebd4fba3") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("11ee391211c6256460b6ed375957fadd8061cafbb31daf967db875aebd5aaad4") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("35d5fc17cfbbadd00f5e710ada39f194c5ad7c766ad67072245f1fad45f0f530") + ], + [ + (0, util_hex_encoding_1.fromHex)("6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("f506898cc7c2e092f9eb9fadae7ba50383f5b46a2a4fe5597dbb553a78981268") + ], + [ + (0, util_hex_encoding_1.fromHex)("616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("7d3e74a05d7db15bce4ad9ec0658ea98e3f06eeecf16b4c6fff2da457ddc2f34") + ], + [ + (0, util_hex_encoding_1.fromHex)("61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161"), + (0, util_hex_encoding_1.fromHex)("ffe054fe7ae0cb6dc65c3af9b61d5209f439851db43d0ba5997337df154668eb") + ], + [ + (0, util_hex_encoding_1.fromHex)("de188941a3375d3a8a061e67576e926dc71a7fa3f0cceb97452b4d3227965f9ea8cc75076d9fb9c5417aa5cb30fc22198b34982dbb629e"), + (0, util_hex_encoding_1.fromHex)("038051e9c324393bd1ca1978dd0952c2aa3742ca4f1bd5cd4611cea83892d382") + ], + [ + millionChars, + (0, util_hex_encoding_1.fromHex)("cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0") + ], + [ + (0, util_hex_encoding_1.fromHex)("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + (0, util_hex_encoding_1.fromHex)("45ad4b37c6e2fc0a2cfcc1b5da524132ec707615c2cae1dbbc43c97aa521db81") + ] +]; +/** + * @see https://tools.ietf.org/html/rfc4231 + */ +exports.hmacTestVectors = [ + [ + (0, util_hex_encoding_1.fromHex)("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"), + (0, util_hex_encoding_1.fromHex)("4869205468657265"), + (0, util_hex_encoding_1.fromHex)("b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7") + ], + [ + (0, util_hex_encoding_1.fromHex)("4a656665"), + (0, util_hex_encoding_1.fromHex)("7768617420646f2079612077616e7420666f72206e6f7468696e673f"), + (0, util_hex_encoding_1.fromHex)("5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843") + ], + [ + (0, util_hex_encoding_1.fromHex)("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + (0, util_hex_encoding_1.fromHex)("dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"), + (0, util_hex_encoding_1.fromHex)("773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe") + ], + [ + (0, util_hex_encoding_1.fromHex)("0102030405060708090a0b0c0d0e0f10111213141516171819"), + (0, util_hex_encoding_1.fromHex)("cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd"), + (0, util_hex_encoding_1.fromHex)("82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b") + ], + [ + (0, util_hex_encoding_1.fromHex)("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + (0, util_hex_encoding_1.fromHex)("54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b6579202d2048617368204b6579204669727374"), + (0, util_hex_encoding_1.fromHex)("60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54") + ], + [ + (0, util_hex_encoding_1.fromHex)("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + (0, util_hex_encoding_1.fromHex)("5468697320697320612074657374207573696e672061206c6172676572207468616e20626c6f636b2d73697a65206b657920616e642061206c6172676572207468616e20626c6f636b2d73697a6520646174612e20546865206b6579206e6565647320746f20626520686173686564206265666f7265206265696e6720757365642062792074686520484d414320616c676f726974686d2e"), + (0, util_hex_encoding_1.fromHex)("9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2") + ] +]; +//# sourceMappingURL=knownHashes.fixture.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.js.map b/server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.js.map new file mode 100644 index 0000000000..6ea6a7dd95 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/build/knownHashes.fixture.js.map @@ -0,0 +1 @@ +{"version":3,"file":"knownHashes.fixture.js","sourceRoot":"","sources":["../src/knownHashes.fixture.ts"],"names":[],"mappings":";;;AAAA,gEAAqD;AAErD,IAAM,YAAY,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;AAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE;IAChC,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;CACtB;AAEY,QAAA,eAAe,GAAoC;IAC9D;QACE,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAC7B,IAAA,2BAAO,EAAC,kEAAkE,CAAC;KAC5E;IACD;QACE,IAAI,UAAU,CAAC,CAAC,CAAC;QACjB,IAAA,2BAAO,EAAC,kEAAkE,CAAC;KAC5E;IACD;QACE,IAAA,2BAAO,EAAC,IAAI,CAAC;QACb,IAAA,2BAAO,EAAC,kEAAkE,CAAC;KAC5E;IACD;QACE,IAAA,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;QACE,IAAA,2BAAO,EAAC,0CAA0C,CAAC;QACnD,IAAA,2BAAO,EACL,sGAAsG,CACvG;QACD,IAAA,2BAAO,EAAC,kEAAkE,CAAC;KAC5E;IACD;QACE,IAAA,2BAAO,EAAC,oDAAoD,CAAC;QAC7D,IAAA,2BAAO,EACL,sGAAsG,CACvG;QACD,IAAA,2BAAO,EAAC,kEAAkE,CAAC;KAC5E;IACD;QACE,IAAA,2BAAO,EACL,wQAAwQ,CACzQ;QACD,IAAA,2BAAO,EACL,8GAA8G,CAC/G;QACD,IAAA,2BAAO,EAAC,kEAAkE,CAAC;KAC5E;IACD;QACE,IAAA,2BAAO,EACL,wQAAwQ,CACzQ;QACD,IAAA,2BAAO,EACL,kTAAkT,CACnT;QACD,IAAA,2BAAO,EAAC,kEAAkE,CAAC;KAC5E;CACF,CAAC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/CopyrightNotice.txt b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/CopyrightNotice.txt new file mode 100644 index 0000000000..3d4c82348e --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/LICENSE.txt b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/LICENSE.txt new file mode 100644 index 0000000000..bfe6430cb0 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/README.md b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/README.md new file mode 100644 index 0000000000..a5b2692c8a --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/README.md @@ -0,0 +1,142 @@ +# tslib + +This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. + +This library is primarily used by the `--importHelpers` flag in TypeScript. +When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: + +```ts +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +exports.x = {}; +exports.y = __assign({}, exports.x); + +``` + +will instead be emitted as something like the following: + +```ts +var tslib_1 = require("tslib"); +exports.x = {}; +exports.y = tslib_1.__assign({}, exports.x); +``` + +Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. +For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. + +# Installing + +For the latest stable version, run: + +## npm + +```sh +# TypeScript 2.3.3 or later +npm install tslib + +# TypeScript 2.3.2 or earlier +npm install tslib@1.6.1 +``` + +## yarn + +```sh +# TypeScript 2.3.3 or later +yarn add tslib + +# TypeScript 2.3.2 or earlier +yarn add tslib@1.6.1 +``` + +## bower + +```sh +# TypeScript 2.3.3 or later +bower install tslib + +# TypeScript 2.3.2 or earlier +bower install tslib@1.6.1 +``` + +## JSPM + +```sh +# TypeScript 2.3.3 or later +jspm install tslib + +# TypeScript 2.3.2 or earlier +jspm install tslib@1.6.1 +``` + +# Usage + +Set the `importHelpers` compiler option on the command line: + +``` +tsc --importHelpers file.ts +``` + +or in your tsconfig.json: + +```json +{ + "compilerOptions": { + "importHelpers": true + } +} +``` + +#### For bower and JSPM users + +You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: + +```json +{ + "compilerOptions": { + "module": "amd", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["bower_components/tslib/tslib.d.ts"] + } + } +} +``` + +For JSPM users: + +```json +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@1.[version].0/tslib.d.ts"] + } + } +} +``` + + +# Contribute + +There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. + +* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +# Documentation + +* [Quick tutorial](http://www.typescriptlang.org/Tutorial) +* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Homepage](http://www.typescriptlang.org/) diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/modules/index.js b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/modules/index.js new file mode 100644 index 0000000000..d241d04222 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/modules/index.js @@ -0,0 +1,51 @@ +import tslib from '../tslib.js'; +const { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +} = tslib; +export { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +}; diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/modules/package.json b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/modules/package.json new file mode 100644 index 0000000000..aafa0e4b45 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/modules/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/package.json b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/package.json new file mode 100644 index 0000000000..f8c2a53d0f --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/package.json @@ -0,0 +1,37 @@ +{ + "name": "tslib", + "author": "Microsoft Corp.", + "homepage": "https://www.typescriptlang.org/", + "version": "1.14.1", + "license": "0BSD", + "description": "Runtime library for TypeScript helper functions", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript", + "tslib", + "runtime" + ], + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/tslib.git" + }, + "main": "tslib.js", + "module": "tslib.es6.js", + "jsnext:main": "tslib.es6.js", + "typings": "tslib.d.ts", + "sideEffects": false, + "exports": { + ".": { + "module": "./tslib.es6.js", + "import": "./modules/index.js", + "default": "./tslib.js" + }, + "./": "./" + } +} diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js new file mode 100644 index 0000000000..0c1b613d8b --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js @@ -0,0 +1,23 @@ +// When on node 14, it validates that all of the commonjs exports +// are correctly re-exported for es modules importers. + +const nodeMajor = Number(process.version.split(".")[0].slice(1)) +if (nodeMajor < 14) { + console.log("Skipping because node does not support module exports.") + process.exit(0) +} + +// ES Modules import via the ./modules folder +import * as esTSLib from "../../modules/index.js" + +// Force a commonjs resolve +import { createRequire } from "module"; +const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js"); + +for (const key in commonJSTSLib) { + if (commonJSTSLib.hasOwnProperty(key)) { + if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`) + } +} + +console.log("All exports in commonjs are available for es module consumers.") diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json new file mode 100644 index 0000000000..166e5095e4 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "scripts": { + "test": "node index.js" + } +} diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.d.ts b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.d.ts new file mode 100644 index 0000000000..0756b28e76 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.d.ts @@ -0,0 +1,37 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +export declare function __generator(thisArg: any, body: Function): any; +export declare function __exportStar(m: any, exports: any): void; +export declare function __values(o: any): any; +export declare function __read(o: any, n?: number): any[]; +export declare function __spread(...args: any[][]): any[]; +export declare function __spreadArrays(...args: any[][]): any[]; +export declare function __await(v: any): any; +export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; +export declare function __asyncDelegator(o: any): any; +export declare function __asyncValues(o: any): any; +export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; +export declare function __importStar(mod: T): T; +export declare function __importDefault(mod: T): T | { default: T }; +export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; +export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; +export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.html b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.html new file mode 100644 index 0000000000..b122e41b06 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.js b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.js new file mode 100644 index 0000000000..0e0d8d079c --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.js @@ -0,0 +1,218 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + +export function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +export function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +export function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +export function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.html b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.html new file mode 100644 index 0000000000..44c9ba51e3 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.js b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.js new file mode 100644 index 0000000000..e5b7c9b809 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.js @@ -0,0 +1,284 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __createBinding = function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }; + + __exportStar = function (m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; + }; + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); diff --git a/server/node_modules/@aws-crypto/sha256-js/package.json b/server/node_modules/@aws-crypto/sha256-js/package.json new file mode 100644 index 0000000000..4e2621c35f --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/package.json @@ -0,0 +1,28 @@ +{ + "name": "@aws-crypto/sha256-js", + "version": "3.0.0", + "scripts": { + "prepublishOnly": "tsc", + "pretest": "tsc -p tsconfig.test.json", + "test": "mocha --require ts-node/register test/**/*test.ts" + }, + "main": "./build/index.js", + "types": "./build/index.d.ts", + "repository": { + "type": "git", + "url": "git@github.com:aws/aws-sdk-js-crypto-helpers.git" + }, + "author": { + "name": "AWS Crypto Tools Team", + "email": "aws-cryptools@amazon.com", + "url": "https://docs.aws.amazon.com/aws-crypto-tools/index.html?id=docs_gateway#lang/en_us" + }, + "homepage": "https://github.com/aws/aws-sdk-js-crypto-helpers/tree/master/packages/sha256-js", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + }, + "gitHead": "7f56cee8f62bd65cd397eeec29c3c997215bd80c" +} diff --git a/server/node_modules/@aws-crypto/sha256-js/src/RawSha256.ts b/server/node_modules/@aws-crypto/sha256-js/src/RawSha256.ts new file mode 100644 index 0000000000..f4a385c095 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/src/RawSha256.ts @@ -0,0 +1,164 @@ +import { + BLOCK_SIZE, + DIGEST_LENGTH, + INIT, + KEY, + MAX_HASHABLE_LENGTH +} from "./constants"; + +/** + * @internal + */ +export class RawSha256 { + private state: Int32Array = Int32Array.from(INIT); + private temp: Int32Array = new Int32Array(64); + private buffer: Uint8Array = new Uint8Array(64); + private bufferLength: number = 0; + private bytesHashed: number = 0; + + /** + * @internal + */ + finished: boolean = false; + + update(data: Uint8Array): void { + if (this.finished) { + throw new Error("Attempted to update an already finished hash."); + } + + let position = 0; + let { byteLength } = data; + this.bytesHashed += byteLength; + + if (this.bytesHashed * 8 > MAX_HASHABLE_LENGTH) { + throw new Error("Cannot hash more than 2^53 - 1 bits"); + } + + while (byteLength > 0) { + this.buffer[this.bufferLength++] = data[position++]; + byteLength--; + + if (this.bufferLength === BLOCK_SIZE) { + this.hashBuffer(); + this.bufferLength = 0; + } + } + } + + digest(): Uint8Array { + if (!this.finished) { + const bitsHashed = this.bytesHashed * 8; + const bufferView = new DataView( + this.buffer.buffer, + this.buffer.byteOffset, + this.buffer.byteLength + ); + + const undecoratedLength = this.bufferLength; + bufferView.setUint8(this.bufferLength++, 0x80); + + // Ensure the final block has enough room for the hashed length + if (undecoratedLength % BLOCK_SIZE >= BLOCK_SIZE - 8) { + for (let i = this.bufferLength; i < BLOCK_SIZE; i++) { + bufferView.setUint8(i, 0); + } + this.hashBuffer(); + this.bufferLength = 0; + } + + for (let i = this.bufferLength; i < BLOCK_SIZE - 8; i++) { + bufferView.setUint8(i, 0); + } + bufferView.setUint32( + BLOCK_SIZE - 8, + Math.floor(bitsHashed / 0x100000000), + true + ); + bufferView.setUint32(BLOCK_SIZE - 4, bitsHashed); + + this.hashBuffer(); + + this.finished = true; + } + + // The value in state is little-endian rather than big-endian, so flip + // each word into a new Uint8Array + const out = new Uint8Array(DIGEST_LENGTH); + for (let i = 0; i < 8; i++) { + out[i * 4] = (this.state[i] >>> 24) & 0xff; + out[i * 4 + 1] = (this.state[i] >>> 16) & 0xff; + out[i * 4 + 2] = (this.state[i] >>> 8) & 0xff; + out[i * 4 + 3] = (this.state[i] >>> 0) & 0xff; + } + + return out; + } + + private hashBuffer(): void { + const { buffer, state } = this; + + let state0 = state[0], + state1 = state[1], + state2 = state[2], + state3 = state[3], + state4 = state[4], + state5 = state[5], + state6 = state[6], + state7 = state[7]; + + for (let i = 0; i < BLOCK_SIZE; i++) { + if (i < 16) { + this.temp[i] = + ((buffer[i * 4] & 0xff) << 24) | + ((buffer[i * 4 + 1] & 0xff) << 16) | + ((buffer[i * 4 + 2] & 0xff) << 8) | + (buffer[i * 4 + 3] & 0xff); + } else { + let u = this.temp[i - 2]; + const t1 = + ((u >>> 17) | (u << 15)) ^ ((u >>> 19) | (u << 13)) ^ (u >>> 10); + + u = this.temp[i - 15]; + const t2 = + ((u >>> 7) | (u << 25)) ^ ((u >>> 18) | (u << 14)) ^ (u >>> 3); + + this.temp[i] = + ((t1 + this.temp[i - 7]) | 0) + ((t2 + this.temp[i - 16]) | 0); + } + + const t1 = + ((((((state4 >>> 6) | (state4 << 26)) ^ + ((state4 >>> 11) | (state4 << 21)) ^ + ((state4 >>> 25) | (state4 << 7))) + + ((state4 & state5) ^ (~state4 & state6))) | + 0) + + ((state7 + ((KEY[i] + this.temp[i]) | 0)) | 0)) | + 0; + + const t2 = + ((((state0 >>> 2) | (state0 << 30)) ^ + ((state0 >>> 13) | (state0 << 19)) ^ + ((state0 >>> 22) | (state0 << 10))) + + ((state0 & state1) ^ (state0 & state2) ^ (state1 & state2))) | + 0; + + state7 = state6; + state6 = state5; + state5 = state4; + state4 = (state3 + t1) | 0; + state3 = state2; + state2 = state1; + state1 = state0; + state0 = (t1 + t2) | 0; + } + + state[0] += state0; + state[1] += state1; + state[2] += state2; + state[3] += state3; + state[4] += state4; + state[5] += state5; + state[6] += state6; + state[7] += state7; + } +} diff --git a/server/node_modules/@aws-crypto/sha256-js/src/constants.ts b/server/node_modules/@aws-crypto/sha256-js/src/constants.ts new file mode 100644 index 0000000000..8cede572fa --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/src/constants.ts @@ -0,0 +1,98 @@ +/** + * @internal + */ +export const BLOCK_SIZE: number = 64; + +/** + * @internal + */ +export const DIGEST_LENGTH: number = 32; + +/** + * @internal + */ +export const KEY = new Uint32Array([ + 0x428a2f98, + 0x71374491, + 0xb5c0fbcf, + 0xe9b5dba5, + 0x3956c25b, + 0x59f111f1, + 0x923f82a4, + 0xab1c5ed5, + 0xd807aa98, + 0x12835b01, + 0x243185be, + 0x550c7dc3, + 0x72be5d74, + 0x80deb1fe, + 0x9bdc06a7, + 0xc19bf174, + 0xe49b69c1, + 0xefbe4786, + 0x0fc19dc6, + 0x240ca1cc, + 0x2de92c6f, + 0x4a7484aa, + 0x5cb0a9dc, + 0x76f988da, + 0x983e5152, + 0xa831c66d, + 0xb00327c8, + 0xbf597fc7, + 0xc6e00bf3, + 0xd5a79147, + 0x06ca6351, + 0x14292967, + 0x27b70a85, + 0x2e1b2138, + 0x4d2c6dfc, + 0x53380d13, + 0x650a7354, + 0x766a0abb, + 0x81c2c92e, + 0x92722c85, + 0xa2bfe8a1, + 0xa81a664b, + 0xc24b8b70, + 0xc76c51a3, + 0xd192e819, + 0xd6990624, + 0xf40e3585, + 0x106aa070, + 0x19a4c116, + 0x1e376c08, + 0x2748774c, + 0x34b0bcb5, + 0x391c0cb3, + 0x4ed8aa4a, + 0x5b9cca4f, + 0x682e6ff3, + 0x748f82ee, + 0x78a5636f, + 0x84c87814, + 0x8cc70208, + 0x90befffa, + 0xa4506ceb, + 0xbef9a3f7, + 0xc67178f2 +]); + +/** + * @internal + */ +export const INIT = [ + 0x6a09e667, + 0xbb67ae85, + 0x3c6ef372, + 0xa54ff53a, + 0x510e527f, + 0x9b05688c, + 0x1f83d9ab, + 0x5be0cd19 +]; + +/** + * @internal + */ +export const MAX_HASHABLE_LENGTH = 2 ** 53 - 1; diff --git a/server/node_modules/@aws-crypto/sha256-js/src/index.ts b/server/node_modules/@aws-crypto/sha256-js/src/index.ts new file mode 100644 index 0000000000..4554d8a3bd --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/src/index.ts @@ -0,0 +1 @@ +export * from "./jsSha256"; diff --git a/server/node_modules/@aws-crypto/sha256-js/src/jsSha256.ts b/server/node_modules/@aws-crypto/sha256-js/src/jsSha256.ts new file mode 100644 index 0000000000..f7bd9934fd --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/src/jsSha256.ts @@ -0,0 +1,94 @@ +import { BLOCK_SIZE } from "./constants"; +import { RawSha256 } from "./RawSha256"; +import { Checksum, SourceData } from "@aws-sdk/types"; +import { isEmptyData, convertToBuffer } from "@aws-crypto/util"; + +export class Sha256 implements Checksum { + private readonly secret?: SourceData; + private hash: RawSha256; + private outer?: RawSha256; + private error: any; + + constructor(secret?: SourceData) { + this.secret = secret; + this.hash = new RawSha256(); + this.reset(); + } + + update(toHash: SourceData): void { + if (isEmptyData(toHash) || this.error) { + return; + } + + try { + this.hash.update(convertToBuffer(toHash)); + } catch (e) { + this.error = e; + } + } + + /* This synchronous method keeps compatibility + * with the v2 aws-sdk. + */ + digestSync(): Uint8Array { + if (this.error) { + throw this.error; + } + + if (this.outer) { + if (!this.outer.finished) { + this.outer.update(this.hash.digest()); + } + + return this.outer.digest(); + } + + return this.hash.digest(); + } + + /* The underlying digest method here is synchronous. + * To keep the same interface with the other hash functions + * the default is to expose this as an async method. + * However, it can sometimes be useful to have a sync method. + */ + async digest(): Promise { + return this.digestSync(); + } + + reset(): void { + this.hash = new RawSha256(); + if (this.secret) { + this.outer = new RawSha256(); + const inner = bufferFromSecret(this.secret); + const outer = new Uint8Array(BLOCK_SIZE); + outer.set(inner); + + for (let i = 0; i < BLOCK_SIZE; i++) { + inner[i] ^= 0x36; + outer[i] ^= 0x5c; + } + + this.hash.update(inner); + this.outer.update(outer); + + // overwrite the copied key in memory + for (let i = 0; i < inner.byteLength; i++) { + inner[i] = 0; + } + } + } +} + +function bufferFromSecret(secret: SourceData): Uint8Array { + let input = convertToBuffer(secret); + + if (input.byteLength > BLOCK_SIZE) { + const bufferHash = new RawSha256(); + bufferHash.update(input); + input = bufferHash.digest(); + } + + const buffer = new Uint8Array(BLOCK_SIZE); + buffer.set(input); + return buffer; +} diff --git a/server/node_modules/@aws-crypto/sha256-js/src/knownHashes.fixture.ts b/server/node_modules/@aws-crypto/sha256-js/src/knownHashes.fixture.ts new file mode 100644 index 0000000000..c83dae2886 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/src/knownHashes.fixture.ts @@ -0,0 +1,401 @@ +import { fromHex } from "@aws-sdk/util-hex-encoding"; + +const millionChars = new Uint8Array(1000000); +for (let i = 0; i < 1000000; i++) { + millionChars[i] = 97; +} + +export const hashTestVectors: Array<[Uint8Array, Uint8Array]> = [ + [ + Uint8Array.from([97, 98, 99]), + fromHex("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad") + ], + [ + new Uint8Array(0), + fromHex("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") + ], + [ + fromHex("61"), + fromHex("ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb") + ], + [ + fromHex("6161"), + fromHex("961b6dd3ede3cb8ecbaacbd68de040cd78eb2ed5889130cceb4c49268ea4d506") + ], + [ + fromHex("616161"), + fromHex("9834876dcfb05cb167a5c24953eba58c4ac89b1adf57f28f2f9d09af107ee8f0") + ], + [ + fromHex("61616161"), + fromHex("61be55a8e2f6b4e172338bddf184d6dbee29c98853e0a0485ecee7f27b9af0b4") + ], + [ + fromHex("6161616161"), + fromHex("ed968e840d10d2d313a870bc131a4e2c311d7ad09bdf32b3418147221f51a6e2") + ], + [ + fromHex("616161616161"), + fromHex("ed02457b5c41d964dbd2f2a609d63fe1bb7528dbe55e1abf5b52c249cd735797") + ], + [ + fromHex("61616161616161"), + fromHex("e46240714b5db3a23eee60479a623efba4d633d27fe4f03c904b9e219a7fbe60") + ], + [ + fromHex("6161616161616161"), + fromHex("1f3ce40415a2081fa3eee75fc39fff8e56c22270d1a978a7249b592dcebd20b4") + ], + [ + fromHex("616161616161616161"), + fromHex("f2aca93b80cae681221f0445fa4e2cae8a1f9f8fa1e1741d9639caad222f537d") + ], + [ + fromHex("61616161616161616161"), + fromHex("bf2cb58a68f684d95a3b78ef8f661c9a4e5b09e82cc8f9cc88cce90528caeb27") + ], + [ + fromHex("6161616161616161616161"), + fromHex("28cb017dfc99073aa1b47c1b30f413e3ce774c4991eb4158de50f9dbb36d8043") + ], + [ + fromHex("616161616161616161616161"), + fromHex("f24abc34b13fade76e805799f71187da6cd90b9cac373ae65ed57f143bd664e5") + ], + [ + fromHex("61616161616161616161616161"), + fromHex("a689d786e81340e45511dec6c7ab2d978434e5db123362450fe10cfac70d19d0") + ], + [ + fromHex("6161616161616161616161616161"), + fromHex("82cab7df0abfb9d95dca4e5937ce2968c798c726fea48c016bf9763221efda13") + ], + [ + fromHex("616161616161616161616161616161"), + fromHex("ef2df0b539c6c23de0f4cbe42648c301ae0e22e887340a4599fb4ef4e2678e48") + ], + [ + fromHex("61616161616161616161616161616161"), + fromHex("0c0beacef8877bbf2416eb00f2b5dc96354e26dd1df5517320459b1236860f8c") + ], + [ + fromHex("6161616161616161616161616161616161"), + fromHex("b860666ee2966dd8f903be44ee605c6e1366f926d9f17a8f49937d11624eb99d") + ], + [ + fromHex("616161616161616161616161616161616161"), + fromHex("c926defaaa3d13eda2fc63a553bb7fb7326bece6e7cb67ca5296e4727d89bab4") + ], + [ + fromHex("61616161616161616161616161616161616161"), + fromHex("a0b4aaab8a966e2193ba172d68162c4656860197f256b5f45f0203397ff3f99c") + ], + [ + fromHex("6161616161616161616161616161616161616161"), + fromHex("42492da06234ad0ac76f5d5debdb6d1ae027cffbe746a1c13b89bb8bc0139137") + ], + [ + fromHex("616161616161616161616161616161616161616161"), + fromHex("7df8e299c834de198e264c3e374bc58ecd9382252a705c183beb02f275571e3b") + ], + [ + fromHex("61616161616161616161616161616161616161616161"), + fromHex("ec7c494df6d2a7ea36668d656e6b8979e33641bfea378c15038af3964db057a3") + ], + [ + fromHex("6161616161616161616161616161616161616161616161"), + fromHex("897d3e95b65f26676081f8b9f3a98b6ee4424566303e8d4e7c7522ebae219eab") + ], + [ + fromHex("616161616161616161616161616161616161616161616161"), + fromHex("09f61f8d9cd65e6a0c258087c485b6293541364e42bd97b2d7936580c8aa3c54") + ], + [ + fromHex("61616161616161616161616161616161616161616161616161"), + fromHex("2f521e2a7d0bd812cbc035f4ed6806eb8d851793b04ba147e8f66b72f5d1f20f") + ], + [ + fromHex("6161616161616161616161616161616161616161616161616161"), + fromHex("9976d549a25115dab4e36d0c1fb8f31cb07da87dd83275977360eb7dc09e88de") + ], + [ + fromHex("616161616161616161616161616161616161616161616161616161"), + fromHex("cc0616e61cbd6e8e5e34e9fb2d320f37de915820206f5696c31f1fbd24aa16de") + ], + [ + fromHex("61616161616161616161616161616161616161616161616161616161"), + fromHex("9c547cb8115a44883b9f70ba68f75117cd55359c92611875e386f8af98c172ab") + ], + [ + fromHex("6161616161616161616161616161616161616161616161616161616161"), + fromHex("6913c9c7fd42fe23df8b6bcd4dbaf1c17748948d97f2980b432319c39eddcf6c") + ], + [ + fromHex("616161616161616161616161616161616161616161616161616161616161"), + fromHex("3a54fc0cbc0b0ef48b6507b7788096235d10292dd3ae24e22f5aa062d4f9864a") + ], + [ + fromHex("61616161616161616161616161616161616161616161616161616161616161"), + fromHex("61c60b487d1a921e0bcc9bf853dda0fb159b30bf57b2e2d2c753b00be15b5a09") + ], + [ + fromHex("6161616161616161616161616161616161616161616161616161616161616161"), + fromHex("3ba3f5f43b92602683c19aee62a20342b084dd5971ddd33808d81a328879a547") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("852785c805c77e71a22340a54e9d95933ed49121e7d2bf3c2d358854bc1359ea") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("a27c896c4859204843166af66f0e902b9c3b3ed6d2fd13d435abc020065c526f") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("629362afc62c74497caed2272e30f8125ecd0965f8d8d7cfc4e260f7f8dd319d") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("22c1d24bcd03e9aee9832efccd6da613fc702793178e5f12c945c7b67ddda933") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("21ec055b38ce759cd4d0f477e9bdec2c5b8199945db4439bae334a964df6246c") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("365a9c3e2c2af0a56e47a9dac51c2c5381bf8f41273bad3175e0e619126ad087") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("b4d5e56e929ba4cda349e9274e3603d0be246b82016bca20f363963c5f2d6845") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("e33cdf9c7f7120b98e8c78408953e07f2ecd183006b5606df349b4c212acf43e") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("c0f8bd4dbc2b0c03107c1c37913f2a7501f521467f45dd0fef6958e9a4692719") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("7a538607fdaab9296995929f451565bbb8142e1844117322aafd2b3d76b01aff") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("66d34fba71f8f450f7e45598853e53bfc23bbd129027cbb131a2f4ffd7878cd0") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("16849877c6c21ef0bfa68e4f6747300ddb171b170b9f00e189edc4c2fc4db93e") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("52789e3423b72beeb898456a4f49662e46b0cbb960784c5ef4b1399d327e7c27") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("6643110c5628fff59edf76d82d5bf573bf800f16a4d65dfb1e5d6f1a46296d0b") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("11eaed932c6c6fddfc2efc394e609facf4abe814fc6180d03b14fce13a07d0e5") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("97daac0ee9998dfcad6c9c0970da5ca411c86233a944c25b47566f6a7bc1ddd5") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("8f9bec6a62dd28ebd36d1227745592de6658b36974a3bb98a4c582f683ea6c42") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("160b4e433e384e05e537dc59b467f7cb2403f0214db15c5db58862a3f1156d2e") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("bfc5fe0e360152ca98c50fab4ed7e3078c17debc2917740d5000913b686ca129") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("6c1b3dc7a706b9dc81352a6716b9c666c608d8626272c64b914ab05572fc6e84") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("abe346a7259fc90b4c27185419628e5e6af6466b1ae9b5446cac4bfc26cf05c4") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("a3f01b6939256127582ac8ae9fb47a382a244680806a3f613a118851c1ca1d47") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("9f4390f8d30c2dd92ec9f095b65e2b9ae9b0a925a5258e241c9f1e910f734318") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("b35439a4ac6f0948b6d6f9e3c6af0f5f590ce20f1bde7090ef7970686ec6738a") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("f13b2d724659eb3bf47f2dd6af1accc87b81f09f59f2b75e5c0bed6589dfe8c6") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("d5c039b748aa64665782974ec3dc3025c042edf54dcdc2b5de31385b094cb678") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("111bb261277afd65f0744b247cd3e47d386d71563d0ed995517807d5ebd4fba3") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("11ee391211c6256460b6ed375957fadd8061cafbb31daf967db875aebd5aaad4") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("35d5fc17cfbbadd00f5e710ada39f194c5ad7c766ad67072245f1fad45f0f530") + ], + [ + fromHex( + "6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("f506898cc7c2e092f9eb9fadae7ba50383f5b46a2a4fe5597dbb553a78981268") + ], + [ + fromHex( + "616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("7d3e74a05d7db15bce4ad9ec0658ea98e3f06eeecf16b4c6fff2da457ddc2f34") + ], + [ + fromHex( + "61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161" + ), + fromHex("ffe054fe7ae0cb6dc65c3af9b61d5209f439851db43d0ba5997337df154668eb") + ], + [ + fromHex( + "de188941a3375d3a8a061e67576e926dc71a7fa3f0cceb97452b4d3227965f9ea8cc75076d9fb9c5417aa5cb30fc22198b34982dbb629e" + ), + fromHex("038051e9c324393bd1ca1978dd0952c2aa3742ca4f1bd5cd4611cea83892d382") + ], + [ + millionChars, + fromHex("cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0") + ], + [ + fromHex( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + ), + fromHex("45ad4b37c6e2fc0a2cfcc1b5da524132ec707615c2cae1dbbc43c97aa521db81") + ] +]; + +/** + * @see https://tools.ietf.org/html/rfc4231 + */ +export const hmacTestVectors: Array<[Uint8Array, Uint8Array, Uint8Array]> = [ + [ + fromHex("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"), + fromHex("4869205468657265"), + fromHex("b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7") + ], + [ + fromHex("4a656665"), + fromHex("7768617420646f2079612077616e7420666f72206e6f7468696e673f"), + fromHex("5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843") + ], + [ + fromHex("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), + fromHex( + "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + ), + fromHex("773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe") + ], + [ + fromHex("0102030405060708090a0b0c0d0e0f10111213141516171819"), + fromHex( + "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd" + ), + fromHex("82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b") + ], + [ + fromHex( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + ), + fromHex( + "54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b6579202d2048617368204b6579204669727374" + ), + fromHex("60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54") + ], + [ + fromHex( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + ), + fromHex( + "5468697320697320612074657374207573696e672061206c6172676572207468616e20626c6f636b2d73697a65206b657920616e642061206c6172676572207468616e20626c6f636b2d73697a6520646174612e20546865206b6579206e6565647320746f20626520686173686564206265666f7265206265696e6720757365642062792074686520484d414320616c676f726974686d2e" + ), + fromHex("9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2") + ] +]; diff --git a/server/node_modules/@aws-crypto/sha256-js/tsconfig.json b/server/node_modules/@aws-crypto/sha256-js/tsconfig.json new file mode 100644 index 0000000000..c242acb079 --- /dev/null +++ b/server/node_modules/@aws-crypto/sha256-js/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "declaration": true, + "strict": true, + "sourceMap": true, + "downlevelIteration": true, + "lib": ["es5", "es2015.promise", "es2015.collection", "es2015.iterable"], + "rootDir": "./src", + "outDir": "./build", + "importHelpers": true, + "noEmitHelpers": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules/**"] +} diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/CHANGELOG.md b/server/node_modules/@aws-crypto/supports-web-crypto/CHANGELOG.md new file mode 100644 index 0000000000..f4a929b917 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/CHANGELOG.md @@ -0,0 +1,46 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.2...v3.0.0) (2023-01-12) + +**Note:** Version bump only for package @aws-crypto/supports-web-crypto + +## [2.0.2](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.1...v2.0.2) (2022-09-07) + +**Note:** Version bump only for package @aws-crypto/supports-web-crypto + +# [2.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.2...v2.0.0) (2021-10-25) + +**Note:** Version bump only for package @aws-crypto/supports-web-crypto + +# [1.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/supports-web-crypto@1.0.0-alpha.0...@aws-crypto/supports-web-crypto@1.0.0) (2020-10-22) + +### Bug Fixes + +- replace `sourceRoot` -> `rootDir` in tsconfig ([#169](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/169)) ([d437167](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/d437167b51d1c56a4fcc2bb8a446b74a7e3b7e06)) + +# [1.0.0-alpha.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/supports-web-crypto@0.1.0-preview.4...@aws-crypto/supports-web-crypto@1.0.0-alpha.0) (2020-02-07) + +**Note:** Version bump only for package @aws-crypto/supports-web-crypto + +# [0.1.0-preview.4](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/supports-web-crypto@0.1.0-preview.2...@aws-crypto/supports-web-crypto@0.1.0-preview.4) (2020-01-16) + +### Bug Fixes + +- Changed package.json files to point to the right Git repo ([#9](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/9)) ([028245d](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/028245d72e642ca98d82226afb300eb154503c4a)), closes [#8](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/8) +- lerna version maintains package-lock ([#14](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/14)) ([2ef29e1](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/2ef29e13779703a5c9b32e93d18918fcb33b7272)), closes [#13](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/13) + +# [0.1.0-preview.3](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/@aws-crypto/supports-web-crypto@0.1.0-preview.2...@aws-crypto/supports-web-crypto@0.1.0-preview.3) (2019-11-15) + +### Bug Fixes + +- Changed package.json files to point to the right Git repo ([#9](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/9)) ([028245d](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/028245d72e642ca98d82226afb300eb154503c4a)), closes [#8](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/8) +- lerna version maintains package-lock ([#14](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/14)) ([2ef29e1](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/2ef29e13779703a5c9b32e93d18918fcb33b7272)), closes [#13](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/13) + +# [0.1.0-preview.2](https://github.com/aws/aws-javascript-crypto-helpers/compare/@aws-crypto/supports-web-crypto@0.1.0-preview.1...@aws-crypto/supports-web-crypto@0.1.0-preview.2) (2019-10-30) + +### Bug Fixes + +- remove /src/ from .npmignore (for sourcemaps) ([#5](https://github.com/aws/aws-javascript-crypto-helpers/issues/5)) ([ec52056](https://github.com/aws/aws-javascript-crypto-helpers/commit/ec52056)) diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/LICENSE b/server/node_modules/@aws-crypto/supports-web-crypto/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/README.md b/server/node_modules/@aws-crypto/supports-web-crypto/README.md new file mode 100644 index 0000000000..78913571a4 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/README.md @@ -0,0 +1,32 @@ +# @aws-crypto/supports-web-crypto + +Functions to check web crypto support for browsers. + +## Usage + +``` +import {supportsWebCrypto} from '@aws-crypto/supports-web-crypto'; + +if (supportsWebCrypto(window)) { + // window.crypto.subtle.encrypt will exist +} + +``` + +## supportsWebCrypto + +Used to make sure `window.crypto.subtle` exists and implements crypto functions +as well as a cryptographic secure random source exists. + +## supportsSecureRandom + +Used to make sure that a cryptographic secure random source exists. +Does not check for `window.crypto.subtle`. + +## supportsSubtleCrypto + +## supportsZeroByteGCM + +## Test + +`npm test` diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/build/index.d.ts b/server/node_modules/@aws-crypto/supports-web-crypto/build/index.d.ts new file mode 100644 index 0000000000..9725c9c298 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/build/index.d.ts @@ -0,0 +1 @@ +export * from "./supportsWebCrypto"; diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/build/index.js b/server/node_modules/@aws-crypto/supports-web-crypto/build/index.js new file mode 100644 index 0000000000..4d82b8d1ee --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/build/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./supportsWebCrypto"), exports); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsOERBQW9DIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSBcIi4vc3VwcG9ydHNXZWJDcnlwdG9cIjtcbiJdfQ== \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/build/supportsWebCrypto.d.ts b/server/node_modules/@aws-crypto/supports-web-crypto/build/supportsWebCrypto.d.ts new file mode 100644 index 0000000000..f2723dc613 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/build/supportsWebCrypto.d.ts @@ -0,0 +1,4 @@ +export declare function supportsWebCrypto(window: Window): boolean; +export declare function supportsSecureRandom(window: Window): boolean; +export declare function supportsSubtleCrypto(subtle: SubtleCrypto): boolean; +export declare function supportsZeroByteGCM(subtle: SubtleCrypto): Promise; diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/build/supportsWebCrypto.js b/server/node_modules/@aws-crypto/supports-web-crypto/build/supportsWebCrypto.js new file mode 100644 index 0000000000..a079bec3f4 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/build/supportsWebCrypto.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.supportsZeroByteGCM = exports.supportsSubtleCrypto = exports.supportsSecureRandom = exports.supportsWebCrypto = void 0; +var tslib_1 = require("tslib"); +var subtleCryptoMethods = [ + "decrypt", + "digest", + "encrypt", + "exportKey", + "generateKey", + "importKey", + "sign", + "verify" +]; +function supportsWebCrypto(window) { + if (supportsSecureRandom(window) && + typeof window.crypto.subtle === "object") { + var subtle = window.crypto.subtle; + return supportsSubtleCrypto(subtle); + } + return false; +} +exports.supportsWebCrypto = supportsWebCrypto; +function supportsSecureRandom(window) { + if (typeof window === "object" && typeof window.crypto === "object") { + var getRandomValues = window.crypto.getRandomValues; + return typeof getRandomValues === "function"; + } + return false; +} +exports.supportsSecureRandom = supportsSecureRandom; +function supportsSubtleCrypto(subtle) { + return (subtle && + subtleCryptoMethods.every(function (methodName) { return typeof subtle[methodName] === "function"; })); +} +exports.supportsSubtleCrypto = supportsSubtleCrypto; +function supportsZeroByteGCM(subtle) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var key, zeroByteAuthTag, _a; + return tslib_1.__generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!supportsSubtleCrypto(subtle)) + return [2 /*return*/, false]; + _b.label = 1; + case 1: + _b.trys.push([1, 4, , 5]); + return [4 /*yield*/, subtle.generateKey({ name: "AES-GCM", length: 128 }, false, ["encrypt"])]; + case 2: + key = _b.sent(); + return [4 /*yield*/, subtle.encrypt({ + name: "AES-GCM", + iv: new Uint8Array(Array(12)), + additionalData: new Uint8Array(Array(16)), + tagLength: 128 + }, key, new Uint8Array(0))]; + case 3: + zeroByteAuthTag = _b.sent(); + return [2 /*return*/, zeroByteAuthTag.byteLength === 16]; + case 4: + _a = _b.sent(); + return [2 /*return*/, false]; + case 5: return [2 /*return*/]; + } + }); + }); +} +exports.supportsZeroByteGCM = supportsZeroByteGCM; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3VwcG9ydHNXZWJDcnlwdG8uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9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24gc3VwcG9ydHNTdWJ0bGVDcnlwdG8oc3VidGxlOiBTdWJ0bGVDcnlwdG8pIHtcbiAgcmV0dXJuIChcbiAgICBzdWJ0bGUgJiZcbiAgICBzdWJ0bGVDcnlwdG9NZXRob2RzLmV2ZXJ5KFxuICAgICAgbWV0aG9kTmFtZSA9PiB0eXBlb2Ygc3VidGxlW21ldGhvZE5hbWVdID09PSBcImZ1bmN0aW9uXCJcbiAgICApXG4gICk7XG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBzdXBwb3J0c1plcm9CeXRlR0NNKHN1YnRsZTogU3VidGxlQ3J5cHRvKSB7XG4gIGlmICghc3VwcG9ydHNTdWJ0bGVDcnlwdG8oc3VidGxlKSkgcmV0dXJuIGZhbHNlO1xuICB0cnkge1xuICAgIGNvbnN0IGtleSA9IGF3YWl0IHN1YnRsZS5nZW5lcmF0ZUtleShcbiAgICAgIHsgbmFtZTogXCJBRVMtR0NNXCIsIGxlbmd0aDogMTI4IH0sXG4gICAgICBmYWxzZSxcbiAgICAgIFtcImVuY3J5cHRcIl1cbiAgICApO1xuICAgIGNvbnN0IHplcm9CeXRlQXV0aFRhZyA9IGF3YWl0IHN1YnRsZS5lbmNyeXB0KFxuICAgICAge1xuICAgICAgICBuYW1lOiBcIkFFUy1HQ01cIixcbiAgICAgICAgaXY6IG5ldyBVaW50OEFycmF5KEFycmF5KDEyKSksXG4gICAgICAgIGFkZGl0aW9uYWxEYXRhOiBuZXcgVWludDhBcnJheShBcnJheSgxNikpLFxuICAgICAgICB0YWdMZW5ndGg6IDEyOFxuICAgICAgfSxcbiAgICAgIGtleSxcbiAgICAgIG5ldyBVaW50OEFycmF5KDApXG4gICAgKTtcbiAgICByZXR1cm4gemVyb0J5dGVBdXRoVGFnLmJ5dGVMZW5ndGggPT09IDE2O1xuICB9IGNhdGNoIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/CopyrightNotice.txt b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/CopyrightNotice.txt new file mode 100644 index 0000000000..3d4c82348e --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/LICENSE.txt b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/LICENSE.txt new file mode 100644 index 0000000000..bfe6430cb0 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/README.md b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/README.md new file mode 100644 index 0000000000..a5b2692c8a --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/README.md @@ -0,0 +1,142 @@ +# tslib + +This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. + +This library is primarily used by the `--importHelpers` flag in TypeScript. +When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: + +```ts +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +exports.x = {}; +exports.y = __assign({}, exports.x); + +``` + +will instead be emitted as something like the following: + +```ts +var tslib_1 = require("tslib"); +exports.x = {}; +exports.y = tslib_1.__assign({}, exports.x); +``` + +Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. +For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. + +# Installing + +For the latest stable version, run: + +## npm + +```sh +# TypeScript 2.3.3 or later +npm install tslib + +# TypeScript 2.3.2 or earlier +npm install tslib@1.6.1 +``` + +## yarn + +```sh +# TypeScript 2.3.3 or later +yarn add tslib + +# TypeScript 2.3.2 or earlier +yarn add tslib@1.6.1 +``` + +## bower + +```sh +# TypeScript 2.3.3 or later +bower install tslib + +# TypeScript 2.3.2 or earlier +bower install tslib@1.6.1 +``` + +## JSPM + +```sh +# TypeScript 2.3.3 or later +jspm install tslib + +# TypeScript 2.3.2 or earlier +jspm install tslib@1.6.1 +``` + +# Usage + +Set the `importHelpers` compiler option on the command line: + +``` +tsc --importHelpers file.ts +``` + +or in your tsconfig.json: + +```json +{ + "compilerOptions": { + "importHelpers": true + } +} +``` + +#### For bower and JSPM users + +You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: + +```json +{ + "compilerOptions": { + "module": "amd", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["bower_components/tslib/tslib.d.ts"] + } + } +} +``` + +For JSPM users: + +```json +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@1.[version].0/tslib.d.ts"] + } + } +} +``` + + +# Contribute + +There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. + +* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +# Documentation + +* [Quick tutorial](http://www.typescriptlang.org/Tutorial) +* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Homepage](http://www.typescriptlang.org/) diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/modules/index.js b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/modules/index.js new file mode 100644 index 0000000000..d241d04222 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/modules/index.js @@ -0,0 +1,51 @@ +import tslib from '../tslib.js'; +const { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +} = tslib; +export { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +}; diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/modules/package.json b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/modules/package.json new file mode 100644 index 0000000000..aafa0e4b45 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/modules/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/package.json b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/package.json new file mode 100644 index 0000000000..f8c2a53d0f --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/package.json @@ -0,0 +1,37 @@ +{ + "name": "tslib", + "author": "Microsoft Corp.", + "homepage": "https://www.typescriptlang.org/", + "version": "1.14.1", + "license": "0BSD", + "description": "Runtime library for TypeScript helper functions", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript", + "tslib", + "runtime" + ], + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/tslib.git" + }, + "main": "tslib.js", + "module": "tslib.es6.js", + "jsnext:main": "tslib.es6.js", + "typings": "tslib.d.ts", + "sideEffects": false, + "exports": { + ".": { + "module": "./tslib.es6.js", + "import": "./modules/index.js", + "default": "./tslib.js" + }, + "./": "./" + } +} diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js new file mode 100644 index 0000000000..0c1b613d8b --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js @@ -0,0 +1,23 @@ +// When on node 14, it validates that all of the commonjs exports +// are correctly re-exported for es modules importers. + +const nodeMajor = Number(process.version.split(".")[0].slice(1)) +if (nodeMajor < 14) { + console.log("Skipping because node does not support module exports.") + process.exit(0) +} + +// ES Modules import via the ./modules folder +import * as esTSLib from "../../modules/index.js" + +// Force a commonjs resolve +import { createRequire } from "module"; +const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js"); + +for (const key in commonJSTSLib) { + if (commonJSTSLib.hasOwnProperty(key)) { + if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`) + } +} + +console.log("All exports in commonjs are available for es module consumers.") diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json new file mode 100644 index 0000000000..166e5095e4 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "scripts": { + "test": "node index.js" + } +} diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.d.ts b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.d.ts new file mode 100644 index 0000000000..0756b28e76 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.d.ts @@ -0,0 +1,37 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +export declare function __generator(thisArg: any, body: Function): any; +export declare function __exportStar(m: any, exports: any): void; +export declare function __values(o: any): any; +export declare function __read(o: any, n?: number): any[]; +export declare function __spread(...args: any[][]): any[]; +export declare function __spreadArrays(...args: any[][]): any[]; +export declare function __await(v: any): any; +export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; +export declare function __asyncDelegator(o: any): any; +export declare function __asyncValues(o: any): any; +export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; +export declare function __importStar(mod: T): T; +export declare function __importDefault(mod: T): T | { default: T }; +export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; +export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; +export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.html b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.html new file mode 100644 index 0000000000..b122e41b06 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.js b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.js new file mode 100644 index 0000000000..0e0d8d079c --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.js @@ -0,0 +1,218 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + +export function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +export function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +export function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +export function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.html b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.html new file mode 100644 index 0000000000..44c9ba51e3 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.js b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.js new file mode 100644 index 0000000000..e5b7c9b809 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.js @@ -0,0 +1,284 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __createBinding = function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }; + + __exportStar = function (m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; + }; + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/package.json b/server/node_modules/@aws-crypto/supports-web-crypto/package.json new file mode 100644 index 0000000000..e28bf4eaa9 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/package.json @@ -0,0 +1,26 @@ +{ + "name": "@aws-crypto/supports-web-crypto", + "version": "3.0.0", + "description": "Provides functions for detecting if the host environment supports the WebCrypto API", + "scripts": { + "pretest": "tsc -p tsconfig.test.json", + "test": "mocha --require ts-node/register test/**/*test.ts" + }, + "repository": { + "type": "git", + "url": "git@github.com:aws/aws-sdk-js-crypto-helpers.git" + }, + "author": { + "name": "AWS Crypto Tools Team", + "email": "aws-cryptools@amazon.com", + "url": "https://docs.aws.amazon.com/aws-crypto-tools/index.html?id=docs_gateway#lang/en_us" + }, + "homepage": "https://github.com/aws/aws-sdk-js-crypto-helpers/tree/master/packages/supports-web-crypto", + "license": "Apache-2.0", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "dependencies": { + "tslib": "^1.11.1" + }, + "gitHead": "7f56cee8f62bd65cd397eeec29c3c997215bd80c" +} diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/src/index.ts b/server/node_modules/@aws-crypto/supports-web-crypto/src/index.ts new file mode 100644 index 0000000000..9725c9c298 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/src/index.ts @@ -0,0 +1 @@ +export * from "./supportsWebCrypto"; diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/src/supportsWebCrypto.ts b/server/node_modules/@aws-crypto/supports-web-crypto/src/supportsWebCrypto.ts new file mode 100644 index 0000000000..7eef629139 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/src/supportsWebCrypto.ts @@ -0,0 +1,76 @@ +type SubtleCryptoMethod = + | "decrypt" + | "digest" + | "encrypt" + | "exportKey" + | "generateKey" + | "importKey" + | "sign" + | "verify"; + +const subtleCryptoMethods: Array = [ + "decrypt", + "digest", + "encrypt", + "exportKey", + "generateKey", + "importKey", + "sign", + "verify" +]; + +export function supportsWebCrypto(window: Window): boolean { + if ( + supportsSecureRandom(window) && + typeof window.crypto.subtle === "object" + ) { + const { subtle } = window.crypto; + + return supportsSubtleCrypto(subtle); + } + + return false; +} + +export function supportsSecureRandom(window: Window): boolean { + if (typeof window === "object" && typeof window.crypto === "object") { + const { getRandomValues } = window.crypto; + + return typeof getRandomValues === "function"; + } + + return false; +} + +export function supportsSubtleCrypto(subtle: SubtleCrypto) { + return ( + subtle && + subtleCryptoMethods.every( + methodName => typeof subtle[methodName] === "function" + ) + ); +} + +export async function supportsZeroByteGCM(subtle: SubtleCrypto) { + if (!supportsSubtleCrypto(subtle)) return false; + try { + const key = await subtle.generateKey( + { name: "AES-GCM", length: 128 }, + false, + ["encrypt"] + ); + const zeroByteAuthTag = await subtle.encrypt( + { + name: "AES-GCM", + iv: new Uint8Array(Array(12)), + additionalData: new Uint8Array(Array(16)), + tagLength: 128 + }, + key, + new Uint8Array(0) + ); + return zeroByteAuthTag.byteLength === 16; + } catch { + return false; + } +} diff --git a/server/node_modules/@aws-crypto/supports-web-crypto/tsconfig.json b/server/node_modules/@aws-crypto/supports-web-crypto/tsconfig.json new file mode 100644 index 0000000000..e4def43369 --- /dev/null +++ b/server/node_modules/@aws-crypto/supports-web-crypto/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": ["dom", "es5", "es2015.collection"], + "strict": true, + "sourceMap": true, + "declaration": true, + "rootDir": "./src", + "outDir": "./build", + "importHelpers": true, + "noEmitHelpers": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules/**"] +} diff --git a/server/node_modules/@aws-crypto/util/CHANGELOG.md b/server/node_modules/@aws-crypto/util/CHANGELOG.md new file mode 100644 index 0000000000..686f49d113 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/CHANGELOG.md @@ -0,0 +1,47 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.2...v3.0.0) (2023-01-12) + +- feat!: replace Hash implementations with Checksum interface (#492) ([da43dc0](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/da43dc0fdf669d9ebb5bfb1b1f7c79e46c4aaae1)), closes [#492](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/492) + +### BREAKING CHANGES + +- All classes that implemented `Hash` now implement `Checksum`. + +## [2.0.2](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.1...v2.0.2) (2022-09-07) + +### Bug Fixes + +- **#337:** update @aws-sdk/types ([#373](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/373)) ([b26a811](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/b26a811a392f5209c7ec7e57251500d4d78f97ff)), closes [#337](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/337) +- **docs:** update README for packages/util ([#382](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/382)) ([f3e650e](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/f3e650e1b4792ffbea2e8a1a015fd55fb951a3a4)) + +## [2.0.1](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v2.0.0...v2.0.1) (2021-12-09) + +### Bug Fixes + +- **uint32ArrayFrom:** increment index & polyfill for Uint32Array ([#270](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/270)) ([a70d603](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/a70d603f3ba7600d3c1213f297d4160a4b3793bd)) + +# [2.0.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.2...v2.0.0) (2021-10-25) + +**Note:** Version bump only for package @aws-crypto/util + +## [1.2.2](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.1...v1.2.2) (2021-10-12) + +### Bug Fixes + +- **crc32c:** ie11 does not support Array.from ([#221](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/221)) ([5f49547](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/5f495472ab8988cf203e0f2a70a51f7e1fcd7e60)) + +## [1.2.1](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.2.0...v1.2.1) (2021-09-17) + +### Bug Fixes + +- better pollyfill check for Buffer ([#217](https://github.com/aws/aws-sdk-js-crypto-helpers/issues/217)) ([bc97da2](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/bc97da29aaf473943e4407c9a29cc30f74f15723)) + +# [1.2.0](https://github.com/aws/aws-sdk-js-crypto-helpers/compare/v1.1.1...v1.2.0) (2021-09-17) + +### Features + +- add @aws-crypto/util ([8f489cb](https://github.com/aws/aws-sdk-js-crypto-helpers/commit/8f489cbe4c0e134f826bac66f1bf5172597048b9)) diff --git a/server/node_modules/@aws-crypto/util/LICENSE b/server/node_modules/@aws-crypto/util/LICENSE new file mode 100644 index 0000000000..980a15ac24 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-crypto/util/README.md b/server/node_modules/@aws-crypto/util/README.md new file mode 100644 index 0000000000..4c1c8aab6a --- /dev/null +++ b/server/node_modules/@aws-crypto/util/README.md @@ -0,0 +1,16 @@ +# @aws-crypto/util + +Helper functions + +## Usage + +``` +import { convertToBuffer } from '@aws-crypto/util'; + +const data = "asdf"; +const utf8EncodedUint8Array = convertToBuffer(data); +``` + +## Test + +`npm test` diff --git a/server/node_modules/@aws-crypto/util/build/convertToBuffer.d.ts b/server/node_modules/@aws-crypto/util/build/convertToBuffer.d.ts new file mode 100644 index 0000000000..697a5cde8b --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/convertToBuffer.d.ts @@ -0,0 +1,2 @@ +import { SourceData } from "@aws-sdk/types"; +export declare function convertToBuffer(data: SourceData): Uint8Array; diff --git a/server/node_modules/@aws-crypto/util/build/convertToBuffer.js b/server/node_modules/@aws-crypto/util/build/convertToBuffer.js new file mode 100644 index 0000000000..6cc8bcfe82 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/convertToBuffer.js @@ -0,0 +1,24 @@ +"use strict"; +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertToBuffer = void 0; +var util_utf8_browser_1 = require("@aws-sdk/util-utf8-browser"); +// Quick polyfill +var fromUtf8 = typeof Buffer !== "undefined" && Buffer.from + ? function (input) { return Buffer.from(input, "utf8"); } + : util_utf8_browser_1.fromUtf8; +function convertToBuffer(data) { + // Already a Uint8, do nothing + if (data instanceof Uint8Array) + return data; + if (typeof data === "string") { + return fromUtf8(data); + } + if (ArrayBuffer.isView(data)) { + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); + } + return new Uint8Array(data); +} +exports.convertToBuffer = convertToBuffer; +//# sourceMappingURL=convertToBuffer.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/build/convertToBuffer.js.map b/server/node_modules/@aws-crypto/util/build/convertToBuffer.js.map new file mode 100644 index 0000000000..d3c0154826 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/convertToBuffer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"convertToBuffer.js","sourceRoot":"","sources":["../src/convertToBuffer.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,sCAAsC;;;AAGtC,gEAAyE;AAEzE,iBAAiB;AACjB,IAAM,QAAQ,GACZ,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,IAAI;IAC1C,CAAC,CAAC,UAAC,KAAa,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,EAA1B,CAA0B;IAC/C,CAAC,CAAC,4BAAe,CAAC;AAEtB,SAAgB,eAAe,CAAC,IAAgB;IAC9C,8BAA8B;IAC9B,IAAI,IAAI,YAAY,UAAU;QAAE,OAAO,IAAI,CAAC;IAE5C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;KACvB;IAED,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QAC5B,OAAO,IAAI,UAAU,CACnB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,iBAAiB,CAC/C,CAAC;KACH;IAED,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAjBD,0CAiBC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/build/index.d.ts b/server/node_modules/@aws-crypto/util/build/index.d.ts new file mode 100644 index 0000000000..783c73c4b8 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/index.d.ts @@ -0,0 +1,4 @@ +export { convertToBuffer } from "./convertToBuffer"; +export { isEmptyData } from "./isEmptyData"; +export { numToUint8 } from "./numToUint8"; +export { uint32ArrayFrom } from './uint32ArrayFrom'; diff --git a/server/node_modules/@aws-crypto/util/build/index.js b/server/node_modules/@aws-crypto/util/build/index.js new file mode 100644 index 0000000000..94e1ca9076 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/index.js @@ -0,0 +1,14 @@ +"use strict"; +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.uint32ArrayFrom = exports.numToUint8 = exports.isEmptyData = exports.convertToBuffer = void 0; +var convertToBuffer_1 = require("./convertToBuffer"); +Object.defineProperty(exports, "convertToBuffer", { enumerable: true, get: function () { return convertToBuffer_1.convertToBuffer; } }); +var isEmptyData_1 = require("./isEmptyData"); +Object.defineProperty(exports, "isEmptyData", { enumerable: true, get: function () { return isEmptyData_1.isEmptyData; } }); +var numToUint8_1 = require("./numToUint8"); +Object.defineProperty(exports, "numToUint8", { enumerable: true, get: function () { return numToUint8_1.numToUint8; } }); +var uint32ArrayFrom_1 = require("./uint32ArrayFrom"); +Object.defineProperty(exports, "uint32ArrayFrom", { enumerable: true, get: function () { return uint32ArrayFrom_1.uint32ArrayFrom; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/build/index.js.map b/server/node_modules/@aws-crypto/util/build/index.js.map new file mode 100644 index 0000000000..afb9af66d0 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,sCAAsC;;;AAEtC,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAkD;AAA1C,kHAAA,eAAe,OAAA"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/build/isEmptyData.d.ts b/server/node_modules/@aws-crypto/util/build/isEmptyData.d.ts new file mode 100644 index 0000000000..43ae4a7c44 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/isEmptyData.d.ts @@ -0,0 +1,2 @@ +import { SourceData } from "@aws-sdk/types"; +export declare function isEmptyData(data: SourceData): boolean; diff --git a/server/node_modules/@aws-crypto/util/build/isEmptyData.js b/server/node_modules/@aws-crypto/util/build/isEmptyData.js new file mode 100644 index 0000000000..6af1e89e02 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/isEmptyData.js @@ -0,0 +1,13 @@ +"use strict"; +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEmptyData = void 0; +function isEmptyData(data) { + if (typeof data === "string") { + return data.length === 0; + } + return data.byteLength === 0; +} +exports.isEmptyData = isEmptyData; +//# sourceMappingURL=isEmptyData.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/build/isEmptyData.js.map b/server/node_modules/@aws-crypto/util/build/isEmptyData.js.map new file mode 100644 index 0000000000..8766be9b75 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/isEmptyData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isEmptyData.js","sourceRoot":"","sources":["../src/isEmptyData.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,sCAAsC;;;AAItC,SAAgB,WAAW,CAAC,IAAgB;IAC1C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC;KAC1B;IAED,OAAO,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC;AAC/B,CAAC;AAND,kCAMC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/build/numToUint8.d.ts b/server/node_modules/@aws-crypto/util/build/numToUint8.d.ts new file mode 100644 index 0000000000..5b702e8ef0 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/numToUint8.d.ts @@ -0,0 +1 @@ +export declare function numToUint8(num: number): Uint8Array; diff --git a/server/node_modules/@aws-crypto/util/build/numToUint8.js b/server/node_modules/@aws-crypto/util/build/numToUint8.js new file mode 100644 index 0000000000..2f070e1076 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/numToUint8.js @@ -0,0 +1,15 @@ +"use strict"; +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.numToUint8 = void 0; +function numToUint8(num) { + return new Uint8Array([ + (num & 0xff000000) >> 24, + (num & 0x00ff0000) >> 16, + (num & 0x0000ff00) >> 8, + num & 0x000000ff, + ]); +} +exports.numToUint8 = numToUint8; +//# sourceMappingURL=numToUint8.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/build/numToUint8.js.map b/server/node_modules/@aws-crypto/util/build/numToUint8.js.map new file mode 100644 index 0000000000..951886bd24 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/numToUint8.js.map @@ -0,0 +1 @@ +{"version":3,"file":"numToUint8.js","sourceRoot":"","sources":["../src/numToUint8.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,sCAAsC;;;AAEtC,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,IAAI,UAAU,CAAC;QACpB,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,EAAE;QACxB,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,EAAE;QACxB,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC;QACvB,GAAG,GAAG,UAAU;KACjB,CAAC,CAAC;AACL,CAAC;AAPD,gCAOC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.d.ts b/server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.d.ts new file mode 100644 index 0000000000..fea6607538 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.d.ts @@ -0,0 +1 @@ +export declare function uint32ArrayFrom(a_lookUpTable: Array): Uint32Array; diff --git a/server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js b/server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js new file mode 100644 index 0000000000..226cdc3d8e --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js @@ -0,0 +1,20 @@ +"use strict"; +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.uint32ArrayFrom = void 0; +// IE 11 does not support Array.from, so we do it manually +function uint32ArrayFrom(a_lookUpTable) { + if (!Uint32Array.from) { + var return_array = new Uint32Array(a_lookUpTable.length); + var a_index = 0; + while (a_index < a_lookUpTable.length) { + return_array[a_index] = a_lookUpTable[a_index]; + a_index += 1; + } + return return_array; + } + return Uint32Array.from(a_lookUpTable); +} +exports.uint32ArrayFrom = uint32ArrayFrom; +//# sourceMappingURL=uint32ArrayFrom.js.map \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js.map b/server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js.map new file mode 100644 index 0000000000..440ef697c7 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uint32ArrayFrom.js","sourceRoot":"","sources":["../src/uint32ArrayFrom.ts"],"names":[],"mappings":";AAAA,oEAAoE;AACpE,sCAAsC;;;AAEtC,0DAA0D;AAC1D,SAAgB,eAAe,CAAC,aAA4B;IAC1D,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE;QACrB,IAAM,YAAY,GAAG,IAAI,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAC1D,IAAI,OAAO,GAAG,CAAC,CAAA;QACf,OAAO,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE;YACrC,YAAY,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;YAC9C,OAAO,IAAI,CAAC,CAAA;SACb;QACD,OAAO,YAAY,CAAA;KACpB;IACD,OAAO,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;AACxC,CAAC;AAXD,0CAWC"} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/CopyrightNotice.txt b/server/node_modules/@aws-crypto/util/node_modules/tslib/CopyrightNotice.txt new file mode 100644 index 0000000000..3d4c82348e --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/LICENSE.txt b/server/node_modules/@aws-crypto/util/node_modules/tslib/LICENSE.txt new file mode 100644 index 0000000000..bfe6430cb0 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/README.md b/server/node_modules/@aws-crypto/util/node_modules/tslib/README.md new file mode 100644 index 0000000000..a5b2692c8a --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/README.md @@ -0,0 +1,142 @@ +# tslib + +This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. + +This library is primarily used by the `--importHelpers` flag in TypeScript. +When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: + +```ts +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +exports.x = {}; +exports.y = __assign({}, exports.x); + +``` + +will instead be emitted as something like the following: + +```ts +var tslib_1 = require("tslib"); +exports.x = {}; +exports.y = tslib_1.__assign({}, exports.x); +``` + +Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. +For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. + +# Installing + +For the latest stable version, run: + +## npm + +```sh +# TypeScript 2.3.3 or later +npm install tslib + +# TypeScript 2.3.2 or earlier +npm install tslib@1.6.1 +``` + +## yarn + +```sh +# TypeScript 2.3.3 or later +yarn add tslib + +# TypeScript 2.3.2 or earlier +yarn add tslib@1.6.1 +``` + +## bower + +```sh +# TypeScript 2.3.3 or later +bower install tslib + +# TypeScript 2.3.2 or earlier +bower install tslib@1.6.1 +``` + +## JSPM + +```sh +# TypeScript 2.3.3 or later +jspm install tslib + +# TypeScript 2.3.2 or earlier +jspm install tslib@1.6.1 +``` + +# Usage + +Set the `importHelpers` compiler option on the command line: + +``` +tsc --importHelpers file.ts +``` + +or in your tsconfig.json: + +```json +{ + "compilerOptions": { + "importHelpers": true + } +} +``` + +#### For bower and JSPM users + +You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: + +```json +{ + "compilerOptions": { + "module": "amd", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["bower_components/tslib/tslib.d.ts"] + } + } +} +``` + +For JSPM users: + +```json +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@1.[version].0/tslib.d.ts"] + } + } +} +``` + + +# Contribute + +There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. + +* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +# Documentation + +* [Quick tutorial](http://www.typescriptlang.org/Tutorial) +* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Homepage](http://www.typescriptlang.org/) diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/modules/index.js b/server/node_modules/@aws-crypto/util/node_modules/tslib/modules/index.js new file mode 100644 index 0000000000..d241d04222 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/modules/index.js @@ -0,0 +1,51 @@ +import tslib from '../tslib.js'; +const { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +} = tslib; +export { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, +}; diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/modules/package.json b/server/node_modules/@aws-crypto/util/node_modules/tslib/modules/package.json new file mode 100644 index 0000000000..aafa0e4b45 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/modules/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/package.json b/server/node_modules/@aws-crypto/util/node_modules/tslib/package.json new file mode 100644 index 0000000000..f8c2a53d0f --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/package.json @@ -0,0 +1,37 @@ +{ + "name": "tslib", + "author": "Microsoft Corp.", + "homepage": "https://www.typescriptlang.org/", + "version": "1.14.1", + "license": "0BSD", + "description": "Runtime library for TypeScript helper functions", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript", + "tslib", + "runtime" + ], + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/tslib.git" + }, + "main": "tslib.js", + "module": "tslib.es6.js", + "jsnext:main": "tslib.es6.js", + "typings": "tslib.d.ts", + "sideEffects": false, + "exports": { + ".": { + "module": "./tslib.es6.js", + "import": "./modules/index.js", + "default": "./tslib.js" + }, + "./": "./" + } +} diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js b/server/node_modules/@aws-crypto/util/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js new file mode 100644 index 0000000000..0c1b613d8b --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js @@ -0,0 +1,23 @@ +// When on node 14, it validates that all of the commonjs exports +// are correctly re-exported for es modules importers. + +const nodeMajor = Number(process.version.split(".")[0].slice(1)) +if (nodeMajor < 14) { + console.log("Skipping because node does not support module exports.") + process.exit(0) +} + +// ES Modules import via the ./modules folder +import * as esTSLib from "../../modules/index.js" + +// Force a commonjs resolve +import { createRequire } from "module"; +const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js"); + +for (const key in commonJSTSLib) { + if (commonJSTSLib.hasOwnProperty(key)) { + if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`) + } +} + +console.log("All exports in commonjs are available for es module consumers.") diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json b/server/node_modules/@aws-crypto/util/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json new file mode 100644 index 0000000000..166e5095e4 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json @@ -0,0 +1,6 @@ +{ + "type": "module", + "scripts": { + "test": "node index.js" + } +} diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.d.ts b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.d.ts new file mode 100644 index 0000000000..0756b28e76 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.d.ts @@ -0,0 +1,37 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +export declare function __generator(thisArg: any, body: Function): any; +export declare function __exportStar(m: any, exports: any): void; +export declare function __values(o: any): any; +export declare function __read(o: any, n?: number): any[]; +export declare function __spread(...args: any[][]): any[]; +export declare function __spreadArrays(...args: any[][]): any[]; +export declare function __await(v: any): any; +export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; +export declare function __asyncDelegator(o: any): any; +export declare function __asyncValues(o: any): any; +export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; +export declare function __importStar(mod: T): T; +export declare function __importDefault(mod: T): T | { default: T }; +export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; +export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; +export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.es6.html b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.es6.html new file mode 100644 index 0000000000..b122e41b06 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.es6.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.es6.js b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.es6.js new file mode 100644 index 0000000000..0e0d8d079c --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.es6.js @@ -0,0 +1,218 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + +export function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +export function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +export function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +export function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.html b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.html new file mode 100644 index 0000000000..44c9ba51e3 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.js b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.js new file mode 100644 index 0000000000..e5b7c9b809 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/node_modules/tslib/tslib.js @@ -0,0 +1,284 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __createBinding = function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }; + + __exportStar = function (m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; + }; + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); diff --git a/server/node_modules/@aws-crypto/util/package.json b/server/node_modules/@aws-crypto/util/package.json new file mode 100644 index 0000000000..24dfd3a516 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/package.json @@ -0,0 +1,31 @@ +{ + "name": "@aws-crypto/util", + "version": "3.0.0", + "scripts": { + "prepublishOnly": "tsc", + "pretest": "tsc -p tsconfig.test.json", + "test": "mocha --require ts-node/register test/**/*test.ts" + }, + "main": "./build/index.js", + "types": "./build/index.d.ts", + "repository": { + "type": "git", + "url": "git@github.com:aws/aws-sdk-js-crypto-helpers.git" + }, + "author": { + "name": "AWS Crypto Tools Team", + "email": "aws-cryptools@amazon.com", + "url": "https://docs.aws.amazon.com/aws-crypto-tools/index.html?id=docs_gateway#lang/en_us" + }, + "homepage": "https://github.com/aws/aws-sdk-js-crypto-helpers/tree/master/packages/util", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "7f56cee8f62bd65cd397eeec29c3c997215bd80c" +} diff --git a/server/node_modules/@aws-crypto/util/src/convertToBuffer.ts b/server/node_modules/@aws-crypto/util/src/convertToBuffer.ts new file mode 100644 index 0000000000..3cda0fce6b --- /dev/null +++ b/server/node_modules/@aws-crypto/util/src/convertToBuffer.ts @@ -0,0 +1,30 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { SourceData } from "@aws-sdk/types"; +import { fromUtf8 as fromUtf8Browser } from "@aws-sdk/util-utf8-browser"; + +// Quick polyfill +const fromUtf8 = + typeof Buffer !== "undefined" && Buffer.from + ? (input: string) => Buffer.from(input, "utf8") + : fromUtf8Browser; + +export function convertToBuffer(data: SourceData): Uint8Array { + // Already a Uint8, do nothing + if (data instanceof Uint8Array) return data; + + if (typeof data === "string") { + return fromUtf8(data); + } + + if (ArrayBuffer.isView(data)) { + return new Uint8Array( + data.buffer, + data.byteOffset, + data.byteLength / Uint8Array.BYTES_PER_ELEMENT + ); + } + + return new Uint8Array(data); +} diff --git a/server/node_modules/@aws-crypto/util/src/index.ts b/server/node_modules/@aws-crypto/util/src/index.ts new file mode 100644 index 0000000000..2f6c62a758 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/src/index.ts @@ -0,0 +1,7 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +export { convertToBuffer } from "./convertToBuffer"; +export { isEmptyData } from "./isEmptyData"; +export { numToUint8 } from "./numToUint8"; +export {uint32ArrayFrom} from './uint32ArrayFrom'; diff --git a/server/node_modules/@aws-crypto/util/src/isEmptyData.ts b/server/node_modules/@aws-crypto/util/src/isEmptyData.ts new file mode 100644 index 0000000000..089764de9b --- /dev/null +++ b/server/node_modules/@aws-crypto/util/src/isEmptyData.ts @@ -0,0 +1,12 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { SourceData } from "@aws-sdk/types"; + +export function isEmptyData(data: SourceData): boolean { + if (typeof data === "string") { + return data.length === 0; + } + + return data.byteLength === 0; +} diff --git a/server/node_modules/@aws-crypto/util/src/numToUint8.ts b/server/node_modules/@aws-crypto/util/src/numToUint8.ts new file mode 100644 index 0000000000..2f40aceb17 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/src/numToUint8.ts @@ -0,0 +1,11 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +export function numToUint8(num: number) { + return new Uint8Array([ + (num & 0xff000000) >> 24, + (num & 0x00ff0000) >> 16, + (num & 0x0000ff00) >> 8, + num & 0x000000ff, + ]); +} diff --git a/server/node_modules/@aws-crypto/util/src/uint32ArrayFrom.ts b/server/node_modules/@aws-crypto/util/src/uint32ArrayFrom.ts new file mode 100644 index 0000000000..b9b6d88799 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/src/uint32ArrayFrom.ts @@ -0,0 +1,16 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// IE 11 does not support Array.from, so we do it manually +export function uint32ArrayFrom(a_lookUpTable: Array): Uint32Array { + if (!Uint32Array.from) { + const return_array = new Uint32Array(a_lookUpTable.length) + let a_index = 0 + while (a_index < a_lookUpTable.length) { + return_array[a_index] = a_lookUpTable[a_index] + a_index += 1 + } + return return_array + } + return Uint32Array.from(a_lookUpTable) +} diff --git a/server/node_modules/@aws-crypto/util/tsconfig.json b/server/node_modules/@aws-crypto/util/tsconfig.json new file mode 100644 index 0000000000..1691089a74 --- /dev/null +++ b/server/node_modules/@aws-crypto/util/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "declaration": true, + "strict": true, + "sourceMap": true, + "downlevelIteration": true, + "importHelpers": true, + "noEmitHelpers": true, + "lib": [ + "es5", + "es2015.promise", + "es2015.collection", + "es2015.iterable", + "es2015.symbol.wellknown" + ], + "rootDir": "./src", + "outDir": "./build" + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules/**"] +} diff --git a/server/node_modules/@aws-sdk/abort-controller/LICENSE b/server/node_modules/@aws-sdk/abort-controller/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/abort-controller/README.md b/server/node_modules/@aws-sdk/abort-controller/README.md new file mode 100644 index 0000000000..409443b633 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/abort-controller + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/abort-controller/latest.svg)](https://www.npmjs.com/package/@aws-sdk/abort-controller) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/abort-controller.svg)](https://www.npmjs.com/package/@aws-sdk/abort-controller) diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-cjs/AbortController.js b/server/node_modules/@aws-sdk/abort-controller/dist-cjs/AbortController.js new file mode 100644 index 0000000000..4c28738218 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-cjs/AbortController.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AbortController = void 0; +const AbortSignal_1 = require("./AbortSignal"); +class AbortController { + constructor() { + this.signal = new AbortSignal_1.AbortSignal(); + } + abort() { + this.signal.abort(); + } +} +exports.AbortController = AbortController; diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-cjs/AbortSignal.js b/server/node_modules/@aws-sdk/abort-controller/dist-cjs/AbortSignal.js new file mode 100644 index 0000000000..9954b7800f --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-cjs/AbortSignal.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AbortSignal = void 0; +class AbortSignal { + constructor() { + this.onabort = null; + this._aborted = false; + Object.defineProperty(this, "_aborted", { + value: false, + writable: true, + }); + } + get aborted() { + return this._aborted; + } + abort() { + this._aborted = true; + if (this.onabort) { + this.onabort(this); + this.onabort = null; + } + } +} +exports.AbortSignal = AbortSignal; diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-cjs/index.js b/server/node_modules/@aws-sdk/abort-controller/dist-cjs/index.js new file mode 100644 index 0000000000..1d31310df8 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-cjs/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./AbortController"), exports); +tslib_1.__exportStar(require("./AbortSignal"), exports); diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-es/AbortController.js b/server/node_modules/@aws-sdk/abort-controller/dist-es/AbortController.js new file mode 100644 index 0000000000..696f1371e4 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-es/AbortController.js @@ -0,0 +1,9 @@ +import { AbortSignal } from "./AbortSignal"; +export class AbortController { + constructor() { + this.signal = new AbortSignal(); + } + abort() { + this.signal.abort(); + } +} diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-es/AbortSignal.js b/server/node_modules/@aws-sdk/abort-controller/dist-es/AbortSignal.js new file mode 100644 index 0000000000..9fc08134af --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-es/AbortSignal.js @@ -0,0 +1,20 @@ +export class AbortSignal { + constructor() { + this.onabort = null; + this._aborted = false; + Object.defineProperty(this, "_aborted", { + value: false, + writable: true, + }); + } + get aborted() { + return this._aborted; + } + abort() { + this._aborted = true; + if (this.onabort) { + this.onabort(this); + this.onabort = null; + } + } +} diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-es/index.js b/server/node_modules/@aws-sdk/abort-controller/dist-es/index.js new file mode 100644 index 0000000000..a0f47f7283 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-es/index.js @@ -0,0 +1,2 @@ +export * from "./AbortController"; +export * from "./AbortSignal"; diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-types/AbortController.d.ts b/server/node_modules/@aws-sdk/abort-controller/dist-types/AbortController.d.ts new file mode 100644 index 0000000000..dec5dc264b --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-types/AbortController.d.ts @@ -0,0 +1,6 @@ +import { AbortController as IAbortController } from "@aws-sdk/types"; +import { AbortSignal } from "./AbortSignal"; +export declare class AbortController implements IAbortController { + readonly signal: AbortSignal; + abort(): void; +} diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-types/AbortSignal.d.ts b/server/node_modules/@aws-sdk/abort-controller/dist-types/AbortSignal.d.ts new file mode 100644 index 0000000000..5326bc4381 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-types/AbortSignal.d.ts @@ -0,0 +1,14 @@ +import { AbortHandler, AbortSignal as IAbortSignal } from "@aws-sdk/types"; +export declare class AbortSignal implements IAbortSignal { + onabort: AbortHandler | null; + private _aborted; + constructor(); + /** + * Whether the associated operation has already been cancelled. + */ + get aborted(): boolean; + /** + * @internal + */ + abort(): void; +} diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-types/index.d.ts b/server/node_modules/@aws-sdk/abort-controller/dist-types/index.d.ts new file mode 100644 index 0000000000..a0f47f7283 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-types/index.d.ts @@ -0,0 +1,2 @@ +export * from "./AbortController"; +export * from "./AbortSignal"; diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/AbortController.d.ts b/server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/AbortController.d.ts new file mode 100644 index 0000000000..64870df873 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/AbortController.d.ts @@ -0,0 +1,6 @@ +import { AbortController as IAbortController } from "@aws-sdk/types"; +import { AbortSignal } from "./AbortSignal"; +export declare class AbortController implements IAbortController { + readonly signal: AbortSignal; + abort(): void; +} diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/AbortSignal.d.ts b/server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/AbortSignal.d.ts new file mode 100644 index 0000000000..af7bd200c4 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/AbortSignal.d.ts @@ -0,0 +1,8 @@ +import { AbortHandler, AbortSignal as IAbortSignal } from "@aws-sdk/types"; +export declare class AbortSignal implements IAbortSignal { + onabort: AbortHandler | null; + private _aborted; + constructor(); + readonly aborted: boolean; + abort(): void; +} diff --git a/server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..a0f47f7283 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export * from "./AbortController"; +export * from "./AbortSignal"; diff --git a/server/node_modules/@aws-sdk/abort-controller/package.json b/server/node_modules/@aws-sdk/abort-controller/package.json new file mode 100644 index 0000000000..d2f2db2fc9 --- /dev/null +++ b/server/node_modules/@aws-sdk/abort-controller/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/abort-controller", + "version": "3.257.0", + "description": "A simple abort controller library", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/abort-controller", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/abort-controller" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/LICENSE b/server/node_modules/@aws-sdk/client-cognito-identity/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/README.md b/server/node_modules/@aws-sdk/client-cognito-identity/README.md new file mode 100644 index 0000000000..a041c9167c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/README.md @@ -0,0 +1,219 @@ + + +# @aws-sdk/client-cognito-identity + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cognito-identity/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cognito-identity) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cognito-identity.svg)](https://www.npmjs.com/package/@aws-sdk/client-cognito-identity) + +## Description + +AWS SDK for JavaScript CognitoIdentity Client for Node.js, Browser and React Native. + +Amazon Cognito Federated Identities + +

Amazon Cognito Federated Identities is a web service that delivers scoped temporary +credentials to mobile devices and other untrusted environments. It uniquely identifies a +device and supplies the user with a consistent identity over the lifetime of an +application.

+

Using Amazon Cognito Federated Identities, you can enable authentication with one or +more third-party identity providers (Facebook, Google, or Login with Amazon) or an Amazon +Cognito user pool, and you can also choose to support unauthenticated access from your app. +Cognito delivers a unique identifier for each user and acts as an OpenID token provider +trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS +credentials.

+

For a description of the authentication flow from the Amazon Cognito Developer Guide +see Authentication Flow.

+

For more information see Amazon Cognito Federated Identities.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cognito-identity +using your favorite package manager: + +- `npm install @aws-sdk/client-cognito-identity` +- `yarn add @aws-sdk/client-cognito-identity` +- `pnpm add @aws-sdk/client-cognito-identity` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CognitoIdentityClient` and +the commands you need, for example `CreateIdentityPoolCommand`: + +```js +// ES5 example +const { CognitoIdentityClient, CreateIdentityPoolCommand } = require("@aws-sdk/client-cognito-identity"); +``` + +```ts +// ES6+ example +import { CognitoIdentityClient, CreateIdentityPoolCommand } from "@aws-sdk/client-cognito-identity"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new CognitoIdentityClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateIdentityPoolCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cognito-identity"; +const client = new AWS.CognitoIdentity({ region: "REGION" }); + +// async/await. +try { + const data = await client.createIdentityPool(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createIdentityPool(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createIdentityPool(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cognito-identity` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentity.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentity.js new file mode 100644 index 0000000000..80ff132ade --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentity.js @@ -0,0 +1,352 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CognitoIdentity = void 0; +const CognitoIdentityClient_1 = require("./CognitoIdentityClient"); +const CreateIdentityPoolCommand_1 = require("./commands/CreateIdentityPoolCommand"); +const DeleteIdentitiesCommand_1 = require("./commands/DeleteIdentitiesCommand"); +const DeleteIdentityPoolCommand_1 = require("./commands/DeleteIdentityPoolCommand"); +const DescribeIdentityCommand_1 = require("./commands/DescribeIdentityCommand"); +const DescribeIdentityPoolCommand_1 = require("./commands/DescribeIdentityPoolCommand"); +const GetCredentialsForIdentityCommand_1 = require("./commands/GetCredentialsForIdentityCommand"); +const GetIdCommand_1 = require("./commands/GetIdCommand"); +const GetIdentityPoolRolesCommand_1 = require("./commands/GetIdentityPoolRolesCommand"); +const GetOpenIdTokenCommand_1 = require("./commands/GetOpenIdTokenCommand"); +const GetOpenIdTokenForDeveloperIdentityCommand_1 = require("./commands/GetOpenIdTokenForDeveloperIdentityCommand"); +const GetPrincipalTagAttributeMapCommand_1 = require("./commands/GetPrincipalTagAttributeMapCommand"); +const ListIdentitiesCommand_1 = require("./commands/ListIdentitiesCommand"); +const ListIdentityPoolsCommand_1 = require("./commands/ListIdentityPoolsCommand"); +const ListTagsForResourceCommand_1 = require("./commands/ListTagsForResourceCommand"); +const LookupDeveloperIdentityCommand_1 = require("./commands/LookupDeveloperIdentityCommand"); +const MergeDeveloperIdentitiesCommand_1 = require("./commands/MergeDeveloperIdentitiesCommand"); +const SetIdentityPoolRolesCommand_1 = require("./commands/SetIdentityPoolRolesCommand"); +const SetPrincipalTagAttributeMapCommand_1 = require("./commands/SetPrincipalTagAttributeMapCommand"); +const TagResourceCommand_1 = require("./commands/TagResourceCommand"); +const UnlinkDeveloperIdentityCommand_1 = require("./commands/UnlinkDeveloperIdentityCommand"); +const UnlinkIdentityCommand_1 = require("./commands/UnlinkIdentityCommand"); +const UntagResourceCommand_1 = require("./commands/UntagResourceCommand"); +const UpdateIdentityPoolCommand_1 = require("./commands/UpdateIdentityPoolCommand"); +class CognitoIdentity extends CognitoIdentityClient_1.CognitoIdentityClient { + createIdentityPool(args, optionsOrCb, cb) { + const command = new CreateIdentityPoolCommand_1.CreateIdentityPoolCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + deleteIdentities(args, optionsOrCb, cb) { + const command = new DeleteIdentitiesCommand_1.DeleteIdentitiesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + deleteIdentityPool(args, optionsOrCb, cb) { + const command = new DeleteIdentityPoolCommand_1.DeleteIdentityPoolCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + describeIdentity(args, optionsOrCb, cb) { + const command = new DescribeIdentityCommand_1.DescribeIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + describeIdentityPool(args, optionsOrCb, cb) { + const command = new DescribeIdentityPoolCommand_1.DescribeIdentityPoolCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getCredentialsForIdentity(args, optionsOrCb, cb) { + const command = new GetCredentialsForIdentityCommand_1.GetCredentialsForIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getId(args, optionsOrCb, cb) { + const command = new GetIdCommand_1.GetIdCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getIdentityPoolRoles(args, optionsOrCb, cb) { + const command = new GetIdentityPoolRolesCommand_1.GetIdentityPoolRolesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getOpenIdToken(args, optionsOrCb, cb) { + const command = new GetOpenIdTokenCommand_1.GetOpenIdTokenCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getOpenIdTokenForDeveloperIdentity(args, optionsOrCb, cb) { + const command = new GetOpenIdTokenForDeveloperIdentityCommand_1.GetOpenIdTokenForDeveloperIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getPrincipalTagAttributeMap(args, optionsOrCb, cb) { + const command = new GetPrincipalTagAttributeMapCommand_1.GetPrincipalTagAttributeMapCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listIdentities(args, optionsOrCb, cb) { + const command = new ListIdentitiesCommand_1.ListIdentitiesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listIdentityPools(args, optionsOrCb, cb) { + const command = new ListIdentityPoolsCommand_1.ListIdentityPoolsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listTagsForResource(args, optionsOrCb, cb) { + const command = new ListTagsForResourceCommand_1.ListTagsForResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + lookupDeveloperIdentity(args, optionsOrCb, cb) { + const command = new LookupDeveloperIdentityCommand_1.LookupDeveloperIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + mergeDeveloperIdentities(args, optionsOrCb, cb) { + const command = new MergeDeveloperIdentitiesCommand_1.MergeDeveloperIdentitiesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + setIdentityPoolRoles(args, optionsOrCb, cb) { + const command = new SetIdentityPoolRolesCommand_1.SetIdentityPoolRolesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + setPrincipalTagAttributeMap(args, optionsOrCb, cb) { + const command = new SetPrincipalTagAttributeMapCommand_1.SetPrincipalTagAttributeMapCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + tagResource(args, optionsOrCb, cb) { + const command = new TagResourceCommand_1.TagResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + unlinkDeveloperIdentity(args, optionsOrCb, cb) { + const command = new UnlinkDeveloperIdentityCommand_1.UnlinkDeveloperIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + unlinkIdentity(args, optionsOrCb, cb) { + const command = new UnlinkIdentityCommand_1.UnlinkIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + untagResource(args, optionsOrCb, cb) { + const command = new UntagResourceCommand_1.UntagResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + updateIdentityPool(args, optionsOrCb, cb) { + const command = new UpdateIdentityPoolCommand_1.UpdateIdentityPoolCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } +} +exports.CognitoIdentity = CognitoIdentity; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentityClient.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentityClient.js new file mode 100644 index 0000000000..1f5c1eb412 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentityClient.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CognitoIdentityClient = void 0; +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const middleware_content_length_1 = require("@aws-sdk/middleware-content-length"); +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_host_header_1 = require("@aws-sdk/middleware-host-header"); +const middleware_logger_1 = require("@aws-sdk/middleware-logger"); +const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection"); +const middleware_retry_1 = require("@aws-sdk/middleware-retry"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const EndpointParameters_1 = require("./endpoint/EndpointParameters"); +const runtimeConfig_1 = require("./runtimeConfig"); +class CognitoIdentityClient extends smithy_client_1.Client { + constructor(configuration) { + const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration); + const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); + const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); + const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); + const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); + const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, middleware_signing_1.resolveAwsAuthConfig)(_config_5); + const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6); + super(_config_7); + this.config = _config_7; + this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); + } + destroy() { + super.destroy(); + } +} +exports.CognitoIdentityClient = CognitoIdentityClient; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/CreateIdentityPoolCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/CreateIdentityPoolCommand.js new file mode 100644 index 0000000000..cd9e2369d6 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/CreateIdentityPoolCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CreateIdentityPoolCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class CreateIdentityPoolCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CreateIdentityPoolCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "CreateIdentityPoolCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.CreateIdentityPoolInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.IdentityPoolFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1CreateIdentityPoolCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1CreateIdentityPoolCommand)(output, context); + } +} +exports.CreateIdentityPoolCommand = CreateIdentityPoolCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentitiesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentitiesCommand.js new file mode 100644 index 0000000000..8fc971db16 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentitiesCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeleteIdentitiesCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class DeleteIdentitiesCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteIdentitiesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "DeleteIdentitiesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.DeleteIdentitiesInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.DeleteIdentitiesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1DeleteIdentitiesCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1DeleteIdentitiesCommand)(output, context); + } +} +exports.DeleteIdentitiesCommand = DeleteIdentitiesCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentityPoolCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentityPoolCommand.js new file mode 100644 index 0000000000..05447d84f0 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentityPoolCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeleteIdentityPoolCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class DeleteIdentityPoolCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DeleteIdentityPoolCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "DeleteIdentityPoolCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.DeleteIdentityPoolInputFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1DeleteIdentityPoolCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1DeleteIdentityPoolCommand)(output, context); + } +} +exports.DeleteIdentityPoolCommand = DeleteIdentityPoolCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityCommand.js new file mode 100644 index 0000000000..7910b266c5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DescribeIdentityCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class DescribeIdentityCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "DescribeIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.DescribeIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.IdentityDescriptionFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1DescribeIdentityCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1DescribeIdentityCommand)(output, context); + } +} +exports.DescribeIdentityCommand = DescribeIdentityCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityPoolCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityPoolCommand.js new file mode 100644 index 0000000000..5326612bff --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityPoolCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DescribeIdentityPoolCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class DescribeIdentityPoolCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DescribeIdentityPoolCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "DescribeIdentityPoolCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.DescribeIdentityPoolInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.IdentityPoolFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1DescribeIdentityPoolCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1DescribeIdentityPoolCommand)(output, context); + } +} +exports.DescribeIdentityPoolCommand = DescribeIdentityPoolCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetCredentialsForIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetCredentialsForIdentityCommand.js new file mode 100644 index 0000000000..da3dec2582 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetCredentialsForIdentityCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetCredentialsForIdentityCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class GetCredentialsForIdentityCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetCredentialsForIdentityCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetCredentialsForIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetCredentialsForIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetCredentialsForIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1GetCredentialsForIdentityCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1GetCredentialsForIdentityCommand)(output, context); + } +} +exports.GetCredentialsForIdentityCommand = GetCredentialsForIdentityCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdCommand.js new file mode 100644 index 0000000000..9a9294a155 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetIdCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class GetIdCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetIdCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetIdCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetIdInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetIdResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1GetIdCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1GetIdCommand)(output, context); + } +} +exports.GetIdCommand = GetIdCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdentityPoolRolesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdentityPoolRolesCommand.js new file mode 100644 index 0000000000..3ef34187c1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdentityPoolRolesCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetIdentityPoolRolesCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class GetIdentityPoolRolesCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetIdentityPoolRolesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetIdentityPoolRolesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetIdentityPoolRolesInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetIdentityPoolRolesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1GetIdentityPoolRolesCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1GetIdentityPoolRolesCommand)(output, context); + } +} +exports.GetIdentityPoolRolesCommand = GetIdentityPoolRolesCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenCommand.js new file mode 100644 index 0000000000..c27703b209 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetOpenIdTokenCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class GetOpenIdTokenCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetOpenIdTokenCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetOpenIdTokenCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetOpenIdTokenInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetOpenIdTokenResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1GetOpenIdTokenCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1GetOpenIdTokenCommand)(output, context); + } +} +exports.GetOpenIdTokenCommand = GetOpenIdTokenCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenForDeveloperIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenForDeveloperIdentityCommand.js new file mode 100644 index 0000000000..2a499698fe --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenForDeveloperIdentityCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetOpenIdTokenForDeveloperIdentityCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class GetOpenIdTokenForDeveloperIdentityCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetOpenIdTokenForDeveloperIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetOpenIdTokenForDeveloperIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand)(output, context); + } +} +exports.GetOpenIdTokenForDeveloperIdentityCommand = GetOpenIdTokenForDeveloperIdentityCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetPrincipalTagAttributeMapCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetPrincipalTagAttributeMapCommand.js new file mode 100644 index 0000000000..05ca06fb46 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetPrincipalTagAttributeMapCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetPrincipalTagAttributeMapCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class GetPrincipalTagAttributeMapCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetPrincipalTagAttributeMapCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetPrincipalTagAttributeMapCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetPrincipalTagAttributeMapInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetPrincipalTagAttributeMapResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1GetPrincipalTagAttributeMapCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1GetPrincipalTagAttributeMapCommand)(output, context); + } +} +exports.GetPrincipalTagAttributeMapCommand = GetPrincipalTagAttributeMapCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentitiesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentitiesCommand.js new file mode 100644 index 0000000000..03ff12565d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentitiesCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListIdentitiesCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class ListIdentitiesCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListIdentitiesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "ListIdentitiesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.ListIdentitiesInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.ListIdentitiesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1ListIdentitiesCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1ListIdentitiesCommand)(output, context); + } +} +exports.ListIdentitiesCommand = ListIdentitiesCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentityPoolsCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentityPoolsCommand.js new file mode 100644 index 0000000000..b64da2e5ff --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentityPoolsCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListIdentityPoolsCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class ListIdentityPoolsCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListIdentityPoolsCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "ListIdentityPoolsCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.ListIdentityPoolsInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.ListIdentityPoolsResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1ListIdentityPoolsCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1ListIdentityPoolsCommand)(output, context); + } +} +exports.ListIdentityPoolsCommand = ListIdentityPoolsCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListTagsForResourceCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListTagsForResourceCommand.js new file mode 100644 index 0000000000..ea5d9cbdd7 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListTagsForResourceCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListTagsForResourceCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class ListTagsForResourceCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "ListTagsForResourceCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.ListTagsForResourceInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.ListTagsForResourceResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1ListTagsForResourceCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1ListTagsForResourceCommand)(output, context); + } +} +exports.ListTagsForResourceCommand = ListTagsForResourceCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/LookupDeveloperIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/LookupDeveloperIdentityCommand.js new file mode 100644 index 0000000000..9e9cc8214d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/LookupDeveloperIdentityCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LookupDeveloperIdentityCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class LookupDeveloperIdentityCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, LookupDeveloperIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "LookupDeveloperIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.LookupDeveloperIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.LookupDeveloperIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1LookupDeveloperIdentityCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1LookupDeveloperIdentityCommand)(output, context); + } +} +exports.LookupDeveloperIdentityCommand = LookupDeveloperIdentityCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/MergeDeveloperIdentitiesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/MergeDeveloperIdentitiesCommand.js new file mode 100644 index 0000000000..cee695618d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/MergeDeveloperIdentitiesCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MergeDeveloperIdentitiesCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class MergeDeveloperIdentitiesCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, MergeDeveloperIdentitiesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "MergeDeveloperIdentitiesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.MergeDeveloperIdentitiesInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.MergeDeveloperIdentitiesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1MergeDeveloperIdentitiesCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1MergeDeveloperIdentitiesCommand)(output, context); + } +} +exports.MergeDeveloperIdentitiesCommand = MergeDeveloperIdentitiesCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetIdentityPoolRolesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetIdentityPoolRolesCommand.js new file mode 100644 index 0000000000..2c4f7c757f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetIdentityPoolRolesCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SetIdentityPoolRolesCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class SetIdentityPoolRolesCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, SetIdentityPoolRolesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "SetIdentityPoolRolesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.SetIdentityPoolRolesInputFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1SetIdentityPoolRolesCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1SetIdentityPoolRolesCommand)(output, context); + } +} +exports.SetIdentityPoolRolesCommand = SetIdentityPoolRolesCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetPrincipalTagAttributeMapCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetPrincipalTagAttributeMapCommand.js new file mode 100644 index 0000000000..0c3c7f97a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetPrincipalTagAttributeMapCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SetPrincipalTagAttributeMapCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class SetPrincipalTagAttributeMapCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, SetPrincipalTagAttributeMapCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "SetPrincipalTagAttributeMapCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.SetPrincipalTagAttributeMapInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.SetPrincipalTagAttributeMapResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1SetPrincipalTagAttributeMapCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1SetPrincipalTagAttributeMapCommand)(output, context); + } +} +exports.SetPrincipalTagAttributeMapCommand = SetPrincipalTagAttributeMapCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/TagResourceCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/TagResourceCommand.js new file mode 100644 index 0000000000..c36ca1d186 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/TagResourceCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TagResourceCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class TagResourceCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, TagResourceCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "TagResourceCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.TagResourceInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.TagResourceResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1TagResourceCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1TagResourceCommand)(output, context); + } +} +exports.TagResourceCommand = TagResourceCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkDeveloperIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkDeveloperIdentityCommand.js new file mode 100644 index 0000000000..af23b2bb9e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkDeveloperIdentityCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnlinkDeveloperIdentityCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class UnlinkDeveloperIdentityCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UnlinkDeveloperIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "UnlinkDeveloperIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.UnlinkDeveloperIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1UnlinkDeveloperIdentityCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1UnlinkDeveloperIdentityCommand)(output, context); + } +} +exports.UnlinkDeveloperIdentityCommand = UnlinkDeveloperIdentityCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkIdentityCommand.js new file mode 100644 index 0000000000..c1415d4cb9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkIdentityCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnlinkIdentityCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class UnlinkIdentityCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UnlinkIdentityCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "UnlinkIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.UnlinkIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1UnlinkIdentityCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1UnlinkIdentityCommand)(output, context); + } +} +exports.UnlinkIdentityCommand = UnlinkIdentityCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UntagResourceCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UntagResourceCommand.js new file mode 100644 index 0000000000..412dd71bbf --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UntagResourceCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UntagResourceCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class UntagResourceCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UntagResourceCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "UntagResourceCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.UntagResourceInputFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.UntagResourceResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1UntagResourceCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1UntagResourceCommand)(output, context); + } +} +exports.UntagResourceCommand = UntagResourceCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UpdateIdentityPoolCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UpdateIdentityPoolCommand.js new file mode 100644 index 0000000000..3ca02ab9f3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UpdateIdentityPoolCommand.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UpdateIdentityPoolCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_json1_1_1 = require("../protocols/Aws_json1_1"); +class UpdateIdentityPoolCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UpdateIdentityPoolCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "UpdateIdentityPoolCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.IdentityPoolFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.IdentityPoolFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_json1_1_1.serializeAws_json1_1UpdateIdentityPoolCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_json1_1_1.deserializeAws_json1_1UpdateIdentityPoolCommand)(output, context); + } +} +exports.UpdateIdentityPoolCommand = UpdateIdentityPoolCommand; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/index.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/index.js new file mode 100644 index 0000000000..66cf4e3daa --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./CreateIdentityPoolCommand"), exports); +tslib_1.__exportStar(require("./DeleteIdentitiesCommand"), exports); +tslib_1.__exportStar(require("./DeleteIdentityPoolCommand"), exports); +tslib_1.__exportStar(require("./DescribeIdentityCommand"), exports); +tslib_1.__exportStar(require("./DescribeIdentityPoolCommand"), exports); +tslib_1.__exportStar(require("./GetCredentialsForIdentityCommand"), exports); +tslib_1.__exportStar(require("./GetIdCommand"), exports); +tslib_1.__exportStar(require("./GetIdentityPoolRolesCommand"), exports); +tslib_1.__exportStar(require("./GetOpenIdTokenCommand"), exports); +tslib_1.__exportStar(require("./GetOpenIdTokenForDeveloperIdentityCommand"), exports); +tslib_1.__exportStar(require("./GetPrincipalTagAttributeMapCommand"), exports); +tslib_1.__exportStar(require("./ListIdentitiesCommand"), exports); +tslib_1.__exportStar(require("./ListIdentityPoolsCommand"), exports); +tslib_1.__exportStar(require("./ListTagsForResourceCommand"), exports); +tslib_1.__exportStar(require("./LookupDeveloperIdentityCommand"), exports); +tslib_1.__exportStar(require("./MergeDeveloperIdentitiesCommand"), exports); +tslib_1.__exportStar(require("./SetIdentityPoolRolesCommand"), exports); +tslib_1.__exportStar(require("./SetPrincipalTagAttributeMapCommand"), exports); +tslib_1.__exportStar(require("./TagResourceCommand"), exports); +tslib_1.__exportStar(require("./UnlinkDeveloperIdentityCommand"), exports); +tslib_1.__exportStar(require("./UnlinkIdentityCommand"), exports); +tslib_1.__exportStar(require("./UntagResourceCommand"), exports); +tslib_1.__exportStar(require("./UpdateIdentityPoolCommand"), exports); diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/EndpointParameters.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/EndpointParameters.js new file mode 100644 index 0000000000..062a61bb5e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/EndpointParameters.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveClientEndpointParameters = void 0; +const resolveClientEndpointParameters = (options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "cognito-identity", + }; +}; +exports.resolveClientEndpointParameters = resolveClientEndpointParameters; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/endpointResolver.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/endpointResolver.js new file mode 100644 index 0000000000..482fab141e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/endpointResolver.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = require("@aws-sdk/util-endpoints"); +const ruleset_1 = require("./ruleset"); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; +exports.defaultEndpointResolver = defaultEndpointResolver; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/ruleset.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/ruleset.js new file mode 100644 index 0000000000..3f6e875a26 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/ruleset.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ruleSet = void 0; +const p = "required", q = "fn", r = "argv", s = "ref"; +const a = "PartitionResult", b = "tree", c = "error", d = "endpoint", e = { [p]: false, "type": "String" }, f = { [p]: true, "default": false, "type": "Boolean" }, g = { [s]: "Endpoint" }, h = { [q]: "booleanEquals", [r]: [{ [s]: "UseFIPS" }, true] }, i = { [q]: "booleanEquals", [r]: [{ [s]: "UseDualStack" }, true] }, j = {}, k = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsFIPS"] }] }, l = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsDualStack"] }] }, m = [g], n = [h], o = [i]; +const _data = { version: "1.0", parameters: { Region: e, UseDualStack: f, UseFIPS: f, Endpoint: e }, rules: [{ conditions: [{ [q]: "aws.partition", [r]: [{ [s]: "Region" }], assign: a }], type: b, rules: [{ conditions: [{ [q]: "isSet", [r]: m }, { [q]: "parseURL", [r]: m, assign: "url" }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: g, properties: j, headers: j }, type: d }] }] }, { conditions: [h, i], type: b, rules: [{ conditions: [k, l], type: b, rules: [{ endpoint: { url: "https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [k], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }; +exports.ruleSet = _data; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/index.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/index.js new file mode 100644 index 0000000000..c705ad82a4 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CognitoIdentityServiceException = void 0; +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./CognitoIdentity"), exports); +tslib_1.__exportStar(require("./CognitoIdentityClient"), exports); +tslib_1.__exportStar(require("./commands"), exports); +tslib_1.__exportStar(require("./models"), exports); +tslib_1.__exportStar(require("./pagination"), exports); +var CognitoIdentityServiceException_1 = require("./models/CognitoIdentityServiceException"); +Object.defineProperty(exports, "CognitoIdentityServiceException", { enumerable: true, get: function () { return CognitoIdentityServiceException_1.CognitoIdentityServiceException; } }); diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/CognitoIdentityServiceException.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/CognitoIdentityServiceException.js new file mode 100644 index 0000000000..9b9e8d5784 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/CognitoIdentityServiceException.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CognitoIdentityServiceException = void 0; +const smithy_client_1 = require("@aws-sdk/smithy-client"); +class CognitoIdentityServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, CognitoIdentityServiceException.prototype); + } +} +exports.CognitoIdentityServiceException = CognitoIdentityServiceException; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/index.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/index.js new file mode 100644 index 0000000000..8ced418bca --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./models_0"), exports); diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/models_0.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/models_0.js new file mode 100644 index 0000000000..c0845f96e2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/models_0.js @@ -0,0 +1,354 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LookupDeveloperIdentityResponseFilterSensitiveLog = exports.LookupDeveloperIdentityInputFilterSensitiveLog = exports.ListTagsForResourceResponseFilterSensitiveLog = exports.ListTagsForResourceInputFilterSensitiveLog = exports.ListIdentityPoolsResponseFilterSensitiveLog = exports.IdentityPoolShortDescriptionFilterSensitiveLog = exports.ListIdentityPoolsInputFilterSensitiveLog = exports.ListIdentitiesResponseFilterSensitiveLog = exports.ListIdentitiesInputFilterSensitiveLog = exports.GetPrincipalTagAttributeMapResponseFilterSensitiveLog = exports.GetPrincipalTagAttributeMapInputFilterSensitiveLog = exports.GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog = exports.GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog = exports.GetOpenIdTokenResponseFilterSensitiveLog = exports.GetOpenIdTokenInputFilterSensitiveLog = exports.GetIdentityPoolRolesResponseFilterSensitiveLog = exports.RoleMappingFilterSensitiveLog = exports.RulesConfigurationTypeFilterSensitiveLog = exports.MappingRuleFilterSensitiveLog = exports.GetIdentityPoolRolesInputFilterSensitiveLog = exports.GetIdResponseFilterSensitiveLog = exports.GetIdInputFilterSensitiveLog = exports.GetCredentialsForIdentityResponseFilterSensitiveLog = exports.CredentialsFilterSensitiveLog = exports.GetCredentialsForIdentityInputFilterSensitiveLog = exports.DescribeIdentityPoolInputFilterSensitiveLog = exports.IdentityDescriptionFilterSensitiveLog = exports.DescribeIdentityInputFilterSensitiveLog = exports.DeleteIdentityPoolInputFilterSensitiveLog = exports.DeleteIdentitiesResponseFilterSensitiveLog = exports.UnprocessedIdentityIdFilterSensitiveLog = exports.DeleteIdentitiesInputFilterSensitiveLog = exports.IdentityPoolFilterSensitiveLog = exports.CreateIdentityPoolInputFilterSensitiveLog = exports.CognitoIdentityProviderFilterSensitiveLog = exports.ConcurrentModificationException = exports.DeveloperUserAlreadyRegisteredException = exports.RoleMappingType = exports.MappingRuleMatchType = exports.InvalidIdentityPoolConfigurationException = exports.ExternalServiceException = exports.ResourceNotFoundException = exports.ErrorCode = exports.TooManyRequestsException = exports.ResourceConflictException = exports.NotAuthorizedException = exports.LimitExceededException = exports.InvalidParameterException = exports.InternalErrorException = exports.AmbiguousRoleResolutionType = void 0; +exports.UntagResourceResponseFilterSensitiveLog = exports.UntagResourceInputFilterSensitiveLog = exports.UnlinkIdentityInputFilterSensitiveLog = exports.UnlinkDeveloperIdentityInputFilterSensitiveLog = exports.TagResourceResponseFilterSensitiveLog = exports.TagResourceInputFilterSensitiveLog = exports.SetPrincipalTagAttributeMapResponseFilterSensitiveLog = exports.SetPrincipalTagAttributeMapInputFilterSensitiveLog = exports.SetIdentityPoolRolesInputFilterSensitiveLog = exports.MergeDeveloperIdentitiesResponseFilterSensitiveLog = exports.MergeDeveloperIdentitiesInputFilterSensitiveLog = void 0; +const CognitoIdentityServiceException_1 = require("./CognitoIdentityServiceException"); +var AmbiguousRoleResolutionType; +(function (AmbiguousRoleResolutionType) { + AmbiguousRoleResolutionType["AUTHENTICATED_ROLE"] = "AuthenticatedRole"; + AmbiguousRoleResolutionType["DENY"] = "Deny"; +})(AmbiguousRoleResolutionType = exports.AmbiguousRoleResolutionType || (exports.AmbiguousRoleResolutionType = {})); +class InternalErrorException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "InternalErrorException", + $fault: "server", + ...opts, + }); + this.name = "InternalErrorException"; + this.$fault = "server"; + Object.setPrototypeOf(this, InternalErrorException.prototype); + } +} +exports.InternalErrorException = InternalErrorException; +class InvalidParameterException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "InvalidParameterException", + $fault: "client", + ...opts, + }); + this.name = "InvalidParameterException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidParameterException.prototype); + } +} +exports.InvalidParameterException = InvalidParameterException; +class LimitExceededException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "LimitExceededException", + $fault: "client", + ...opts, + }); + this.name = "LimitExceededException"; + this.$fault = "client"; + Object.setPrototypeOf(this, LimitExceededException.prototype); + } +} +exports.LimitExceededException = LimitExceededException; +class NotAuthorizedException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "NotAuthorizedException", + $fault: "client", + ...opts, + }); + this.name = "NotAuthorizedException"; + this.$fault = "client"; + Object.setPrototypeOf(this, NotAuthorizedException.prototype); + } +} +exports.NotAuthorizedException = NotAuthorizedException; +class ResourceConflictException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "ResourceConflictException", + $fault: "client", + ...opts, + }); + this.name = "ResourceConflictException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ResourceConflictException.prototype); + } +} +exports.ResourceConflictException = ResourceConflictException; +class TooManyRequestsException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "TooManyRequestsException", + $fault: "client", + ...opts, + }); + this.name = "TooManyRequestsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, TooManyRequestsException.prototype); + } +} +exports.TooManyRequestsException = TooManyRequestsException; +var ErrorCode; +(function (ErrorCode) { + ErrorCode["ACCESS_DENIED"] = "AccessDenied"; + ErrorCode["INTERNAL_SERVER_ERROR"] = "InternalServerError"; +})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {})); +class ResourceNotFoundException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + this.name = "ResourceNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + } +} +exports.ResourceNotFoundException = ResourceNotFoundException; +class ExternalServiceException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "ExternalServiceException", + $fault: "client", + ...opts, + }); + this.name = "ExternalServiceException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ExternalServiceException.prototype); + } +} +exports.ExternalServiceException = ExternalServiceException; +class InvalidIdentityPoolConfigurationException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "InvalidIdentityPoolConfigurationException", + $fault: "client", + ...opts, + }); + this.name = "InvalidIdentityPoolConfigurationException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidIdentityPoolConfigurationException.prototype); + } +} +exports.InvalidIdentityPoolConfigurationException = InvalidIdentityPoolConfigurationException; +var MappingRuleMatchType; +(function (MappingRuleMatchType) { + MappingRuleMatchType["CONTAINS"] = "Contains"; + MappingRuleMatchType["EQUALS"] = "Equals"; + MappingRuleMatchType["NOT_EQUAL"] = "NotEqual"; + MappingRuleMatchType["STARTS_WITH"] = "StartsWith"; +})(MappingRuleMatchType = exports.MappingRuleMatchType || (exports.MappingRuleMatchType = {})); +var RoleMappingType; +(function (RoleMappingType) { + RoleMappingType["RULES"] = "Rules"; + RoleMappingType["TOKEN"] = "Token"; +})(RoleMappingType = exports.RoleMappingType || (exports.RoleMappingType = {})); +class DeveloperUserAlreadyRegisteredException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "DeveloperUserAlreadyRegisteredException", + $fault: "client", + ...opts, + }); + this.name = "DeveloperUserAlreadyRegisteredException"; + this.$fault = "client"; + Object.setPrototypeOf(this, DeveloperUserAlreadyRegisteredException.prototype); + } +} +exports.DeveloperUserAlreadyRegisteredException = DeveloperUserAlreadyRegisteredException; +class ConcurrentModificationException extends CognitoIdentityServiceException_1.CognitoIdentityServiceException { + constructor(opts) { + super({ + name: "ConcurrentModificationException", + $fault: "client", + ...opts, + }); + this.name = "ConcurrentModificationException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ConcurrentModificationException.prototype); + } +} +exports.ConcurrentModificationException = ConcurrentModificationException; +const CognitoIdentityProviderFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.CognitoIdentityProviderFilterSensitiveLog = CognitoIdentityProviderFilterSensitiveLog; +const CreateIdentityPoolInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.CreateIdentityPoolInputFilterSensitiveLog = CreateIdentityPoolInputFilterSensitiveLog; +const IdentityPoolFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.IdentityPoolFilterSensitiveLog = IdentityPoolFilterSensitiveLog; +const DeleteIdentitiesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.DeleteIdentitiesInputFilterSensitiveLog = DeleteIdentitiesInputFilterSensitiveLog; +const UnprocessedIdentityIdFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.UnprocessedIdentityIdFilterSensitiveLog = UnprocessedIdentityIdFilterSensitiveLog; +const DeleteIdentitiesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.DeleteIdentitiesResponseFilterSensitiveLog = DeleteIdentitiesResponseFilterSensitiveLog; +const DeleteIdentityPoolInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.DeleteIdentityPoolInputFilterSensitiveLog = DeleteIdentityPoolInputFilterSensitiveLog; +const DescribeIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.DescribeIdentityInputFilterSensitiveLog = DescribeIdentityInputFilterSensitiveLog; +const IdentityDescriptionFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.IdentityDescriptionFilterSensitiveLog = IdentityDescriptionFilterSensitiveLog; +const DescribeIdentityPoolInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.DescribeIdentityPoolInputFilterSensitiveLog = DescribeIdentityPoolInputFilterSensitiveLog; +const GetCredentialsForIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetCredentialsForIdentityInputFilterSensitiveLog = GetCredentialsForIdentityInputFilterSensitiveLog; +const CredentialsFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.CredentialsFilterSensitiveLog = CredentialsFilterSensitiveLog; +const GetCredentialsForIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetCredentialsForIdentityResponseFilterSensitiveLog = GetCredentialsForIdentityResponseFilterSensitiveLog; +const GetIdInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetIdInputFilterSensitiveLog = GetIdInputFilterSensitiveLog; +const GetIdResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetIdResponseFilterSensitiveLog = GetIdResponseFilterSensitiveLog; +const GetIdentityPoolRolesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetIdentityPoolRolesInputFilterSensitiveLog = GetIdentityPoolRolesInputFilterSensitiveLog; +const MappingRuleFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.MappingRuleFilterSensitiveLog = MappingRuleFilterSensitiveLog; +const RulesConfigurationTypeFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.RulesConfigurationTypeFilterSensitiveLog = RulesConfigurationTypeFilterSensitiveLog; +const RoleMappingFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.RoleMappingFilterSensitiveLog = RoleMappingFilterSensitiveLog; +const GetIdentityPoolRolesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetIdentityPoolRolesResponseFilterSensitiveLog = GetIdentityPoolRolesResponseFilterSensitiveLog; +const GetOpenIdTokenInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetOpenIdTokenInputFilterSensitiveLog = GetOpenIdTokenInputFilterSensitiveLog; +const GetOpenIdTokenResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetOpenIdTokenResponseFilterSensitiveLog = GetOpenIdTokenResponseFilterSensitiveLog; +const GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog = GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog; +const GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog = GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog; +const GetPrincipalTagAttributeMapInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetPrincipalTagAttributeMapInputFilterSensitiveLog = GetPrincipalTagAttributeMapInputFilterSensitiveLog; +const GetPrincipalTagAttributeMapResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetPrincipalTagAttributeMapResponseFilterSensitiveLog = GetPrincipalTagAttributeMapResponseFilterSensitiveLog; +const ListIdentitiesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.ListIdentitiesInputFilterSensitiveLog = ListIdentitiesInputFilterSensitiveLog; +const ListIdentitiesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.ListIdentitiesResponseFilterSensitiveLog = ListIdentitiesResponseFilterSensitiveLog; +const ListIdentityPoolsInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.ListIdentityPoolsInputFilterSensitiveLog = ListIdentityPoolsInputFilterSensitiveLog; +const IdentityPoolShortDescriptionFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.IdentityPoolShortDescriptionFilterSensitiveLog = IdentityPoolShortDescriptionFilterSensitiveLog; +const ListIdentityPoolsResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.ListIdentityPoolsResponseFilterSensitiveLog = ListIdentityPoolsResponseFilterSensitiveLog; +const ListTagsForResourceInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.ListTagsForResourceInputFilterSensitiveLog = ListTagsForResourceInputFilterSensitiveLog; +const ListTagsForResourceResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.ListTagsForResourceResponseFilterSensitiveLog = ListTagsForResourceResponseFilterSensitiveLog; +const LookupDeveloperIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.LookupDeveloperIdentityInputFilterSensitiveLog = LookupDeveloperIdentityInputFilterSensitiveLog; +const LookupDeveloperIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.LookupDeveloperIdentityResponseFilterSensitiveLog = LookupDeveloperIdentityResponseFilterSensitiveLog; +const MergeDeveloperIdentitiesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.MergeDeveloperIdentitiesInputFilterSensitiveLog = MergeDeveloperIdentitiesInputFilterSensitiveLog; +const MergeDeveloperIdentitiesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.MergeDeveloperIdentitiesResponseFilterSensitiveLog = MergeDeveloperIdentitiesResponseFilterSensitiveLog; +const SetIdentityPoolRolesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.SetIdentityPoolRolesInputFilterSensitiveLog = SetIdentityPoolRolesInputFilterSensitiveLog; +const SetPrincipalTagAttributeMapInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.SetPrincipalTagAttributeMapInputFilterSensitiveLog = SetPrincipalTagAttributeMapInputFilterSensitiveLog; +const SetPrincipalTagAttributeMapResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.SetPrincipalTagAttributeMapResponseFilterSensitiveLog = SetPrincipalTagAttributeMapResponseFilterSensitiveLog; +const TagResourceInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.TagResourceInputFilterSensitiveLog = TagResourceInputFilterSensitiveLog; +const TagResourceResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.TagResourceResponseFilterSensitiveLog = TagResourceResponseFilterSensitiveLog; +const UnlinkDeveloperIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.UnlinkDeveloperIdentityInputFilterSensitiveLog = UnlinkDeveloperIdentityInputFilterSensitiveLog; +const UnlinkIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.UnlinkIdentityInputFilterSensitiveLog = UnlinkIdentityInputFilterSensitiveLog; +const UntagResourceInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.UntagResourceInputFilterSensitiveLog = UntagResourceInputFilterSensitiveLog; +const UntagResourceResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.UntagResourceResponseFilterSensitiveLog = UntagResourceResponseFilterSensitiveLog; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/Interfaces.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/Interfaces.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/Interfaces.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/ListIdentityPoolsPaginator.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/ListIdentityPoolsPaginator.js new file mode 100644 index 0000000000..1d900ffcdd --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/ListIdentityPoolsPaginator.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.paginateListIdentityPools = void 0; +const CognitoIdentity_1 = require("../CognitoIdentity"); +const CognitoIdentityClient_1 = require("../CognitoIdentityClient"); +const ListIdentityPoolsCommand_1 = require("../commands/ListIdentityPoolsCommand"); +const makePagedClientRequest = async (client, input, ...args) => { + return await client.send(new ListIdentityPoolsCommand_1.ListIdentityPoolsCommand(input), ...args); +}; +const makePagedRequest = async (client, input, ...args) => { + return await client.listIdentityPools(input, ...args); +}; +async function* paginateListIdentityPools(config, input, ...additionalArguments) { + let token = config.startingToken || undefined; + let hasNext = true; + let page; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CognitoIdentity_1.CognitoIdentity) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } + else if (config.client instanceof CognitoIdentityClient_1.CognitoIdentityClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } + else { + throw new Error("Invalid client, expected CognitoIdentity | CognitoIdentityClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return undefined; +} +exports.paginateListIdentityPools = paginateListIdentityPools; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/index.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/index.js new file mode 100644 index 0000000000..42a98db717 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./Interfaces"), exports); +tslib_1.__exportStar(require("./ListIdentityPoolsPaginator"), exports); diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/protocols/Aws_json1_1.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/protocols/Aws_json1_1.js new file mode 100644 index 0000000000..d90d4bb005 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/protocols/Aws_json1_1.js @@ -0,0 +1,2219 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deserializeAws_json1_1UpdateIdentityPoolCommand = exports.deserializeAws_json1_1UntagResourceCommand = exports.deserializeAws_json1_1UnlinkIdentityCommand = exports.deserializeAws_json1_1UnlinkDeveloperIdentityCommand = exports.deserializeAws_json1_1TagResourceCommand = exports.deserializeAws_json1_1SetPrincipalTagAttributeMapCommand = exports.deserializeAws_json1_1SetIdentityPoolRolesCommand = exports.deserializeAws_json1_1MergeDeveloperIdentitiesCommand = exports.deserializeAws_json1_1LookupDeveloperIdentityCommand = exports.deserializeAws_json1_1ListTagsForResourceCommand = exports.deserializeAws_json1_1ListIdentityPoolsCommand = exports.deserializeAws_json1_1ListIdentitiesCommand = exports.deserializeAws_json1_1GetPrincipalTagAttributeMapCommand = exports.deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = exports.deserializeAws_json1_1GetOpenIdTokenCommand = exports.deserializeAws_json1_1GetIdentityPoolRolesCommand = exports.deserializeAws_json1_1GetIdCommand = exports.deserializeAws_json1_1GetCredentialsForIdentityCommand = exports.deserializeAws_json1_1DescribeIdentityPoolCommand = exports.deserializeAws_json1_1DescribeIdentityCommand = exports.deserializeAws_json1_1DeleteIdentityPoolCommand = exports.deserializeAws_json1_1DeleteIdentitiesCommand = exports.deserializeAws_json1_1CreateIdentityPoolCommand = exports.serializeAws_json1_1UpdateIdentityPoolCommand = exports.serializeAws_json1_1UntagResourceCommand = exports.serializeAws_json1_1UnlinkIdentityCommand = exports.serializeAws_json1_1UnlinkDeveloperIdentityCommand = exports.serializeAws_json1_1TagResourceCommand = exports.serializeAws_json1_1SetPrincipalTagAttributeMapCommand = exports.serializeAws_json1_1SetIdentityPoolRolesCommand = exports.serializeAws_json1_1MergeDeveloperIdentitiesCommand = exports.serializeAws_json1_1LookupDeveloperIdentityCommand = exports.serializeAws_json1_1ListTagsForResourceCommand = exports.serializeAws_json1_1ListIdentityPoolsCommand = exports.serializeAws_json1_1ListIdentitiesCommand = exports.serializeAws_json1_1GetPrincipalTagAttributeMapCommand = exports.serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = exports.serializeAws_json1_1GetOpenIdTokenCommand = exports.serializeAws_json1_1GetIdentityPoolRolesCommand = exports.serializeAws_json1_1GetIdCommand = exports.serializeAws_json1_1GetCredentialsForIdentityCommand = exports.serializeAws_json1_1DescribeIdentityPoolCommand = exports.serializeAws_json1_1DescribeIdentityCommand = exports.serializeAws_json1_1DeleteIdentityPoolCommand = exports.serializeAws_json1_1DeleteIdentitiesCommand = exports.serializeAws_json1_1CreateIdentityPoolCommand = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const CognitoIdentityServiceException_1 = require("../models/CognitoIdentityServiceException"); +const models_0_1 = require("../models/models_0"); +const serializeAws_json1_1CreateIdentityPoolCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.CreateIdentityPool", + }; + let body; + body = JSON.stringify(serializeAws_json1_1CreateIdentityPoolInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1CreateIdentityPoolCommand = serializeAws_json1_1CreateIdentityPoolCommand; +const serializeAws_json1_1DeleteIdentitiesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.DeleteIdentities", + }; + let body; + body = JSON.stringify(serializeAws_json1_1DeleteIdentitiesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1DeleteIdentitiesCommand = serializeAws_json1_1DeleteIdentitiesCommand; +const serializeAws_json1_1DeleteIdentityPoolCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.DeleteIdentityPool", + }; + let body; + body = JSON.stringify(serializeAws_json1_1DeleteIdentityPoolInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1DeleteIdentityPoolCommand = serializeAws_json1_1DeleteIdentityPoolCommand; +const serializeAws_json1_1DescribeIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.DescribeIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1DescribeIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1DescribeIdentityCommand = serializeAws_json1_1DescribeIdentityCommand; +const serializeAws_json1_1DescribeIdentityPoolCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.DescribeIdentityPool", + }; + let body; + body = JSON.stringify(serializeAws_json1_1DescribeIdentityPoolInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1DescribeIdentityPoolCommand = serializeAws_json1_1DescribeIdentityPoolCommand; +const serializeAws_json1_1GetCredentialsForIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetCredentialsForIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetCredentialsForIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1GetCredentialsForIdentityCommand = serializeAws_json1_1GetCredentialsForIdentityCommand; +const serializeAws_json1_1GetIdCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetId", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetIdInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1GetIdCommand = serializeAws_json1_1GetIdCommand; +const serializeAws_json1_1GetIdentityPoolRolesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetIdentityPoolRoles", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetIdentityPoolRolesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1GetIdentityPoolRolesCommand = serializeAws_json1_1GetIdentityPoolRolesCommand; +const serializeAws_json1_1GetOpenIdTokenCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetOpenIdToken", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1GetOpenIdTokenCommand = serializeAws_json1_1GetOpenIdTokenCommand; +const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand; +const serializeAws_json1_1GetPrincipalTagAttributeMapCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetPrincipalTagAttributeMap", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetPrincipalTagAttributeMapInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1GetPrincipalTagAttributeMapCommand = serializeAws_json1_1GetPrincipalTagAttributeMapCommand; +const serializeAws_json1_1ListIdentitiesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.ListIdentities", + }; + let body; + body = JSON.stringify(serializeAws_json1_1ListIdentitiesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1ListIdentitiesCommand = serializeAws_json1_1ListIdentitiesCommand; +const serializeAws_json1_1ListIdentityPoolsCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.ListIdentityPools", + }; + let body; + body = JSON.stringify(serializeAws_json1_1ListIdentityPoolsInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1ListIdentityPoolsCommand = serializeAws_json1_1ListIdentityPoolsCommand; +const serializeAws_json1_1ListTagsForResourceCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.ListTagsForResource", + }; + let body; + body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1ListTagsForResourceCommand = serializeAws_json1_1ListTagsForResourceCommand; +const serializeAws_json1_1LookupDeveloperIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.LookupDeveloperIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1LookupDeveloperIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1LookupDeveloperIdentityCommand = serializeAws_json1_1LookupDeveloperIdentityCommand; +const serializeAws_json1_1MergeDeveloperIdentitiesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.MergeDeveloperIdentities", + }; + let body; + body = JSON.stringify(serializeAws_json1_1MergeDeveloperIdentitiesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1MergeDeveloperIdentitiesCommand = serializeAws_json1_1MergeDeveloperIdentitiesCommand; +const serializeAws_json1_1SetIdentityPoolRolesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.SetIdentityPoolRoles", + }; + let body; + body = JSON.stringify(serializeAws_json1_1SetIdentityPoolRolesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1SetIdentityPoolRolesCommand = serializeAws_json1_1SetIdentityPoolRolesCommand; +const serializeAws_json1_1SetPrincipalTagAttributeMapCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.SetPrincipalTagAttributeMap", + }; + let body; + body = JSON.stringify(serializeAws_json1_1SetPrincipalTagAttributeMapInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1SetPrincipalTagAttributeMapCommand = serializeAws_json1_1SetPrincipalTagAttributeMapCommand; +const serializeAws_json1_1TagResourceCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.TagResource", + }; + let body; + body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1TagResourceCommand = serializeAws_json1_1TagResourceCommand; +const serializeAws_json1_1UnlinkDeveloperIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.UnlinkDeveloperIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1UnlinkDeveloperIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1UnlinkDeveloperIdentityCommand = serializeAws_json1_1UnlinkDeveloperIdentityCommand; +const serializeAws_json1_1UnlinkIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.UnlinkIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1UnlinkIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1UnlinkIdentityCommand = serializeAws_json1_1UnlinkIdentityCommand; +const serializeAws_json1_1UntagResourceCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.UntagResource", + }; + let body; + body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1UntagResourceCommand = serializeAws_json1_1UntagResourceCommand; +const serializeAws_json1_1UpdateIdentityPoolCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.UpdateIdentityPool", + }; + let body; + body = JSON.stringify(serializeAws_json1_1IdentityPool(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_json1_1UpdateIdentityPoolCommand = serializeAws_json1_1UpdateIdentityPoolCommand; +const deserializeAws_json1_1CreateIdentityPoolCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1CreateIdentityPoolCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1IdentityPool(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1CreateIdentityPoolCommand = deserializeAws_json1_1CreateIdentityPoolCommand; +const deserializeAws_json1_1CreateIdentityPoolCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cognitoidentity#LimitExceededException": + throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1DeleteIdentitiesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1DeleteIdentitiesCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1DeleteIdentitiesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1DeleteIdentitiesCommand = deserializeAws_json1_1DeleteIdentitiesCommand; +const deserializeAws_json1_1DeleteIdentitiesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1DeleteIdentityPoolCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1DeleteIdentityPoolCommandError(output, context); + } + await collectBody(output.body, context); + const response = { + $metadata: deserializeMetadata(output), + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1DeleteIdentityPoolCommand = deserializeAws_json1_1DeleteIdentityPoolCommand; +const deserializeAws_json1_1DeleteIdentityPoolCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1DescribeIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1DescribeIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1IdentityDescription(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1DescribeIdentityCommand = deserializeAws_json1_1DescribeIdentityCommand; +const deserializeAws_json1_1DescribeIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1DescribeIdentityPoolCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1DescribeIdentityPoolCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1IdentityPool(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1DescribeIdentityPoolCommand = deserializeAws_json1_1DescribeIdentityPoolCommand; +const deserializeAws_json1_1DescribeIdentityPoolCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1GetCredentialsForIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetCredentialsForIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetCredentialsForIdentityResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1GetCredentialsForIdentityCommand = deserializeAws_json1_1GetCredentialsForIdentityCommand; +const deserializeAws_json1_1GetCredentialsForIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExternalServiceException": + case "com.amazonaws.cognitoidentity#ExternalServiceException": + throw await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidIdentityPoolConfigurationException": + case "com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException": + throw await deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1GetIdCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetIdCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetIdResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1GetIdCommand = deserializeAws_json1_1GetIdCommand; +const deserializeAws_json1_1GetIdCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExternalServiceException": + case "com.amazonaws.cognitoidentity#ExternalServiceException": + throw await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cognitoidentity#LimitExceededException": + throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1GetIdentityPoolRolesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetIdentityPoolRolesCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetIdentityPoolRolesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1GetIdentityPoolRolesCommand = deserializeAws_json1_1GetIdentityPoolRolesCommand; +const deserializeAws_json1_1GetIdentityPoolRolesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1GetOpenIdTokenCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetOpenIdTokenCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetOpenIdTokenResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1GetOpenIdTokenCommand = deserializeAws_json1_1GetOpenIdTokenCommand; +const deserializeAws_json1_1GetOpenIdTokenCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExternalServiceException": + case "com.amazonaws.cognitoidentity#ExternalServiceException": + throw await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand; +const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "DeveloperUserAlreadyRegisteredException": + case "com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException": + throw await deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1GetPrincipalTagAttributeMapCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetPrincipalTagAttributeMapCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetPrincipalTagAttributeMapResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1GetPrincipalTagAttributeMapCommand = deserializeAws_json1_1GetPrincipalTagAttributeMapCommand; +const deserializeAws_json1_1GetPrincipalTagAttributeMapCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1ListIdentitiesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1ListIdentitiesCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1ListIdentitiesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1ListIdentitiesCommand = deserializeAws_json1_1ListIdentitiesCommand; +const deserializeAws_json1_1ListIdentitiesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1ListIdentityPoolsCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1ListIdentityPoolsCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1ListIdentityPoolsResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1ListIdentityPoolsCommand = deserializeAws_json1_1ListIdentityPoolsCommand; +const deserializeAws_json1_1ListIdentityPoolsCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1ListTagsForResourceCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1ListTagsForResourceCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1ListTagsForResourceCommand = deserializeAws_json1_1ListTagsForResourceCommand; +const deserializeAws_json1_1ListTagsForResourceCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1LookupDeveloperIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1LookupDeveloperIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1LookupDeveloperIdentityResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1LookupDeveloperIdentityCommand = deserializeAws_json1_1LookupDeveloperIdentityCommand; +const deserializeAws_json1_1LookupDeveloperIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1MergeDeveloperIdentitiesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1MergeDeveloperIdentitiesCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1MergeDeveloperIdentitiesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1MergeDeveloperIdentitiesCommand = deserializeAws_json1_1MergeDeveloperIdentitiesCommand; +const deserializeAws_json1_1MergeDeveloperIdentitiesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1SetIdentityPoolRolesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1SetIdentityPoolRolesCommandError(output, context); + } + await collectBody(output.body, context); + const response = { + $metadata: deserializeMetadata(output), + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1SetIdentityPoolRolesCommand = deserializeAws_json1_1SetIdentityPoolRolesCommand; +const deserializeAws_json1_1SetIdentityPoolRolesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ConcurrentModificationException": + case "com.amazonaws.cognitoidentity#ConcurrentModificationException": + throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1SetPrincipalTagAttributeMapCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1SetPrincipalTagAttributeMapCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1SetPrincipalTagAttributeMapResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1SetPrincipalTagAttributeMapCommand = deserializeAws_json1_1SetPrincipalTagAttributeMapCommand; +const deserializeAws_json1_1SetPrincipalTagAttributeMapCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1TagResourceCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1TagResourceCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1TagResourceResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1TagResourceCommand = deserializeAws_json1_1TagResourceCommand; +const deserializeAws_json1_1TagResourceCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1UnlinkDeveloperIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1UnlinkDeveloperIdentityCommandError(output, context); + } + await collectBody(output.body, context); + const response = { + $metadata: deserializeMetadata(output), + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1UnlinkDeveloperIdentityCommand = deserializeAws_json1_1UnlinkDeveloperIdentityCommand; +const deserializeAws_json1_1UnlinkDeveloperIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1UnlinkIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1UnlinkIdentityCommandError(output, context); + } + await collectBody(output.body, context); + const response = { + $metadata: deserializeMetadata(output), + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1UnlinkIdentityCommand = deserializeAws_json1_1UnlinkIdentityCommand; +const deserializeAws_json1_1UnlinkIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExternalServiceException": + case "com.amazonaws.cognitoidentity#ExternalServiceException": + throw await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1UntagResourceCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1UntagResourceCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1UntagResourceResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1UntagResourceCommand = deserializeAws_json1_1UntagResourceCommand; +const deserializeAws_json1_1UntagResourceCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1UpdateIdentityPoolCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1UpdateIdentityPoolCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1IdentityPool(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_json1_1UpdateIdentityPoolCommand = deserializeAws_json1_1UpdateIdentityPoolCommand; +const deserializeAws_json1_1UpdateIdentityPoolCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ConcurrentModificationException": + case "com.amazonaws.cognitoidentity#ConcurrentModificationException": + throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cognitoidentity#LimitExceededException": + throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: CognitoIdentityServiceException_1.CognitoIdentityServiceException, + errorCode, + }); + } +}; +const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1ConcurrentModificationException(body, context); + const exception = new models_0_1.ConcurrentModificationException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1DeveloperUserAlreadyRegisteredException(body, context); + const exception = new models_0_1.DeveloperUserAlreadyRegisteredException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1ExternalServiceExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1ExternalServiceException(body, context); + const exception = new models_0_1.ExternalServiceException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1InternalErrorExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1InternalErrorException(body, context); + const exception = new models_0_1.InternalErrorException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1InvalidIdentityPoolConfigurationException(body, context); + const exception = new models_0_1.InvalidIdentityPoolConfigurationException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1InvalidParameterExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1InvalidParameterException(body, context); + const exception = new models_0_1.InvalidParameterException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1LimitExceededException(body, context); + const exception = new models_0_1.LimitExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1NotAuthorizedExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1NotAuthorizedException(body, context); + const exception = new models_0_1.NotAuthorizedException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1ResourceConflictExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1ResourceConflictException(body, context); + const exception = new models_0_1.ResourceConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context); + const exception = new models_0_1.ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_json1_1TooManyRequestsExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1TooManyRequestsException(body, context); + const exception = new models_0_1.TooManyRequestsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const serializeAws_json1_1CognitoIdentityProvider = (input, context) => { + return { + ...(input.ClientId != null && { ClientId: input.ClientId }), + ...(input.ProviderName != null && { ProviderName: input.ProviderName }), + ...(input.ServerSideTokenCheck != null && { ServerSideTokenCheck: input.ServerSideTokenCheck }), + }; +}; +const serializeAws_json1_1CognitoIdentityProviderList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return serializeAws_json1_1CognitoIdentityProvider(entry, context); + }); +}; +const serializeAws_json1_1CreateIdentityPoolInput = (input, context) => { + return { + ...(input.AllowClassicFlow != null && { AllowClassicFlow: input.AllowClassicFlow }), + ...(input.AllowUnauthenticatedIdentities != null && { + AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities, + }), + ...(input.CognitoIdentityProviders != null && { + CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(input.CognitoIdentityProviders, context), + }), + ...(input.DeveloperProviderName != null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.IdentityPoolName != null && { IdentityPoolName: input.IdentityPoolName }), + ...(input.IdentityPoolTags != null && { + IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context), + }), + ...(input.OpenIdConnectProviderARNs != null && { + OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context), + }), + ...(input.SamlProviderARNs != null && { + SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context), + }), + ...(input.SupportedLoginProviders != null && { + SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context), + }), + }; +}; +const serializeAws_json1_1DeleteIdentitiesInput = (input, context) => { + return { + ...(input.IdentityIdsToDelete != null && { + IdentityIdsToDelete: serializeAws_json1_1IdentityIdList(input.IdentityIdsToDelete, context), + }), + }; +}; +const serializeAws_json1_1DeleteIdentityPoolInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + }; +}; +const serializeAws_json1_1DescribeIdentityInput = (input, context) => { + return { + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + }; +}; +const serializeAws_json1_1DescribeIdentityPoolInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + }; +}; +const serializeAws_json1_1GetCredentialsForIdentityInput = (input, context) => { + return { + ...(input.CustomRoleArn != null && { CustomRoleArn: input.CustomRoleArn }), + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + }; +}; +const serializeAws_json1_1GetIdentityPoolRolesInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + }; +}; +const serializeAws_json1_1GetIdInput = (input, context) => { + return { + ...(input.AccountId != null && { AccountId: input.AccountId }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + }; +}; +const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput = (input, context) => { + return { + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + ...(input.PrincipalTags != null && { + PrincipalTags: serializeAws_json1_1PrincipalTags(input.PrincipalTags, context), + }), + ...(input.TokenDuration != null && { TokenDuration: input.TokenDuration }), + }; +}; +const serializeAws_json1_1GetOpenIdTokenInput = (input, context) => { + return { + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + }; +}; +const serializeAws_json1_1GetPrincipalTagAttributeMapInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityProviderName != null && { IdentityProviderName: input.IdentityProviderName }), + }; +}; +const serializeAws_json1_1IdentityIdList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1IdentityPool = (input, context) => { + return { + ...(input.AllowClassicFlow != null && { AllowClassicFlow: input.AllowClassicFlow }), + ...(input.AllowUnauthenticatedIdentities != null && { + AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities, + }), + ...(input.CognitoIdentityProviders != null && { + CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(input.CognitoIdentityProviders, context), + }), + ...(input.DeveloperProviderName != null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityPoolName != null && { IdentityPoolName: input.IdentityPoolName }), + ...(input.IdentityPoolTags != null && { + IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context), + }), + ...(input.OpenIdConnectProviderARNs != null && { + OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context), + }), + ...(input.SamlProviderARNs != null && { + SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context), + }), + ...(input.SupportedLoginProviders != null && { + SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context), + }), + }; +}; +const serializeAws_json1_1IdentityPoolTagsListType = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1IdentityPoolTagsType = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1IdentityProviders = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1ListIdentitiesInput = (input, context) => { + return { + ...(input.HideDisabled != null && { HideDisabled: input.HideDisabled }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.MaxResults != null && { MaxResults: input.MaxResults }), + ...(input.NextToken != null && { NextToken: input.NextToken }), + }; +}; +const serializeAws_json1_1ListIdentityPoolsInput = (input, context) => { + return { + ...(input.MaxResults != null && { MaxResults: input.MaxResults }), + ...(input.NextToken != null && { NextToken: input.NextToken }), + }; +}; +const serializeAws_json1_1ListTagsForResourceInput = (input, context) => { + return { + ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }), + }; +}; +const serializeAws_json1_1LoginsList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1LoginsMap = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1LookupDeveloperIdentityInput = (input, context) => { + return { + ...(input.DeveloperUserIdentifier != null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }), + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.MaxResults != null && { MaxResults: input.MaxResults }), + ...(input.NextToken != null && { NextToken: input.NextToken }), + }; +}; +const serializeAws_json1_1MappingRule = (input, context) => { + return { + ...(input.Claim != null && { Claim: input.Claim }), + ...(input.MatchType != null && { MatchType: input.MatchType }), + ...(input.RoleARN != null && { RoleARN: input.RoleARN }), + ...(input.Value != null && { Value: input.Value }), + }; +}; +const serializeAws_json1_1MappingRulesList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return serializeAws_json1_1MappingRule(entry, context); + }); +}; +const serializeAws_json1_1MergeDeveloperIdentitiesInput = (input, context) => { + return { + ...(input.DestinationUserIdentifier != null && { DestinationUserIdentifier: input.DestinationUserIdentifier }), + ...(input.DeveloperProviderName != null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.SourceUserIdentifier != null && { SourceUserIdentifier: input.SourceUserIdentifier }), + }; +}; +const serializeAws_json1_1OIDCProviderList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1PrincipalTags = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1RoleMapping = (input, context) => { + return { + ...(input.AmbiguousRoleResolution != null && { AmbiguousRoleResolution: input.AmbiguousRoleResolution }), + ...(input.RulesConfiguration != null && { + RulesConfiguration: serializeAws_json1_1RulesConfigurationType(input.RulesConfiguration, context), + }), + ...(input.Type != null && { Type: input.Type }), + }; +}; +const serializeAws_json1_1RoleMappingMap = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = serializeAws_json1_1RoleMapping(value, context); + return acc; + }, {}); +}; +const serializeAws_json1_1RolesMap = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1RulesConfigurationType = (input, context) => { + return { + ...(input.Rules != null && { Rules: serializeAws_json1_1MappingRulesList(input.Rules, context) }), + }; +}; +const serializeAws_json1_1SAMLProviderList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1SetIdentityPoolRolesInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.RoleMappings != null && { + RoleMappings: serializeAws_json1_1RoleMappingMap(input.RoleMappings, context), + }), + ...(input.Roles != null && { Roles: serializeAws_json1_1RolesMap(input.Roles, context) }), + }; +}; +const serializeAws_json1_1SetPrincipalTagAttributeMapInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityProviderName != null && { IdentityProviderName: input.IdentityProviderName }), + ...(input.PrincipalTags != null && { + PrincipalTags: serializeAws_json1_1PrincipalTags(input.PrincipalTags, context), + }), + ...(input.UseDefaults != null && { UseDefaults: input.UseDefaults }), + }; +}; +const serializeAws_json1_1TagResourceInput = (input, context) => { + return { + ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }), + ...(input.Tags != null && { Tags: serializeAws_json1_1IdentityPoolTagsType(input.Tags, context) }), + }; +}; +const serializeAws_json1_1UnlinkDeveloperIdentityInput = (input, context) => { + return { + ...(input.DeveloperProviderName != null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.DeveloperUserIdentifier != null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }), + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + }; +}; +const serializeAws_json1_1UnlinkIdentityInput = (input, context) => { + return { + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + ...(input.LoginsToRemove != null && { + LoginsToRemove: serializeAws_json1_1LoginsList(input.LoginsToRemove, context), + }), + }; +}; +const serializeAws_json1_1UntagResourceInput = (input, context) => { + return { + ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys != null && { TagKeys: serializeAws_json1_1IdentityPoolTagsListType(input.TagKeys, context) }), + }; +}; +const deserializeAws_json1_1CognitoIdentityProvider = (output, context) => { + return { + ClientId: (0, smithy_client_1.expectString)(output.ClientId), + ProviderName: (0, smithy_client_1.expectString)(output.ProviderName), + ServerSideTokenCheck: (0, smithy_client_1.expectBoolean)(output.ServerSideTokenCheck), + }; +}; +const deserializeAws_json1_1CognitoIdentityProviderList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1CognitoIdentityProvider(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1ConcurrentModificationException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1Credentials = (output, context) => { + return { + AccessKeyId: (0, smithy_client_1.expectString)(output.AccessKeyId), + Expiration: output.Expiration != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.Expiration))) : undefined, + SecretKey: (0, smithy_client_1.expectString)(output.SecretKey), + SessionToken: (0, smithy_client_1.expectString)(output.SessionToken), + }; +}; +const deserializeAws_json1_1DeleteIdentitiesResponse = (output, context) => { + return { + UnprocessedIdentityIds: output.UnprocessedIdentityIds != null + ? deserializeAws_json1_1UnprocessedIdentityIdList(output.UnprocessedIdentityIds, context) + : undefined, + }; +}; +const deserializeAws_json1_1DeveloperUserAlreadyRegisteredException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1DeveloperUserIdentifierList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return (0, smithy_client_1.expectString)(entry); + }); + return retVal; +}; +const deserializeAws_json1_1ExternalServiceException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1GetCredentialsForIdentityResponse = (output, context) => { + return { + Credentials: output.Credentials != null ? deserializeAws_json1_1Credentials(output.Credentials, context) : undefined, + IdentityId: (0, smithy_client_1.expectString)(output.IdentityId), + }; +}; +const deserializeAws_json1_1GetIdentityPoolRolesResponse = (output, context) => { + return { + IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId), + RoleMappings: output.RoleMappings != null ? deserializeAws_json1_1RoleMappingMap(output.RoleMappings, context) : undefined, + Roles: output.Roles != null ? deserializeAws_json1_1RolesMap(output.Roles, context) : undefined, + }; +}; +const deserializeAws_json1_1GetIdResponse = (output, context) => { + return { + IdentityId: (0, smithy_client_1.expectString)(output.IdentityId), + }; +}; +const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse = (output, context) => { + return { + IdentityId: (0, smithy_client_1.expectString)(output.IdentityId), + Token: (0, smithy_client_1.expectString)(output.Token), + }; +}; +const deserializeAws_json1_1GetOpenIdTokenResponse = (output, context) => { + return { + IdentityId: (0, smithy_client_1.expectString)(output.IdentityId), + Token: (0, smithy_client_1.expectString)(output.Token), + }; +}; +const deserializeAws_json1_1GetPrincipalTagAttributeMapResponse = (output, context) => { + return { + IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId), + IdentityProviderName: (0, smithy_client_1.expectString)(output.IdentityProviderName), + PrincipalTags: output.PrincipalTags != null ? deserializeAws_json1_1PrincipalTags(output.PrincipalTags, context) : undefined, + UseDefaults: (0, smithy_client_1.expectBoolean)(output.UseDefaults), + }; +}; +const deserializeAws_json1_1IdentitiesList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1IdentityDescription(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1IdentityDescription = (output, context) => { + return { + CreationDate: output.CreationDate != null + ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationDate))) + : undefined, + IdentityId: (0, smithy_client_1.expectString)(output.IdentityId), + LastModifiedDate: output.LastModifiedDate != null + ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModifiedDate))) + : undefined, + Logins: output.Logins != null ? deserializeAws_json1_1LoginsList(output.Logins, context) : undefined, + }; +}; +const deserializeAws_json1_1IdentityPool = (output, context) => { + return { + AllowClassicFlow: (0, smithy_client_1.expectBoolean)(output.AllowClassicFlow), + AllowUnauthenticatedIdentities: (0, smithy_client_1.expectBoolean)(output.AllowUnauthenticatedIdentities), + CognitoIdentityProviders: output.CognitoIdentityProviders != null + ? deserializeAws_json1_1CognitoIdentityProviderList(output.CognitoIdentityProviders, context) + : undefined, + DeveloperProviderName: (0, smithy_client_1.expectString)(output.DeveloperProviderName), + IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId), + IdentityPoolName: (0, smithy_client_1.expectString)(output.IdentityPoolName), + IdentityPoolTags: output.IdentityPoolTags != null + ? deserializeAws_json1_1IdentityPoolTagsType(output.IdentityPoolTags, context) + : undefined, + OpenIdConnectProviderARNs: output.OpenIdConnectProviderARNs != null + ? deserializeAws_json1_1OIDCProviderList(output.OpenIdConnectProviderARNs, context) + : undefined, + SamlProviderARNs: output.SamlProviderARNs != null + ? deserializeAws_json1_1SAMLProviderList(output.SamlProviderARNs, context) + : undefined, + SupportedLoginProviders: output.SupportedLoginProviders != null + ? deserializeAws_json1_1IdentityProviders(output.SupportedLoginProviders, context) + : undefined, + }; +}; +const deserializeAws_json1_1IdentityPoolShortDescription = (output, context) => { + return { + IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId), + IdentityPoolName: (0, smithy_client_1.expectString)(output.IdentityPoolName), + }; +}; +const deserializeAws_json1_1IdentityPoolsList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1IdentityPoolShortDescription(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1IdentityPoolTagsType = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = (0, smithy_client_1.expectString)(value); + return acc; + }, {}); +}; +const deserializeAws_json1_1IdentityProviders = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = (0, smithy_client_1.expectString)(value); + return acc; + }, {}); +}; +const deserializeAws_json1_1InternalErrorException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1InvalidIdentityPoolConfigurationException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1InvalidParameterException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1LimitExceededException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1ListIdentitiesResponse = (output, context) => { + return { + Identities: output.Identities != null ? deserializeAws_json1_1IdentitiesList(output.Identities, context) : undefined, + IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId), + NextToken: (0, smithy_client_1.expectString)(output.NextToken), + }; +}; +const deserializeAws_json1_1ListIdentityPoolsResponse = (output, context) => { + return { + IdentityPools: output.IdentityPools != null ? deserializeAws_json1_1IdentityPoolsList(output.IdentityPools, context) : undefined, + NextToken: (0, smithy_client_1.expectString)(output.NextToken), + }; +}; +const deserializeAws_json1_1ListTagsForResourceResponse = (output, context) => { + return { + Tags: output.Tags != null ? deserializeAws_json1_1IdentityPoolTagsType(output.Tags, context) : undefined, + }; +}; +const deserializeAws_json1_1LoginsList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return (0, smithy_client_1.expectString)(entry); + }); + return retVal; +}; +const deserializeAws_json1_1LookupDeveloperIdentityResponse = (output, context) => { + return { + DeveloperUserIdentifierList: output.DeveloperUserIdentifierList != null + ? deserializeAws_json1_1DeveloperUserIdentifierList(output.DeveloperUserIdentifierList, context) + : undefined, + IdentityId: (0, smithy_client_1.expectString)(output.IdentityId), + NextToken: (0, smithy_client_1.expectString)(output.NextToken), + }; +}; +const deserializeAws_json1_1MappingRule = (output, context) => { + return { + Claim: (0, smithy_client_1.expectString)(output.Claim), + MatchType: (0, smithy_client_1.expectString)(output.MatchType), + RoleARN: (0, smithy_client_1.expectString)(output.RoleARN), + Value: (0, smithy_client_1.expectString)(output.Value), + }; +}; +const deserializeAws_json1_1MappingRulesList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1MappingRule(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1MergeDeveloperIdentitiesResponse = (output, context) => { + return { + IdentityId: (0, smithy_client_1.expectString)(output.IdentityId), + }; +}; +const deserializeAws_json1_1NotAuthorizedException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1OIDCProviderList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return (0, smithy_client_1.expectString)(entry); + }); + return retVal; +}; +const deserializeAws_json1_1PrincipalTags = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = (0, smithy_client_1.expectString)(value); + return acc; + }, {}); +}; +const deserializeAws_json1_1ResourceConflictException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1ResourceNotFoundException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1RoleMapping = (output, context) => { + return { + AmbiguousRoleResolution: (0, smithy_client_1.expectString)(output.AmbiguousRoleResolution), + RulesConfiguration: output.RulesConfiguration != null + ? deserializeAws_json1_1RulesConfigurationType(output.RulesConfiguration, context) + : undefined, + Type: (0, smithy_client_1.expectString)(output.Type), + }; +}; +const deserializeAws_json1_1RoleMappingMap = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = deserializeAws_json1_1RoleMapping(value, context); + return acc; + }, {}); +}; +const deserializeAws_json1_1RolesMap = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = (0, smithy_client_1.expectString)(value); + return acc; + }, {}); +}; +const deserializeAws_json1_1RulesConfigurationType = (output, context) => { + return { + Rules: output.Rules != null ? deserializeAws_json1_1MappingRulesList(output.Rules, context) : undefined, + }; +}; +const deserializeAws_json1_1SAMLProviderList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return (0, smithy_client_1.expectString)(entry); + }); + return retVal; +}; +const deserializeAws_json1_1SetPrincipalTagAttributeMapResponse = (output, context) => { + return { + IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId), + IdentityProviderName: (0, smithy_client_1.expectString)(output.IdentityProviderName), + PrincipalTags: output.PrincipalTags != null ? deserializeAws_json1_1PrincipalTags(output.PrincipalTags, context) : undefined, + UseDefaults: (0, smithy_client_1.expectBoolean)(output.UseDefaults), + }; +}; +const deserializeAws_json1_1TagResourceResponse = (output, context) => { + return {}; +}; +const deserializeAws_json1_1TooManyRequestsException = (output, context) => { + return { + message: (0, smithy_client_1.expectString)(output.message), + }; +}; +const deserializeAws_json1_1UnprocessedIdentityId = (output, context) => { + return { + ErrorCode: (0, smithy_client_1.expectString)(output.ErrorCode), + IdentityId: (0, smithy_client_1.expectString)(output.IdentityId), + }; +}; +const deserializeAws_json1_1UnprocessedIdentityIdList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1UnprocessedIdentityId(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1UntagResourceResponse = (output, context) => { + return {}; +}; +const deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); +const collectBody = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; +const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new protocol_http_1.HttpRequest(contents); +}; +const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}); +const parseErrorBody = async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; +const loadRestJsonErrorCode = (output, data) => { + const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.browser.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.browser.js new file mode 100644 index 0000000000..9737cf8255 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.browser.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const tslib_1 = require("tslib"); +const package_json_1 = tslib_1.__importDefault(require("../package.json")); +const sha256_browser_1 = require("@aws-crypto/sha256-browser"); +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const fetch_http_handler_1 = require("@aws-sdk/fetch-http-handler"); +const invalid_dependency_1 = require("@aws-sdk/invalid-dependency"); +const util_body_length_browser_1 = require("@aws-sdk/util-body-length-browser"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser"); +const runtimeConfig_shared_1 = require("./runtimeConfig.shared"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const util_defaults_mode_browser_1 = require("@aws-sdk/util-defaults-mode-browser"); +const getRuntimeConfig = (config) => { + const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"), + requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? sha256_browser_1.Sha256, + streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.js new file mode 100644 index 0000000000..94f37be555 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const tslib_1 = require("tslib"); +const package_json_1 = tslib_1.__importDefault(require("../package.json")); +const client_sts_1 = require("@aws-sdk/client-sts"); +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const credential_provider_node_1 = require("@aws-sdk/credential-provider-node"); +const hash_node_1 = require("@aws-sdk/hash-node"); +const middleware_retry_1 = require("@aws-sdk/middleware-retry"); +const node_config_provider_1 = require("@aws-sdk/node-config-provider"); +const node_http_handler_1 = require("@aws-sdk/node-http-handler"); +const util_body_length_node_1 = require("@aws-sdk/util-body-length-node"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node"); +const runtimeConfig_shared_1 = require("./runtimeConfig.shared"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const util_defaults_mode_node_1 = require("@aws-sdk/util-defaults-mode-node"); +const smithy_client_2 = require("@aws-sdk/smithy-client"); +const getRuntimeConfig = (config) => { + (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? (0, client_sts_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider), + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? + (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.native.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.native.js new file mode 100644 index 0000000000..34c5f8ece1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.native.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const sha256_js_1 = require("@aws-crypto/sha256-js"); +const runtimeConfig_browser_1 = require("./runtimeConfig.browser"); +const getRuntimeConfig = (config) => { + const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? sha256_js_1.Sha256, + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.shared.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.shared.js new file mode 100644 index 0000000000..58a8fdbdfd --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.shared.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const url_parser_1 = require("@aws-sdk/url-parser"); +const util_base64_1 = require("@aws-sdk/util-base64"); +const util_utf8_1 = require("@aws-sdk/util-utf8"); +const endpointResolver_1 = require("./endpoint/endpointResolver"); +const getRuntimeConfig = (config) => ({ + apiVersion: "2014-06-30", + base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64, + base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + serviceId: config?.serviceId ?? "Cognito Identity", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, +}); +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentity.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentity.js new file mode 100644 index 0000000000..9d39653cbf --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentity.js @@ -0,0 +1,348 @@ +import { CognitoIdentityClient } from "./CognitoIdentityClient"; +import { CreateIdentityPoolCommand, } from "./commands/CreateIdentityPoolCommand"; +import { DeleteIdentitiesCommand, } from "./commands/DeleteIdentitiesCommand"; +import { DeleteIdentityPoolCommand, } from "./commands/DeleteIdentityPoolCommand"; +import { DescribeIdentityCommand, } from "./commands/DescribeIdentityCommand"; +import { DescribeIdentityPoolCommand, } from "./commands/DescribeIdentityPoolCommand"; +import { GetCredentialsForIdentityCommand, } from "./commands/GetCredentialsForIdentityCommand"; +import { GetIdCommand } from "./commands/GetIdCommand"; +import { GetIdentityPoolRolesCommand, } from "./commands/GetIdentityPoolRolesCommand"; +import { GetOpenIdTokenCommand, } from "./commands/GetOpenIdTokenCommand"; +import { GetOpenIdTokenForDeveloperIdentityCommand, } from "./commands/GetOpenIdTokenForDeveloperIdentityCommand"; +import { GetPrincipalTagAttributeMapCommand, } from "./commands/GetPrincipalTagAttributeMapCommand"; +import { ListIdentitiesCommand, } from "./commands/ListIdentitiesCommand"; +import { ListIdentityPoolsCommand, } from "./commands/ListIdentityPoolsCommand"; +import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand"; +import { LookupDeveloperIdentityCommand, } from "./commands/LookupDeveloperIdentityCommand"; +import { MergeDeveloperIdentitiesCommand, } from "./commands/MergeDeveloperIdentitiesCommand"; +import { SetIdentityPoolRolesCommand, } from "./commands/SetIdentityPoolRolesCommand"; +import { SetPrincipalTagAttributeMapCommand, } from "./commands/SetPrincipalTagAttributeMapCommand"; +import { TagResourceCommand } from "./commands/TagResourceCommand"; +import { UnlinkDeveloperIdentityCommand, } from "./commands/UnlinkDeveloperIdentityCommand"; +import { UnlinkIdentityCommand, } from "./commands/UnlinkIdentityCommand"; +import { UntagResourceCommand, } from "./commands/UntagResourceCommand"; +import { UpdateIdentityPoolCommand, } from "./commands/UpdateIdentityPoolCommand"; +export class CognitoIdentity extends CognitoIdentityClient { + createIdentityPool(args, optionsOrCb, cb) { + const command = new CreateIdentityPoolCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + deleteIdentities(args, optionsOrCb, cb) { + const command = new DeleteIdentitiesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + deleteIdentityPool(args, optionsOrCb, cb) { + const command = new DeleteIdentityPoolCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + describeIdentity(args, optionsOrCb, cb) { + const command = new DescribeIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + describeIdentityPool(args, optionsOrCb, cb) { + const command = new DescribeIdentityPoolCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getCredentialsForIdentity(args, optionsOrCb, cb) { + const command = new GetCredentialsForIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getId(args, optionsOrCb, cb) { + const command = new GetIdCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getIdentityPoolRoles(args, optionsOrCb, cb) { + const command = new GetIdentityPoolRolesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getOpenIdToken(args, optionsOrCb, cb) { + const command = new GetOpenIdTokenCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getOpenIdTokenForDeveloperIdentity(args, optionsOrCb, cb) { + const command = new GetOpenIdTokenForDeveloperIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getPrincipalTagAttributeMap(args, optionsOrCb, cb) { + const command = new GetPrincipalTagAttributeMapCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listIdentities(args, optionsOrCb, cb) { + const command = new ListIdentitiesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listIdentityPools(args, optionsOrCb, cb) { + const command = new ListIdentityPoolsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listTagsForResource(args, optionsOrCb, cb) { + const command = new ListTagsForResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + lookupDeveloperIdentity(args, optionsOrCb, cb) { + const command = new LookupDeveloperIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + mergeDeveloperIdentities(args, optionsOrCb, cb) { + const command = new MergeDeveloperIdentitiesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + setIdentityPoolRoles(args, optionsOrCb, cb) { + const command = new SetIdentityPoolRolesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + setPrincipalTagAttributeMap(args, optionsOrCb, cb) { + const command = new SetPrincipalTagAttributeMapCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + tagResource(args, optionsOrCb, cb) { + const command = new TagResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + unlinkDeveloperIdentity(args, optionsOrCb, cb) { + const command = new UnlinkDeveloperIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + unlinkIdentity(args, optionsOrCb, cb) { + const command = new UnlinkIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + untagResource(args, optionsOrCb, cb) { + const command = new UntagResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + updateIdentityPool(args, optionsOrCb, cb) { + const command = new UpdateIdentityPoolCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentityClient.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentityClient.js new file mode 100644 index 0000000000..f647f14f21 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentityClient.js @@ -0,0 +1,35 @@ +import { resolveRegionConfig } from "@aws-sdk/config-resolver"; +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; +import { resolveEndpointConfig } from "@aws-sdk/middleware-endpoint"; +import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { getRetryPlugin, resolveRetryConfig } from "@aws-sdk/middleware-retry"; +import { resolveAwsAuthConfig } from "@aws-sdk/middleware-signing"; +import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent"; +import { Client as __Client, } from "@aws-sdk/smithy-client"; +import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +export class CognitoIdentityClient extends __Client { + constructor(configuration) { + const _config_0 = __getRuntimeConfig(configuration); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveRegionConfig(_config_1); + const _config_3 = resolveEndpointConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveAwsAuthConfig(_config_5); + const _config_7 = resolveUserAgentConfig(_config_6); + super(_config_7); + this.config = _config_7; + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + } + destroy() { + super.destroy(); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/CreateIdentityPoolCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/CreateIdentityPoolCommand.js new file mode 100644 index 0000000000..4c6de5db6a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/CreateIdentityPoolCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { CreateIdentityPoolInputFilterSensitiveLog, IdentityPoolFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1CreateIdentityPoolCommand, serializeAws_json1_1CreateIdentityPoolCommand, } from "../protocols/Aws_json1_1"; +export class CreateIdentityPoolCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, CreateIdentityPoolCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "CreateIdentityPoolCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: CreateIdentityPoolInputFilterSensitiveLog, + outputFilterSensitiveLog: IdentityPoolFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1CreateIdentityPoolCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1CreateIdentityPoolCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentitiesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentitiesCommand.js new file mode 100644 index 0000000000..8575ea4d5e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentitiesCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { DeleteIdentitiesInputFilterSensitiveLog, DeleteIdentitiesResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1DeleteIdentitiesCommand, serializeAws_json1_1DeleteIdentitiesCommand, } from "../protocols/Aws_json1_1"; +export class DeleteIdentitiesCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DeleteIdentitiesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "DeleteIdentitiesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: DeleteIdentitiesInputFilterSensitiveLog, + outputFilterSensitiveLog: DeleteIdentitiesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1DeleteIdentitiesCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1DeleteIdentitiesCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentityPoolCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentityPoolCommand.js new file mode 100644 index 0000000000..5880921acf --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentityPoolCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { DeleteIdentityPoolInputFilterSensitiveLog } from "../models/models_0"; +import { deserializeAws_json1_1DeleteIdentityPoolCommand, serializeAws_json1_1DeleteIdentityPoolCommand, } from "../protocols/Aws_json1_1"; +export class DeleteIdentityPoolCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DeleteIdentityPoolCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "DeleteIdentityPoolCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: DeleteIdentityPoolInputFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1DeleteIdentityPoolCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1DeleteIdentityPoolCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityCommand.js new file mode 100644 index 0000000000..b57e33c9e2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { DescribeIdentityInputFilterSensitiveLog, IdentityDescriptionFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1DescribeIdentityCommand, serializeAws_json1_1DescribeIdentityCommand, } from "../protocols/Aws_json1_1"; +export class DescribeIdentityCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DescribeIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "DescribeIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: DescribeIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: IdentityDescriptionFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1DescribeIdentityCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1DescribeIdentityCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityPoolCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityPoolCommand.js new file mode 100644 index 0000000000..4d3e1903df --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityPoolCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { DescribeIdentityPoolInputFilterSensitiveLog, IdentityPoolFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1DescribeIdentityPoolCommand, serializeAws_json1_1DescribeIdentityPoolCommand, } from "../protocols/Aws_json1_1"; +export class DescribeIdentityPoolCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DescribeIdentityPoolCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "DescribeIdentityPoolCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: DescribeIdentityPoolInputFilterSensitiveLog, + outputFilterSensitiveLog: IdentityPoolFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1DescribeIdentityPoolCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1DescribeIdentityPoolCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetCredentialsForIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetCredentialsForIdentityCommand.js new file mode 100644 index 0000000000..f15fd7cf83 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetCredentialsForIdentityCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetCredentialsForIdentityInputFilterSensitiveLog, GetCredentialsForIdentityResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1GetCredentialsForIdentityCommand, serializeAws_json1_1GetCredentialsForIdentityCommand, } from "../protocols/Aws_json1_1"; +export class GetCredentialsForIdentityCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetCredentialsForIdentityCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetCredentialsForIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetCredentialsForIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: GetCredentialsForIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1GetCredentialsForIdentityCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1GetCredentialsForIdentityCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdCommand.js new file mode 100644 index 0000000000..2a296c5e38 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetIdInputFilterSensitiveLog, GetIdResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1GetIdCommand, serializeAws_json1_1GetIdCommand } from "../protocols/Aws_json1_1"; +export class GetIdCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetIdCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetIdCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetIdInputFilterSensitiveLog, + outputFilterSensitiveLog: GetIdResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1GetIdCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1GetIdCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdentityPoolRolesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdentityPoolRolesCommand.js new file mode 100644 index 0000000000..214cd7e5ef --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdentityPoolRolesCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetIdentityPoolRolesInputFilterSensitiveLog, GetIdentityPoolRolesResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1GetIdentityPoolRolesCommand, serializeAws_json1_1GetIdentityPoolRolesCommand, } from "../protocols/Aws_json1_1"; +export class GetIdentityPoolRolesCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetIdentityPoolRolesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetIdentityPoolRolesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetIdentityPoolRolesInputFilterSensitiveLog, + outputFilterSensitiveLog: GetIdentityPoolRolesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1GetIdentityPoolRolesCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1GetIdentityPoolRolesCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenCommand.js new file mode 100644 index 0000000000..2ef50ea2c7 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetOpenIdTokenInputFilterSensitiveLog, GetOpenIdTokenResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1GetOpenIdTokenCommand, serializeAws_json1_1GetOpenIdTokenCommand, } from "../protocols/Aws_json1_1"; +export class GetOpenIdTokenCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetOpenIdTokenCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetOpenIdTokenCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetOpenIdTokenInputFilterSensitiveLog, + outputFilterSensitiveLog: GetOpenIdTokenResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1GetOpenIdTokenCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1GetOpenIdTokenCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenForDeveloperIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenForDeveloperIdentityCommand.js new file mode 100644 index 0000000000..43425b5a72 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenForDeveloperIdentityCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog, GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand, serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand, } from "../protocols/Aws_json1_1"; +export class GetOpenIdTokenForDeveloperIdentityCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetOpenIdTokenForDeveloperIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetOpenIdTokenForDeveloperIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetPrincipalTagAttributeMapCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetPrincipalTagAttributeMapCommand.js new file mode 100644 index 0000000000..bc8ee0b045 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetPrincipalTagAttributeMapCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetPrincipalTagAttributeMapInputFilterSensitiveLog, GetPrincipalTagAttributeMapResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1GetPrincipalTagAttributeMapCommand, serializeAws_json1_1GetPrincipalTagAttributeMapCommand, } from "../protocols/Aws_json1_1"; +export class GetPrincipalTagAttributeMapCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetPrincipalTagAttributeMapCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "GetPrincipalTagAttributeMapCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetPrincipalTagAttributeMapInputFilterSensitiveLog, + outputFilterSensitiveLog: GetPrincipalTagAttributeMapResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1GetPrincipalTagAttributeMapCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1GetPrincipalTagAttributeMapCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentitiesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentitiesCommand.js new file mode 100644 index 0000000000..e9fa692c41 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentitiesCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { ListIdentitiesInputFilterSensitiveLog, ListIdentitiesResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1ListIdentitiesCommand, serializeAws_json1_1ListIdentitiesCommand, } from "../protocols/Aws_json1_1"; +export class ListIdentitiesCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListIdentitiesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "ListIdentitiesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListIdentitiesInputFilterSensitiveLog, + outputFilterSensitiveLog: ListIdentitiesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1ListIdentitiesCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1ListIdentitiesCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentityPoolsCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentityPoolsCommand.js new file mode 100644 index 0000000000..7ad729d018 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentityPoolsCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { ListIdentityPoolsInputFilterSensitiveLog, ListIdentityPoolsResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1ListIdentityPoolsCommand, serializeAws_json1_1ListIdentityPoolsCommand, } from "../protocols/Aws_json1_1"; +export class ListIdentityPoolsCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListIdentityPoolsCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "ListIdentityPoolsCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListIdentityPoolsInputFilterSensitiveLog, + outputFilterSensitiveLog: ListIdentityPoolsResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1ListIdentityPoolsCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1ListIdentityPoolsCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListTagsForResourceCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListTagsForResourceCommand.js new file mode 100644 index 0000000000..d195bf9600 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListTagsForResourceCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { ListTagsForResourceInputFilterSensitiveLog, ListTagsForResourceResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1ListTagsForResourceCommand, serializeAws_json1_1ListTagsForResourceCommand, } from "../protocols/Aws_json1_1"; +export class ListTagsForResourceCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "ListTagsForResourceCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListTagsForResourceInputFilterSensitiveLog, + outputFilterSensitiveLog: ListTagsForResourceResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1ListTagsForResourceCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1ListTagsForResourceCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/LookupDeveloperIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/LookupDeveloperIdentityCommand.js new file mode 100644 index 0000000000..4e88166145 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/LookupDeveloperIdentityCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { LookupDeveloperIdentityInputFilterSensitiveLog, LookupDeveloperIdentityResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1LookupDeveloperIdentityCommand, serializeAws_json1_1LookupDeveloperIdentityCommand, } from "../protocols/Aws_json1_1"; +export class LookupDeveloperIdentityCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, LookupDeveloperIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "LookupDeveloperIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: LookupDeveloperIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: LookupDeveloperIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1LookupDeveloperIdentityCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1LookupDeveloperIdentityCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/MergeDeveloperIdentitiesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/MergeDeveloperIdentitiesCommand.js new file mode 100644 index 0000000000..c970219b9a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/MergeDeveloperIdentitiesCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { MergeDeveloperIdentitiesInputFilterSensitiveLog, MergeDeveloperIdentitiesResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1MergeDeveloperIdentitiesCommand, serializeAws_json1_1MergeDeveloperIdentitiesCommand, } from "../protocols/Aws_json1_1"; +export class MergeDeveloperIdentitiesCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, MergeDeveloperIdentitiesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "MergeDeveloperIdentitiesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: MergeDeveloperIdentitiesInputFilterSensitiveLog, + outputFilterSensitiveLog: MergeDeveloperIdentitiesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1MergeDeveloperIdentitiesCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1MergeDeveloperIdentitiesCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetIdentityPoolRolesCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetIdentityPoolRolesCommand.js new file mode 100644 index 0000000000..22f5686a8b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetIdentityPoolRolesCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { SetIdentityPoolRolesInputFilterSensitiveLog } from "../models/models_0"; +import { deserializeAws_json1_1SetIdentityPoolRolesCommand, serializeAws_json1_1SetIdentityPoolRolesCommand, } from "../protocols/Aws_json1_1"; +export class SetIdentityPoolRolesCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, SetIdentityPoolRolesCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "SetIdentityPoolRolesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: SetIdentityPoolRolesInputFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1SetIdentityPoolRolesCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1SetIdentityPoolRolesCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetPrincipalTagAttributeMapCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetPrincipalTagAttributeMapCommand.js new file mode 100644 index 0000000000..52e200d787 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetPrincipalTagAttributeMapCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { SetPrincipalTagAttributeMapInputFilterSensitiveLog, SetPrincipalTagAttributeMapResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1SetPrincipalTagAttributeMapCommand, serializeAws_json1_1SetPrincipalTagAttributeMapCommand, } from "../protocols/Aws_json1_1"; +export class SetPrincipalTagAttributeMapCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, SetPrincipalTagAttributeMapCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "SetPrincipalTagAttributeMapCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: SetPrincipalTagAttributeMapInputFilterSensitiveLog, + outputFilterSensitiveLog: SetPrincipalTagAttributeMapResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1SetPrincipalTagAttributeMapCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1SetPrincipalTagAttributeMapCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/TagResourceCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/TagResourceCommand.js new file mode 100644 index 0000000000..f6edea79e9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/TagResourceCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { TagResourceInputFilterSensitiveLog, TagResourceResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1TagResourceCommand, serializeAws_json1_1TagResourceCommand, } from "../protocols/Aws_json1_1"; +export class TagResourceCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, TagResourceCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "TagResourceCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: TagResourceInputFilterSensitiveLog, + outputFilterSensitiveLog: TagResourceResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1TagResourceCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1TagResourceCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkDeveloperIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkDeveloperIdentityCommand.js new file mode 100644 index 0000000000..ab730a8c27 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkDeveloperIdentityCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { UnlinkDeveloperIdentityInputFilterSensitiveLog } from "../models/models_0"; +import { deserializeAws_json1_1UnlinkDeveloperIdentityCommand, serializeAws_json1_1UnlinkDeveloperIdentityCommand, } from "../protocols/Aws_json1_1"; +export class UnlinkDeveloperIdentityCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UnlinkDeveloperIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "UnlinkDeveloperIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UnlinkDeveloperIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1UnlinkDeveloperIdentityCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1UnlinkDeveloperIdentityCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkIdentityCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkIdentityCommand.js new file mode 100644 index 0000000000..e746a07a40 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkIdentityCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { UnlinkIdentityInputFilterSensitiveLog } from "../models/models_0"; +import { deserializeAws_json1_1UnlinkIdentityCommand, serializeAws_json1_1UnlinkIdentityCommand, } from "../protocols/Aws_json1_1"; +export class UnlinkIdentityCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UnlinkIdentityCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "UnlinkIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UnlinkIdentityInputFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1UnlinkIdentityCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1UnlinkIdentityCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UntagResourceCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UntagResourceCommand.js new file mode 100644 index 0000000000..e4ed02cce1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UntagResourceCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { UntagResourceInputFilterSensitiveLog, UntagResourceResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_json1_1UntagResourceCommand, serializeAws_json1_1UntagResourceCommand, } from "../protocols/Aws_json1_1"; +export class UntagResourceCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UntagResourceCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "UntagResourceCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UntagResourceInputFilterSensitiveLog, + outputFilterSensitiveLog: UntagResourceResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1UntagResourceCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1UntagResourceCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UpdateIdentityPoolCommand.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UpdateIdentityPoolCommand.js new file mode 100644 index 0000000000..3547b38258 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UpdateIdentityPoolCommand.js @@ -0,0 +1,44 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { IdentityPoolFilterSensitiveLog } from "../models/models_0"; +import { deserializeAws_json1_1UpdateIdentityPoolCommand, serializeAws_json1_1UpdateIdentityPoolCommand, } from "../protocols/Aws_json1_1"; +export class UpdateIdentityPoolCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UpdateIdentityPoolCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "CognitoIdentityClient"; + const commandName = "UpdateIdentityPoolCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: IdentityPoolFilterSensitiveLog, + outputFilterSensitiveLog: IdentityPoolFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_json1_1UpdateIdentityPoolCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_json1_1UpdateIdentityPoolCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/index.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/index.js new file mode 100644 index 0000000000..8df424ba4b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/index.js @@ -0,0 +1,23 @@ +export * from "./CreateIdentityPoolCommand"; +export * from "./DeleteIdentitiesCommand"; +export * from "./DeleteIdentityPoolCommand"; +export * from "./DescribeIdentityCommand"; +export * from "./DescribeIdentityPoolCommand"; +export * from "./GetCredentialsForIdentityCommand"; +export * from "./GetIdCommand"; +export * from "./GetIdentityPoolRolesCommand"; +export * from "./GetOpenIdTokenCommand"; +export * from "./GetOpenIdTokenForDeveloperIdentityCommand"; +export * from "./GetPrincipalTagAttributeMapCommand"; +export * from "./ListIdentitiesCommand"; +export * from "./ListIdentityPoolsCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./LookupDeveloperIdentityCommand"; +export * from "./MergeDeveloperIdentitiesCommand"; +export * from "./SetIdentityPoolRolesCommand"; +export * from "./SetPrincipalTagAttributeMapCommand"; +export * from "./TagResourceCommand"; +export * from "./UnlinkDeveloperIdentityCommand"; +export * from "./UnlinkIdentityCommand"; +export * from "./UntagResourceCommand"; +export * from "./UpdateIdentityPoolCommand"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/EndpointParameters.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/EndpointParameters.js new file mode 100644 index 0000000000..e460db8392 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/EndpointParameters.js @@ -0,0 +1,8 @@ +export const resolveClientEndpointParameters = (options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "cognito-identity", + }; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/endpointResolver.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/endpointResolver.js new file mode 100644 index 0000000000..f7d9738dd1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/endpointResolver.js @@ -0,0 +1,8 @@ +import { resolveEndpoint } from "@aws-sdk/util-endpoints"; +import { ruleSet } from "./ruleset"; +export const defaultEndpointResolver = (endpointParams, context = {}) => { + return resolveEndpoint(ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/ruleset.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/ruleset.js new file mode 100644 index 0000000000..81550cab51 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoint/ruleset.js @@ -0,0 +1,4 @@ +const p = "required", q = "fn", r = "argv", s = "ref"; +const a = "PartitionResult", b = "tree", c = "error", d = "endpoint", e = { [p]: false, "type": "String" }, f = { [p]: true, "default": false, "type": "Boolean" }, g = { [s]: "Endpoint" }, h = { [q]: "booleanEquals", [r]: [{ [s]: "UseFIPS" }, true] }, i = { [q]: "booleanEquals", [r]: [{ [s]: "UseDualStack" }, true] }, j = {}, k = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsFIPS"] }] }, l = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsDualStack"] }] }, m = [g], n = [h], o = [i]; +const _data = { version: "1.0", parameters: { Region: e, UseDualStack: f, UseFIPS: f, Endpoint: e }, rules: [{ conditions: [{ [q]: "aws.partition", [r]: [{ [s]: "Region" }], assign: a }], type: b, rules: [{ conditions: [{ [q]: "isSet", [r]: m }, { [q]: "parseURL", [r]: m, assign: "url" }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: g, properties: j, headers: j }, type: d }] }] }, { conditions: [h, i], type: b, rules: [{ conditions: [k, l], type: b, rules: [{ endpoint: { url: "https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [k], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }; +export const ruleSet = _data; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/index.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/index.js new file mode 100644 index 0000000000..c7525c3f7c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/index.js @@ -0,0 +1,6 @@ +export * from "./CognitoIdentity"; +export * from "./CognitoIdentityClient"; +export * from "./commands"; +export * from "./models"; +export * from "./pagination"; +export { CognitoIdentityServiceException } from "./models/CognitoIdentityServiceException"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/CognitoIdentityServiceException.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/CognitoIdentityServiceException.js new file mode 100644 index 0000000000..6981a2d20f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/CognitoIdentityServiceException.js @@ -0,0 +1,7 @@ +import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client"; +export class CognitoIdentityServiceException extends __ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, CognitoIdentityServiceException.prototype); + } +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/index.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/index.js new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/index.js @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/models_0.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/models_0.js new file mode 100644 index 0000000000..2185b17e7d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/models_0.js @@ -0,0 +1,293 @@ +import { CognitoIdentityServiceException as __BaseException } from "./CognitoIdentityServiceException"; +export var AmbiguousRoleResolutionType; +(function (AmbiguousRoleResolutionType) { + AmbiguousRoleResolutionType["AUTHENTICATED_ROLE"] = "AuthenticatedRole"; + AmbiguousRoleResolutionType["DENY"] = "Deny"; +})(AmbiguousRoleResolutionType || (AmbiguousRoleResolutionType = {})); +export class InternalErrorException extends __BaseException { + constructor(opts) { + super({ + name: "InternalErrorException", + $fault: "server", + ...opts, + }); + this.name = "InternalErrorException"; + this.$fault = "server"; + Object.setPrototypeOf(this, InternalErrorException.prototype); + } +} +export class InvalidParameterException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidParameterException", + $fault: "client", + ...opts, + }); + this.name = "InvalidParameterException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidParameterException.prototype); + } +} +export class LimitExceededException extends __BaseException { + constructor(opts) { + super({ + name: "LimitExceededException", + $fault: "client", + ...opts, + }); + this.name = "LimitExceededException"; + this.$fault = "client"; + Object.setPrototypeOf(this, LimitExceededException.prototype); + } +} +export class NotAuthorizedException extends __BaseException { + constructor(opts) { + super({ + name: "NotAuthorizedException", + $fault: "client", + ...opts, + }); + this.name = "NotAuthorizedException"; + this.$fault = "client"; + Object.setPrototypeOf(this, NotAuthorizedException.prototype); + } +} +export class ResourceConflictException extends __BaseException { + constructor(opts) { + super({ + name: "ResourceConflictException", + $fault: "client", + ...opts, + }); + this.name = "ResourceConflictException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ResourceConflictException.prototype); + } +} +export class TooManyRequestsException extends __BaseException { + constructor(opts) { + super({ + name: "TooManyRequestsException", + $fault: "client", + ...opts, + }); + this.name = "TooManyRequestsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, TooManyRequestsException.prototype); + } +} +export var ErrorCode; +(function (ErrorCode) { + ErrorCode["ACCESS_DENIED"] = "AccessDenied"; + ErrorCode["INTERNAL_SERVER_ERROR"] = "InternalServerError"; +})(ErrorCode || (ErrorCode = {})); +export class ResourceNotFoundException extends __BaseException { + constructor(opts) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + this.name = "ResourceNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + } +} +export class ExternalServiceException extends __BaseException { + constructor(opts) { + super({ + name: "ExternalServiceException", + $fault: "client", + ...opts, + }); + this.name = "ExternalServiceException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ExternalServiceException.prototype); + } +} +export class InvalidIdentityPoolConfigurationException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidIdentityPoolConfigurationException", + $fault: "client", + ...opts, + }); + this.name = "InvalidIdentityPoolConfigurationException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidIdentityPoolConfigurationException.prototype); + } +} +export var MappingRuleMatchType; +(function (MappingRuleMatchType) { + MappingRuleMatchType["CONTAINS"] = "Contains"; + MappingRuleMatchType["EQUALS"] = "Equals"; + MappingRuleMatchType["NOT_EQUAL"] = "NotEqual"; + MappingRuleMatchType["STARTS_WITH"] = "StartsWith"; +})(MappingRuleMatchType || (MappingRuleMatchType = {})); +export var RoleMappingType; +(function (RoleMappingType) { + RoleMappingType["RULES"] = "Rules"; + RoleMappingType["TOKEN"] = "Token"; +})(RoleMappingType || (RoleMappingType = {})); +export class DeveloperUserAlreadyRegisteredException extends __BaseException { + constructor(opts) { + super({ + name: "DeveloperUserAlreadyRegisteredException", + $fault: "client", + ...opts, + }); + this.name = "DeveloperUserAlreadyRegisteredException"; + this.$fault = "client"; + Object.setPrototypeOf(this, DeveloperUserAlreadyRegisteredException.prototype); + } +} +export class ConcurrentModificationException extends __BaseException { + constructor(opts) { + super({ + name: "ConcurrentModificationException", + $fault: "client", + ...opts, + }); + this.name = "ConcurrentModificationException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ConcurrentModificationException.prototype); + } +} +export const CognitoIdentityProviderFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const CreateIdentityPoolInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const IdentityPoolFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const DeleteIdentitiesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const UnprocessedIdentityIdFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const DeleteIdentitiesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const DeleteIdentityPoolInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const DescribeIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const IdentityDescriptionFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const DescribeIdentityPoolInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetCredentialsForIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const CredentialsFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetCredentialsForIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetIdInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetIdResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetIdentityPoolRolesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const MappingRuleFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const RulesConfigurationTypeFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const RoleMappingFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetIdentityPoolRolesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetOpenIdTokenInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetOpenIdTokenResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetPrincipalTagAttributeMapInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetPrincipalTagAttributeMapResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const ListIdentitiesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const ListIdentitiesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const ListIdentityPoolsInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const IdentityPoolShortDescriptionFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const ListIdentityPoolsResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const ListTagsForResourceInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const ListTagsForResourceResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const LookupDeveloperIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const LookupDeveloperIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const MergeDeveloperIdentitiesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const MergeDeveloperIdentitiesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const SetIdentityPoolRolesInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const SetPrincipalTagAttributeMapInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const SetPrincipalTagAttributeMapResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const TagResourceInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const TagResourceResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const UnlinkDeveloperIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const UnlinkIdentityInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const UntagResourceInputFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const UntagResourceResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/Interfaces.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/Interfaces.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/Interfaces.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/ListIdentityPoolsPaginator.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/ListIdentityPoolsPaginator.js new file mode 100644 index 0000000000..0fd9a9201b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/ListIdentityPoolsPaginator.js @@ -0,0 +1,32 @@ +import { CognitoIdentity } from "../CognitoIdentity"; +import { CognitoIdentityClient } from "../CognitoIdentityClient"; +import { ListIdentityPoolsCommand, } from "../commands/ListIdentityPoolsCommand"; +const makePagedClientRequest = async (client, input, ...args) => { + return await client.send(new ListIdentityPoolsCommand(input), ...args); +}; +const makePagedRequest = async (client, input, ...args) => { + return await client.listIdentityPools(input, ...args); +}; +export async function* paginateListIdentityPools(config, input, ...additionalArguments) { + let token = config.startingToken || undefined; + let hasNext = true; + let page; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CognitoIdentity) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } + else if (config.client instanceof CognitoIdentityClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } + else { + throw new Error("Invalid client, expected CognitoIdentity | CognitoIdentityClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return undefined; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/index.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/index.js new file mode 100644 index 0000000000..c77b96c1d1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/index.js @@ -0,0 +1,2 @@ +export * from "./Interfaces"; +export * from "./ListIdentityPoolsPaginator"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/protocols/Aws_json1_1.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/protocols/Aws_json1_1.js new file mode 100644 index 0000000000..f5cc950990 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/protocols/Aws_json1_1.js @@ -0,0 +1,2170 @@ +import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http"; +import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client"; +import { CognitoIdentityServiceException as __BaseException } from "../models/CognitoIdentityServiceException"; +import { ConcurrentModificationException, DeveloperUserAlreadyRegisteredException, ExternalServiceException, InternalErrorException, InvalidIdentityPoolConfigurationException, InvalidParameterException, LimitExceededException, NotAuthorizedException, ResourceConflictException, ResourceNotFoundException, TooManyRequestsException, } from "../models/models_0"; +export const serializeAws_json1_1CreateIdentityPoolCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.CreateIdentityPool", + }; + let body; + body = JSON.stringify(serializeAws_json1_1CreateIdentityPoolInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1DeleteIdentitiesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.DeleteIdentities", + }; + let body; + body = JSON.stringify(serializeAws_json1_1DeleteIdentitiesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1DeleteIdentityPoolCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.DeleteIdentityPool", + }; + let body; + body = JSON.stringify(serializeAws_json1_1DeleteIdentityPoolInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1DescribeIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.DescribeIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1DescribeIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1DescribeIdentityPoolCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.DescribeIdentityPool", + }; + let body; + body = JSON.stringify(serializeAws_json1_1DescribeIdentityPoolInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1GetCredentialsForIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetCredentialsForIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetCredentialsForIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1GetIdCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetId", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetIdInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1GetIdentityPoolRolesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetIdentityPoolRoles", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetIdentityPoolRolesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1GetOpenIdTokenCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetOpenIdToken", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1GetPrincipalTagAttributeMapCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.GetPrincipalTagAttributeMap", + }; + let body; + body = JSON.stringify(serializeAws_json1_1GetPrincipalTagAttributeMapInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1ListIdentitiesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.ListIdentities", + }; + let body; + body = JSON.stringify(serializeAws_json1_1ListIdentitiesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1ListIdentityPoolsCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.ListIdentityPools", + }; + let body; + body = JSON.stringify(serializeAws_json1_1ListIdentityPoolsInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1ListTagsForResourceCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.ListTagsForResource", + }; + let body; + body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1LookupDeveloperIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.LookupDeveloperIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1LookupDeveloperIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1MergeDeveloperIdentitiesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.MergeDeveloperIdentities", + }; + let body; + body = JSON.stringify(serializeAws_json1_1MergeDeveloperIdentitiesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1SetIdentityPoolRolesCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.SetIdentityPoolRoles", + }; + let body; + body = JSON.stringify(serializeAws_json1_1SetIdentityPoolRolesInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1SetPrincipalTagAttributeMapCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.SetPrincipalTagAttributeMap", + }; + let body; + body = JSON.stringify(serializeAws_json1_1SetPrincipalTagAttributeMapInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1TagResourceCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.TagResource", + }; + let body; + body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1UnlinkDeveloperIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.UnlinkDeveloperIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1UnlinkDeveloperIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1UnlinkIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.UnlinkIdentity", + }; + let body; + body = JSON.stringify(serializeAws_json1_1UnlinkIdentityInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1UntagResourceCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.UntagResource", + }; + let body; + body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_json1_1UpdateIdentityPoolCommand = async (input, context) => { + const headers = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "AWSCognitoIdentityService.UpdateIdentityPool", + }; + let body; + body = JSON.stringify(serializeAws_json1_1IdentityPool(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const deserializeAws_json1_1CreateIdentityPoolCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1CreateIdentityPoolCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1IdentityPool(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1CreateIdentityPoolCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cognitoidentity#LimitExceededException": + throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1DeleteIdentitiesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1DeleteIdentitiesCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1DeleteIdentitiesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1DeleteIdentitiesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1DeleteIdentityPoolCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1DeleteIdentityPoolCommandError(output, context); + } + await collectBody(output.body, context); + const response = { + $metadata: deserializeMetadata(output), + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1DeleteIdentityPoolCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1DescribeIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1DescribeIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1IdentityDescription(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1DescribeIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1DescribeIdentityPoolCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1DescribeIdentityPoolCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1IdentityPool(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1DescribeIdentityPoolCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1GetCredentialsForIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetCredentialsForIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetCredentialsForIdentityResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1GetCredentialsForIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExternalServiceException": + case "com.amazonaws.cognitoidentity#ExternalServiceException": + throw await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidIdentityPoolConfigurationException": + case "com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException": + throw await deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1GetIdCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetIdCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetIdResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1GetIdCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExternalServiceException": + case "com.amazonaws.cognitoidentity#ExternalServiceException": + throw await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cognitoidentity#LimitExceededException": + throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1GetIdentityPoolRolesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetIdentityPoolRolesCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetIdentityPoolRolesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1GetIdentityPoolRolesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1GetOpenIdTokenCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetOpenIdTokenCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetOpenIdTokenResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1GetOpenIdTokenCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExternalServiceException": + case "com.amazonaws.cognitoidentity#ExternalServiceException": + throw await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "DeveloperUserAlreadyRegisteredException": + case "com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException": + throw await deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1GetPrincipalTagAttributeMapCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1GetPrincipalTagAttributeMapCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1GetPrincipalTagAttributeMapResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1GetPrincipalTagAttributeMapCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1ListIdentitiesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1ListIdentitiesCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1ListIdentitiesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1ListIdentitiesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1ListIdentityPoolsCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1ListIdentityPoolsCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1ListIdentityPoolsResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1ListIdentityPoolsCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1ListTagsForResourceCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1ListTagsForResourceCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1ListTagsForResourceCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1LookupDeveloperIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1LookupDeveloperIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1LookupDeveloperIdentityResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1LookupDeveloperIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1MergeDeveloperIdentitiesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1MergeDeveloperIdentitiesCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1MergeDeveloperIdentitiesResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1MergeDeveloperIdentitiesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1SetIdentityPoolRolesCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1SetIdentityPoolRolesCommandError(output, context); + } + await collectBody(output.body, context); + const response = { + $metadata: deserializeMetadata(output), + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1SetIdentityPoolRolesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ConcurrentModificationException": + case "com.amazonaws.cognitoidentity#ConcurrentModificationException": + throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1SetPrincipalTagAttributeMapCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1SetPrincipalTagAttributeMapCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1SetPrincipalTagAttributeMapResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1SetPrincipalTagAttributeMapCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1TagResourceCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1TagResourceCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1TagResourceResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1TagResourceCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1UnlinkDeveloperIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1UnlinkDeveloperIdentityCommandError(output, context); + } + await collectBody(output.body, context); + const response = { + $metadata: deserializeMetadata(output), + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1UnlinkDeveloperIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1UnlinkIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1UnlinkIdentityCommandError(output, context); + } + await collectBody(output.body, context); + const response = { + $metadata: deserializeMetadata(output), + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1UnlinkIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExternalServiceException": + case "com.amazonaws.cognitoidentity#ExternalServiceException": + throw await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1UntagResourceCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1UntagResourceCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1UntagResourceResponse(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1UntagResourceCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_json1_1UpdateIdentityPoolCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1UpdateIdentityPoolCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_json1_1IdentityPool(data, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_json1_1UpdateIdentityPoolCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ConcurrentModificationException": + case "com.amazonaws.cognitoidentity#ConcurrentModificationException": + throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context); + case "InternalErrorException": + case "com.amazonaws.cognitoidentity#InternalErrorException": + throw await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cognitoidentity#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cognitoidentity#LimitExceededException": + throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.cognitoidentity#NotAuthorizedException": + throw await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitoidentity#ResourceConflictException": + throw await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.cognitoidentity#TooManyRequestsException": + throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1ConcurrentModificationException(body, context); + const exception = new ConcurrentModificationException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1DeveloperUserAlreadyRegisteredException(body, context); + const exception = new DeveloperUserAlreadyRegisteredException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1ExternalServiceExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1ExternalServiceException(body, context); + const exception = new ExternalServiceException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1InternalErrorExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1InternalErrorException(body, context); + const exception = new InternalErrorException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1InvalidIdentityPoolConfigurationException(body, context); + const exception = new InvalidIdentityPoolConfigurationException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1InvalidParameterExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1InvalidParameterException(body, context); + const exception = new InvalidParameterException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1LimitExceededException(body, context); + const exception = new LimitExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1NotAuthorizedExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1NotAuthorizedException(body, context); + const exception = new NotAuthorizedException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1ResourceConflictExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1ResourceConflictException(body, context); + const exception = new ResourceConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_json1_1TooManyRequestsExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_json1_1TooManyRequestsException(body, context); + const exception = new TooManyRequestsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const serializeAws_json1_1CognitoIdentityProvider = (input, context) => { + return { + ...(input.ClientId != null && { ClientId: input.ClientId }), + ...(input.ProviderName != null && { ProviderName: input.ProviderName }), + ...(input.ServerSideTokenCheck != null && { ServerSideTokenCheck: input.ServerSideTokenCheck }), + }; +}; +const serializeAws_json1_1CognitoIdentityProviderList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return serializeAws_json1_1CognitoIdentityProvider(entry, context); + }); +}; +const serializeAws_json1_1CreateIdentityPoolInput = (input, context) => { + return { + ...(input.AllowClassicFlow != null && { AllowClassicFlow: input.AllowClassicFlow }), + ...(input.AllowUnauthenticatedIdentities != null && { + AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities, + }), + ...(input.CognitoIdentityProviders != null && { + CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(input.CognitoIdentityProviders, context), + }), + ...(input.DeveloperProviderName != null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.IdentityPoolName != null && { IdentityPoolName: input.IdentityPoolName }), + ...(input.IdentityPoolTags != null && { + IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context), + }), + ...(input.OpenIdConnectProviderARNs != null && { + OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context), + }), + ...(input.SamlProviderARNs != null && { + SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context), + }), + ...(input.SupportedLoginProviders != null && { + SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context), + }), + }; +}; +const serializeAws_json1_1DeleteIdentitiesInput = (input, context) => { + return { + ...(input.IdentityIdsToDelete != null && { + IdentityIdsToDelete: serializeAws_json1_1IdentityIdList(input.IdentityIdsToDelete, context), + }), + }; +}; +const serializeAws_json1_1DeleteIdentityPoolInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + }; +}; +const serializeAws_json1_1DescribeIdentityInput = (input, context) => { + return { + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + }; +}; +const serializeAws_json1_1DescribeIdentityPoolInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + }; +}; +const serializeAws_json1_1GetCredentialsForIdentityInput = (input, context) => { + return { + ...(input.CustomRoleArn != null && { CustomRoleArn: input.CustomRoleArn }), + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + }; +}; +const serializeAws_json1_1GetIdentityPoolRolesInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + }; +}; +const serializeAws_json1_1GetIdInput = (input, context) => { + return { + ...(input.AccountId != null && { AccountId: input.AccountId }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + }; +}; +const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput = (input, context) => { + return { + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + ...(input.PrincipalTags != null && { + PrincipalTags: serializeAws_json1_1PrincipalTags(input.PrincipalTags, context), + }), + ...(input.TokenDuration != null && { TokenDuration: input.TokenDuration }), + }; +}; +const serializeAws_json1_1GetOpenIdTokenInput = (input, context) => { + return { + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + }; +}; +const serializeAws_json1_1GetPrincipalTagAttributeMapInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityProviderName != null && { IdentityProviderName: input.IdentityProviderName }), + }; +}; +const serializeAws_json1_1IdentityIdList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1IdentityPool = (input, context) => { + return { + ...(input.AllowClassicFlow != null && { AllowClassicFlow: input.AllowClassicFlow }), + ...(input.AllowUnauthenticatedIdentities != null && { + AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities, + }), + ...(input.CognitoIdentityProviders != null && { + CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(input.CognitoIdentityProviders, context), + }), + ...(input.DeveloperProviderName != null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityPoolName != null && { IdentityPoolName: input.IdentityPoolName }), + ...(input.IdentityPoolTags != null && { + IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context), + }), + ...(input.OpenIdConnectProviderARNs != null && { + OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context), + }), + ...(input.SamlProviderARNs != null && { + SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context), + }), + ...(input.SupportedLoginProviders != null && { + SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context), + }), + }; +}; +const serializeAws_json1_1IdentityPoolTagsListType = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1IdentityPoolTagsType = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1IdentityProviders = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1ListIdentitiesInput = (input, context) => { + return { + ...(input.HideDisabled != null && { HideDisabled: input.HideDisabled }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.MaxResults != null && { MaxResults: input.MaxResults }), + ...(input.NextToken != null && { NextToken: input.NextToken }), + }; +}; +const serializeAws_json1_1ListIdentityPoolsInput = (input, context) => { + return { + ...(input.MaxResults != null && { MaxResults: input.MaxResults }), + ...(input.NextToken != null && { NextToken: input.NextToken }), + }; +}; +const serializeAws_json1_1ListTagsForResourceInput = (input, context) => { + return { + ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }), + }; +}; +const serializeAws_json1_1LoginsList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1LoginsMap = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1LookupDeveloperIdentityInput = (input, context) => { + return { + ...(input.DeveloperUserIdentifier != null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }), + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.MaxResults != null && { MaxResults: input.MaxResults }), + ...(input.NextToken != null && { NextToken: input.NextToken }), + }; +}; +const serializeAws_json1_1MappingRule = (input, context) => { + return { + ...(input.Claim != null && { Claim: input.Claim }), + ...(input.MatchType != null && { MatchType: input.MatchType }), + ...(input.RoleARN != null && { RoleARN: input.RoleARN }), + ...(input.Value != null && { Value: input.Value }), + }; +}; +const serializeAws_json1_1MappingRulesList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return serializeAws_json1_1MappingRule(entry, context); + }); +}; +const serializeAws_json1_1MergeDeveloperIdentitiesInput = (input, context) => { + return { + ...(input.DestinationUserIdentifier != null && { DestinationUserIdentifier: input.DestinationUserIdentifier }), + ...(input.DeveloperProviderName != null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.SourceUserIdentifier != null && { SourceUserIdentifier: input.SourceUserIdentifier }), + }; +}; +const serializeAws_json1_1OIDCProviderList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1PrincipalTags = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1RoleMapping = (input, context) => { + return { + ...(input.AmbiguousRoleResolution != null && { AmbiguousRoleResolution: input.AmbiguousRoleResolution }), + ...(input.RulesConfiguration != null && { + RulesConfiguration: serializeAws_json1_1RulesConfigurationType(input.RulesConfiguration, context), + }), + ...(input.Type != null && { Type: input.Type }), + }; +}; +const serializeAws_json1_1RoleMappingMap = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = serializeAws_json1_1RoleMapping(value, context); + return acc; + }, {}); +}; +const serializeAws_json1_1RolesMap = (input, context) => { + return Object.entries(input).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; +const serializeAws_json1_1RulesConfigurationType = (input, context) => { + return { + ...(input.Rules != null && { Rules: serializeAws_json1_1MappingRulesList(input.Rules, context) }), + }; +}; +const serializeAws_json1_1SAMLProviderList = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const serializeAws_json1_1SetIdentityPoolRolesInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.RoleMappings != null && { + RoleMappings: serializeAws_json1_1RoleMappingMap(input.RoleMappings, context), + }), + ...(input.Roles != null && { Roles: serializeAws_json1_1RolesMap(input.Roles, context) }), + }; +}; +const serializeAws_json1_1SetPrincipalTagAttributeMapInput = (input, context) => { + return { + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityProviderName != null && { IdentityProviderName: input.IdentityProviderName }), + ...(input.PrincipalTags != null && { + PrincipalTags: serializeAws_json1_1PrincipalTags(input.PrincipalTags, context), + }), + ...(input.UseDefaults != null && { UseDefaults: input.UseDefaults }), + }; +}; +const serializeAws_json1_1TagResourceInput = (input, context) => { + return { + ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }), + ...(input.Tags != null && { Tags: serializeAws_json1_1IdentityPoolTagsType(input.Tags, context) }), + }; +}; +const serializeAws_json1_1UnlinkDeveloperIdentityInput = (input, context) => { + return { + ...(input.DeveloperProviderName != null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.DeveloperUserIdentifier != null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }), + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.IdentityPoolId != null && { IdentityPoolId: input.IdentityPoolId }), + }; +}; +const serializeAws_json1_1UnlinkIdentityInput = (input, context) => { + return { + ...(input.IdentityId != null && { IdentityId: input.IdentityId }), + ...(input.Logins != null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + ...(input.LoginsToRemove != null && { + LoginsToRemove: serializeAws_json1_1LoginsList(input.LoginsToRemove, context), + }), + }; +}; +const serializeAws_json1_1UntagResourceInput = (input, context) => { + return { + ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys != null && { TagKeys: serializeAws_json1_1IdentityPoolTagsListType(input.TagKeys, context) }), + }; +}; +const deserializeAws_json1_1CognitoIdentityProvider = (output, context) => { + return { + ClientId: __expectString(output.ClientId), + ProviderName: __expectString(output.ProviderName), + ServerSideTokenCheck: __expectBoolean(output.ServerSideTokenCheck), + }; +}; +const deserializeAws_json1_1CognitoIdentityProviderList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1CognitoIdentityProvider(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1ConcurrentModificationException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1Credentials = (output, context) => { + return { + AccessKeyId: __expectString(output.AccessKeyId), + Expiration: output.Expiration != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Expiration))) : undefined, + SecretKey: __expectString(output.SecretKey), + SessionToken: __expectString(output.SessionToken), + }; +}; +const deserializeAws_json1_1DeleteIdentitiesResponse = (output, context) => { + return { + UnprocessedIdentityIds: output.UnprocessedIdentityIds != null + ? deserializeAws_json1_1UnprocessedIdentityIdList(output.UnprocessedIdentityIds, context) + : undefined, + }; +}; +const deserializeAws_json1_1DeveloperUserAlreadyRegisteredException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1DeveloperUserIdentifierList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return __expectString(entry); + }); + return retVal; +}; +const deserializeAws_json1_1ExternalServiceException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1GetCredentialsForIdentityResponse = (output, context) => { + return { + Credentials: output.Credentials != null ? deserializeAws_json1_1Credentials(output.Credentials, context) : undefined, + IdentityId: __expectString(output.IdentityId), + }; +}; +const deserializeAws_json1_1GetIdentityPoolRolesResponse = (output, context) => { + return { + IdentityPoolId: __expectString(output.IdentityPoolId), + RoleMappings: output.RoleMappings != null ? deserializeAws_json1_1RoleMappingMap(output.RoleMappings, context) : undefined, + Roles: output.Roles != null ? deserializeAws_json1_1RolesMap(output.Roles, context) : undefined, + }; +}; +const deserializeAws_json1_1GetIdResponse = (output, context) => { + return { + IdentityId: __expectString(output.IdentityId), + }; +}; +const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse = (output, context) => { + return { + IdentityId: __expectString(output.IdentityId), + Token: __expectString(output.Token), + }; +}; +const deserializeAws_json1_1GetOpenIdTokenResponse = (output, context) => { + return { + IdentityId: __expectString(output.IdentityId), + Token: __expectString(output.Token), + }; +}; +const deserializeAws_json1_1GetPrincipalTagAttributeMapResponse = (output, context) => { + return { + IdentityPoolId: __expectString(output.IdentityPoolId), + IdentityProviderName: __expectString(output.IdentityProviderName), + PrincipalTags: output.PrincipalTags != null ? deserializeAws_json1_1PrincipalTags(output.PrincipalTags, context) : undefined, + UseDefaults: __expectBoolean(output.UseDefaults), + }; +}; +const deserializeAws_json1_1IdentitiesList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1IdentityDescription(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1IdentityDescription = (output, context) => { + return { + CreationDate: output.CreationDate != null + ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationDate))) + : undefined, + IdentityId: __expectString(output.IdentityId), + LastModifiedDate: output.LastModifiedDate != null + ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastModifiedDate))) + : undefined, + Logins: output.Logins != null ? deserializeAws_json1_1LoginsList(output.Logins, context) : undefined, + }; +}; +const deserializeAws_json1_1IdentityPool = (output, context) => { + return { + AllowClassicFlow: __expectBoolean(output.AllowClassicFlow), + AllowUnauthenticatedIdentities: __expectBoolean(output.AllowUnauthenticatedIdentities), + CognitoIdentityProviders: output.CognitoIdentityProviders != null + ? deserializeAws_json1_1CognitoIdentityProviderList(output.CognitoIdentityProviders, context) + : undefined, + DeveloperProviderName: __expectString(output.DeveloperProviderName), + IdentityPoolId: __expectString(output.IdentityPoolId), + IdentityPoolName: __expectString(output.IdentityPoolName), + IdentityPoolTags: output.IdentityPoolTags != null + ? deserializeAws_json1_1IdentityPoolTagsType(output.IdentityPoolTags, context) + : undefined, + OpenIdConnectProviderARNs: output.OpenIdConnectProviderARNs != null + ? deserializeAws_json1_1OIDCProviderList(output.OpenIdConnectProviderARNs, context) + : undefined, + SamlProviderARNs: output.SamlProviderARNs != null + ? deserializeAws_json1_1SAMLProviderList(output.SamlProviderARNs, context) + : undefined, + SupportedLoginProviders: output.SupportedLoginProviders != null + ? deserializeAws_json1_1IdentityProviders(output.SupportedLoginProviders, context) + : undefined, + }; +}; +const deserializeAws_json1_1IdentityPoolShortDescription = (output, context) => { + return { + IdentityPoolId: __expectString(output.IdentityPoolId), + IdentityPoolName: __expectString(output.IdentityPoolName), + }; +}; +const deserializeAws_json1_1IdentityPoolsList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1IdentityPoolShortDescription(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1IdentityPoolTagsType = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = __expectString(value); + return acc; + }, {}); +}; +const deserializeAws_json1_1IdentityProviders = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = __expectString(value); + return acc; + }, {}); +}; +const deserializeAws_json1_1InternalErrorException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1InvalidIdentityPoolConfigurationException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1InvalidParameterException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1LimitExceededException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1ListIdentitiesResponse = (output, context) => { + return { + Identities: output.Identities != null ? deserializeAws_json1_1IdentitiesList(output.Identities, context) : undefined, + IdentityPoolId: __expectString(output.IdentityPoolId), + NextToken: __expectString(output.NextToken), + }; +}; +const deserializeAws_json1_1ListIdentityPoolsResponse = (output, context) => { + return { + IdentityPools: output.IdentityPools != null ? deserializeAws_json1_1IdentityPoolsList(output.IdentityPools, context) : undefined, + NextToken: __expectString(output.NextToken), + }; +}; +const deserializeAws_json1_1ListTagsForResourceResponse = (output, context) => { + return { + Tags: output.Tags != null ? deserializeAws_json1_1IdentityPoolTagsType(output.Tags, context) : undefined, + }; +}; +const deserializeAws_json1_1LoginsList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return __expectString(entry); + }); + return retVal; +}; +const deserializeAws_json1_1LookupDeveloperIdentityResponse = (output, context) => { + return { + DeveloperUserIdentifierList: output.DeveloperUserIdentifierList != null + ? deserializeAws_json1_1DeveloperUserIdentifierList(output.DeveloperUserIdentifierList, context) + : undefined, + IdentityId: __expectString(output.IdentityId), + NextToken: __expectString(output.NextToken), + }; +}; +const deserializeAws_json1_1MappingRule = (output, context) => { + return { + Claim: __expectString(output.Claim), + MatchType: __expectString(output.MatchType), + RoleARN: __expectString(output.RoleARN), + Value: __expectString(output.Value), + }; +}; +const deserializeAws_json1_1MappingRulesList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1MappingRule(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1MergeDeveloperIdentitiesResponse = (output, context) => { + return { + IdentityId: __expectString(output.IdentityId), + }; +}; +const deserializeAws_json1_1NotAuthorizedException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1OIDCProviderList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return __expectString(entry); + }); + return retVal; +}; +const deserializeAws_json1_1PrincipalTags = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = __expectString(value); + return acc; + }, {}); +}; +const deserializeAws_json1_1ResourceConflictException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1ResourceNotFoundException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1RoleMapping = (output, context) => { + return { + AmbiguousRoleResolution: __expectString(output.AmbiguousRoleResolution), + RulesConfiguration: output.RulesConfiguration != null + ? deserializeAws_json1_1RulesConfigurationType(output.RulesConfiguration, context) + : undefined, + Type: __expectString(output.Type), + }; +}; +const deserializeAws_json1_1RoleMappingMap = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = deserializeAws_json1_1RoleMapping(value, context); + return acc; + }, {}); +}; +const deserializeAws_json1_1RolesMap = (output, context) => { + return Object.entries(output).reduce((acc, [key, value]) => { + if (value === null) { + return acc; + } + acc[key] = __expectString(value); + return acc; + }, {}); +}; +const deserializeAws_json1_1RulesConfigurationType = (output, context) => { + return { + Rules: output.Rules != null ? deserializeAws_json1_1MappingRulesList(output.Rules, context) : undefined, + }; +}; +const deserializeAws_json1_1SAMLProviderList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return __expectString(entry); + }); + return retVal; +}; +const deserializeAws_json1_1SetPrincipalTagAttributeMapResponse = (output, context) => { + return { + IdentityPoolId: __expectString(output.IdentityPoolId), + IdentityProviderName: __expectString(output.IdentityProviderName), + PrincipalTags: output.PrincipalTags != null ? deserializeAws_json1_1PrincipalTags(output.PrincipalTags, context) : undefined, + UseDefaults: __expectBoolean(output.UseDefaults), + }; +}; +const deserializeAws_json1_1TagResourceResponse = (output, context) => { + return {}; +}; +const deserializeAws_json1_1TooManyRequestsException = (output, context) => { + return { + message: __expectString(output.message), + }; +}; +const deserializeAws_json1_1UnprocessedIdentityId = (output, context) => { + return { + ErrorCode: __expectString(output.ErrorCode), + IdentityId: __expectString(output.IdentityId), + }; +}; +const deserializeAws_json1_1UnprocessedIdentityIdList = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_json1_1UnprocessedIdentityId(entry, context); + }); + return retVal; +}; +const deserializeAws_json1_1UntagResourceResponse = (output, context) => { + return {}; +}; +const deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); +const collectBody = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; +const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new __HttpRequest(contents); +}; +const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}); +const parseErrorBody = async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; +const loadRestJsonErrorCode = (output, data) => { + const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.browser.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.browser.js new file mode 100644 index 0000000000..f1486d52d0 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.browser.js @@ -0,0 +1,34 @@ +import packageInfo from "../package.json"; +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser"; +export const getRuntimeConfig = (config) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.js new file mode 100644 index 0000000000..cdcdb5b829 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.js @@ -0,0 +1,43 @@ +import packageInfo from "../package.json"; +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; +export const getRuntimeConfig = (config) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.native.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.native.js new file mode 100644 index 0000000000..0b54695282 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.native.js @@ -0,0 +1,11 @@ +import { Sha256 } from "@aws-crypto/sha256-js"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; +export const getRuntimeConfig = (config) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.shared.js b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.shared.js new file mode 100644 index 0000000000..fd9620a6a8 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.shared.js @@ -0,0 +1,17 @@ +import { NoOpLogger } from "@aws-sdk/smithy-client"; +import { parseUrl } from "@aws-sdk/url-parser"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +export const getRuntimeConfig = (config) => ({ + apiVersion: "2014-06-30", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "Cognito Identity", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, +}); diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentity.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentity.d.ts new file mode 100644 index 0000000000..49a90239f3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentity.d.ts @@ -0,0 +1,295 @@ +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; +import { CognitoIdentityClient } from "./CognitoIdentityClient"; +import { CreateIdentityPoolCommandInput, CreateIdentityPoolCommandOutput } from "./commands/CreateIdentityPoolCommand"; +import { DeleteIdentitiesCommandInput, DeleteIdentitiesCommandOutput } from "./commands/DeleteIdentitiesCommand"; +import { DeleteIdentityPoolCommandInput, DeleteIdentityPoolCommandOutput } from "./commands/DeleteIdentityPoolCommand"; +import { DescribeIdentityCommandInput, DescribeIdentityCommandOutput } from "./commands/DescribeIdentityCommand"; +import { DescribeIdentityPoolCommandInput, DescribeIdentityPoolCommandOutput } from "./commands/DescribeIdentityPoolCommand"; +import { GetCredentialsForIdentityCommandInput, GetCredentialsForIdentityCommandOutput } from "./commands/GetCredentialsForIdentityCommand"; +import { GetIdCommandInput, GetIdCommandOutput } from "./commands/GetIdCommand"; +import { GetIdentityPoolRolesCommandInput, GetIdentityPoolRolesCommandOutput } from "./commands/GetIdentityPoolRolesCommand"; +import { GetOpenIdTokenCommandInput, GetOpenIdTokenCommandOutput } from "./commands/GetOpenIdTokenCommand"; +import { GetOpenIdTokenForDeveloperIdentityCommandInput, GetOpenIdTokenForDeveloperIdentityCommandOutput } from "./commands/GetOpenIdTokenForDeveloperIdentityCommand"; +import { GetPrincipalTagAttributeMapCommandInput, GetPrincipalTagAttributeMapCommandOutput } from "./commands/GetPrincipalTagAttributeMapCommand"; +import { ListIdentitiesCommandInput, ListIdentitiesCommandOutput } from "./commands/ListIdentitiesCommand"; +import { ListIdentityPoolsCommandInput, ListIdentityPoolsCommandOutput } from "./commands/ListIdentityPoolsCommand"; +import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand"; +import { LookupDeveloperIdentityCommandInput, LookupDeveloperIdentityCommandOutput } from "./commands/LookupDeveloperIdentityCommand"; +import { MergeDeveloperIdentitiesCommandInput, MergeDeveloperIdentitiesCommandOutput } from "./commands/MergeDeveloperIdentitiesCommand"; +import { SetIdentityPoolRolesCommandInput, SetIdentityPoolRolesCommandOutput } from "./commands/SetIdentityPoolRolesCommand"; +import { SetPrincipalTagAttributeMapCommandInput, SetPrincipalTagAttributeMapCommandOutput } from "./commands/SetPrincipalTagAttributeMapCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { UnlinkDeveloperIdentityCommandInput, UnlinkDeveloperIdentityCommandOutput } from "./commands/UnlinkDeveloperIdentityCommand"; +import { UnlinkIdentityCommandInput, UnlinkIdentityCommandOutput } from "./commands/UnlinkIdentityCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +import { UpdateIdentityPoolCommandInput, UpdateIdentityPoolCommandOutput } from "./commands/UpdateIdentityPoolCommand"; +/** + * Amazon Cognito Federated Identities + *

Amazon Cognito Federated Identities is a web service that delivers scoped temporary + * credentials to mobile devices and other untrusted environments. It uniquely identifies a + * device and supplies the user with a consistent identity over the lifetime of an + * application.

+ *

Using Amazon Cognito Federated Identities, you can enable authentication with one or + * more third-party identity providers (Facebook, Google, or Login with Amazon) or an Amazon + * Cognito user pool, and you can also choose to support unauthenticated access from your app. + * Cognito delivers a unique identifier for each user and acts as an OpenID token provider + * trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS + * credentials.

+ *

For a description of the authentication flow from the Amazon Cognito Developer Guide + * see Authentication Flow.

+ *

For more information see Amazon Cognito Federated Identities.

+ */ +export declare class CognitoIdentity extends CognitoIdentityClient { + /** + *

Creates a new identity pool. The identity pool is a store of user identity + * information that is specific to your AWS account. The keys for SupportedLoginProviders are as follows:

+ * + *
    + *
  • + *

    Facebook: graph.facebook.com + *

    + *
  • + *
  • + *

    Google: accounts.google.com + *

    + *
  • + *
  • + *

    Amazon: www.amazon.com + *

    + *
  • + *
  • + *

    Twitter: api.twitter.com + *

    + *
  • + *
  • + *

    Digits: www.digits.com + *

    + *
  • + *
+ * + *

You must use AWS Developer credentials to call this API.

+ */ + createIdentityPool(args: CreateIdentityPoolCommandInput, options?: __HttpHandlerOptions): Promise; + createIdentityPool(args: CreateIdentityPoolCommandInput, cb: (err: any, data?: CreateIdentityPoolCommandOutput) => void): void; + createIdentityPool(args: CreateIdentityPoolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateIdentityPoolCommandOutput) => void): void; + /** + *

Deletes identities from an identity pool. You can specify a list of 1-60 identities + * that you want to delete.

+ *

You must use AWS Developer credentials to call this API.

+ */ + deleteIdentities(args: DeleteIdentitiesCommandInput, options?: __HttpHandlerOptions): Promise; + deleteIdentities(args: DeleteIdentitiesCommandInput, cb: (err: any, data?: DeleteIdentitiesCommandOutput) => void): void; + deleteIdentities(args: DeleteIdentitiesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteIdentitiesCommandOutput) => void): void; + /** + *

Deletes an identity pool. Once a pool is deleted, users will not be able to + * authenticate with the pool.

+ *

You must use AWS Developer credentials to call this API.

+ */ + deleteIdentityPool(args: DeleteIdentityPoolCommandInput, options?: __HttpHandlerOptions): Promise; + deleteIdentityPool(args: DeleteIdentityPoolCommandInput, cb: (err: any, data?: DeleteIdentityPoolCommandOutput) => void): void; + deleteIdentityPool(args: DeleteIdentityPoolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteIdentityPoolCommandOutput) => void): void; + /** + *

Returns metadata related to the given identity, including when the identity was + * created and any associated linked logins.

+ *

You must use AWS Developer credentials to call this API.

+ */ + describeIdentity(args: DescribeIdentityCommandInput, options?: __HttpHandlerOptions): Promise; + describeIdentity(args: DescribeIdentityCommandInput, cb: (err: any, data?: DescribeIdentityCommandOutput) => void): void; + describeIdentity(args: DescribeIdentityCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeIdentityCommandOutput) => void): void; + /** + *

Gets details about a particular identity pool, including the pool name, ID + * description, creation date, and current number of users.

+ *

You must use AWS Developer credentials to call this API.

+ */ + describeIdentityPool(args: DescribeIdentityPoolCommandInput, options?: __HttpHandlerOptions): Promise; + describeIdentityPool(args: DescribeIdentityPoolCommandInput, cb: (err: any, data?: DescribeIdentityPoolCommandOutput) => void): void; + describeIdentityPool(args: DescribeIdentityPoolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeIdentityPoolCommandOutput) => void): void; + /** + *

Returns credentials for the provided identity ID. Any provided logins will be + * validated against supported login providers. If the token is for + * cognito-identity.amazonaws.com, it will be passed through to AWS Security Token Service + * with the appropriate role for the token.

+ *

This is a public API. You do not need any credentials to call this API.

+ */ + getCredentialsForIdentity(args: GetCredentialsForIdentityCommandInput, options?: __HttpHandlerOptions): Promise; + getCredentialsForIdentity(args: GetCredentialsForIdentityCommandInput, cb: (err: any, data?: GetCredentialsForIdentityCommandOutput) => void): void; + getCredentialsForIdentity(args: GetCredentialsForIdentityCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetCredentialsForIdentityCommandOutput) => void): void; + /** + *

Generates (or retrieves) a Cognito ID. Supplying multiple logins will create an + * implicit linked account.

+ *

This is a public API. You do not need any credentials to call this API.

+ */ + getId(args: GetIdCommandInput, options?: __HttpHandlerOptions): Promise; + getId(args: GetIdCommandInput, cb: (err: any, data?: GetIdCommandOutput) => void): void; + getId(args: GetIdCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetIdCommandOutput) => void): void; + /** + *

Gets the roles for an identity pool.

+ *

You must use AWS Developer credentials to call this API.

+ */ + getIdentityPoolRoles(args: GetIdentityPoolRolesCommandInput, options?: __HttpHandlerOptions): Promise; + getIdentityPoolRoles(args: GetIdentityPoolRolesCommandInput, cb: (err: any, data?: GetIdentityPoolRolesCommandOutput) => void): void; + getIdentityPoolRoles(args: GetIdentityPoolRolesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetIdentityPoolRolesCommandOutput) => void): void; + /** + *

Gets an OpenID token, using a known Cognito ID. This known Cognito ID is returned by + * GetId. You can optionally add additional logins for the identity. + * Supplying multiple logins creates an implicit link.

+ *

The OpenID token is valid for 10 minutes.

+ *

This is a public API. You do not need any credentials to call this API.

+ */ + getOpenIdToken(args: GetOpenIdTokenCommandInput, options?: __HttpHandlerOptions): Promise; + getOpenIdToken(args: GetOpenIdTokenCommandInput, cb: (err: any, data?: GetOpenIdTokenCommandOutput) => void): void; + getOpenIdToken(args: GetOpenIdTokenCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetOpenIdTokenCommandOutput) => void): void; + /** + *

Registers (or retrieves) a Cognito IdentityId and an OpenID Connect + * token for a user authenticated by your backend authentication process. Supplying multiple + * logins will create an implicit linked account. You can only specify one developer provider + * as part of the Logins map, which is linked to the identity pool. The developer + * provider is the "domain" by which Cognito will refer to your users.

+ *

You can use GetOpenIdTokenForDeveloperIdentity to create a new identity + * and to link new logins (that is, user credentials issued by a public provider or developer + * provider) to an existing identity. When you want to create a new identity, the + * IdentityId should be null. When you want to associate a new login with an + * existing authenticated/unauthenticated identity, you can do so by providing the existing + * IdentityId. This API will create the identity in the specified + * IdentityPoolId.

+ *

You must use AWS Developer credentials to call this API.

+ */ + getOpenIdTokenForDeveloperIdentity(args: GetOpenIdTokenForDeveloperIdentityCommandInput, options?: __HttpHandlerOptions): Promise; + getOpenIdTokenForDeveloperIdentity(args: GetOpenIdTokenForDeveloperIdentityCommandInput, cb: (err: any, data?: GetOpenIdTokenForDeveloperIdentityCommandOutput) => void): void; + getOpenIdTokenForDeveloperIdentity(args: GetOpenIdTokenForDeveloperIdentityCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetOpenIdTokenForDeveloperIdentityCommandOutput) => void): void; + /** + *

Use GetPrincipalTagAttributeMap to list all mappings between PrincipalTags and user attributes.

+ */ + getPrincipalTagAttributeMap(args: GetPrincipalTagAttributeMapCommandInput, options?: __HttpHandlerOptions): Promise; + getPrincipalTagAttributeMap(args: GetPrincipalTagAttributeMapCommandInput, cb: (err: any, data?: GetPrincipalTagAttributeMapCommandOutput) => void): void; + getPrincipalTagAttributeMap(args: GetPrincipalTagAttributeMapCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetPrincipalTagAttributeMapCommandOutput) => void): void; + /** + *

Lists the identities in an identity pool.

+ *

You must use AWS Developer credentials to call this API.

+ */ + listIdentities(args: ListIdentitiesCommandInput, options?: __HttpHandlerOptions): Promise; + listIdentities(args: ListIdentitiesCommandInput, cb: (err: any, data?: ListIdentitiesCommandOutput) => void): void; + listIdentities(args: ListIdentitiesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListIdentitiesCommandOutput) => void): void; + /** + *

Lists all of the Cognito identity pools registered for your account.

+ *

You must use AWS Developer credentials to call this API.

+ */ + listIdentityPools(args: ListIdentityPoolsCommandInput, options?: __HttpHandlerOptions): Promise; + listIdentityPools(args: ListIdentityPoolsCommandInput, cb: (err: any, data?: ListIdentityPoolsCommandOutput) => void): void; + listIdentityPools(args: ListIdentityPoolsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListIdentityPoolsCommandOutput) => void): void; + /** + *

Lists the tags that are assigned to an Amazon Cognito identity pool.

+ *

A tag is a label that you can apply to identity pools to categorize and manage them in + * different ways, such as by purpose, owner, environment, or other criteria.

+ *

You can use this action up to 10 times per second, per account.

+ */ + listTagsForResource(args: ListTagsForResourceCommandInput, options?: __HttpHandlerOptions): Promise; + listTagsForResource(args: ListTagsForResourceCommandInput, cb: (err: any, data?: ListTagsForResourceCommandOutput) => void): void; + listTagsForResource(args: ListTagsForResourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListTagsForResourceCommandOutput) => void): void; + /** + *

Retrieves the IdentityID associated with a + * DeveloperUserIdentifier or the list of DeveloperUserIdentifier + * values associated with an IdentityId for an existing identity. Either + * IdentityID or DeveloperUserIdentifier must not be null. If you + * supply only one of these values, the other value will be searched in the database and + * returned as a part of the response. If you supply both, + * DeveloperUserIdentifier will be matched against IdentityID. If + * the values are verified against the database, the response returns both values and is the + * same as the request. Otherwise a ResourceConflictException is + * thrown.

+ *

+ * LookupDeveloperIdentity is intended for low-throughput control plane + * operations: for example, to enable customer service to locate an identity ID by username. + * If you are using it for higher-volume operations such as user authentication, your requests + * are likely to be throttled. GetOpenIdTokenForDeveloperIdentity is a + * better option for higher-volume operations for user authentication.

+ *

You must use AWS Developer credentials to call this API.

+ */ + lookupDeveloperIdentity(args: LookupDeveloperIdentityCommandInput, options?: __HttpHandlerOptions): Promise; + lookupDeveloperIdentity(args: LookupDeveloperIdentityCommandInput, cb: (err: any, data?: LookupDeveloperIdentityCommandOutput) => void): void; + lookupDeveloperIdentity(args: LookupDeveloperIdentityCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: LookupDeveloperIdentityCommandOutput) => void): void; + /** + *

Merges two users having different IdentityIds, existing in the same + * identity pool, and identified by the same developer provider. You can use this action to + * request that discrete users be merged and identified as a single user in the Cognito + * environment. Cognito associates the given source user (SourceUserIdentifier) + * with the IdentityId of the DestinationUserIdentifier. Only + * developer-authenticated users can be merged. If the users to be merged are associated with + * the same public provider, but as two different users, an exception will be + * thrown.

+ *

The number of linked logins is limited to 20. So, the number of linked logins for the + * source user, SourceUserIdentifier, and the destination user, + * DestinationUserIdentifier, together should not be larger than 20. + * Otherwise, an exception will be thrown.

+ *

You must use AWS Developer credentials to call this API.

+ */ + mergeDeveloperIdentities(args: MergeDeveloperIdentitiesCommandInput, options?: __HttpHandlerOptions): Promise; + mergeDeveloperIdentities(args: MergeDeveloperIdentitiesCommandInput, cb: (err: any, data?: MergeDeveloperIdentitiesCommandOutput) => void): void; + mergeDeveloperIdentities(args: MergeDeveloperIdentitiesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: MergeDeveloperIdentitiesCommandOutput) => void): void; + /** + *

Sets the roles for an identity pool. These roles are used when making calls to GetCredentialsForIdentity action.

+ *

You must use AWS Developer credentials to call this API.

+ */ + setIdentityPoolRoles(args: SetIdentityPoolRolesCommandInput, options?: __HttpHandlerOptions): Promise; + setIdentityPoolRoles(args: SetIdentityPoolRolesCommandInput, cb: (err: any, data?: SetIdentityPoolRolesCommandOutput) => void): void; + setIdentityPoolRoles(args: SetIdentityPoolRolesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: SetIdentityPoolRolesCommandOutput) => void): void; + /** + *

You can use this operation to use default (username and clientID) attribute or custom attribute mappings.

+ */ + setPrincipalTagAttributeMap(args: SetPrincipalTagAttributeMapCommandInput, options?: __HttpHandlerOptions): Promise; + setPrincipalTagAttributeMap(args: SetPrincipalTagAttributeMapCommandInput, cb: (err: any, data?: SetPrincipalTagAttributeMapCommandOutput) => void): void; + setPrincipalTagAttributeMap(args: SetPrincipalTagAttributeMapCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: SetPrincipalTagAttributeMapCommandOutput) => void): void; + /** + *

Assigns a set of tags to the specified Amazon Cognito identity pool. A tag is a label + * that you can use to categorize and manage identity pools in different ways, such as by + * purpose, owner, environment, or other criteria.

+ *

Each tag consists of a key and value, both of which you define. A key is a general + * category for more specific values. For example, if you have two versions of an identity + * pool, one for testing and another for production, you might assign an + * Environment tag key to both identity pools. The value of this key might be + * Test for one identity pool and Production for the + * other.

+ *

Tags are useful for cost tracking and access control. You can activate your tags so that + * they appear on the Billing and Cost Management console, where you can track the costs + * associated with your identity pools. In an IAM policy, you can constrain permissions for + * identity pools based on specific tags or tag values.

+ *

You can use this action up to 5 times per second, per account. An identity pool can have + * as many as 50 tags.

+ */ + tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void; + tagResource(args: TagResourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: TagResourceCommandOutput) => void): void; + /** + *

Unlinks a DeveloperUserIdentifier from an existing identity. Unlinked + * developer users will be considered new identities next time they are seen. If, for a given + * Cognito identity, you remove all federated identities as well as the developer user + * identifier, the Cognito identity becomes inaccessible.

+ *

You must use AWS Developer credentials to call this API.

+ */ + unlinkDeveloperIdentity(args: UnlinkDeveloperIdentityCommandInput, options?: __HttpHandlerOptions): Promise; + unlinkDeveloperIdentity(args: UnlinkDeveloperIdentityCommandInput, cb: (err: any, data?: UnlinkDeveloperIdentityCommandOutput) => void): void; + unlinkDeveloperIdentity(args: UnlinkDeveloperIdentityCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UnlinkDeveloperIdentityCommandOutput) => void): void; + /** + *

Unlinks a federated identity from an existing account. Unlinked logins will be + * considered new identities next time they are seen. Removing the last linked login will make + * this identity inaccessible.

+ *

This is a public API. You do not need any credentials to call this API.

+ */ + unlinkIdentity(args: UnlinkIdentityCommandInput, options?: __HttpHandlerOptions): Promise; + unlinkIdentity(args: UnlinkIdentityCommandInput, cb: (err: any, data?: UnlinkIdentityCommandOutput) => void): void; + unlinkIdentity(args: UnlinkIdentityCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UnlinkIdentityCommandOutput) => void): void; + /** + *

Removes the specified tags from the specified Amazon Cognito identity pool. You can use + * this action up to 5 times per second, per account

+ */ + untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void; + untagResource(args: UntagResourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UntagResourceCommandOutput) => void): void; + /** + *

Updates an identity pool.

+ *

You must use AWS Developer credentials to call this API.

+ */ + updateIdentityPool(args: UpdateIdentityPoolCommandInput, options?: __HttpHandlerOptions): Promise; + updateIdentityPool(args: UpdateIdentityPoolCommandInput, cb: (err: any, data?: UpdateIdentityPoolCommandOutput) => void): void; + updateIdentityPool(args: UpdateIdentityPoolCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UpdateIdentityPoolCommandOutput) => void): void; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentityClient.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentityClient.d.ts new file mode 100644 index 0000000000..1b0a49acaa --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentityClient.d.ts @@ -0,0 +1,177 @@ +import { RegionInputConfig, RegionResolvedConfig } from "@aws-sdk/config-resolver"; +import { EndpointInputConfig, EndpointResolvedConfig } from "@aws-sdk/middleware-endpoint"; +import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header"; +import { RetryInputConfig, RetryResolvedConfig } from "@aws-sdk/middleware-retry"; +import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing"; +import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@aws-sdk/smithy-client"; +import { BodyLengthCalculator as __BodyLengthCalculator, ChecksumConstructor as __ChecksumConstructor, Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types"; +import { CreateIdentityPoolCommandInput, CreateIdentityPoolCommandOutput } from "./commands/CreateIdentityPoolCommand"; +import { DeleteIdentitiesCommandInput, DeleteIdentitiesCommandOutput } from "./commands/DeleteIdentitiesCommand"; +import { DeleteIdentityPoolCommandInput, DeleteIdentityPoolCommandOutput } from "./commands/DeleteIdentityPoolCommand"; +import { DescribeIdentityCommandInput, DescribeIdentityCommandOutput } from "./commands/DescribeIdentityCommand"; +import { DescribeIdentityPoolCommandInput, DescribeIdentityPoolCommandOutput } from "./commands/DescribeIdentityPoolCommand"; +import { GetCredentialsForIdentityCommandInput, GetCredentialsForIdentityCommandOutput } from "./commands/GetCredentialsForIdentityCommand"; +import { GetIdCommandInput, GetIdCommandOutput } from "./commands/GetIdCommand"; +import { GetIdentityPoolRolesCommandInput, GetIdentityPoolRolesCommandOutput } from "./commands/GetIdentityPoolRolesCommand"; +import { GetOpenIdTokenCommandInput, GetOpenIdTokenCommandOutput } from "./commands/GetOpenIdTokenCommand"; +import { GetOpenIdTokenForDeveloperIdentityCommandInput, GetOpenIdTokenForDeveloperIdentityCommandOutput } from "./commands/GetOpenIdTokenForDeveloperIdentityCommand"; +import { GetPrincipalTagAttributeMapCommandInput, GetPrincipalTagAttributeMapCommandOutput } from "./commands/GetPrincipalTagAttributeMapCommand"; +import { ListIdentitiesCommandInput, ListIdentitiesCommandOutput } from "./commands/ListIdentitiesCommand"; +import { ListIdentityPoolsCommandInput, ListIdentityPoolsCommandOutput } from "./commands/ListIdentityPoolsCommand"; +import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand"; +import { LookupDeveloperIdentityCommandInput, LookupDeveloperIdentityCommandOutput } from "./commands/LookupDeveloperIdentityCommand"; +import { MergeDeveloperIdentitiesCommandInput, MergeDeveloperIdentitiesCommandOutput } from "./commands/MergeDeveloperIdentitiesCommand"; +import { SetIdentityPoolRolesCommandInput, SetIdentityPoolRolesCommandOutput } from "./commands/SetIdentityPoolRolesCommand"; +import { SetPrincipalTagAttributeMapCommandInput, SetPrincipalTagAttributeMapCommandOutput } from "./commands/SetPrincipalTagAttributeMapCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { UnlinkDeveloperIdentityCommandInput, UnlinkDeveloperIdentityCommandOutput } from "./commands/UnlinkDeveloperIdentityCommand"; +import { UnlinkIdentityCommandInput, UnlinkIdentityCommandOutput } from "./commands/UnlinkIdentityCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +import { UpdateIdentityPoolCommandInput, UpdateIdentityPoolCommandOutput } from "./commands/UpdateIdentityPoolCommand"; +import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters"; +export declare type ServiceInputTypes = CreateIdentityPoolCommandInput | DeleteIdentitiesCommandInput | DeleteIdentityPoolCommandInput | DescribeIdentityCommandInput | DescribeIdentityPoolCommandInput | GetCredentialsForIdentityCommandInput | GetIdCommandInput | GetIdentityPoolRolesCommandInput | GetOpenIdTokenCommandInput | GetOpenIdTokenForDeveloperIdentityCommandInput | GetPrincipalTagAttributeMapCommandInput | ListIdentitiesCommandInput | ListIdentityPoolsCommandInput | ListTagsForResourceCommandInput | LookupDeveloperIdentityCommandInput | MergeDeveloperIdentitiesCommandInput | SetIdentityPoolRolesCommandInput | SetPrincipalTagAttributeMapCommandInput | TagResourceCommandInput | UnlinkDeveloperIdentityCommandInput | UnlinkIdentityCommandInput | UntagResourceCommandInput | UpdateIdentityPoolCommandInput; +export declare type ServiceOutputTypes = CreateIdentityPoolCommandOutput | DeleteIdentitiesCommandOutput | DeleteIdentityPoolCommandOutput | DescribeIdentityCommandOutput | DescribeIdentityPoolCommandOutput | GetCredentialsForIdentityCommandOutput | GetIdCommandOutput | GetIdentityPoolRolesCommandOutput | GetOpenIdTokenCommandOutput | GetOpenIdTokenForDeveloperIdentityCommandOutput | GetPrincipalTagAttributeMapCommandOutput | ListIdentitiesCommandOutput | ListIdentityPoolsCommandOutput | ListTagsForResourceCommandOutput | LookupDeveloperIdentityCommandOutput | MergeDeveloperIdentitiesCommandOutput | SetIdentityPoolRolesCommandOutput | SetPrincipalTagAttributeMapCommandOutput | TagResourceCommandOutput | UnlinkDeveloperIdentityCommandOutput | UnlinkIdentityCommandOutput | UntagResourceCommandOutput | UpdateIdentityPoolCommandOutput; +export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandler; + /** + * A constructor for a class implementing the {@link __Checksum} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + /** + * The runtime environment. + * @internal + */ + runtime?: string; + /** + * Disable dyanamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + /** + * Specifies which retry algorithm to use. + */ + retryMode?: string | __Provider; + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + /** + * Default credentials provider; Not available in browser runtime. + * @internal + */ + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** + * The {@link __DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} +declare type CognitoIdentityClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig & ClientInputEndpointParameters; +/** + * The configuration interface of CognitoIdentityClient class constructor that set the region, credentials and other options. + */ +export interface CognitoIdentityClientConfig extends CognitoIdentityClientConfigType { +} +declare type CognitoIdentityClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & RegionResolvedConfig & EndpointResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters; +/** + * The resolved configuration interface of CognitoIdentityClient class. This is resolved and normalized from the {@link CognitoIdentityClientConfig | constructor configuration interface}. + */ +export interface CognitoIdentityClientResolvedConfig extends CognitoIdentityClientResolvedConfigType { +} +/** + * Amazon Cognito Federated Identities + *

Amazon Cognito Federated Identities is a web service that delivers scoped temporary + * credentials to mobile devices and other untrusted environments. It uniquely identifies a + * device and supplies the user with a consistent identity over the lifetime of an + * application.

+ *

Using Amazon Cognito Federated Identities, you can enable authentication with one or + * more third-party identity providers (Facebook, Google, or Login with Amazon) or an Amazon + * Cognito user pool, and you can also choose to support unauthenticated access from your app. + * Cognito delivers a unique identifier for each user and acts as an OpenID token provider + * trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS + * credentials.

+ *

For a description of the authentication flow from the Amazon Cognito Developer Guide + * see Authentication Flow.

+ *

For more information see Amazon Cognito Federated Identities.

+ */ +export declare class CognitoIdentityClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, CognitoIdentityClientResolvedConfig> { + /** + * The resolved configuration of CognitoIdentityClient class. This is resolved and normalized from the {@link CognitoIdentityClientConfig | constructor configuration interface}. + */ + readonly config: CognitoIdentityClientResolvedConfig; + constructor(configuration: CognitoIdentityClientConfig); + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/CreateIdentityPoolCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/CreateIdentityPoolCommand.d.ts new file mode 100644 index 0000000000..5c07038c6f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/CreateIdentityPoolCommand.d.ts @@ -0,0 +1,63 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { CreateIdentityPoolInput, IdentityPool } from "../models/models_0"; +export interface CreateIdentityPoolCommandInput extends CreateIdentityPoolInput { +} +export interface CreateIdentityPoolCommandOutput extends IdentityPool, __MetadataBearer { +} +/** + *

Creates a new identity pool. The identity pool is a store of user identity + * information that is specific to your AWS account. The keys for SupportedLoginProviders are as follows:

+ * + *
    + *
  • + *

    Facebook: graph.facebook.com + *

    + *
  • + *
  • + *

    Google: accounts.google.com + *

    + *
  • + *
  • + *

    Amazon: www.amazon.com + *

    + *
  • + *
  • + *

    Twitter: api.twitter.com + *

    + *
  • + *
  • + *

    Digits: www.digits.com + *

    + *
  • + *
+ * + *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, CreateIdentityPoolCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, CreateIdentityPoolCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new CreateIdentityPoolCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link CreateIdentityPoolCommandInput} for command's `input` shape. + * @see {@link CreateIdentityPoolCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class CreateIdentityPoolCommand extends $Command { + readonly input: CreateIdentityPoolCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: CreateIdentityPoolCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentitiesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentitiesCommand.d.ts new file mode 100644 index 0000000000..119e8568d5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentitiesCommand.d.ts @@ -0,0 +1,39 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { DeleteIdentitiesInput, DeleteIdentitiesResponse } from "../models/models_0"; +export interface DeleteIdentitiesCommandInput extends DeleteIdentitiesInput { +} +export interface DeleteIdentitiesCommandOutput extends DeleteIdentitiesResponse, __MetadataBearer { +} +/** + *

Deletes identities from an identity pool. You can specify a list of 1-60 identities + * that you want to delete.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, DeleteIdentitiesCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, DeleteIdentitiesCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new DeleteIdentitiesCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link DeleteIdentitiesCommandInput} for command's `input` shape. + * @see {@link DeleteIdentitiesCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class DeleteIdentitiesCommand extends $Command { + readonly input: DeleteIdentitiesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DeleteIdentitiesCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentityPoolCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentityPoolCommand.d.ts new file mode 100644 index 0000000000..43c70118f7 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentityPoolCommand.d.ts @@ -0,0 +1,39 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { DeleteIdentityPoolInput } from "../models/models_0"; +export interface DeleteIdentityPoolCommandInput extends DeleteIdentityPoolInput { +} +export interface DeleteIdentityPoolCommandOutput extends __MetadataBearer { +} +/** + *

Deletes an identity pool. Once a pool is deleted, users will not be able to + * authenticate with the pool.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, DeleteIdentityPoolCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, DeleteIdentityPoolCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new DeleteIdentityPoolCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link DeleteIdentityPoolCommandInput} for command's `input` shape. + * @see {@link DeleteIdentityPoolCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class DeleteIdentityPoolCommand extends $Command { + readonly input: DeleteIdentityPoolCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DeleteIdentityPoolCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityCommand.d.ts new file mode 100644 index 0000000000..f40d93fe9f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityCommand.d.ts @@ -0,0 +1,39 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { DescribeIdentityInput, IdentityDescription } from "../models/models_0"; +export interface DescribeIdentityCommandInput extends DescribeIdentityInput { +} +export interface DescribeIdentityCommandOutput extends IdentityDescription, __MetadataBearer { +} +/** + *

Returns metadata related to the given identity, including when the identity was + * created and any associated linked logins.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, DescribeIdentityCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, DescribeIdentityCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new DescribeIdentityCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link DescribeIdentityCommandInput} for command's `input` shape. + * @see {@link DescribeIdentityCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class DescribeIdentityCommand extends $Command { + readonly input: DescribeIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DescribeIdentityCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityPoolCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityPoolCommand.d.ts new file mode 100644 index 0000000000..256764f868 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityPoolCommand.d.ts @@ -0,0 +1,39 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { DescribeIdentityPoolInput, IdentityPool } from "../models/models_0"; +export interface DescribeIdentityPoolCommandInput extends DescribeIdentityPoolInput { +} +export interface DescribeIdentityPoolCommandOutput extends IdentityPool, __MetadataBearer { +} +/** + *

Gets details about a particular identity pool, including the pool name, ID + * description, creation date, and current number of users.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, DescribeIdentityPoolCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, DescribeIdentityPoolCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new DescribeIdentityPoolCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link DescribeIdentityPoolCommandInput} for command's `input` shape. + * @see {@link DescribeIdentityPoolCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class DescribeIdentityPoolCommand extends $Command { + readonly input: DescribeIdentityPoolCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DescribeIdentityPoolCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetCredentialsForIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetCredentialsForIdentityCommand.d.ts new file mode 100644 index 0000000000..f3fbde2f24 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetCredentialsForIdentityCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { GetCredentialsForIdentityInput, GetCredentialsForIdentityResponse } from "../models/models_0"; +export interface GetCredentialsForIdentityCommandInput extends GetCredentialsForIdentityInput { +} +export interface GetCredentialsForIdentityCommandOutput extends GetCredentialsForIdentityResponse, __MetadataBearer { +} +/** + *

Returns credentials for the provided identity ID. Any provided logins will be + * validated against supported login providers. If the token is for + * cognito-identity.amazonaws.com, it will be passed through to AWS Security Token Service + * with the appropriate role for the token.

+ *

This is a public API. You do not need any credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, GetCredentialsForIdentityCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, GetCredentialsForIdentityCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new GetCredentialsForIdentityCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetCredentialsForIdentityCommandInput} for command's `input` shape. + * @see {@link GetCredentialsForIdentityCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class GetCredentialsForIdentityCommand extends $Command { + readonly input: GetCredentialsForIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetCredentialsForIdentityCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdCommand.d.ts new file mode 100644 index 0000000000..94c1f88ab4 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdCommand.d.ts @@ -0,0 +1,39 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { GetIdInput, GetIdResponse } from "../models/models_0"; +export interface GetIdCommandInput extends GetIdInput { +} +export interface GetIdCommandOutput extends GetIdResponse, __MetadataBearer { +} +/** + *

Generates (or retrieves) a Cognito ID. Supplying multiple logins will create an + * implicit linked account.

+ *

This is a public API. You do not need any credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, GetIdCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, GetIdCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new GetIdCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetIdCommandInput} for command's `input` shape. + * @see {@link GetIdCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class GetIdCommand extends $Command { + readonly input: GetIdCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetIdCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdentityPoolRolesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdentityPoolRolesCommand.d.ts new file mode 100644 index 0000000000..679b393a5d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdentityPoolRolesCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { GetIdentityPoolRolesInput, GetIdentityPoolRolesResponse } from "../models/models_0"; +export interface GetIdentityPoolRolesCommandInput extends GetIdentityPoolRolesInput { +} +export interface GetIdentityPoolRolesCommandOutput extends GetIdentityPoolRolesResponse, __MetadataBearer { +} +/** + *

Gets the roles for an identity pool.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, GetIdentityPoolRolesCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, GetIdentityPoolRolesCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new GetIdentityPoolRolesCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetIdentityPoolRolesCommandInput} for command's `input` shape. + * @see {@link GetIdentityPoolRolesCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class GetIdentityPoolRolesCommand extends $Command { + readonly input: GetIdentityPoolRolesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetIdentityPoolRolesCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenCommand.d.ts new file mode 100644 index 0000000000..eebc55262d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { GetOpenIdTokenInput, GetOpenIdTokenResponse } from "../models/models_0"; +export interface GetOpenIdTokenCommandInput extends GetOpenIdTokenInput { +} +export interface GetOpenIdTokenCommandOutput extends GetOpenIdTokenResponse, __MetadataBearer { +} +/** + *

Gets an OpenID token, using a known Cognito ID. This known Cognito ID is returned by + * GetId. You can optionally add additional logins for the identity. + * Supplying multiple logins creates an implicit link.

+ *

The OpenID token is valid for 10 minutes.

+ *

This is a public API. You do not need any credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, GetOpenIdTokenCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, GetOpenIdTokenCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new GetOpenIdTokenCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetOpenIdTokenCommandInput} for command's `input` shape. + * @see {@link GetOpenIdTokenCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class GetOpenIdTokenCommand extends $Command { + readonly input: GetOpenIdTokenCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetOpenIdTokenCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts new file mode 100644 index 0000000000..0cea74e37d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts @@ -0,0 +1,49 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { GetOpenIdTokenForDeveloperIdentityInput, GetOpenIdTokenForDeveloperIdentityResponse } from "../models/models_0"; +export interface GetOpenIdTokenForDeveloperIdentityCommandInput extends GetOpenIdTokenForDeveloperIdentityInput { +} +export interface GetOpenIdTokenForDeveloperIdentityCommandOutput extends GetOpenIdTokenForDeveloperIdentityResponse, __MetadataBearer { +} +/** + *

Registers (or retrieves) a Cognito IdentityId and an OpenID Connect + * token for a user authenticated by your backend authentication process. Supplying multiple + * logins will create an implicit linked account. You can only specify one developer provider + * as part of the Logins map, which is linked to the identity pool. The developer + * provider is the "domain" by which Cognito will refer to your users.

+ *

You can use GetOpenIdTokenForDeveloperIdentity to create a new identity + * and to link new logins (that is, user credentials issued by a public provider or developer + * provider) to an existing identity. When you want to create a new identity, the + * IdentityId should be null. When you want to associate a new login with an + * existing authenticated/unauthenticated identity, you can do so by providing the existing + * IdentityId. This API will create the identity in the specified + * IdentityPoolId.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, GetOpenIdTokenForDeveloperIdentityCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, GetOpenIdTokenForDeveloperIdentityCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new GetOpenIdTokenForDeveloperIdentityCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetOpenIdTokenForDeveloperIdentityCommandInput} for command's `input` shape. + * @see {@link GetOpenIdTokenForDeveloperIdentityCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class GetOpenIdTokenForDeveloperIdentityCommand extends $Command { + readonly input: GetOpenIdTokenForDeveloperIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetOpenIdTokenForDeveloperIdentityCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetPrincipalTagAttributeMapCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetPrincipalTagAttributeMapCommand.d.ts new file mode 100644 index 0000000000..8276298f50 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetPrincipalTagAttributeMapCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { GetPrincipalTagAttributeMapInput, GetPrincipalTagAttributeMapResponse } from "../models/models_0"; +export interface GetPrincipalTagAttributeMapCommandInput extends GetPrincipalTagAttributeMapInput { +} +export interface GetPrincipalTagAttributeMapCommandOutput extends GetPrincipalTagAttributeMapResponse, __MetadataBearer { +} +/** + *

Use GetPrincipalTagAttributeMap to list all mappings between PrincipalTags and user attributes.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, GetPrincipalTagAttributeMapCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, GetPrincipalTagAttributeMapCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new GetPrincipalTagAttributeMapCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetPrincipalTagAttributeMapCommandInput} for command's `input` shape. + * @see {@link GetPrincipalTagAttributeMapCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class GetPrincipalTagAttributeMapCommand extends $Command { + readonly input: GetPrincipalTagAttributeMapCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetPrincipalTagAttributeMapCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentitiesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentitiesCommand.d.ts new file mode 100644 index 0000000000..5ac2c2685d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentitiesCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { ListIdentitiesInput, ListIdentitiesResponse } from "../models/models_0"; +export interface ListIdentitiesCommandInput extends ListIdentitiesInput { +} +export interface ListIdentitiesCommandOutput extends ListIdentitiesResponse, __MetadataBearer { +} +/** + *

Lists the identities in an identity pool.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, ListIdentitiesCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, ListIdentitiesCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new ListIdentitiesCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListIdentitiesCommandInput} for command's `input` shape. + * @see {@link ListIdentitiesCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class ListIdentitiesCommand extends $Command { + readonly input: ListIdentitiesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListIdentitiesCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentityPoolsCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentityPoolsCommand.d.ts new file mode 100644 index 0000000000..af38749aeb --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentityPoolsCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { ListIdentityPoolsInput, ListIdentityPoolsResponse } from "../models/models_0"; +export interface ListIdentityPoolsCommandInput extends ListIdentityPoolsInput { +} +export interface ListIdentityPoolsCommandOutput extends ListIdentityPoolsResponse, __MetadataBearer { +} +/** + *

Lists all of the Cognito identity pools registered for your account.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, ListIdentityPoolsCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, ListIdentityPoolsCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new ListIdentityPoolsCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListIdentityPoolsCommandInput} for command's `input` shape. + * @see {@link ListIdentityPoolsCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class ListIdentityPoolsCommand extends $Command { + readonly input: ListIdentityPoolsCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListIdentityPoolsCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListTagsForResourceCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListTagsForResourceCommand.d.ts new file mode 100644 index 0000000000..1fcad70650 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListTagsForResourceCommand.d.ts @@ -0,0 +1,40 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { ListTagsForResourceInput, ListTagsForResourceResponse } from "../models/models_0"; +export interface ListTagsForResourceCommandInput extends ListTagsForResourceInput { +} +export interface ListTagsForResourceCommandOutput extends ListTagsForResourceResponse, __MetadataBearer { +} +/** + *

Lists the tags that are assigned to an Amazon Cognito identity pool.

+ *

A tag is a label that you can apply to identity pools to categorize and manage them in + * different ways, such as by purpose, owner, environment, or other criteria.

+ *

You can use this action up to 10 times per second, per account.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, ListTagsForResourceCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, ListTagsForResourceCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new ListTagsForResourceCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListTagsForResourceCommandInput} for command's `input` shape. + * @see {@link ListTagsForResourceCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class ListTagsForResourceCommand extends $Command { + readonly input: ListTagsForResourceCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListTagsForResourceCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/LookupDeveloperIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/LookupDeveloperIdentityCommand.d.ts new file mode 100644 index 0000000000..46fe227ac1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/LookupDeveloperIdentityCommand.d.ts @@ -0,0 +1,53 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { LookupDeveloperIdentityInput, LookupDeveloperIdentityResponse } from "../models/models_0"; +export interface LookupDeveloperIdentityCommandInput extends LookupDeveloperIdentityInput { +} +export interface LookupDeveloperIdentityCommandOutput extends LookupDeveloperIdentityResponse, __MetadataBearer { +} +/** + *

Retrieves the IdentityID associated with a + * DeveloperUserIdentifier or the list of DeveloperUserIdentifier + * values associated with an IdentityId for an existing identity. Either + * IdentityID or DeveloperUserIdentifier must not be null. If you + * supply only one of these values, the other value will be searched in the database and + * returned as a part of the response. If you supply both, + * DeveloperUserIdentifier will be matched against IdentityID. If + * the values are verified against the database, the response returns both values and is the + * same as the request. Otherwise a ResourceConflictException is + * thrown.

+ *

+ * LookupDeveloperIdentity is intended for low-throughput control plane + * operations: for example, to enable customer service to locate an identity ID by username. + * If you are using it for higher-volume operations such as user authentication, your requests + * are likely to be throttled. GetOpenIdTokenForDeveloperIdentity is a + * better option for higher-volume operations for user authentication.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, LookupDeveloperIdentityCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, LookupDeveloperIdentityCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new LookupDeveloperIdentityCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link LookupDeveloperIdentityCommandInput} for command's `input` shape. + * @see {@link LookupDeveloperIdentityCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class LookupDeveloperIdentityCommand extends $Command { + readonly input: LookupDeveloperIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: LookupDeveloperIdentityCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/MergeDeveloperIdentitiesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/MergeDeveloperIdentitiesCommand.d.ts new file mode 100644 index 0000000000..b882f18218 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/MergeDeveloperIdentitiesCommand.d.ts @@ -0,0 +1,49 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { MergeDeveloperIdentitiesInput, MergeDeveloperIdentitiesResponse } from "../models/models_0"; +export interface MergeDeveloperIdentitiesCommandInput extends MergeDeveloperIdentitiesInput { +} +export interface MergeDeveloperIdentitiesCommandOutput extends MergeDeveloperIdentitiesResponse, __MetadataBearer { +} +/** + *

Merges two users having different IdentityIds, existing in the same + * identity pool, and identified by the same developer provider. You can use this action to + * request that discrete users be merged and identified as a single user in the Cognito + * environment. Cognito associates the given source user (SourceUserIdentifier) + * with the IdentityId of the DestinationUserIdentifier. Only + * developer-authenticated users can be merged. If the users to be merged are associated with + * the same public provider, but as two different users, an exception will be + * thrown.

+ *

The number of linked logins is limited to 20. So, the number of linked logins for the + * source user, SourceUserIdentifier, and the destination user, + * DestinationUserIdentifier, together should not be larger than 20. + * Otherwise, an exception will be thrown.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, MergeDeveloperIdentitiesCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, MergeDeveloperIdentitiesCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new MergeDeveloperIdentitiesCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link MergeDeveloperIdentitiesCommandInput} for command's `input` shape. + * @see {@link MergeDeveloperIdentitiesCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class MergeDeveloperIdentitiesCommand extends $Command { + readonly input: MergeDeveloperIdentitiesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: MergeDeveloperIdentitiesCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetIdentityPoolRolesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetIdentityPoolRolesCommand.d.ts new file mode 100644 index 0000000000..c7a353e3aa --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetIdentityPoolRolesCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { SetIdentityPoolRolesInput } from "../models/models_0"; +export interface SetIdentityPoolRolesCommandInput extends SetIdentityPoolRolesInput { +} +export interface SetIdentityPoolRolesCommandOutput extends __MetadataBearer { +} +/** + *

Sets the roles for an identity pool. These roles are used when making calls to GetCredentialsForIdentity action.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, SetIdentityPoolRolesCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, SetIdentityPoolRolesCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new SetIdentityPoolRolesCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link SetIdentityPoolRolesCommandInput} for command's `input` shape. + * @see {@link SetIdentityPoolRolesCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class SetIdentityPoolRolesCommand extends $Command { + readonly input: SetIdentityPoolRolesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: SetIdentityPoolRolesCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetPrincipalTagAttributeMapCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetPrincipalTagAttributeMapCommand.d.ts new file mode 100644 index 0000000000..9920760555 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetPrincipalTagAttributeMapCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { SetPrincipalTagAttributeMapInput, SetPrincipalTagAttributeMapResponse } from "../models/models_0"; +export interface SetPrincipalTagAttributeMapCommandInput extends SetPrincipalTagAttributeMapInput { +} +export interface SetPrincipalTagAttributeMapCommandOutput extends SetPrincipalTagAttributeMapResponse, __MetadataBearer { +} +/** + *

You can use this operation to use default (username and clientID) attribute or custom attribute mappings.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, SetPrincipalTagAttributeMapCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, SetPrincipalTagAttributeMapCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new SetPrincipalTagAttributeMapCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link SetPrincipalTagAttributeMapCommandInput} for command's `input` shape. + * @see {@link SetPrincipalTagAttributeMapCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class SetPrincipalTagAttributeMapCommand extends $Command { + readonly input: SetPrincipalTagAttributeMapCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: SetPrincipalTagAttributeMapCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/TagResourceCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/TagResourceCommand.d.ts new file mode 100644 index 0000000000..c04b4d49e5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/TagResourceCommand.d.ts @@ -0,0 +1,51 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { TagResourceInput, TagResourceResponse } from "../models/models_0"; +export interface TagResourceCommandInput extends TagResourceInput { +} +export interface TagResourceCommandOutput extends TagResourceResponse, __MetadataBearer { +} +/** + *

Assigns a set of tags to the specified Amazon Cognito identity pool. A tag is a label + * that you can use to categorize and manage identity pools in different ways, such as by + * purpose, owner, environment, or other criteria.

+ *

Each tag consists of a key and value, both of which you define. A key is a general + * category for more specific values. For example, if you have two versions of an identity + * pool, one for testing and another for production, you might assign an + * Environment tag key to both identity pools. The value of this key might be + * Test for one identity pool and Production for the + * other.

+ *

Tags are useful for cost tracking and access control. You can activate your tags so that + * they appear on the Billing and Cost Management console, where you can track the costs + * associated with your identity pools. In an IAM policy, you can constrain permissions for + * identity pools based on specific tags or tag values.

+ *

You can use this action up to 5 times per second, per account. An identity pool can have + * as many as 50 tags.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, TagResourceCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, TagResourceCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new TagResourceCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link TagResourceCommandInput} for command's `input` shape. + * @see {@link TagResourceCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class TagResourceCommand extends $Command { + readonly input: TagResourceCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: TagResourceCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkDeveloperIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkDeveloperIdentityCommand.d.ts new file mode 100644 index 0000000000..9a1237a62e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkDeveloperIdentityCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { UnlinkDeveloperIdentityInput } from "../models/models_0"; +export interface UnlinkDeveloperIdentityCommandInput extends UnlinkDeveloperIdentityInput { +} +export interface UnlinkDeveloperIdentityCommandOutput extends __MetadataBearer { +} +/** + *

Unlinks a DeveloperUserIdentifier from an existing identity. Unlinked + * developer users will be considered new identities next time they are seen. If, for a given + * Cognito identity, you remove all federated identities as well as the developer user + * identifier, the Cognito identity becomes inaccessible.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, UnlinkDeveloperIdentityCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, UnlinkDeveloperIdentityCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new UnlinkDeveloperIdentityCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link UnlinkDeveloperIdentityCommandInput} for command's `input` shape. + * @see {@link UnlinkDeveloperIdentityCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class UnlinkDeveloperIdentityCommand extends $Command { + readonly input: UnlinkDeveloperIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: UnlinkDeveloperIdentityCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkIdentityCommand.d.ts new file mode 100644 index 0000000000..64cb116522 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkIdentityCommand.d.ts @@ -0,0 +1,40 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { UnlinkIdentityInput } from "../models/models_0"; +export interface UnlinkIdentityCommandInput extends UnlinkIdentityInput { +} +export interface UnlinkIdentityCommandOutput extends __MetadataBearer { +} +/** + *

Unlinks a federated identity from an existing account. Unlinked logins will be + * considered new identities next time they are seen. Removing the last linked login will make + * this identity inaccessible.

+ *

This is a public API. You do not need any credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, UnlinkIdentityCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, UnlinkIdentityCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new UnlinkIdentityCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link UnlinkIdentityCommandInput} for command's `input` shape. + * @see {@link UnlinkIdentityCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class UnlinkIdentityCommand extends $Command { + readonly input: UnlinkIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: UnlinkIdentityCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UntagResourceCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UntagResourceCommand.d.ts new file mode 100644 index 0000000000..688fd8beaa --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UntagResourceCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { UntagResourceInput, UntagResourceResponse } from "../models/models_0"; +export interface UntagResourceCommandInput extends UntagResourceInput { +} +export interface UntagResourceCommandOutput extends UntagResourceResponse, __MetadataBearer { +} +/** + *

Removes the specified tags from the specified Amazon Cognito identity pool. You can use + * this action up to 5 times per second, per account

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, UntagResourceCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, UntagResourceCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new UntagResourceCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link UntagResourceCommandInput} for command's `input` shape. + * @see {@link UntagResourceCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class UntagResourceCommand extends $Command { + readonly input: UntagResourceCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: UntagResourceCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UpdateIdentityPoolCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UpdateIdentityPoolCommand.d.ts new file mode 100644 index 0000000000..92afdab1e8 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UpdateIdentityPoolCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient"; +import { IdentityPool } from "../models/models_0"; +export interface UpdateIdentityPoolCommandInput extends IdentityPool { +} +export interface UpdateIdentityPoolCommandOutput extends IdentityPool, __MetadataBearer { +} +/** + *

Updates an identity pool.

+ *

You must use AWS Developer credentials to call this API.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CognitoIdentityClient, UpdateIdentityPoolCommand } from "@aws-sdk/client-cognito-identity"; // ES Modules import + * // const { CognitoIdentityClient, UpdateIdentityPoolCommand } = require("@aws-sdk/client-cognito-identity"); // CommonJS import + * const client = new CognitoIdentityClient(config); + * const command = new UpdateIdentityPoolCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link UpdateIdentityPoolCommandInput} for command's `input` shape. + * @see {@link UpdateIdentityPoolCommandOutput} for command's `response` shape. + * @see {@link CognitoIdentityClientResolvedConfig | config} for CognitoIdentityClient's `config` shape. + * + */ +export declare class UpdateIdentityPoolCommand extends $Command { + readonly input: UpdateIdentityPoolCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: UpdateIdentityPoolCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: CognitoIdentityClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/index.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/index.d.ts new file mode 100644 index 0000000000..8df424ba4b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/index.d.ts @@ -0,0 +1,23 @@ +export * from "./CreateIdentityPoolCommand"; +export * from "./DeleteIdentitiesCommand"; +export * from "./DeleteIdentityPoolCommand"; +export * from "./DescribeIdentityCommand"; +export * from "./DescribeIdentityPoolCommand"; +export * from "./GetCredentialsForIdentityCommand"; +export * from "./GetIdCommand"; +export * from "./GetIdentityPoolRolesCommand"; +export * from "./GetOpenIdTokenCommand"; +export * from "./GetOpenIdTokenForDeveloperIdentityCommand"; +export * from "./GetPrincipalTagAttributeMapCommand"; +export * from "./ListIdentitiesCommand"; +export * from "./ListIdentityPoolsCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./LookupDeveloperIdentityCommand"; +export * from "./MergeDeveloperIdentitiesCommand"; +export * from "./SetIdentityPoolRolesCommand"; +export * from "./SetPrincipalTagAttributeMapCommand"; +export * from "./TagResourceCommand"; +export * from "./UnlinkDeveloperIdentityCommand"; +export * from "./UnlinkIdentityCommand"; +export * from "./UntagResourceCommand"; +export * from "./UpdateIdentityPoolCommand"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/EndpointParameters.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/EndpointParameters.d.ts new file mode 100644 index 0000000000..fd716b2afe --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/EndpointParameters.d.ts @@ -0,0 +1,19 @@ +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@aws-sdk/types"; +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} +export declare type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; +export declare const resolveClientEndpointParameters: (options: T & ClientInputEndpointParameters) => T & ClientInputEndpointParameters & { + defaultSigningName: string; +}; +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/endpointResolver.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/endpointResolver.d.ts new file mode 100644 index 0000000000..62107b6db3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/endpointResolver.d.ts @@ -0,0 +1,5 @@ +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParameters } from "./EndpointParameters"; +export declare const defaultEndpointResolver: (endpointParams: EndpointParameters, context?: { + logger?: Logger; +}) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/ruleset.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/ruleset.d.ts new file mode 100644 index 0000000000..a822ad761a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoint/ruleset.d.ts @@ -0,0 +1,2 @@ +import { RuleSetObject } from "@aws-sdk/util-endpoints"; +export declare const ruleSet: RuleSetObject; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/index.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/index.d.ts new file mode 100644 index 0000000000..c7525c3f7c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/index.d.ts @@ -0,0 +1,6 @@ +export * from "./CognitoIdentity"; +export * from "./CognitoIdentityClient"; +export * from "./commands"; +export * from "./models"; +export * from "./pagination"; +export { CognitoIdentityServiceException } from "./models/CognitoIdentityServiceException"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/CognitoIdentityServiceException.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/CognitoIdentityServiceException.d.ts new file mode 100644 index 0000000000..024634df4e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/CognitoIdentityServiceException.d.ts @@ -0,0 +1,10 @@ +import { ServiceException as __ServiceException, ServiceExceptionOptions as __ServiceExceptionOptions } from "@aws-sdk/smithy-client"; +/** + * Base exception class for all service exceptions from CognitoIdentity service. + */ +export declare class CognitoIdentityServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions); +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/index.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/index.d.ts new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/index.d.ts @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/models_0.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/models_0.d.ts new file mode 100644 index 0000000000..51a100066a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/models_0.d.ts @@ -0,0 +1,1166 @@ +import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client"; +import { CognitoIdentityServiceException as __BaseException } from "./CognitoIdentityServiceException"; +export declare enum AmbiguousRoleResolutionType { + AUTHENTICATED_ROLE = "AuthenticatedRole", + DENY = "Deny" +} +/** + *

A provider representing an Amazon Cognito user pool and its client ID.

+ */ +export interface CognitoIdentityProvider { + /** + *

The provider name for an Amazon Cognito user pool. For example, + * cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789.

+ */ + ProviderName?: string; + /** + *

The client ID for the Amazon Cognito user pool.

+ */ + ClientId?: string; + /** + *

TRUE if server-side token validation is enabled for the identity provider’s + * token.

+ *

Once you set ServerSideTokenCheck to TRUE for an identity pool, that + * identity pool will check with the integrated user pools to make sure that the user has not + * been globally signed out or deleted before the identity pool provides an OIDC token or AWS + * credentials for the user.

+ *

If the user is signed out or deleted, the identity pool will return a 400 Not + * Authorized error.

+ */ + ServerSideTokenCheck?: boolean; +} +/** + *

Input to the CreateIdentityPool action.

+ */ +export interface CreateIdentityPoolInput { + /** + *

A string that you provide.

+ */ + IdentityPoolName: string | undefined; + /** + *

TRUE if the identity pool supports unauthenticated logins.

+ */ + AllowUnauthenticatedIdentities: boolean | undefined; + /** + *

Enables or disables the Basic (Classic) authentication flow. For more information, see + * Identity Pools (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide.

+ */ + AllowClassicFlow?: boolean; + /** + *

Optional key:value pairs mapping provider names to provider app IDs.

+ */ + SupportedLoginProviders?: Record; + /** + *

The "domain" by which Cognito will refer to your users. This name acts as a + * placeholder that allows your backend and the Cognito service to communicate about the + * developer provider. For the DeveloperProviderName, you can use letters as well + * as period (.), underscore (_), and dash + * (-).

+ *

Once you have set a developer provider name, you cannot change it. Please take care + * in setting this parameter.

+ */ + DeveloperProviderName?: string; + /** + *

The Amazon Resource Names (ARN) of the OpenID Connect providers.

+ */ + OpenIdConnectProviderARNs?: string[]; + /** + *

An array of Amazon Cognito user pools and their client IDs.

+ */ + CognitoIdentityProviders?: CognitoIdentityProvider[]; + /** + *

An array of Amazon Resource Names (ARNs) of the SAML provider for your identity + * pool.

+ */ + SamlProviderARNs?: string[]; + /** + *

Tags to assign to the identity pool. A tag is a label that you can apply to identity + * pools to categorize and manage them in different ways, such as by purpose, owner, + * environment, or other criteria.

+ */ + IdentityPoolTags?: Record; +} +/** + *

An object representing an Amazon Cognito identity pool.

+ */ +export interface IdentityPool { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; + /** + *

A string that you provide.

+ */ + IdentityPoolName: string | undefined; + /** + *

TRUE if the identity pool supports unauthenticated logins.

+ */ + AllowUnauthenticatedIdentities: boolean | undefined; + /** + *

Enables or disables the Basic (Classic) authentication flow. For more information, see + * Identity Pools (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide.

+ */ + AllowClassicFlow?: boolean; + /** + *

Optional key:value pairs mapping provider names to provider app IDs.

+ */ + SupportedLoginProviders?: Record; + /** + *

The "domain" by which Cognito will refer to your users.

+ */ + DeveloperProviderName?: string; + /** + *

The ARNs of the OpenID Connect providers.

+ */ + OpenIdConnectProviderARNs?: string[]; + /** + *

A list representing an Amazon Cognito user pool and its client ID.

+ */ + CognitoIdentityProviders?: CognitoIdentityProvider[]; + /** + *

An array of Amazon Resource Names (ARNs) of the SAML provider for your identity + * pool.

+ */ + SamlProviderARNs?: string[]; + /** + *

The tags that are assigned to the identity pool. A tag is a label that you can apply to + * identity pools to categorize and manage them in different ways, such as by purpose, owner, + * environment, or other criteria.

+ */ + IdentityPoolTags?: Record; +} +/** + *

Thrown when the service encounters an error during processing the request.

+ */ +export declare class InternalErrorException extends __BaseException { + readonly name: "InternalErrorException"; + readonly $fault: "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Thrown for missing or bad input parameter(s).

+ */ +export declare class InvalidParameterException extends __BaseException { + readonly name: "InvalidParameterException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Thrown when the total number of user pools has exceeded a preset limit.

+ */ +export declare class LimitExceededException extends __BaseException { + readonly name: "LimitExceededException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Thrown when a user is not authorized to access the requested resource.

+ */ +export declare class NotAuthorizedException extends __BaseException { + readonly name: "NotAuthorizedException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Thrown when a user tries to use a login which is already linked to another + * account.

+ */ +export declare class ResourceConflictException extends __BaseException { + readonly name: "ResourceConflictException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Thrown when a request is throttled.

+ */ +export declare class TooManyRequestsException extends __BaseException { + readonly name: "TooManyRequestsException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Input to the DeleteIdentities action.

+ */ +export interface DeleteIdentitiesInput { + /** + *

A list of 1-60 identities that you want to delete.

+ */ + IdentityIdsToDelete: string[] | undefined; +} +export declare enum ErrorCode { + ACCESS_DENIED = "AccessDenied", + INTERNAL_SERVER_ERROR = "InternalServerError" +} +/** + *

An array of UnprocessedIdentityId objects, each of which contains an ErrorCode and + * IdentityId.

+ */ +export interface UnprocessedIdentityId { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; + /** + *

The error code indicating the type of error that occurred.

+ */ + ErrorCode?: ErrorCode | string; +} +/** + *

Returned in response to a successful DeleteIdentities + * operation.

+ */ +export interface DeleteIdentitiesResponse { + /** + *

An array of UnprocessedIdentityId objects, each of which contains an ErrorCode and + * IdentityId.

+ */ + UnprocessedIdentityIds?: UnprocessedIdentityId[]; +} +/** + *

Input to the DeleteIdentityPool action.

+ */ +export interface DeleteIdentityPoolInput { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; +} +/** + *

Thrown when the requested resource (for example, a dataset or record) does not + * exist.

+ */ +export declare class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Input to the DescribeIdentity action.

+ */ +export interface DescribeIdentityInput { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId: string | undefined; +} +/** + *

A description of the identity.

+ */ +export interface IdentityDescription { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; + /** + *

The provider names.

+ */ + Logins?: string[]; + /** + *

Date on which the identity was created.

+ */ + CreationDate?: Date; + /** + *

Date on which the identity was last modified.

+ */ + LastModifiedDate?: Date; +} +/** + *

Input to the DescribeIdentityPool action.

+ */ +export interface DescribeIdentityPoolInput { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; +} +/** + *

An exception thrown when a dependent service such as Facebook or Twitter is not + * responding

+ */ +export declare class ExternalServiceException extends __BaseException { + readonly name: "ExternalServiceException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Input to the GetCredentialsForIdentity action.

+ */ +export interface GetCredentialsForIdentityInput { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId: string | undefined; + /** + *

A set of optional name-value pairs that map provider names to provider tokens. The + * name-value pair will follow the syntax "provider_name": + * "provider_user_identifier".

+ *

Logins should not be specified when trying to get credentials for an unauthenticated + * identity.

+ *

The Logins parameter is required when using identities associated with external + * identity providers such as Facebook. For examples of Logins maps, see the code + * examples in the External Identity Providers section of the Amazon Cognito Developer + * Guide.

+ */ + Logins?: Record; + /** + *

The Amazon Resource Name (ARN) of the role to be assumed when multiple roles were + * received in the token from the identity provider. For example, a SAML-based identity + * provider. This parameter is optional for identity providers that do not support role + * customization.

+ */ + CustomRoleArn?: string; +} +/** + *

Credentials for the provided identity ID.

+ */ +export interface Credentials { + /** + *

The Access Key portion of the credentials.

+ */ + AccessKeyId?: string; + /** + *

The Secret Access Key portion of the credentials

+ */ + SecretKey?: string; + /** + *

The Session Token portion of the credentials

+ */ + SessionToken?: string; + /** + *

The date at which these credentials will expire.

+ */ + Expiration?: Date; +} +/** + *

Returned in response to a successful GetCredentialsForIdentity + * operation.

+ */ +export interface GetCredentialsForIdentityResponse { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; + /** + *

Credentials for the provided identity ID.

+ */ + Credentials?: Credentials; +} +/** + *

Thrown if the identity pool has no role associated for the given auth type + * (auth/unauth) or if the AssumeRole fails.

+ */ +export declare class InvalidIdentityPoolConfigurationException extends __BaseException { + readonly name: "InvalidIdentityPoolConfigurationException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Input to the GetId action.

+ */ +export interface GetIdInput { + /** + *

A standard AWS account ID (9+ digits).

+ */ + AccountId?: string; + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; + /** + *

A set of optional name-value pairs that map provider names to provider tokens. The + * available provider names for Logins are as follows:

+ *
    + *
  • + *

    Facebook: graph.facebook.com + *

    + *
  • + *
  • + *

    Amazon Cognito user pool: + * cognito-idp..amazonaws.com/, + * for example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789. + *

    + *
  • + *
  • + *

    Google: accounts.google.com + *

    + *
  • + *
  • + *

    Amazon: www.amazon.com + *

    + *
  • + *
  • + *

    Twitter: api.twitter.com + *

    + *
  • + *
  • + *

    Digits: www.digits.com + *

    + *
  • + *
+ */ + Logins?: Record; +} +/** + *

Returned in response to a GetId request.

+ */ +export interface GetIdResponse { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; +} +/** + *

Input to the GetIdentityPoolRoles action.

+ */ +export interface GetIdentityPoolRolesInput { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; +} +export declare enum MappingRuleMatchType { + CONTAINS = "Contains", + EQUALS = "Equals", + NOT_EQUAL = "NotEqual", + STARTS_WITH = "StartsWith" +} +/** + *

A rule that maps a claim name, a claim value, and a match type to a role + * ARN.

+ */ +export interface MappingRule { + /** + *

The claim name that must be present in the token, for example, "isAdmin" or + * "paid".

+ */ + Claim: string | undefined; + /** + *

The match condition that specifies how closely the claim value in the IdP token must + * match Value.

+ */ + MatchType: MappingRuleMatchType | string | undefined; + /** + *

A brief string that the claim must match, for example, "paid" or "yes".

+ */ + Value: string | undefined; + /** + *

The role ARN.

+ */ + RoleARN: string | undefined; +} +/** + *

A container for rules.

+ */ +export interface RulesConfigurationType { + /** + *

An array of rules. You can specify up to 25 rules per identity provider.

+ *

Rules are evaluated in order. The first one to match specifies the role.

+ */ + Rules: MappingRule[] | undefined; +} +export declare enum RoleMappingType { + RULES = "Rules", + TOKEN = "Token" +} +/** + *

A role mapping.

+ */ +export interface RoleMapping { + /** + *

The role mapping type. Token will use cognito:roles and + * cognito:preferred_role claims from the Cognito identity provider token to + * map groups to roles. Rules will attempt to match claims from the token to map to a + * role.

+ */ + Type: RoleMappingType | string | undefined; + /** + *

If you specify Token or Rules as the Type, + * AmbiguousRoleResolution is required.

+ *

Specifies the action to be taken if either no rules match the claim value for the + * Rules type, or there is no cognito:preferred_role claim and + * there are multiple cognito:roles matches for the Token + * type.

+ */ + AmbiguousRoleResolution?: AmbiguousRoleResolutionType | string; + /** + *

The rules to be used for mapping users to roles.

+ *

If you specify Rules as the role mapping type, RulesConfiguration is + * required.

+ */ + RulesConfiguration?: RulesConfigurationType; +} +/** + *

Returned in response to a successful GetIdentityPoolRoles + * operation.

+ */ +export interface GetIdentityPoolRolesResponse { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId?: string; + /** + *

The map of roles associated with this pool. Currently only authenticated and + * unauthenticated roles are supported.

+ */ + Roles?: Record; + /** + *

How users for a specific identity provider are to mapped to roles. This is a + * String-to-RoleMapping object map. The string identifies the identity + * provider, for example, "graph.facebook.com" or + * "cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id".

+ */ + RoleMappings?: Record; +} +/** + *

Input to the GetOpenIdToken action.

+ */ +export interface GetOpenIdTokenInput { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId: string | undefined; + /** + *

A set of optional name-value pairs that map provider names to provider tokens. When + * using graph.facebook.com and www.amazon.com, supply the access_token returned from the + * provider's authflow. For accounts.google.com, an Amazon Cognito user pool provider, or any + * other OpenID Connect provider, always include the id_token.

+ */ + Logins?: Record; +} +/** + *

Returned in response to a successful GetOpenIdToken request.

+ */ +export interface GetOpenIdTokenResponse { + /** + *

A unique identifier in the format REGION:GUID. Note that the IdentityId returned may + * not match the one passed on input.

+ */ + IdentityId?: string; + /** + *

An OpenID token, valid for 10 minutes.

+ */ + Token?: string; +} +/** + *

The provided developer user identifier is already registered with Cognito under a + * different identity ID.

+ */ +export declare class DeveloperUserAlreadyRegisteredException extends __BaseException { + readonly name: "DeveloperUserAlreadyRegisteredException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Input to the GetOpenIdTokenForDeveloperIdentity action.

+ */ +export interface GetOpenIdTokenForDeveloperIdentityInput { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; + /** + *

A set of optional name-value pairs that map provider names to provider tokens. Each + * name-value pair represents a user from a public provider or developer provider. If the user + * is from a developer provider, the name-value pair will follow the syntax + * "developer_provider_name": "developer_user_identifier". The developer + * provider is the "domain" by which Cognito will refer to your users; you provided this + * domain while creating/updating the identity pool. The developer user identifier is an + * identifier from your backend that uniquely identifies a user. When you create an identity + * pool, you can specify the supported logins.

+ */ + Logins: Record | undefined; + /** + *

Use this operation to configure attribute mappings for custom providers.

+ */ + PrincipalTags?: Record; + /** + *

The expiration time of the token, in seconds. You can specify a custom expiration + * time for the token so that you can cache it. If you don't provide an expiration time, the + * token is valid for 15 minutes. You can exchange the token with Amazon STS for temporary AWS + * credentials, which are valid for a maximum of one hour. The maximum token duration you can + * set is 24 hours. You should take care in setting the expiration time for a token, as there + * are significant security implications: an attacker could use a leaked token to access your + * AWS resources for the token's duration.

+ * + *

Please provide for a small grace period, usually no more than 5 minutes, to account for clock skew.

+ *
+ */ + TokenDuration?: number; +} +/** + *

Returned in response to a successful GetOpenIdTokenForDeveloperIdentity + * request.

+ */ +export interface GetOpenIdTokenForDeveloperIdentityResponse { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; + /** + *

An OpenID token.

+ */ + Token?: string; +} +export interface GetPrincipalTagAttributeMapInput { + /** + *

You can use this operation to get the ID of the Identity Pool you setup attribute mappings for.

+ */ + IdentityPoolId: string | undefined; + /** + *

You can use this operation to get the provider name.

+ */ + IdentityProviderName: string | undefined; +} +export interface GetPrincipalTagAttributeMapResponse { + /** + *

You can use this operation to get the ID of the Identity Pool you setup attribute mappings for.

+ */ + IdentityPoolId?: string; + /** + *

You can use this operation to get the provider name.

+ */ + IdentityProviderName?: string; + /** + *

You can use this operation to list

+ */ + UseDefaults?: boolean; + /** + *

You can use this operation to add principal tags. The PrincipalTagsoperation enables you to reference user attributes in your IAM permissions policy.

+ */ + PrincipalTags?: Record; +} +/** + *

Input to the ListIdentities action.

+ */ +export interface ListIdentitiesInput { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; + /** + *

The maximum number of identities to return.

+ */ + MaxResults: number | undefined; + /** + *

A pagination token.

+ */ + NextToken?: string; + /** + *

An optional boolean parameter that allows you to hide disabled identities. If + * omitted, the ListIdentities API will include disabled identities in the response.

+ */ + HideDisabled?: boolean; +} +/** + *

The response to a ListIdentities request.

+ */ +export interface ListIdentitiesResponse { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId?: string; + /** + *

An object containing a set of identities and associated mappings.

+ */ + Identities?: IdentityDescription[]; + /** + *

A pagination token.

+ */ + NextToken?: string; +} +/** + *

Input to the ListIdentityPools action.

+ */ +export interface ListIdentityPoolsInput { + /** + *

The maximum number of identities to return.

+ */ + MaxResults: number | undefined; + /** + *

A pagination token.

+ */ + NextToken?: string; +} +/** + *

A description of the identity pool.

+ */ +export interface IdentityPoolShortDescription { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId?: string; + /** + *

A string that you provide.

+ */ + IdentityPoolName?: string; +} +/** + *

The result of a successful ListIdentityPools action.

+ */ +export interface ListIdentityPoolsResponse { + /** + *

The identity pools returned by the ListIdentityPools action.

+ */ + IdentityPools?: IdentityPoolShortDescription[]; + /** + *

A pagination token.

+ */ + NextToken?: string; +} +export interface ListTagsForResourceInput { + /** + *

The Amazon Resource Name (ARN) of the identity pool that the tags are assigned + * to.

+ */ + ResourceArn: string | undefined; +} +export interface ListTagsForResourceResponse { + /** + *

The tags that are assigned to the identity pool.

+ */ + Tags?: Record; +} +/** + *

Input to the LookupDeveloperIdentityInput action.

+ */ +export interface LookupDeveloperIdentityInput { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; + /** + *

A unique ID used by your backend authentication process to identify a user. + * Typically, a developer identity provider would issue many developer user identifiers, in + * keeping with the number of users.

+ */ + DeveloperUserIdentifier?: string; + /** + *

The maximum number of identities to return.

+ */ + MaxResults?: number; + /** + *

A pagination token. The first call you make will have NextToken set to + * null. After that the service will return NextToken values as needed. For + * example, let's say you make a request with MaxResults set to 10, and there are + * 20 matches in the database. The service will return a pagination token as a part of the + * response. This token can be used to call the API again and get results starting from the + * 11th match.

+ */ + NextToken?: string; +} +/** + *

Returned in response to a successful LookupDeveloperIdentity + * action.

+ */ +export interface LookupDeveloperIdentityResponse { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; + /** + *

This is the list of developer user identifiers associated with an identity ID. + * Cognito supports the association of multiple developer user identifiers with an identity + * ID.

+ */ + DeveloperUserIdentifierList?: string[]; + /** + *

A pagination token. The first call you make will have NextToken set to + * null. After that the service will return NextToken values as needed. For + * example, let's say you make a request with MaxResults set to 10, and there are + * 20 matches in the database. The service will return a pagination token as a part of the + * response. This token can be used to call the API again and get results starting from the + * 11th match.

+ */ + NextToken?: string; +} +/** + *

Input to the MergeDeveloperIdentities action.

+ */ +export interface MergeDeveloperIdentitiesInput { + /** + *

User identifier for the source user. The value should be a + * DeveloperUserIdentifier.

+ */ + SourceUserIdentifier: string | undefined; + /** + *

User identifier for the destination user. The value should be a + * DeveloperUserIdentifier.

+ */ + DestinationUserIdentifier: string | undefined; + /** + *

The "domain" by which Cognito will refer to your users. This is a (pseudo) domain + * name that you provide while creating an identity pool. This name acts as a placeholder that + * allows your backend and the Cognito service to communicate about the developer provider. + * For the DeveloperProviderName, you can use letters as well as period (.), + * underscore (_), and dash (-).

+ */ + DeveloperProviderName: string | undefined; + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; +} +/** + *

Returned in response to a successful MergeDeveloperIdentities + * action.

+ */ +export interface MergeDeveloperIdentitiesResponse { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId?: string; +} +/** + *

Thrown if there are parallel requests to modify a resource.

+ */ +export declare class ConcurrentModificationException extends __BaseException { + readonly name: "ConcurrentModificationException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Input to the SetIdentityPoolRoles action.

+ */ +export interface SetIdentityPoolRolesInput { + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; + /** + *

The map of roles associated with this pool. For a given role, the key will be either + * "authenticated" or "unauthenticated" and the value will be the Role ARN.

+ */ + Roles: Record | undefined; + /** + *

How users for a specific identity provider are to mapped to roles. This is a string + * to RoleMapping object map. The string identifies the identity provider, + * for example, "graph.facebook.com" or + * "cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id".

+ *

Up to 25 rules can be specified per identity provider.

+ */ + RoleMappings?: Record; +} +export interface SetPrincipalTagAttributeMapInput { + /** + *

The ID of the Identity Pool you want to set attribute mappings for.

+ */ + IdentityPoolId: string | undefined; + /** + *

The provider name you want to use for attribute mappings.

+ */ + IdentityProviderName: string | undefined; + /** + *

You can use this operation to use default (username and clientID) attribute mappings.

+ */ + UseDefaults?: boolean; + /** + *

You can use this operation to add principal tags.

+ */ + PrincipalTags?: Record; +} +export interface SetPrincipalTagAttributeMapResponse { + /** + *

The ID of the Identity Pool you want to set attribute mappings for.

+ */ + IdentityPoolId?: string; + /** + *

The provider name you want to use for attribute mappings.

+ */ + IdentityProviderName?: string; + /** + *

You can use this operation to select default (username and clientID) attribute mappings.

+ */ + UseDefaults?: boolean; + /** + *

You can use this operation to add principal tags. The PrincipalTagsoperation enables you to reference user attributes in your IAM permissions policy.

+ */ + PrincipalTags?: Record; +} +export interface TagResourceInput { + /** + *

The Amazon Resource Name (ARN) of the identity pool.

+ */ + ResourceArn: string | undefined; + /** + *

The tags to assign to the identity pool.

+ */ + Tags: Record | undefined; +} +export interface TagResourceResponse { +} +/** + *

Input to the UnlinkDeveloperIdentity action.

+ */ +export interface UnlinkDeveloperIdentityInput { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId: string | undefined; + /** + *

An identity pool ID in the format REGION:GUID.

+ */ + IdentityPoolId: string | undefined; + /** + *

The "domain" by which Cognito will refer to your users.

+ */ + DeveloperProviderName: string | undefined; + /** + *

A unique ID used by your backend authentication process to identify a user.

+ */ + DeveloperUserIdentifier: string | undefined; +} +/** + *

Input to the UnlinkIdentity action.

+ */ +export interface UnlinkIdentityInput { + /** + *

A unique identifier in the format REGION:GUID.

+ */ + IdentityId: string | undefined; + /** + *

A set of optional name-value pairs that map provider names to provider + * tokens.

+ */ + Logins: Record | undefined; + /** + *

Provider names to unlink from this identity.

+ */ + LoginsToRemove: string[] | undefined; +} +export interface UntagResourceInput { + /** + *

The Amazon Resource Name (ARN) of the identity pool.

+ */ + ResourceArn: string | undefined; + /** + *

The keys of the tags to remove from the user pool.

+ */ + TagKeys: string[] | undefined; +} +export interface UntagResourceResponse { +} +/** + * @internal + */ +export declare const CognitoIdentityProviderFilterSensitiveLog: (obj: CognitoIdentityProvider) => any; +/** + * @internal + */ +export declare const CreateIdentityPoolInputFilterSensitiveLog: (obj: CreateIdentityPoolInput) => any; +/** + * @internal + */ +export declare const IdentityPoolFilterSensitiveLog: (obj: IdentityPool) => any; +/** + * @internal + */ +export declare const DeleteIdentitiesInputFilterSensitiveLog: (obj: DeleteIdentitiesInput) => any; +/** + * @internal + */ +export declare const UnprocessedIdentityIdFilterSensitiveLog: (obj: UnprocessedIdentityId) => any; +/** + * @internal + */ +export declare const DeleteIdentitiesResponseFilterSensitiveLog: (obj: DeleteIdentitiesResponse) => any; +/** + * @internal + */ +export declare const DeleteIdentityPoolInputFilterSensitiveLog: (obj: DeleteIdentityPoolInput) => any; +/** + * @internal + */ +export declare const DescribeIdentityInputFilterSensitiveLog: (obj: DescribeIdentityInput) => any; +/** + * @internal + */ +export declare const IdentityDescriptionFilterSensitiveLog: (obj: IdentityDescription) => any; +/** + * @internal + */ +export declare const DescribeIdentityPoolInputFilterSensitiveLog: (obj: DescribeIdentityPoolInput) => any; +/** + * @internal + */ +export declare const GetCredentialsForIdentityInputFilterSensitiveLog: (obj: GetCredentialsForIdentityInput) => any; +/** + * @internal + */ +export declare const CredentialsFilterSensitiveLog: (obj: Credentials) => any; +/** + * @internal + */ +export declare const GetCredentialsForIdentityResponseFilterSensitiveLog: (obj: GetCredentialsForIdentityResponse) => any; +/** + * @internal + */ +export declare const GetIdInputFilterSensitiveLog: (obj: GetIdInput) => any; +/** + * @internal + */ +export declare const GetIdResponseFilterSensitiveLog: (obj: GetIdResponse) => any; +/** + * @internal + */ +export declare const GetIdentityPoolRolesInputFilterSensitiveLog: (obj: GetIdentityPoolRolesInput) => any; +/** + * @internal + */ +export declare const MappingRuleFilterSensitiveLog: (obj: MappingRule) => any; +/** + * @internal + */ +export declare const RulesConfigurationTypeFilterSensitiveLog: (obj: RulesConfigurationType) => any; +/** + * @internal + */ +export declare const RoleMappingFilterSensitiveLog: (obj: RoleMapping) => any; +/** + * @internal + */ +export declare const GetIdentityPoolRolesResponseFilterSensitiveLog: (obj: GetIdentityPoolRolesResponse) => any; +/** + * @internal + */ +export declare const GetOpenIdTokenInputFilterSensitiveLog: (obj: GetOpenIdTokenInput) => any; +/** + * @internal + */ +export declare const GetOpenIdTokenResponseFilterSensitiveLog: (obj: GetOpenIdTokenResponse) => any; +/** + * @internal + */ +export declare const GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog: (obj: GetOpenIdTokenForDeveloperIdentityInput) => any; +/** + * @internal + */ +export declare const GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog: (obj: GetOpenIdTokenForDeveloperIdentityResponse) => any; +/** + * @internal + */ +export declare const GetPrincipalTagAttributeMapInputFilterSensitiveLog: (obj: GetPrincipalTagAttributeMapInput) => any; +/** + * @internal + */ +export declare const GetPrincipalTagAttributeMapResponseFilterSensitiveLog: (obj: GetPrincipalTagAttributeMapResponse) => any; +/** + * @internal + */ +export declare const ListIdentitiesInputFilterSensitiveLog: (obj: ListIdentitiesInput) => any; +/** + * @internal + */ +export declare const ListIdentitiesResponseFilterSensitiveLog: (obj: ListIdentitiesResponse) => any; +/** + * @internal + */ +export declare const ListIdentityPoolsInputFilterSensitiveLog: (obj: ListIdentityPoolsInput) => any; +/** + * @internal + */ +export declare const IdentityPoolShortDescriptionFilterSensitiveLog: (obj: IdentityPoolShortDescription) => any; +/** + * @internal + */ +export declare const ListIdentityPoolsResponseFilterSensitiveLog: (obj: ListIdentityPoolsResponse) => any; +/** + * @internal + */ +export declare const ListTagsForResourceInputFilterSensitiveLog: (obj: ListTagsForResourceInput) => any; +/** + * @internal + */ +export declare const ListTagsForResourceResponseFilterSensitiveLog: (obj: ListTagsForResourceResponse) => any; +/** + * @internal + */ +export declare const LookupDeveloperIdentityInputFilterSensitiveLog: (obj: LookupDeveloperIdentityInput) => any; +/** + * @internal + */ +export declare const LookupDeveloperIdentityResponseFilterSensitiveLog: (obj: LookupDeveloperIdentityResponse) => any; +/** + * @internal + */ +export declare const MergeDeveloperIdentitiesInputFilterSensitiveLog: (obj: MergeDeveloperIdentitiesInput) => any; +/** + * @internal + */ +export declare const MergeDeveloperIdentitiesResponseFilterSensitiveLog: (obj: MergeDeveloperIdentitiesResponse) => any; +/** + * @internal + */ +export declare const SetIdentityPoolRolesInputFilterSensitiveLog: (obj: SetIdentityPoolRolesInput) => any; +/** + * @internal + */ +export declare const SetPrincipalTagAttributeMapInputFilterSensitiveLog: (obj: SetPrincipalTagAttributeMapInput) => any; +/** + * @internal + */ +export declare const SetPrincipalTagAttributeMapResponseFilterSensitiveLog: (obj: SetPrincipalTagAttributeMapResponse) => any; +/** + * @internal + */ +export declare const TagResourceInputFilterSensitiveLog: (obj: TagResourceInput) => any; +/** + * @internal + */ +export declare const TagResourceResponseFilterSensitiveLog: (obj: TagResourceResponse) => any; +/** + * @internal + */ +export declare const UnlinkDeveloperIdentityInputFilterSensitiveLog: (obj: UnlinkDeveloperIdentityInput) => any; +/** + * @internal + */ +export declare const UnlinkIdentityInputFilterSensitiveLog: (obj: UnlinkIdentityInput) => any; +/** + * @internal + */ +export declare const UntagResourceInputFilterSensitiveLog: (obj: UntagResourceInput) => any; +/** + * @internal + */ +export declare const UntagResourceResponseFilterSensitiveLog: (obj: UntagResourceResponse) => any; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/Interfaces.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/Interfaces.d.ts new file mode 100644 index 0000000000..f48a2576ec --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/Interfaces.d.ts @@ -0,0 +1,6 @@ +import { PaginationConfiguration } from "@aws-sdk/types"; +import { CognitoIdentity } from "../CognitoIdentity"; +import { CognitoIdentityClient } from "../CognitoIdentityClient"; +export interface CognitoIdentityPaginationConfiguration extends PaginationConfiguration { + client: CognitoIdentity | CognitoIdentityClient; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/ListIdentityPoolsPaginator.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/ListIdentityPoolsPaginator.d.ts new file mode 100644 index 0000000000..0a800e04ac --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/ListIdentityPoolsPaginator.d.ts @@ -0,0 +1,4 @@ +import { Paginator } from "@aws-sdk/types"; +import { ListIdentityPoolsCommandInput, ListIdentityPoolsCommandOutput } from "../commands/ListIdentityPoolsCommand"; +import { CognitoIdentityPaginationConfiguration } from "./Interfaces"; +export declare function paginateListIdentityPools(config: CognitoIdentityPaginationConfiguration, input: ListIdentityPoolsCommandInput, ...additionalArguments: any): Paginator; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/index.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/index.d.ts new file mode 100644 index 0000000000..c77b96c1d1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Interfaces"; +export * from "./ListIdentityPoolsPaginator"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/protocols/Aws_json1_1.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/protocols/Aws_json1_1.d.ts new file mode 100644 index 0000000000..567fb395f3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/protocols/Aws_json1_1.d.ts @@ -0,0 +1,71 @@ +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { SerdeContext as __SerdeContext } from "@aws-sdk/types"; +import { CreateIdentityPoolCommandInput, CreateIdentityPoolCommandOutput } from "../commands/CreateIdentityPoolCommand"; +import { DeleteIdentitiesCommandInput, DeleteIdentitiesCommandOutput } from "../commands/DeleteIdentitiesCommand"; +import { DeleteIdentityPoolCommandInput, DeleteIdentityPoolCommandOutput } from "../commands/DeleteIdentityPoolCommand"; +import { DescribeIdentityCommandInput, DescribeIdentityCommandOutput } from "../commands/DescribeIdentityCommand"; +import { DescribeIdentityPoolCommandInput, DescribeIdentityPoolCommandOutput } from "../commands/DescribeIdentityPoolCommand"; +import { GetCredentialsForIdentityCommandInput, GetCredentialsForIdentityCommandOutput } from "../commands/GetCredentialsForIdentityCommand"; +import { GetIdCommandInput, GetIdCommandOutput } from "../commands/GetIdCommand"; +import { GetIdentityPoolRolesCommandInput, GetIdentityPoolRolesCommandOutput } from "../commands/GetIdentityPoolRolesCommand"; +import { GetOpenIdTokenCommandInput, GetOpenIdTokenCommandOutput } from "../commands/GetOpenIdTokenCommand"; +import { GetOpenIdTokenForDeveloperIdentityCommandInput, GetOpenIdTokenForDeveloperIdentityCommandOutput } from "../commands/GetOpenIdTokenForDeveloperIdentityCommand"; +import { GetPrincipalTagAttributeMapCommandInput, GetPrincipalTagAttributeMapCommandOutput } from "../commands/GetPrincipalTagAttributeMapCommand"; +import { ListIdentitiesCommandInput, ListIdentitiesCommandOutput } from "../commands/ListIdentitiesCommand"; +import { ListIdentityPoolsCommandInput, ListIdentityPoolsCommandOutput } from "../commands/ListIdentityPoolsCommand"; +import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "../commands/ListTagsForResourceCommand"; +import { LookupDeveloperIdentityCommandInput, LookupDeveloperIdentityCommandOutput } from "../commands/LookupDeveloperIdentityCommand"; +import { MergeDeveloperIdentitiesCommandInput, MergeDeveloperIdentitiesCommandOutput } from "../commands/MergeDeveloperIdentitiesCommand"; +import { SetIdentityPoolRolesCommandInput, SetIdentityPoolRolesCommandOutput } from "../commands/SetIdentityPoolRolesCommand"; +import { SetPrincipalTagAttributeMapCommandInput, SetPrincipalTagAttributeMapCommandOutput } from "../commands/SetPrincipalTagAttributeMapCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; +import { UnlinkDeveloperIdentityCommandInput, UnlinkDeveloperIdentityCommandOutput } from "../commands/UnlinkDeveloperIdentityCommand"; +import { UnlinkIdentityCommandInput, UnlinkIdentityCommandOutput } from "../commands/UnlinkIdentityCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; +import { UpdateIdentityPoolCommandInput, UpdateIdentityPoolCommandOutput } from "../commands/UpdateIdentityPoolCommand"; +export declare const serializeAws_json1_1CreateIdentityPoolCommand: (input: CreateIdentityPoolCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1DeleteIdentitiesCommand: (input: DeleteIdentitiesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1DeleteIdentityPoolCommand: (input: DeleteIdentityPoolCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1DescribeIdentityCommand: (input: DescribeIdentityCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1DescribeIdentityPoolCommand: (input: DescribeIdentityPoolCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetCredentialsForIdentityCommand: (input: GetCredentialsForIdentityCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetIdCommand: (input: GetIdCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetIdentityPoolRolesCommand: (input: GetIdentityPoolRolesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetOpenIdTokenCommand: (input: GetOpenIdTokenCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand: (input: GetOpenIdTokenForDeveloperIdentityCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetPrincipalTagAttributeMapCommand: (input: GetPrincipalTagAttributeMapCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1ListIdentitiesCommand: (input: ListIdentitiesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1ListIdentityPoolsCommand: (input: ListIdentityPoolsCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1ListTagsForResourceCommand: (input: ListTagsForResourceCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1LookupDeveloperIdentityCommand: (input: LookupDeveloperIdentityCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1MergeDeveloperIdentitiesCommand: (input: MergeDeveloperIdentitiesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1SetIdentityPoolRolesCommand: (input: SetIdentityPoolRolesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1SetPrincipalTagAttributeMapCommand: (input: SetPrincipalTagAttributeMapCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1TagResourceCommand: (input: TagResourceCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1UnlinkDeveloperIdentityCommand: (input: UnlinkDeveloperIdentityCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1UnlinkIdentityCommand: (input: UnlinkIdentityCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1UntagResourceCommand: (input: UntagResourceCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1UpdateIdentityPoolCommand: (input: UpdateIdentityPoolCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const deserializeAws_json1_1CreateIdentityPoolCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1DeleteIdentitiesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1DeleteIdentityPoolCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1DescribeIdentityCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1DescribeIdentityPoolCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1GetCredentialsForIdentityCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1GetIdCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1GetIdentityPoolRolesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1GetOpenIdTokenCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1GetPrincipalTagAttributeMapCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1ListIdentitiesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1ListIdentityPoolsCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1ListTagsForResourceCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1LookupDeveloperIdentityCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1MergeDeveloperIdentitiesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1SetIdentityPoolRolesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1SetPrincipalTagAttributeMapCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1TagResourceCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1UnlinkDeveloperIdentityCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1UnlinkIdentityCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1UntagResourceCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_json1_1UpdateIdentityPoolCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.browser.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.browser.d.ts new file mode 100644 index 0000000000..47df2505e3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.browser.d.ts @@ -0,0 +1,42 @@ +import { FetchHttpHandler as RequestHandler } from "@aws-sdk/fetch-http-handler"; +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: CognitoIdentityClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + credentialDefaultProvider: (input: any) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: ((string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider) & (string | import("@aws-sdk/types").Provider | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider)) | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + credentials?: import("@aws-sdk/types").AwsCredentialIdentity | import("@aws-sdk/types").Provider | undefined; + signer?: import("@aws-sdk/types").RequestSigner | ((authScheme?: import("@aws-sdk/types").AuthScheme | undefined) => Promise) | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: (new (options: import("@aws-sdk/signature-v4").SignatureV4Init & import("@aws-sdk/signature-v4").SignatureV4CryptoInit) => import("@aws-sdk/types").RequestSigner) | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.d.ts new file mode 100644 index 0000000000..56dc3df11e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.d.ts @@ -0,0 +1,42 @@ +import { NodeHttpHandler as RequestHandler } from "@aws-sdk/node-http-handler"; +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: CognitoIdentityClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + credentialDefaultProvider: (input: any) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: ((string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider) & (string | import("@aws-sdk/types").Provider | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider)) | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + credentials?: import("@aws-sdk/types").AwsCredentialIdentity | import("@aws-sdk/types").Provider | undefined; + signer?: import("@aws-sdk/types").RequestSigner | ((authScheme?: import("@aws-sdk/types").AuthScheme | undefined) => Promise) | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: (new (options: import("@aws-sdk/signature-v4").SignatureV4Init & import("@aws-sdk/signature-v4").SignatureV4CryptoInit) => import("@aws-sdk/types").RequestSigner) | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.native.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.native.d.ts new file mode 100644 index 0000000000..208b26b5ba --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.native.d.ts @@ -0,0 +1,41 @@ +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: CognitoIdentityClientConfig) => { + runtime: string; + sha256: import("@aws-sdk/types").HashConstructor; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | import("@aws-sdk/fetch-http-handler").FetchHttpHandler; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + streamCollector: import("@aws-sdk/types").StreamCollector; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + maxAttempts: number | import("@aws-sdk/types").Provider; + retryMode: string | import("@aws-sdk/types").Provider; + logger: import("@aws-sdk/types").Logger; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + serviceId: string; + region: string | import("@aws-sdk/types").Provider; + credentialDefaultProvider: (input: any) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + defaultsMode: import("@aws-sdk/smithy-client").DefaultsMode | import("@aws-sdk/types").Provider; + endpoint?: string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + credentials?: import("@aws-sdk/types").AwsCredentialIdentity | import("@aws-sdk/types").Provider | undefined; + signer?: import("@aws-sdk/types").RequestSigner | ((authScheme?: import("@aws-sdk/types").AuthScheme | undefined) => Promise) | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: (new (options: import("@aws-sdk/signature-v4").SignatureV4Init & import("@aws-sdk/signature-v4").SignatureV4CryptoInit) => import("@aws-sdk/types").RequestSigner) | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.shared.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.shared.d.ts new file mode 100644 index 0000000000..91ace18a2b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.shared.d.ts @@ -0,0 +1,18 @@ +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: CognitoIdentityClientConfig) => { + apiVersion: string; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + urlParser: import("@aws-sdk/types").UrlParser; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentity.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentity.d.ts new file mode 100644 index 0000000000..3289527e2e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentity.d.ts @@ -0,0 +1,398 @@ +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; +import { CognitoIdentityClient } from "./CognitoIdentityClient"; +import { + CreateIdentityPoolCommandInput, + CreateIdentityPoolCommandOutput, +} from "./commands/CreateIdentityPoolCommand"; +import { + DeleteIdentitiesCommandInput, + DeleteIdentitiesCommandOutput, +} from "./commands/DeleteIdentitiesCommand"; +import { + DeleteIdentityPoolCommandInput, + DeleteIdentityPoolCommandOutput, +} from "./commands/DeleteIdentityPoolCommand"; +import { + DescribeIdentityCommandInput, + DescribeIdentityCommandOutput, +} from "./commands/DescribeIdentityCommand"; +import { + DescribeIdentityPoolCommandInput, + DescribeIdentityPoolCommandOutput, +} from "./commands/DescribeIdentityPoolCommand"; +import { + GetCredentialsForIdentityCommandInput, + GetCredentialsForIdentityCommandOutput, +} from "./commands/GetCredentialsForIdentityCommand"; +import { GetIdCommandInput, GetIdCommandOutput } from "./commands/GetIdCommand"; +import { + GetIdentityPoolRolesCommandInput, + GetIdentityPoolRolesCommandOutput, +} from "./commands/GetIdentityPoolRolesCommand"; +import { + GetOpenIdTokenCommandInput, + GetOpenIdTokenCommandOutput, +} from "./commands/GetOpenIdTokenCommand"; +import { + GetOpenIdTokenForDeveloperIdentityCommandInput, + GetOpenIdTokenForDeveloperIdentityCommandOutput, +} from "./commands/GetOpenIdTokenForDeveloperIdentityCommand"; +import { + GetPrincipalTagAttributeMapCommandInput, + GetPrincipalTagAttributeMapCommandOutput, +} from "./commands/GetPrincipalTagAttributeMapCommand"; +import { + ListIdentitiesCommandInput, + ListIdentitiesCommandOutput, +} from "./commands/ListIdentitiesCommand"; +import { + ListIdentityPoolsCommandInput, + ListIdentityPoolsCommandOutput, +} from "./commands/ListIdentityPoolsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { + LookupDeveloperIdentityCommandInput, + LookupDeveloperIdentityCommandOutput, +} from "./commands/LookupDeveloperIdentityCommand"; +import { + MergeDeveloperIdentitiesCommandInput, + MergeDeveloperIdentitiesCommandOutput, +} from "./commands/MergeDeveloperIdentitiesCommand"; +import { + SetIdentityPoolRolesCommandInput, + SetIdentityPoolRolesCommandOutput, +} from "./commands/SetIdentityPoolRolesCommand"; +import { + SetPrincipalTagAttributeMapCommandInput, + SetPrincipalTagAttributeMapCommandOutput, +} from "./commands/SetPrincipalTagAttributeMapCommand"; +import { + TagResourceCommandInput, + TagResourceCommandOutput, +} from "./commands/TagResourceCommand"; +import { + UnlinkDeveloperIdentityCommandInput, + UnlinkDeveloperIdentityCommandOutput, +} from "./commands/UnlinkDeveloperIdentityCommand"; +import { + UnlinkIdentityCommandInput, + UnlinkIdentityCommandOutput, +} from "./commands/UnlinkIdentityCommand"; +import { + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "./commands/UntagResourceCommand"; +import { + UpdateIdentityPoolCommandInput, + UpdateIdentityPoolCommandOutput, +} from "./commands/UpdateIdentityPoolCommand"; +export declare class CognitoIdentity extends CognitoIdentityClient { + createIdentityPool( + args: CreateIdentityPoolCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createIdentityPool( + args: CreateIdentityPoolCommandInput, + cb: (err: any, data?: CreateIdentityPoolCommandOutput) => void + ): void; + createIdentityPool( + args: CreateIdentityPoolCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateIdentityPoolCommandOutput) => void + ): void; + deleteIdentities( + args: DeleteIdentitiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteIdentities( + args: DeleteIdentitiesCommandInput, + cb: (err: any, data?: DeleteIdentitiesCommandOutput) => void + ): void; + deleteIdentities( + args: DeleteIdentitiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteIdentitiesCommandOutput) => void + ): void; + deleteIdentityPool( + args: DeleteIdentityPoolCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteIdentityPool( + args: DeleteIdentityPoolCommandInput, + cb: (err: any, data?: DeleteIdentityPoolCommandOutput) => void + ): void; + deleteIdentityPool( + args: DeleteIdentityPoolCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteIdentityPoolCommandOutput) => void + ): void; + describeIdentity( + args: DescribeIdentityCommandInput, + options?: __HttpHandlerOptions + ): Promise; + describeIdentity( + args: DescribeIdentityCommandInput, + cb: (err: any, data?: DescribeIdentityCommandOutput) => void + ): void; + describeIdentity( + args: DescribeIdentityCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeIdentityCommandOutput) => void + ): void; + describeIdentityPool( + args: DescribeIdentityPoolCommandInput, + options?: __HttpHandlerOptions + ): Promise; + describeIdentityPool( + args: DescribeIdentityPoolCommandInput, + cb: (err: any, data?: DescribeIdentityPoolCommandOutput) => void + ): void; + describeIdentityPool( + args: DescribeIdentityPoolCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeIdentityPoolCommandOutput) => void + ): void; + getCredentialsForIdentity( + args: GetCredentialsForIdentityCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getCredentialsForIdentity( + args: GetCredentialsForIdentityCommandInput, + cb: (err: any, data?: GetCredentialsForIdentityCommandOutput) => void + ): void; + getCredentialsForIdentity( + args: GetCredentialsForIdentityCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetCredentialsForIdentityCommandOutput) => void + ): void; + getId( + args: GetIdCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getId( + args: GetIdCommandInput, + cb: (err: any, data?: GetIdCommandOutput) => void + ): void; + getId( + args: GetIdCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetIdCommandOutput) => void + ): void; + getIdentityPoolRoles( + args: GetIdentityPoolRolesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getIdentityPoolRoles( + args: GetIdentityPoolRolesCommandInput, + cb: (err: any, data?: GetIdentityPoolRolesCommandOutput) => void + ): void; + getIdentityPoolRoles( + args: GetIdentityPoolRolesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetIdentityPoolRolesCommandOutput) => void + ): void; + getOpenIdToken( + args: GetOpenIdTokenCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getOpenIdToken( + args: GetOpenIdTokenCommandInput, + cb: (err: any, data?: GetOpenIdTokenCommandOutput) => void + ): void; + getOpenIdToken( + args: GetOpenIdTokenCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetOpenIdTokenCommandOutput) => void + ): void; + getOpenIdTokenForDeveloperIdentity( + args: GetOpenIdTokenForDeveloperIdentityCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getOpenIdTokenForDeveloperIdentity( + args: GetOpenIdTokenForDeveloperIdentityCommandInput, + cb: ( + err: any, + data?: GetOpenIdTokenForDeveloperIdentityCommandOutput + ) => void + ): void; + getOpenIdTokenForDeveloperIdentity( + args: GetOpenIdTokenForDeveloperIdentityCommandInput, + options: __HttpHandlerOptions, + cb: ( + err: any, + data?: GetOpenIdTokenForDeveloperIdentityCommandOutput + ) => void + ): void; + getPrincipalTagAttributeMap( + args: GetPrincipalTagAttributeMapCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getPrincipalTagAttributeMap( + args: GetPrincipalTagAttributeMapCommandInput, + cb: (err: any, data?: GetPrincipalTagAttributeMapCommandOutput) => void + ): void; + getPrincipalTagAttributeMap( + args: GetPrincipalTagAttributeMapCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetPrincipalTagAttributeMapCommandOutput) => void + ): void; + listIdentities( + args: ListIdentitiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listIdentities( + args: ListIdentitiesCommandInput, + cb: (err: any, data?: ListIdentitiesCommandOutput) => void + ): void; + listIdentities( + args: ListIdentitiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListIdentitiesCommandOutput) => void + ): void; + listIdentityPools( + args: ListIdentityPoolsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listIdentityPools( + args: ListIdentityPoolsCommandInput, + cb: (err: any, data?: ListIdentityPoolsCommandOutput) => void + ): void; + listIdentityPools( + args: ListIdentityPoolsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListIdentityPoolsCommandOutput) => void + ): void; + listTagsForResource( + args: ListTagsForResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listTagsForResource( + args: ListTagsForResourceCommandInput, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + listTagsForResource( + args: ListTagsForResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + lookupDeveloperIdentity( + args: LookupDeveloperIdentityCommandInput, + options?: __HttpHandlerOptions + ): Promise; + lookupDeveloperIdentity( + args: LookupDeveloperIdentityCommandInput, + cb: (err: any, data?: LookupDeveloperIdentityCommandOutput) => void + ): void; + lookupDeveloperIdentity( + args: LookupDeveloperIdentityCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: LookupDeveloperIdentityCommandOutput) => void + ): void; + mergeDeveloperIdentities( + args: MergeDeveloperIdentitiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + mergeDeveloperIdentities( + args: MergeDeveloperIdentitiesCommandInput, + cb: (err: any, data?: MergeDeveloperIdentitiesCommandOutput) => void + ): void; + mergeDeveloperIdentities( + args: MergeDeveloperIdentitiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: MergeDeveloperIdentitiesCommandOutput) => void + ): void; + setIdentityPoolRoles( + args: SetIdentityPoolRolesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + setIdentityPoolRoles( + args: SetIdentityPoolRolesCommandInput, + cb: (err: any, data?: SetIdentityPoolRolesCommandOutput) => void + ): void; + setIdentityPoolRoles( + args: SetIdentityPoolRolesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SetIdentityPoolRolesCommandOutput) => void + ): void; + setPrincipalTagAttributeMap( + args: SetPrincipalTagAttributeMapCommandInput, + options?: __HttpHandlerOptions + ): Promise; + setPrincipalTagAttributeMap( + args: SetPrincipalTagAttributeMapCommandInput, + cb: (err: any, data?: SetPrincipalTagAttributeMapCommandOutput) => void + ): void; + setPrincipalTagAttributeMap( + args: SetPrincipalTagAttributeMapCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SetPrincipalTagAttributeMapCommandOutput) => void + ): void; + tagResource( + args: TagResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + tagResource( + args: TagResourceCommandInput, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + unlinkDeveloperIdentity( + args: UnlinkDeveloperIdentityCommandInput, + options?: __HttpHandlerOptions + ): Promise; + unlinkDeveloperIdentity( + args: UnlinkDeveloperIdentityCommandInput, + cb: (err: any, data?: UnlinkDeveloperIdentityCommandOutput) => void + ): void; + unlinkDeveloperIdentity( + args: UnlinkDeveloperIdentityCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UnlinkDeveloperIdentityCommandOutput) => void + ): void; + unlinkIdentity( + args: UnlinkIdentityCommandInput, + options?: __HttpHandlerOptions + ): Promise; + unlinkIdentity( + args: UnlinkIdentityCommandInput, + cb: (err: any, data?: UnlinkIdentityCommandOutput) => void + ): void; + unlinkIdentity( + args: UnlinkIdentityCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UnlinkIdentityCommandOutput) => void + ): void; + untagResource( + args: UntagResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + untagResource( + args: UntagResourceCommandInput, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + updateIdentityPool( + args: UpdateIdentityPoolCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateIdentityPool( + args: UpdateIdentityPoolCommandInput, + cb: (err: any, data?: UpdateIdentityPoolCommandOutput) => void + ): void; + updateIdentityPool( + args: UpdateIdentityPoolCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateIdentityPoolCommandOutput) => void + ): void; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentityClient.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentityClient.d.ts new file mode 100644 index 0000000000..c36ab30e67 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentityClient.d.ts @@ -0,0 +1,248 @@ +import { + RegionInputConfig, + RegionResolvedConfig, +} from "@aws-sdk/config-resolver"; +import { + EndpointInputConfig, + EndpointResolvedConfig, +} from "@aws-sdk/middleware-endpoint"; +import { + HostHeaderInputConfig, + HostHeaderResolvedConfig, +} from "@aws-sdk/middleware-host-header"; +import { + RetryInputConfig, + RetryResolvedConfig, +} from "@aws-sdk/middleware-retry"; +import { + AwsAuthInputConfig, + AwsAuthResolvedConfig, +} from "@aws-sdk/middleware-signing"; +import { + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@aws-sdk/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + ChecksumConstructor as __ChecksumConstructor, + Credentials as __Credentials, + Decoder as __Decoder, + Encoder as __Encoder, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@aws-sdk/types"; +import { + CreateIdentityPoolCommandInput, + CreateIdentityPoolCommandOutput, +} from "./commands/CreateIdentityPoolCommand"; +import { + DeleteIdentitiesCommandInput, + DeleteIdentitiesCommandOutput, +} from "./commands/DeleteIdentitiesCommand"; +import { + DeleteIdentityPoolCommandInput, + DeleteIdentityPoolCommandOutput, +} from "./commands/DeleteIdentityPoolCommand"; +import { + DescribeIdentityCommandInput, + DescribeIdentityCommandOutput, +} from "./commands/DescribeIdentityCommand"; +import { + DescribeIdentityPoolCommandInput, + DescribeIdentityPoolCommandOutput, +} from "./commands/DescribeIdentityPoolCommand"; +import { + GetCredentialsForIdentityCommandInput, + GetCredentialsForIdentityCommandOutput, +} from "./commands/GetCredentialsForIdentityCommand"; +import { GetIdCommandInput, GetIdCommandOutput } from "./commands/GetIdCommand"; +import { + GetIdentityPoolRolesCommandInput, + GetIdentityPoolRolesCommandOutput, +} from "./commands/GetIdentityPoolRolesCommand"; +import { + GetOpenIdTokenCommandInput, + GetOpenIdTokenCommandOutput, +} from "./commands/GetOpenIdTokenCommand"; +import { + GetOpenIdTokenForDeveloperIdentityCommandInput, + GetOpenIdTokenForDeveloperIdentityCommandOutput, +} from "./commands/GetOpenIdTokenForDeveloperIdentityCommand"; +import { + GetPrincipalTagAttributeMapCommandInput, + GetPrincipalTagAttributeMapCommandOutput, +} from "./commands/GetPrincipalTagAttributeMapCommand"; +import { + ListIdentitiesCommandInput, + ListIdentitiesCommandOutput, +} from "./commands/ListIdentitiesCommand"; +import { + ListIdentityPoolsCommandInput, + ListIdentityPoolsCommandOutput, +} from "./commands/ListIdentityPoolsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { + LookupDeveloperIdentityCommandInput, + LookupDeveloperIdentityCommandOutput, +} from "./commands/LookupDeveloperIdentityCommand"; +import { + MergeDeveloperIdentitiesCommandInput, + MergeDeveloperIdentitiesCommandOutput, +} from "./commands/MergeDeveloperIdentitiesCommand"; +import { + SetIdentityPoolRolesCommandInput, + SetIdentityPoolRolesCommandOutput, +} from "./commands/SetIdentityPoolRolesCommand"; +import { + SetPrincipalTagAttributeMapCommandInput, + SetPrincipalTagAttributeMapCommandOutput, +} from "./commands/SetPrincipalTagAttributeMapCommand"; +import { + TagResourceCommandInput, + TagResourceCommandOutput, +} from "./commands/TagResourceCommand"; +import { + UnlinkDeveloperIdentityCommandInput, + UnlinkDeveloperIdentityCommandOutput, +} from "./commands/UnlinkDeveloperIdentityCommand"; +import { + UnlinkIdentityCommandInput, + UnlinkIdentityCommandOutput, +} from "./commands/UnlinkIdentityCommand"; +import { + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "./commands/UntagResourceCommand"; +import { + UpdateIdentityPoolCommandInput, + UpdateIdentityPoolCommandOutput, +} from "./commands/UpdateIdentityPoolCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, +} from "./endpoint/EndpointParameters"; +export declare type ServiceInputTypes = + | CreateIdentityPoolCommandInput + | DeleteIdentitiesCommandInput + | DeleteIdentityPoolCommandInput + | DescribeIdentityCommandInput + | DescribeIdentityPoolCommandInput + | GetCredentialsForIdentityCommandInput + | GetIdCommandInput + | GetIdentityPoolRolesCommandInput + | GetOpenIdTokenCommandInput + | GetOpenIdTokenForDeveloperIdentityCommandInput + | GetPrincipalTagAttributeMapCommandInput + | ListIdentitiesCommandInput + | ListIdentityPoolsCommandInput + | ListTagsForResourceCommandInput + | LookupDeveloperIdentityCommandInput + | MergeDeveloperIdentitiesCommandInput + | SetIdentityPoolRolesCommandInput + | SetPrincipalTagAttributeMapCommandInput + | TagResourceCommandInput + | UnlinkDeveloperIdentityCommandInput + | UnlinkIdentityCommandInput + | UntagResourceCommandInput + | UpdateIdentityPoolCommandInput; +export declare type ServiceOutputTypes = + | CreateIdentityPoolCommandOutput + | DeleteIdentitiesCommandOutput + | DeleteIdentityPoolCommandOutput + | DescribeIdentityCommandOutput + | DescribeIdentityPoolCommandOutput + | GetCredentialsForIdentityCommandOutput + | GetIdCommandOutput + | GetIdentityPoolRolesCommandOutput + | GetOpenIdTokenCommandOutput + | GetOpenIdTokenForDeveloperIdentityCommandOutput + | GetPrincipalTagAttributeMapCommandOutput + | ListIdentitiesCommandOutput + | ListIdentityPoolsCommandOutput + | ListTagsForResourceCommandOutput + | LookupDeveloperIdentityCommandOutput + | MergeDeveloperIdentitiesCommandOutput + | SetIdentityPoolRolesCommandOutput + | SetPrincipalTagAttributeMapCommandOutput + | TagResourceCommandOutput + | UnlinkDeveloperIdentityCommandOutput + | UnlinkIdentityCommandOutput + | UntagResourceCommandOutput + | UpdateIdentityPoolCommandOutput; +export interface ClientDefaults + extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + requestHandler?: __HttpHandler; + sha256?: __ChecksumConstructor | __HashConstructor; + urlParser?: __UrlParser; + bodyLengthChecker?: __BodyLengthCalculator; + streamCollector?: __StreamCollector; + base64Decoder?: __Decoder; + base64Encoder?: __Encoder; + utf8Decoder?: __Decoder; + utf8Encoder?: __Encoder; + runtime?: string; + disableHostPrefix?: boolean; + maxAttempts?: number | __Provider; + retryMode?: string | __Provider; + logger?: __Logger; + useDualstackEndpoint?: boolean | __Provider; + useFipsEndpoint?: boolean | __Provider; + serviceId?: string; + region?: string | __Provider; + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + defaultUserAgentProvider?: Provider<__UserAgent>; + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} +declare type CognitoIdentityClientConfigType = Partial< + __SmithyConfiguration<__HttpHandlerOptions> +> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + AwsAuthInputConfig & + UserAgentInputConfig & + ClientInputEndpointParameters; +export interface CognitoIdentityClientConfig + extends CognitoIdentityClientConfigType {} +declare type CognitoIdentityClientResolvedConfigType = + __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + AwsAuthResolvedConfig & + UserAgentResolvedConfig & + ClientResolvedEndpointParameters; +export interface CognitoIdentityClientResolvedConfig + extends CognitoIdentityClientResolvedConfigType {} +export declare class CognitoIdentityClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + CognitoIdentityClientResolvedConfig +> { + readonly config: CognitoIdentityClientResolvedConfig; + constructor(configuration: CognitoIdentityClientConfig); + destroy(): void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/CreateIdentityPoolCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/CreateIdentityPoolCommand.d.ts new file mode 100644 index 0000000000..054394d009 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/CreateIdentityPoolCommand.d.ts @@ -0,0 +1,35 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { CreateIdentityPoolInput, IdentityPool } from "../models/models_0"; +export interface CreateIdentityPoolCommandInput + extends CreateIdentityPoolInput {} +export interface CreateIdentityPoolCommandOutput + extends IdentityPool, + __MetadataBearer {} +export declare class CreateIdentityPoolCommand extends $Command< + CreateIdentityPoolCommandInput, + CreateIdentityPoolCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: CreateIdentityPoolCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: CreateIdentityPoolCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentitiesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentitiesCommand.d.ts new file mode 100644 index 0000000000..1aa1da76d0 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentitiesCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + DeleteIdentitiesInput, + DeleteIdentitiesResponse, +} from "../models/models_0"; +export interface DeleteIdentitiesCommandInput extends DeleteIdentitiesInput {} +export interface DeleteIdentitiesCommandOutput + extends DeleteIdentitiesResponse, + __MetadataBearer {} +export declare class DeleteIdentitiesCommand extends $Command< + DeleteIdentitiesCommandInput, + DeleteIdentitiesCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: DeleteIdentitiesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DeleteIdentitiesCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentityPoolCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentityPoolCommand.d.ts new file mode 100644 index 0000000000..b300727277 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentityPoolCommand.d.ts @@ -0,0 +1,33 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { DeleteIdentityPoolInput } from "../models/models_0"; +export interface DeleteIdentityPoolCommandInput + extends DeleteIdentityPoolInput {} +export interface DeleteIdentityPoolCommandOutput extends __MetadataBearer {} +export declare class DeleteIdentityPoolCommand extends $Command< + DeleteIdentityPoolCommandInput, + DeleteIdentityPoolCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: DeleteIdentityPoolCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DeleteIdentityPoolCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityCommand.d.ts new file mode 100644 index 0000000000..ab7de5c049 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityCommand.d.ts @@ -0,0 +1,34 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { DescribeIdentityInput, IdentityDescription } from "../models/models_0"; +export interface DescribeIdentityCommandInput extends DescribeIdentityInput {} +export interface DescribeIdentityCommandOutput + extends IdentityDescription, + __MetadataBearer {} +export declare class DescribeIdentityCommand extends $Command< + DescribeIdentityCommandInput, + DescribeIdentityCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: DescribeIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DescribeIdentityCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityPoolCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityPoolCommand.d.ts new file mode 100644 index 0000000000..055f253a0f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityPoolCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { DescribeIdentityPoolInput, IdentityPool } from "../models/models_0"; +export interface DescribeIdentityPoolCommandInput + extends DescribeIdentityPoolInput {} +export interface DescribeIdentityPoolCommandOutput + extends IdentityPool, + __MetadataBearer {} +export declare class DescribeIdentityPoolCommand extends $Command< + DescribeIdentityPoolCommandInput, + DescribeIdentityPoolCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: DescribeIdentityPoolCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DescribeIdentityPoolCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeIdentityPoolCommandInput, + DescribeIdentityPoolCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetCredentialsForIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetCredentialsForIdentityCommand.d.ts new file mode 100644 index 0000000000..271894b3f7 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetCredentialsForIdentityCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + GetCredentialsForIdentityInput, + GetCredentialsForIdentityResponse, +} from "../models/models_0"; +export interface GetCredentialsForIdentityCommandInput + extends GetCredentialsForIdentityInput {} +export interface GetCredentialsForIdentityCommandOutput + extends GetCredentialsForIdentityResponse, + __MetadataBearer {} +export declare class GetCredentialsForIdentityCommand extends $Command< + GetCredentialsForIdentityCommandInput, + GetCredentialsForIdentityCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: GetCredentialsForIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetCredentialsForIdentityCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetCredentialsForIdentityCommandInput, + GetCredentialsForIdentityCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdCommand.d.ts new file mode 100644 index 0000000000..1a04450740 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdCommand.d.ts @@ -0,0 +1,32 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { GetIdInput, GetIdResponse } from "../models/models_0"; +export interface GetIdCommandInput extends GetIdInput {} +export interface GetIdCommandOutput extends GetIdResponse, __MetadataBearer {} +export declare class GetIdCommand extends $Command< + GetIdCommandInput, + GetIdCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: GetIdCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetIdCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdentityPoolRolesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdentityPoolRolesCommand.d.ts new file mode 100644 index 0000000000..562a84376b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdentityPoolRolesCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + GetIdentityPoolRolesInput, + GetIdentityPoolRolesResponse, +} from "../models/models_0"; +export interface GetIdentityPoolRolesCommandInput + extends GetIdentityPoolRolesInput {} +export interface GetIdentityPoolRolesCommandOutput + extends GetIdentityPoolRolesResponse, + __MetadataBearer {} +export declare class GetIdentityPoolRolesCommand extends $Command< + GetIdentityPoolRolesCommandInput, + GetIdentityPoolRolesCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: GetIdentityPoolRolesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetIdentityPoolRolesCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetIdentityPoolRolesCommandInput, + GetIdentityPoolRolesCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenCommand.d.ts new file mode 100644 index 0000000000..a7a7f0cabb --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + GetOpenIdTokenInput, + GetOpenIdTokenResponse, +} from "../models/models_0"; +export interface GetOpenIdTokenCommandInput extends GetOpenIdTokenInput {} +export interface GetOpenIdTokenCommandOutput + extends GetOpenIdTokenResponse, + __MetadataBearer {} +export declare class GetOpenIdTokenCommand extends $Command< + GetOpenIdTokenCommandInput, + GetOpenIdTokenCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: GetOpenIdTokenCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetOpenIdTokenCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts new file mode 100644 index 0000000000..700419074f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + GetOpenIdTokenForDeveloperIdentityInput, + GetOpenIdTokenForDeveloperIdentityResponse, +} from "../models/models_0"; +export interface GetOpenIdTokenForDeveloperIdentityCommandInput + extends GetOpenIdTokenForDeveloperIdentityInput {} +export interface GetOpenIdTokenForDeveloperIdentityCommandOutput + extends GetOpenIdTokenForDeveloperIdentityResponse, + __MetadataBearer {} +export declare class GetOpenIdTokenForDeveloperIdentityCommand extends $Command< + GetOpenIdTokenForDeveloperIdentityCommandInput, + GetOpenIdTokenForDeveloperIdentityCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: GetOpenIdTokenForDeveloperIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetOpenIdTokenForDeveloperIdentityCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetOpenIdTokenForDeveloperIdentityCommandInput, + GetOpenIdTokenForDeveloperIdentityCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetPrincipalTagAttributeMapCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetPrincipalTagAttributeMapCommand.d.ts new file mode 100644 index 0000000000..59226c3442 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetPrincipalTagAttributeMapCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + GetPrincipalTagAttributeMapInput, + GetPrincipalTagAttributeMapResponse, +} from "../models/models_0"; +export interface GetPrincipalTagAttributeMapCommandInput + extends GetPrincipalTagAttributeMapInput {} +export interface GetPrincipalTagAttributeMapCommandOutput + extends GetPrincipalTagAttributeMapResponse, + __MetadataBearer {} +export declare class GetPrincipalTagAttributeMapCommand extends $Command< + GetPrincipalTagAttributeMapCommandInput, + GetPrincipalTagAttributeMapCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: GetPrincipalTagAttributeMapCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetPrincipalTagAttributeMapCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetPrincipalTagAttributeMapCommandInput, + GetPrincipalTagAttributeMapCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentitiesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentitiesCommand.d.ts new file mode 100644 index 0000000000..e8d230006b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentitiesCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + ListIdentitiesInput, + ListIdentitiesResponse, +} from "../models/models_0"; +export interface ListIdentitiesCommandInput extends ListIdentitiesInput {} +export interface ListIdentitiesCommandOutput + extends ListIdentitiesResponse, + __MetadataBearer {} +export declare class ListIdentitiesCommand extends $Command< + ListIdentitiesCommandInput, + ListIdentitiesCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: ListIdentitiesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListIdentitiesCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentityPoolsCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentityPoolsCommand.d.ts new file mode 100644 index 0000000000..8aa3c06aa6 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentityPoolsCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + ListIdentityPoolsInput, + ListIdentityPoolsResponse, +} from "../models/models_0"; +export interface ListIdentityPoolsCommandInput extends ListIdentityPoolsInput {} +export interface ListIdentityPoolsCommandOutput + extends ListIdentityPoolsResponse, + __MetadataBearer {} +export declare class ListIdentityPoolsCommand extends $Command< + ListIdentityPoolsCommandInput, + ListIdentityPoolsCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: ListIdentityPoolsCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListIdentityPoolsCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts new file mode 100644 index 0000000000..00c1bda41b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + ListTagsForResourceInput, + ListTagsForResourceResponse, +} from "../models/models_0"; +export interface ListTagsForResourceCommandInput + extends ListTagsForResourceInput {} +export interface ListTagsForResourceCommandOutput + extends ListTagsForResourceResponse, + __MetadataBearer {} +export declare class ListTagsForResourceCommand extends $Command< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: ListTagsForResourceCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListTagsForResourceCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/LookupDeveloperIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/LookupDeveloperIdentityCommand.d.ts new file mode 100644 index 0000000000..cef29d53a5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/LookupDeveloperIdentityCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + LookupDeveloperIdentityInput, + LookupDeveloperIdentityResponse, +} from "../models/models_0"; +export interface LookupDeveloperIdentityCommandInput + extends LookupDeveloperIdentityInput {} +export interface LookupDeveloperIdentityCommandOutput + extends LookupDeveloperIdentityResponse, + __MetadataBearer {} +export declare class LookupDeveloperIdentityCommand extends $Command< + LookupDeveloperIdentityCommandInput, + LookupDeveloperIdentityCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: LookupDeveloperIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: LookupDeveloperIdentityCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + LookupDeveloperIdentityCommandInput, + LookupDeveloperIdentityCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/MergeDeveloperIdentitiesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/MergeDeveloperIdentitiesCommand.d.ts new file mode 100644 index 0000000000..cb2bbeb440 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/MergeDeveloperIdentitiesCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + MergeDeveloperIdentitiesInput, + MergeDeveloperIdentitiesResponse, +} from "../models/models_0"; +export interface MergeDeveloperIdentitiesCommandInput + extends MergeDeveloperIdentitiesInput {} +export interface MergeDeveloperIdentitiesCommandOutput + extends MergeDeveloperIdentitiesResponse, + __MetadataBearer {} +export declare class MergeDeveloperIdentitiesCommand extends $Command< + MergeDeveloperIdentitiesCommandInput, + MergeDeveloperIdentitiesCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: MergeDeveloperIdentitiesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: MergeDeveloperIdentitiesCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + MergeDeveloperIdentitiesCommandInput, + MergeDeveloperIdentitiesCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetIdentityPoolRolesCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetIdentityPoolRolesCommand.d.ts new file mode 100644 index 0000000000..eeb02e210f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetIdentityPoolRolesCommand.d.ts @@ -0,0 +1,36 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { SetIdentityPoolRolesInput } from "../models/models_0"; +export interface SetIdentityPoolRolesCommandInput + extends SetIdentityPoolRolesInput {} +export interface SetIdentityPoolRolesCommandOutput extends __MetadataBearer {} +export declare class SetIdentityPoolRolesCommand extends $Command< + SetIdentityPoolRolesCommandInput, + SetIdentityPoolRolesCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: SetIdentityPoolRolesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: SetIdentityPoolRolesCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + SetIdentityPoolRolesCommandInput, + SetIdentityPoolRolesCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetPrincipalTagAttributeMapCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetPrincipalTagAttributeMapCommand.d.ts new file mode 100644 index 0000000000..3c245864c7 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetPrincipalTagAttributeMapCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { + SetPrincipalTagAttributeMapInput, + SetPrincipalTagAttributeMapResponse, +} from "../models/models_0"; +export interface SetPrincipalTagAttributeMapCommandInput + extends SetPrincipalTagAttributeMapInput {} +export interface SetPrincipalTagAttributeMapCommandOutput + extends SetPrincipalTagAttributeMapResponse, + __MetadataBearer {} +export declare class SetPrincipalTagAttributeMapCommand extends $Command< + SetPrincipalTagAttributeMapCommandInput, + SetPrincipalTagAttributeMapCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: SetPrincipalTagAttributeMapCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: SetPrincipalTagAttributeMapCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + SetPrincipalTagAttributeMapCommandInput, + SetPrincipalTagAttributeMapCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/TagResourceCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/TagResourceCommand.d.ts new file mode 100644 index 0000000000..e7d7d998f5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/TagResourceCommand.d.ts @@ -0,0 +1,34 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { TagResourceInput, TagResourceResponse } from "../models/models_0"; +export interface TagResourceCommandInput extends TagResourceInput {} +export interface TagResourceCommandOutput + extends TagResourceResponse, + __MetadataBearer {} +export declare class TagResourceCommand extends $Command< + TagResourceCommandInput, + TagResourceCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: TagResourceCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: TagResourceCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkDeveloperIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkDeveloperIdentityCommand.d.ts new file mode 100644 index 0000000000..f6791964a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkDeveloperIdentityCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { UnlinkDeveloperIdentityInput } from "../models/models_0"; +export interface UnlinkDeveloperIdentityCommandInput + extends UnlinkDeveloperIdentityInput {} +export interface UnlinkDeveloperIdentityCommandOutput + extends __MetadataBearer {} +export declare class UnlinkDeveloperIdentityCommand extends $Command< + UnlinkDeveloperIdentityCommandInput, + UnlinkDeveloperIdentityCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: UnlinkDeveloperIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: UnlinkDeveloperIdentityCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + UnlinkDeveloperIdentityCommandInput, + UnlinkDeveloperIdentityCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkIdentityCommand.d.ts new file mode 100644 index 0000000000..d42c4f60af --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkIdentityCommand.d.ts @@ -0,0 +1,32 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { UnlinkIdentityInput } from "../models/models_0"; +export interface UnlinkIdentityCommandInput extends UnlinkIdentityInput {} +export interface UnlinkIdentityCommandOutput extends __MetadataBearer {} +export declare class UnlinkIdentityCommand extends $Command< + UnlinkIdentityCommandInput, + UnlinkIdentityCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: UnlinkIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: UnlinkIdentityCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UntagResourceCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UntagResourceCommand.d.ts new file mode 100644 index 0000000000..edd6fac2e9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UntagResourceCommand.d.ts @@ -0,0 +1,34 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { UntagResourceInput, UntagResourceResponse } from "../models/models_0"; +export interface UntagResourceCommandInput extends UntagResourceInput {} +export interface UntagResourceCommandOutput + extends UntagResourceResponse, + __MetadataBearer {} +export declare class UntagResourceCommand extends $Command< + UntagResourceCommandInput, + UntagResourceCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: UntagResourceCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: UntagResourceCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UpdateIdentityPoolCommand.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UpdateIdentityPoolCommand.d.ts new file mode 100644 index 0000000000..cf0d56a188 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UpdateIdentityPoolCommand.d.ts @@ -0,0 +1,34 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + CognitoIdentityClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../CognitoIdentityClient"; +import { IdentityPool } from "../models/models_0"; +export interface UpdateIdentityPoolCommandInput extends IdentityPool {} +export interface UpdateIdentityPoolCommandOutput + extends IdentityPool, + __MetadataBearer {} +export declare class UpdateIdentityPoolCommand extends $Command< + UpdateIdentityPoolCommandInput, + UpdateIdentityPoolCommandOutput, + CognitoIdentityClientResolvedConfig +> { + readonly input: UpdateIdentityPoolCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: UpdateIdentityPoolCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CognitoIdentityClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/index.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/index.d.ts new file mode 100644 index 0000000000..8df424ba4b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/index.d.ts @@ -0,0 +1,23 @@ +export * from "./CreateIdentityPoolCommand"; +export * from "./DeleteIdentitiesCommand"; +export * from "./DeleteIdentityPoolCommand"; +export * from "./DescribeIdentityCommand"; +export * from "./DescribeIdentityPoolCommand"; +export * from "./GetCredentialsForIdentityCommand"; +export * from "./GetIdCommand"; +export * from "./GetIdentityPoolRolesCommand"; +export * from "./GetOpenIdTokenCommand"; +export * from "./GetOpenIdTokenForDeveloperIdentityCommand"; +export * from "./GetPrincipalTagAttributeMapCommand"; +export * from "./ListIdentitiesCommand"; +export * from "./ListIdentityPoolsCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./LookupDeveloperIdentityCommand"; +export * from "./MergeDeveloperIdentitiesCommand"; +export * from "./SetIdentityPoolRolesCommand"; +export * from "./SetPrincipalTagAttributeMapCommand"; +export * from "./TagResourceCommand"; +export * from "./UnlinkDeveloperIdentityCommand"; +export * from "./UnlinkIdentityCommand"; +export * from "./UntagResourceCommand"; +export * from "./UpdateIdentityPoolCommand"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/EndpointParameters.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/EndpointParameters.d.ts new file mode 100644 index 0000000000..07bea1ea11 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/EndpointParameters.d.ts @@ -0,0 +1,34 @@ +import { + Endpoint, + EndpointParameters as __EndpointParameters, + EndpointV2, + Provider, +} from "@aws-sdk/types"; +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: + | string + | Provider + | Endpoint + | Provider + | EndpointV2 + | Provider; +} +export declare type ClientResolvedEndpointParameters = + ClientInputEndpointParameters & { + defaultSigningName: string; + }; +export declare const resolveClientEndpointParameters: ( + options: T & ClientInputEndpointParameters +) => T & + ClientInputEndpointParameters & { + defaultSigningName: string; + }; +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/endpointResolver.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/endpointResolver.d.ts new file mode 100644 index 0000000000..4c971a7f41 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/endpointResolver.d.ts @@ -0,0 +1,8 @@ +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParameters } from "./EndpointParameters"; +export declare const defaultEndpointResolver: ( + endpointParams: EndpointParameters, + context?: { + logger?: Logger; + } +) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/ruleset.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/ruleset.d.ts new file mode 100644 index 0000000000..a822ad761a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoint/ruleset.d.ts @@ -0,0 +1,2 @@ +import { RuleSetObject } from "@aws-sdk/util-endpoints"; +export declare const ruleSet: RuleSetObject; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..c7525c3f7c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/index.d.ts @@ -0,0 +1,6 @@ +export * from "./CognitoIdentity"; +export * from "./CognitoIdentityClient"; +export * from "./commands"; +export * from "./models"; +export * from "./pagination"; +export { CognitoIdentityServiceException } from "./models/CognitoIdentityServiceException"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/CognitoIdentityServiceException.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/CognitoIdentityServiceException.d.ts new file mode 100644 index 0000000000..7a1b93cca6 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/CognitoIdentityServiceException.d.ts @@ -0,0 +1,7 @@ +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@aws-sdk/smithy-client"; +export declare class CognitoIdentityServiceException extends __ServiceException { + constructor(options: __ServiceExceptionOptions); +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/index.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/index.d.ts new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/index.d.ts @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/models_0.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/models_0.d.ts new file mode 100644 index 0000000000..9416fc2d00 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/models_0.d.ts @@ -0,0 +1,449 @@ +import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client"; +import { CognitoIdentityServiceException as __BaseException } from "./CognitoIdentityServiceException"; +export declare enum AmbiguousRoleResolutionType { + AUTHENTICATED_ROLE = "AuthenticatedRole", + DENY = "Deny", +} +export interface CognitoIdentityProvider { + ProviderName?: string; + ClientId?: string; + ServerSideTokenCheck?: boolean; +} +export interface CreateIdentityPoolInput { + IdentityPoolName: string | undefined; + AllowUnauthenticatedIdentities: boolean | undefined; + AllowClassicFlow?: boolean; + SupportedLoginProviders?: Record; + DeveloperProviderName?: string; + OpenIdConnectProviderARNs?: string[]; + CognitoIdentityProviders?: CognitoIdentityProvider[]; + SamlProviderARNs?: string[]; + IdentityPoolTags?: Record; +} +export interface IdentityPool { + IdentityPoolId: string | undefined; + IdentityPoolName: string | undefined; + AllowUnauthenticatedIdentities: boolean | undefined; + AllowClassicFlow?: boolean; + SupportedLoginProviders?: Record; + DeveloperProviderName?: string; + OpenIdConnectProviderARNs?: string[]; + CognitoIdentityProviders?: CognitoIdentityProvider[]; + SamlProviderARNs?: string[]; + IdentityPoolTags?: Record; +} +export declare class InternalErrorException extends __BaseException { + readonly name: "InternalErrorException"; + readonly $fault: "server"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class InvalidParameterException extends __BaseException { + readonly name: "InvalidParameterException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class LimitExceededException extends __BaseException { + readonly name: "LimitExceededException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class NotAuthorizedException extends __BaseException { + readonly name: "NotAuthorizedException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class ResourceConflictException extends __BaseException { + readonly name: "ResourceConflictException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class TooManyRequestsException extends __BaseException { + readonly name: "TooManyRequestsException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export interface DeleteIdentitiesInput { + IdentityIdsToDelete: string[] | undefined; +} +export declare enum ErrorCode { + ACCESS_DENIED = "AccessDenied", + INTERNAL_SERVER_ERROR = "InternalServerError", +} +export interface UnprocessedIdentityId { + IdentityId?: string; + ErrorCode?: ErrorCode | string; +} +export interface DeleteIdentitiesResponse { + UnprocessedIdentityIds?: UnprocessedIdentityId[]; +} +export interface DeleteIdentityPoolInput { + IdentityPoolId: string | undefined; +} +export declare class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export interface DescribeIdentityInput { + IdentityId: string | undefined; +} +export interface IdentityDescription { + IdentityId?: string; + Logins?: string[]; + CreationDate?: Date; + LastModifiedDate?: Date; +} +export interface DescribeIdentityPoolInput { + IdentityPoolId: string | undefined; +} +export declare class ExternalServiceException extends __BaseException { + readonly name: "ExternalServiceException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export interface GetCredentialsForIdentityInput { + IdentityId: string | undefined; + Logins?: Record; + CustomRoleArn?: string; +} +export interface Credentials { + AccessKeyId?: string; + SecretKey?: string; + SessionToken?: string; + Expiration?: Date; +} +export interface GetCredentialsForIdentityResponse { + IdentityId?: string; + Credentials?: Credentials; +} +export declare class InvalidIdentityPoolConfigurationException extends __BaseException { + readonly name: "InvalidIdentityPoolConfigurationException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType< + InvalidIdentityPoolConfigurationException, + __BaseException + > + ); +} +export interface GetIdInput { + AccountId?: string; + IdentityPoolId: string | undefined; + Logins?: Record; +} +export interface GetIdResponse { + IdentityId?: string; +} +export interface GetIdentityPoolRolesInput { + IdentityPoolId: string | undefined; +} +export declare enum MappingRuleMatchType { + CONTAINS = "Contains", + EQUALS = "Equals", + NOT_EQUAL = "NotEqual", + STARTS_WITH = "StartsWith", +} +export interface MappingRule { + Claim: string | undefined; + MatchType: MappingRuleMatchType | string | undefined; + Value: string | undefined; + RoleARN: string | undefined; +} +export interface RulesConfigurationType { + Rules: MappingRule[] | undefined; +} +export declare enum RoleMappingType { + RULES = "Rules", + TOKEN = "Token", +} +export interface RoleMapping { + Type: RoleMappingType | string | undefined; + AmbiguousRoleResolution?: AmbiguousRoleResolutionType | string; + RulesConfiguration?: RulesConfigurationType; +} +export interface GetIdentityPoolRolesResponse { + IdentityPoolId?: string; + Roles?: Record; + RoleMappings?: Record; +} +export interface GetOpenIdTokenInput { + IdentityId: string | undefined; + Logins?: Record; +} +export interface GetOpenIdTokenResponse { + IdentityId?: string; + Token?: string; +} +export declare class DeveloperUserAlreadyRegisteredException extends __BaseException { + readonly name: "DeveloperUserAlreadyRegisteredException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType< + DeveloperUserAlreadyRegisteredException, + __BaseException + > + ); +} +export interface GetOpenIdTokenForDeveloperIdentityInput { + IdentityPoolId: string | undefined; + IdentityId?: string; + Logins: Record | undefined; + PrincipalTags?: Record; + TokenDuration?: number; +} +export interface GetOpenIdTokenForDeveloperIdentityResponse { + IdentityId?: string; + Token?: string; +} +export interface GetPrincipalTagAttributeMapInput { + IdentityPoolId: string | undefined; + IdentityProviderName: string | undefined; +} +export interface GetPrincipalTagAttributeMapResponse { + IdentityPoolId?: string; + IdentityProviderName?: string; + UseDefaults?: boolean; + PrincipalTags?: Record; +} +export interface ListIdentitiesInput { + IdentityPoolId: string | undefined; + MaxResults: number | undefined; + NextToken?: string; + HideDisabled?: boolean; +} +export interface ListIdentitiesResponse { + IdentityPoolId?: string; + Identities?: IdentityDescription[]; + NextToken?: string; +} +export interface ListIdentityPoolsInput { + MaxResults: number | undefined; + NextToken?: string; +} +export interface IdentityPoolShortDescription { + IdentityPoolId?: string; + IdentityPoolName?: string; +} +export interface ListIdentityPoolsResponse { + IdentityPools?: IdentityPoolShortDescription[]; + NextToken?: string; +} +export interface ListTagsForResourceInput { + ResourceArn: string | undefined; +} +export interface ListTagsForResourceResponse { + Tags?: Record; +} +export interface LookupDeveloperIdentityInput { + IdentityPoolId: string | undefined; + IdentityId?: string; + DeveloperUserIdentifier?: string; + MaxResults?: number; + NextToken?: string; +} +export interface LookupDeveloperIdentityResponse { + IdentityId?: string; + DeveloperUserIdentifierList?: string[]; + NextToken?: string; +} +export interface MergeDeveloperIdentitiesInput { + SourceUserIdentifier: string | undefined; + DestinationUserIdentifier: string | undefined; + DeveloperProviderName: string | undefined; + IdentityPoolId: string | undefined; +} +export interface MergeDeveloperIdentitiesResponse { + IdentityId?: string; +} +export declare class ConcurrentModificationException extends __BaseException { + readonly name: "ConcurrentModificationException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType< + ConcurrentModificationException, + __BaseException + > + ); +} +export interface SetIdentityPoolRolesInput { + IdentityPoolId: string | undefined; + Roles: Record | undefined; + RoleMappings?: Record; +} +export interface SetPrincipalTagAttributeMapInput { + IdentityPoolId: string | undefined; + IdentityProviderName: string | undefined; + UseDefaults?: boolean; + PrincipalTags?: Record; +} +export interface SetPrincipalTagAttributeMapResponse { + IdentityPoolId?: string; + IdentityProviderName?: string; + UseDefaults?: boolean; + PrincipalTags?: Record; +} +export interface TagResourceInput { + ResourceArn: string | undefined; + Tags: Record | undefined; +} +export interface TagResourceResponse {} +export interface UnlinkDeveloperIdentityInput { + IdentityId: string | undefined; + IdentityPoolId: string | undefined; + DeveloperProviderName: string | undefined; + DeveloperUserIdentifier: string | undefined; +} +export interface UnlinkIdentityInput { + IdentityId: string | undefined; + Logins: Record | undefined; + LoginsToRemove: string[] | undefined; +} +export interface UntagResourceInput { + ResourceArn: string | undefined; + TagKeys: string[] | undefined; +} +export interface UntagResourceResponse {} +export declare const CognitoIdentityProviderFilterSensitiveLog: ( + obj: CognitoIdentityProvider +) => any; +export declare const CreateIdentityPoolInputFilterSensitiveLog: ( + obj: CreateIdentityPoolInput +) => any; +export declare const IdentityPoolFilterSensitiveLog: (obj: IdentityPool) => any; +export declare const DeleteIdentitiesInputFilterSensitiveLog: ( + obj: DeleteIdentitiesInput +) => any; +export declare const UnprocessedIdentityIdFilterSensitiveLog: ( + obj: UnprocessedIdentityId +) => any; +export declare const DeleteIdentitiesResponseFilterSensitiveLog: ( + obj: DeleteIdentitiesResponse +) => any; +export declare const DeleteIdentityPoolInputFilterSensitiveLog: ( + obj: DeleteIdentityPoolInput +) => any; +export declare const DescribeIdentityInputFilterSensitiveLog: ( + obj: DescribeIdentityInput +) => any; +export declare const IdentityDescriptionFilterSensitiveLog: ( + obj: IdentityDescription +) => any; +export declare const DescribeIdentityPoolInputFilterSensitiveLog: ( + obj: DescribeIdentityPoolInput +) => any; +export declare const GetCredentialsForIdentityInputFilterSensitiveLog: ( + obj: GetCredentialsForIdentityInput +) => any; +export declare const CredentialsFilterSensitiveLog: (obj: Credentials) => any; +export declare const GetCredentialsForIdentityResponseFilterSensitiveLog: ( + obj: GetCredentialsForIdentityResponse +) => any; +export declare const GetIdInputFilterSensitiveLog: (obj: GetIdInput) => any; +export declare const GetIdResponseFilterSensitiveLog: ( + obj: GetIdResponse +) => any; +export declare const GetIdentityPoolRolesInputFilterSensitiveLog: ( + obj: GetIdentityPoolRolesInput +) => any; +export declare const MappingRuleFilterSensitiveLog: (obj: MappingRule) => any; +export declare const RulesConfigurationTypeFilterSensitiveLog: ( + obj: RulesConfigurationType +) => any; +export declare const RoleMappingFilterSensitiveLog: (obj: RoleMapping) => any; +export declare const GetIdentityPoolRolesResponseFilterSensitiveLog: ( + obj: GetIdentityPoolRolesResponse +) => any; +export declare const GetOpenIdTokenInputFilterSensitiveLog: ( + obj: GetOpenIdTokenInput +) => any; +export declare const GetOpenIdTokenResponseFilterSensitiveLog: ( + obj: GetOpenIdTokenResponse +) => any; +export declare const GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog: ( + obj: GetOpenIdTokenForDeveloperIdentityInput +) => any; +export declare const GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog: ( + obj: GetOpenIdTokenForDeveloperIdentityResponse +) => any; +export declare const GetPrincipalTagAttributeMapInputFilterSensitiveLog: ( + obj: GetPrincipalTagAttributeMapInput +) => any; +export declare const GetPrincipalTagAttributeMapResponseFilterSensitiveLog: ( + obj: GetPrincipalTagAttributeMapResponse +) => any; +export declare const ListIdentitiesInputFilterSensitiveLog: ( + obj: ListIdentitiesInput +) => any; +export declare const ListIdentitiesResponseFilterSensitiveLog: ( + obj: ListIdentitiesResponse +) => any; +export declare const ListIdentityPoolsInputFilterSensitiveLog: ( + obj: ListIdentityPoolsInput +) => any; +export declare const IdentityPoolShortDescriptionFilterSensitiveLog: ( + obj: IdentityPoolShortDescription +) => any; +export declare const ListIdentityPoolsResponseFilterSensitiveLog: ( + obj: ListIdentityPoolsResponse +) => any; +export declare const ListTagsForResourceInputFilterSensitiveLog: ( + obj: ListTagsForResourceInput +) => any; +export declare const ListTagsForResourceResponseFilterSensitiveLog: ( + obj: ListTagsForResourceResponse +) => any; +export declare const LookupDeveloperIdentityInputFilterSensitiveLog: ( + obj: LookupDeveloperIdentityInput +) => any; +export declare const LookupDeveloperIdentityResponseFilterSensitiveLog: ( + obj: LookupDeveloperIdentityResponse +) => any; +export declare const MergeDeveloperIdentitiesInputFilterSensitiveLog: ( + obj: MergeDeveloperIdentitiesInput +) => any; +export declare const MergeDeveloperIdentitiesResponseFilterSensitiveLog: ( + obj: MergeDeveloperIdentitiesResponse +) => any; +export declare const SetIdentityPoolRolesInputFilterSensitiveLog: ( + obj: SetIdentityPoolRolesInput +) => any; +export declare const SetPrincipalTagAttributeMapInputFilterSensitiveLog: ( + obj: SetPrincipalTagAttributeMapInput +) => any; +export declare const SetPrincipalTagAttributeMapResponseFilterSensitiveLog: ( + obj: SetPrincipalTagAttributeMapResponse +) => any; +export declare const TagResourceInputFilterSensitiveLog: ( + obj: TagResourceInput +) => any; +export declare const TagResourceResponseFilterSensitiveLog: ( + obj: TagResourceResponse +) => any; +export declare const UnlinkDeveloperIdentityInputFilterSensitiveLog: ( + obj: UnlinkDeveloperIdentityInput +) => any; +export declare const UnlinkIdentityInputFilterSensitiveLog: ( + obj: UnlinkIdentityInput +) => any; +export declare const UntagResourceInputFilterSensitiveLog: ( + obj: UntagResourceInput +) => any; +export declare const UntagResourceResponseFilterSensitiveLog: ( + obj: UntagResourceResponse +) => any; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/Interfaces.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/Interfaces.d.ts new file mode 100644 index 0000000000..e2c77a90e1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/Interfaces.d.ts @@ -0,0 +1,7 @@ +import { PaginationConfiguration } from "@aws-sdk/types"; +import { CognitoIdentity } from "../CognitoIdentity"; +import { CognitoIdentityClient } from "../CognitoIdentityClient"; +export interface CognitoIdentityPaginationConfiguration + extends PaginationConfiguration { + client: CognitoIdentity | CognitoIdentityClient; +} diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/ListIdentityPoolsPaginator.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/ListIdentityPoolsPaginator.d.ts new file mode 100644 index 0000000000..377b31b93c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/ListIdentityPoolsPaginator.d.ts @@ -0,0 +1,11 @@ +import { Paginator } from "@aws-sdk/types"; +import { + ListIdentityPoolsCommandInput, + ListIdentityPoolsCommandOutput, +} from "../commands/ListIdentityPoolsCommand"; +import { CognitoIdentityPaginationConfiguration } from "./Interfaces"; +export declare function paginateListIdentityPools( + config: CognitoIdentityPaginationConfiguration, + input: ListIdentityPoolsCommandInput, + ...additionalArguments: any +): Paginator; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/index.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/index.d.ts new file mode 100644 index 0000000000..c77b96c1d1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Interfaces"; +export * from "./ListIdentityPoolsPaginator"; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/protocols/Aws_json1_1.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/protocols/Aws_json1_1.d.ts new file mode 100644 index 0000000000..7cf21bb2ae --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/protocols/Aws_json1_1.d.ts @@ -0,0 +1,281 @@ +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, +} from "@aws-sdk/protocol-http"; +import { SerdeContext as __SerdeContext } from "@aws-sdk/types"; +import { + CreateIdentityPoolCommandInput, + CreateIdentityPoolCommandOutput, +} from "../commands/CreateIdentityPoolCommand"; +import { + DeleteIdentitiesCommandInput, + DeleteIdentitiesCommandOutput, +} from "../commands/DeleteIdentitiesCommand"; +import { + DeleteIdentityPoolCommandInput, + DeleteIdentityPoolCommandOutput, +} from "../commands/DeleteIdentityPoolCommand"; +import { + DescribeIdentityCommandInput, + DescribeIdentityCommandOutput, +} from "../commands/DescribeIdentityCommand"; +import { + DescribeIdentityPoolCommandInput, + DescribeIdentityPoolCommandOutput, +} from "../commands/DescribeIdentityPoolCommand"; +import { + GetCredentialsForIdentityCommandInput, + GetCredentialsForIdentityCommandOutput, +} from "../commands/GetCredentialsForIdentityCommand"; +import { + GetIdCommandInput, + GetIdCommandOutput, +} from "../commands/GetIdCommand"; +import { + GetIdentityPoolRolesCommandInput, + GetIdentityPoolRolesCommandOutput, +} from "../commands/GetIdentityPoolRolesCommand"; +import { + GetOpenIdTokenCommandInput, + GetOpenIdTokenCommandOutput, +} from "../commands/GetOpenIdTokenCommand"; +import { + GetOpenIdTokenForDeveloperIdentityCommandInput, + GetOpenIdTokenForDeveloperIdentityCommandOutput, +} from "../commands/GetOpenIdTokenForDeveloperIdentityCommand"; +import { + GetPrincipalTagAttributeMapCommandInput, + GetPrincipalTagAttributeMapCommandOutput, +} from "../commands/GetPrincipalTagAttributeMapCommand"; +import { + ListIdentitiesCommandInput, + ListIdentitiesCommandOutput, +} from "../commands/ListIdentitiesCommand"; +import { + ListIdentityPoolsCommandInput, + ListIdentityPoolsCommandOutput, +} from "../commands/ListIdentityPoolsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { + LookupDeveloperIdentityCommandInput, + LookupDeveloperIdentityCommandOutput, +} from "../commands/LookupDeveloperIdentityCommand"; +import { + MergeDeveloperIdentitiesCommandInput, + MergeDeveloperIdentitiesCommandOutput, +} from "../commands/MergeDeveloperIdentitiesCommand"; +import { + SetIdentityPoolRolesCommandInput, + SetIdentityPoolRolesCommandOutput, +} from "../commands/SetIdentityPoolRolesCommand"; +import { + SetPrincipalTagAttributeMapCommandInput, + SetPrincipalTagAttributeMapCommandOutput, +} from "../commands/SetPrincipalTagAttributeMapCommand"; +import { + TagResourceCommandInput, + TagResourceCommandOutput, +} from "../commands/TagResourceCommand"; +import { + UnlinkDeveloperIdentityCommandInput, + UnlinkDeveloperIdentityCommandOutput, +} from "../commands/UnlinkDeveloperIdentityCommand"; +import { + UnlinkIdentityCommandInput, + UnlinkIdentityCommandOutput, +} from "../commands/UnlinkIdentityCommand"; +import { + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "../commands/UntagResourceCommand"; +import { + UpdateIdentityPoolCommandInput, + UpdateIdentityPoolCommandOutput, +} from "../commands/UpdateIdentityPoolCommand"; +export declare const serializeAws_json1_1CreateIdentityPoolCommand: ( + input: CreateIdentityPoolCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1DeleteIdentitiesCommand: ( + input: DeleteIdentitiesCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1DeleteIdentityPoolCommand: ( + input: DeleteIdentityPoolCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1DescribeIdentityCommand: ( + input: DescribeIdentityCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1DescribeIdentityPoolCommand: ( + input: DescribeIdentityPoolCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetCredentialsForIdentityCommand: ( + input: GetCredentialsForIdentityCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetIdCommand: ( + input: GetIdCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetIdentityPoolRolesCommand: ( + input: GetIdentityPoolRolesCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetOpenIdTokenCommand: ( + input: GetOpenIdTokenCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand: ( + input: GetOpenIdTokenForDeveloperIdentityCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1GetPrincipalTagAttributeMapCommand: ( + input: GetPrincipalTagAttributeMapCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1ListIdentitiesCommand: ( + input: ListIdentitiesCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1ListIdentityPoolsCommand: ( + input: ListIdentityPoolsCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1ListTagsForResourceCommand: ( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1LookupDeveloperIdentityCommand: ( + input: LookupDeveloperIdentityCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1MergeDeveloperIdentitiesCommand: ( + input: MergeDeveloperIdentitiesCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1SetIdentityPoolRolesCommand: ( + input: SetIdentityPoolRolesCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1SetPrincipalTagAttributeMapCommand: ( + input: SetPrincipalTagAttributeMapCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1TagResourceCommand: ( + input: TagResourceCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1UnlinkDeveloperIdentityCommand: ( + input: UnlinkDeveloperIdentityCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1UnlinkIdentityCommand: ( + input: UnlinkIdentityCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1UntagResourceCommand: ( + input: UntagResourceCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_json1_1UpdateIdentityPoolCommand: ( + input: UpdateIdentityPoolCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const deserializeAws_json1_1CreateIdentityPoolCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1DeleteIdentitiesCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1DeleteIdentityPoolCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1DescribeIdentityCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1DescribeIdentityPoolCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1GetCredentialsForIdentityCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1GetIdCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1GetIdentityPoolRolesCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1GetOpenIdTokenCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1GetPrincipalTagAttributeMapCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1ListIdentitiesCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1ListIdentityPoolsCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1ListTagsForResourceCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1LookupDeveloperIdentityCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1MergeDeveloperIdentitiesCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1SetIdentityPoolRolesCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1SetPrincipalTagAttributeMapCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1TagResourceCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1UnlinkDeveloperIdentityCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1UnlinkIdentityCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1UntagResourceCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_json1_1UpdateIdentityPoolCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.browser.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.browser.d.ts new file mode 100644 index 0000000000..7431a2ead3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.browser.d.ts @@ -0,0 +1,93 @@ +import { FetchHttpHandler as RequestHandler } from "@aws-sdk/fetch-http-handler"; +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +export declare const getRuntimeConfig: ( + config: CognitoIdentityClientConfig +) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").ResolvedDefaultsMode + >; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + credentialDefaultProvider: ( + input: any + ) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: + | (( + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + ) & + ( + | string + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").EndpointV2 + > + )) + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + credentials?: + | import("@aws-sdk/types").AwsCredentialIdentity + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").AwsCredentialIdentity + > + | undefined; + signer?: + | import("@aws-sdk/types").RequestSigner + | (( + authScheme?: import("@aws-sdk/types").AuthScheme | undefined + ) => Promise) + | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: + | (new ( + options: import("@aws-sdk/signature-v4").SignatureV4Init & + import("@aws-sdk/signature-v4").SignatureV4CryptoInit + ) => import("@aws-sdk/types").RequestSigner) + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.d.ts new file mode 100644 index 0000000000..9f4424e28f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.d.ts @@ -0,0 +1,93 @@ +import { NodeHttpHandler as RequestHandler } from "@aws-sdk/node-http-handler"; +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +export declare const getRuntimeConfig: ( + config: CognitoIdentityClientConfig +) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").ResolvedDefaultsMode + >; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + credentialDefaultProvider: ( + input: any + ) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: + | (( + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + ) & + ( + | string + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").EndpointV2 + > + )) + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + credentials?: + | import("@aws-sdk/types").AwsCredentialIdentity + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").AwsCredentialIdentity + > + | undefined; + signer?: + | import("@aws-sdk/types").RequestSigner + | (( + authScheme?: import("@aws-sdk/types").AuthScheme | undefined + ) => Promise) + | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: + | (new ( + options: import("@aws-sdk/signature-v4").SignatureV4Init & + import("@aws-sdk/signature-v4").SignatureV4CryptoInit + ) => import("@aws-sdk/types").RequestSigner) + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.native.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.native.d.ts new file mode 100644 index 0000000000..1727149240 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.native.d.ts @@ -0,0 +1,82 @@ +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +export declare const getRuntimeConfig: ( + config: CognitoIdentityClientConfig +) => { + runtime: string; + sha256: import("@aws-sdk/types").HashConstructor; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | import("@aws-sdk/fetch-http-handler").FetchHttpHandler; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + streamCollector: import("@aws-sdk/types").StreamCollector; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + maxAttempts: number | import("@aws-sdk/types").Provider; + retryMode: string | import("@aws-sdk/types").Provider; + logger: import("@aws-sdk/types").Logger; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + serviceId: string; + region: string | import("@aws-sdk/types").Provider; + credentialDefaultProvider: ( + input: any + ) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + defaultsMode: + | import("@aws-sdk/smithy-client").DefaultsMode + | import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").DefaultsMode + >; + endpoint?: + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + credentials?: + | import("@aws-sdk/types").AwsCredentialIdentity + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").AwsCredentialIdentity + > + | undefined; + signer?: + | import("@aws-sdk/types").RequestSigner + | (( + authScheme?: import("@aws-sdk/types").AuthScheme | undefined + ) => Promise) + | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: + | (new ( + options: import("@aws-sdk/signature-v4").SignatureV4Init & + import("@aws-sdk/signature-v4").SignatureV4CryptoInit + ) => import("@aws-sdk/types").RequestSigner) + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.shared.d.ts b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.shared.d.ts new file mode 100644 index 0000000000..ad5850d1e9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.shared.d.ts @@ -0,0 +1,20 @@ +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +export declare const getRuntimeConfig: ( + config: CognitoIdentityClientConfig +) => { + apiVersion: string; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + urlParser: import("@aws-sdk/types").UrlParser; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; +}; diff --git a/server/node_modules/@aws-sdk/client-cognito-identity/package.json b/server/node_modules/@aws-sdk/client-cognito-identity/package.json new file mode 100644 index 0000000000..3d81abbe9c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-cognito-identity/package.json @@ -0,0 +1,106 @@ +{ + "name": "@aws-sdk/client-cognito-identity", + "description": "AWS SDK for JavaScript Cognito Identity Client for Node.js, Browser and React Native", + "version": "3.264.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:docs": "typedoc", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "generate:client": "node ../../scripts/generate-clients/single-service --solo cognito-identity", + "test:e2e": "ts-mocha test/**/*.ispec.ts && karma start karma.conf.js" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "3.264.0", + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/credential-provider-node": "3.264.0", + "@aws-sdk/fetch-http-handler": "3.257.0", + "@aws-sdk/hash-node": "3.257.0", + "@aws-sdk/invalid-dependency": "3.257.0", + "@aws-sdk/middleware-content-length": "3.257.0", + "@aws-sdk/middleware-endpoint": "3.264.0", + "@aws-sdk/middleware-host-header": "3.257.0", + "@aws-sdk/middleware-logger": "3.257.0", + "@aws-sdk/middleware-recursion-detection": "3.257.0", + "@aws-sdk/middleware-retry": "3.259.0", + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/middleware-signing": "3.257.0", + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/middleware-user-agent": "3.257.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/node-http-handler": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/smithy-client": "3.261.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.261.0", + "@aws-sdk/util-defaults-mode-node": "3.261.0", + "@aws-sdk/util-endpoints": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "@aws-sdk/util-user-agent-browser": "3.257.0", + "@aws-sdk/util-user-agent-node": "3.259.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/client-iam": "3.264.0", + "@aws-sdk/service-client-documentation-generator": "3.208.0", + "@tsconfig/node14": "1.0.3", + "@types/chai": "^4.2.11", + "@types/mocha": "^8.0.4", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "overrides": { + "typedoc": { + "typescript": "~4.6.2" + } + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-cognito-identity" + } +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/LICENSE b/server/node_modules/@aws-sdk/client-sso-oidc/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/README.md b/server/node_modules/@aws-sdk/client-sso-oidc/README.md new file mode 100644 index 0000000000..376da4220f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/README.md @@ -0,0 +1,244 @@ + + +# @aws-sdk/client-sso-oidc + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sso-oidc/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso-oidc) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sso-oidc.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso-oidc) + +## Description + +AWS SDK for JavaScript SSOOIDC Client for Node.js, Browser and React Native. + +

AWS IAM Identity Center (successor to AWS Single Sign-On) OpenID Connect (OIDC) is a web service that enables a client (such as AWS CLI +or a native application) to register with IAM Identity Center. The service also enables the client to +fetch the user’s access token upon successful authentication and authorization with +IAM Identity Center.

+ +

Although AWS Single Sign-On was renamed, the sso and +identitystore API namespaces will continue to retain their original name for +backward compatibility purposes. For more information, see IAM Identity Center rename.

+
+

+Considerations for Using This Guide +

+

Before you begin using this guide, we recommend that you first review the following +important information about how the IAM Identity Center OIDC service works.

+
    +
  • +

    The IAM Identity Center OIDC service currently implements only the portions of the OAuth 2.0 +Device Authorization Grant standard (https://tools.ietf.org/html/rfc8628) that are necessary to enable single +sign-on authentication with the AWS CLI. Support for other OIDC flows frequently needed +for native applications, such as Authorization Code Flow (+ PKCE), will be addressed in +future releases.

    +
  • +
  • +

    The service emits only OIDC access tokens, such that obtaining a new token (For +example, token refresh) requires explicit user re-authentication.

    +
  • +
  • +

    The access tokens provided by this service grant access to all AWS account +entitlements assigned to an IAM Identity Center user, not just a particular application.

    +
  • +
  • +

    The documentation in this guide does not describe the mechanism to convert the access +token into AWS Auth (“sigv4”) credentials for use with IAM-protected AWS service +endpoints. For more information, see GetRoleCredentials in the IAM Identity Center Portal API Reference +Guide.

    +
  • +
+ +

For general information about IAM Identity Center, see What is +IAM Identity Center? in the IAM Identity Center User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sso-oidc +using your favorite package manager: + +- `npm install @aws-sdk/client-sso-oidc` +- `yarn add @aws-sdk/client-sso-oidc` +- `pnpm add @aws-sdk/client-sso-oidc` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SSOOIDCClient` and +the commands you need, for example `CreateTokenCommand`: + +```js +// ES5 example +const { SSOOIDCClient, CreateTokenCommand } = require("@aws-sdk/client-sso-oidc"); +``` + +```ts +// ES6+ example +import { SSOOIDCClient, CreateTokenCommand } from "@aws-sdk/client-sso-oidc"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new SSOOIDCClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateTokenCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sso-oidc"; +const client = new AWS.SSOOIDC({ region: "REGION" }); + +// async/await. +try { + const data = await client.createToken(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createToken(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createToken(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sso-oidc` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/SSOOIDC.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/SSOOIDC.js new file mode 100644 index 0000000000..85dc6848f5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/SSOOIDC.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSOOIDC = void 0; +const CreateTokenCommand_1 = require("./commands/CreateTokenCommand"); +const RegisterClientCommand_1 = require("./commands/RegisterClientCommand"); +const StartDeviceAuthorizationCommand_1 = require("./commands/StartDeviceAuthorizationCommand"); +const SSOOIDCClient_1 = require("./SSOOIDCClient"); +class SSOOIDC extends SSOOIDCClient_1.SSOOIDCClient { + createToken(args, optionsOrCb, cb) { + const command = new CreateTokenCommand_1.CreateTokenCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + registerClient(args, optionsOrCb, cb) { + const command = new RegisterClientCommand_1.RegisterClientCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + startDeviceAuthorization(args, optionsOrCb, cb) { + const command = new StartDeviceAuthorizationCommand_1.StartDeviceAuthorizationCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } +} +exports.SSOOIDC = SSOOIDC; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/SSOOIDCClient.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/SSOOIDCClient.js new file mode 100644 index 0000000000..9a60274af2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/SSOOIDCClient.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSOOIDCClient = void 0; +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const middleware_content_length_1 = require("@aws-sdk/middleware-content-length"); +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_host_header_1 = require("@aws-sdk/middleware-host-header"); +const middleware_logger_1 = require("@aws-sdk/middleware-logger"); +const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection"); +const middleware_retry_1 = require("@aws-sdk/middleware-retry"); +const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const EndpointParameters_1 = require("./endpoint/EndpointParameters"); +const runtimeConfig_1 = require("./runtimeConfig"); +class SSOOIDCClient extends smithy_client_1.Client { + constructor(configuration) { + const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration); + const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); + const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); + const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); + const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); + const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_5); + super(_config_6); + this.config = _config_6; + this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); + } + destroy() { + super.destroy(); + } +} +exports.SSOOIDCClient = SSOOIDCClient; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/CreateTokenCommand.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/CreateTokenCommand.js new file mode 100644 index 0000000000..7c635c6de7 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/CreateTokenCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CreateTokenCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_restJson1_1 = require("../protocols/Aws_restJson1"); +class CreateTokenCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, CreateTokenCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOOIDCClient"; + const commandName = "CreateTokenCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.CreateTokenRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.CreateTokenResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_restJson1_1.serializeAws_restJson1CreateTokenCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_restJson1_1.deserializeAws_restJson1CreateTokenCommand)(output, context); + } +} +exports.CreateTokenCommand = CreateTokenCommand; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/RegisterClientCommand.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/RegisterClientCommand.js new file mode 100644 index 0000000000..b82228d6cc --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/RegisterClientCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RegisterClientCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_restJson1_1 = require("../protocols/Aws_restJson1"); +class RegisterClientCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, RegisterClientCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOOIDCClient"; + const commandName = "RegisterClientCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.RegisterClientRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.RegisterClientResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_restJson1_1.serializeAws_restJson1RegisterClientCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_restJson1_1.deserializeAws_restJson1RegisterClientCommand)(output, context); + } +} +exports.RegisterClientCommand = RegisterClientCommand; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/StartDeviceAuthorizationCommand.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/StartDeviceAuthorizationCommand.js new file mode 100644 index 0000000000..9322b909f9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/StartDeviceAuthorizationCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StartDeviceAuthorizationCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_restJson1_1 = require("../protocols/Aws_restJson1"); +class StartDeviceAuthorizationCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, StartDeviceAuthorizationCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOOIDCClient"; + const commandName = "StartDeviceAuthorizationCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.StartDeviceAuthorizationRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.StartDeviceAuthorizationResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_restJson1_1.serializeAws_restJson1StartDeviceAuthorizationCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_restJson1_1.deserializeAws_restJson1StartDeviceAuthorizationCommand)(output, context); + } +} +exports.StartDeviceAuthorizationCommand = StartDeviceAuthorizationCommand; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/index.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/index.js new file mode 100644 index 0000000000..335288d964 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/commands/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./CreateTokenCommand"), exports); +tslib_1.__exportStar(require("./RegisterClientCommand"), exports); +tslib_1.__exportStar(require("./StartDeviceAuthorizationCommand"), exports); diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/EndpointParameters.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/EndpointParameters.js new file mode 100644 index 0000000000..6c6cec2897 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/EndpointParameters.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveClientEndpointParameters = void 0; +const resolveClientEndpointParameters = (options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "awsssooidc", + }; +}; +exports.resolveClientEndpointParameters = resolveClientEndpointParameters; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js new file mode 100644 index 0000000000..482fab141e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = require("@aws-sdk/util-endpoints"); +const ruleset_1 = require("./ruleset"); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; +exports.defaultEndpointResolver = defaultEndpointResolver; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js new file mode 100644 index 0000000000..fbd4a73a5d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ruleSet = void 0; +const p = "required", q = "fn", r = "argv", s = "ref"; +const a = "PartitionResult", b = "tree", c = "error", d = "endpoint", e = { [p]: false, "type": "String" }, f = { [p]: true, "default": false, "type": "Boolean" }, g = { [s]: "Endpoint" }, h = { [q]: "booleanEquals", [r]: [{ [s]: "UseFIPS" }, true] }, i = { [q]: "booleanEquals", [r]: [{ [s]: "UseDualStack" }, true] }, j = {}, k = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsFIPS"] }] }, l = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsDualStack"] }] }, m = [g], n = [h], o = [i]; +const _data = { version: "1.0", parameters: { Region: e, UseDualStack: f, UseFIPS: f, Endpoint: e }, rules: [{ conditions: [{ [q]: "aws.partition", [r]: [{ [s]: "Region" }], assign: a }], type: b, rules: [{ conditions: [{ [q]: "isSet", [r]: m }, { [q]: "parseURL", [r]: m, assign: "url" }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: g, properties: j, headers: j }, type: d }] }] }, { conditions: [h, i], type: b, rules: [{ conditions: [k, l], type: b, rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [k], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }; +exports.ruleSet = _data; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js new file mode 100644 index 0000000000..a014be8e0e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSOOIDCServiceException = void 0; +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./SSOOIDC"), exports); +tslib_1.__exportStar(require("./SSOOIDCClient"), exports); +tslib_1.__exportStar(require("./commands"), exports); +tslib_1.__exportStar(require("./models"), exports); +var SSOOIDCServiceException_1 = require("./models/SSOOIDCServiceException"); +Object.defineProperty(exports, "SSOOIDCServiceException", { enumerable: true, get: function () { return SSOOIDCServiceException_1.SSOOIDCServiceException; } }); diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/SSOOIDCServiceException.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/SSOOIDCServiceException.js new file mode 100644 index 0000000000..c941d88658 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/SSOOIDCServiceException.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSOOIDCServiceException = void 0; +const smithy_client_1 = require("@aws-sdk/smithy-client"); +class SSOOIDCServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, SSOOIDCServiceException.prototype); + } +} +exports.SSOOIDCServiceException = SSOOIDCServiceException; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/index.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/index.js new file mode 100644 index 0000000000..8ced418bca --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./models_0"), exports); diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/models_0.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/models_0.js new file mode 100644 index 0000000000..ea4d0ed1a1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/models/models_0.js @@ -0,0 +1,208 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StartDeviceAuthorizationResponseFilterSensitiveLog = exports.StartDeviceAuthorizationRequestFilterSensitiveLog = exports.RegisterClientResponseFilterSensitiveLog = exports.RegisterClientRequestFilterSensitiveLog = exports.CreateTokenResponseFilterSensitiveLog = exports.CreateTokenRequestFilterSensitiveLog = exports.InvalidClientMetadataException = exports.UnsupportedGrantTypeException = exports.UnauthorizedClientException = exports.SlowDownException = exports.InvalidScopeException = exports.InvalidRequestException = exports.InvalidGrantException = exports.InvalidClientException = exports.InternalServerException = exports.ExpiredTokenException = exports.AuthorizationPendingException = exports.AccessDeniedException = void 0; +const SSOOIDCServiceException_1 = require("./SSOOIDCServiceException"); +class AccessDeniedException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts, + }); + this.name = "AccessDeniedException"; + this.$fault = "client"; + Object.setPrototypeOf(this, AccessDeniedException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.AccessDeniedException = AccessDeniedException; +class AuthorizationPendingException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "AuthorizationPendingException", + $fault: "client", + ...opts, + }); + this.name = "AuthorizationPendingException"; + this.$fault = "client"; + Object.setPrototypeOf(this, AuthorizationPendingException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.AuthorizationPendingException = AuthorizationPendingException; +class ExpiredTokenException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts, + }); + this.name = "ExpiredTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ExpiredTokenException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.ExpiredTokenException = ExpiredTokenException; +class InternalServerException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + this.name = "InternalServerException"; + this.$fault = "server"; + Object.setPrototypeOf(this, InternalServerException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.InternalServerException = InternalServerException; +class InvalidClientException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidClientException", + $fault: "client", + ...opts, + }); + this.name = "InvalidClientException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.InvalidClientException = InvalidClientException; +class InvalidGrantException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidGrantException", + $fault: "client", + ...opts, + }); + this.name = "InvalidGrantException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidGrantException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.InvalidGrantException = InvalidGrantException; +class InvalidRequestException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts, + }); + this.name = "InvalidRequestException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidRequestException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.InvalidRequestException = InvalidRequestException; +class InvalidScopeException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidScopeException", + $fault: "client", + ...opts, + }); + this.name = "InvalidScopeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidScopeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.InvalidScopeException = InvalidScopeException; +class SlowDownException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "SlowDownException", + $fault: "client", + ...opts, + }); + this.name = "SlowDownException"; + this.$fault = "client"; + Object.setPrototypeOf(this, SlowDownException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.SlowDownException = SlowDownException; +class UnauthorizedClientException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "UnauthorizedClientException", + $fault: "client", + ...opts, + }); + this.name = "UnauthorizedClientException"; + this.$fault = "client"; + Object.setPrototypeOf(this, UnauthorizedClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.UnauthorizedClientException = UnauthorizedClientException; +class UnsupportedGrantTypeException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "UnsupportedGrantTypeException", + $fault: "client", + ...opts, + }); + this.name = "UnsupportedGrantTypeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.UnsupportedGrantTypeException = UnsupportedGrantTypeException; +class InvalidClientMetadataException extends SSOOIDCServiceException_1.SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidClientMetadataException", + $fault: "client", + ...opts, + }); + this.name = "InvalidClientMetadataException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidClientMetadataException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +exports.InvalidClientMetadataException = InvalidClientMetadataException; +const CreateTokenRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.CreateTokenRequestFilterSensitiveLog = CreateTokenRequestFilterSensitiveLog; +const CreateTokenResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.CreateTokenResponseFilterSensitiveLog = CreateTokenResponseFilterSensitiveLog; +const RegisterClientRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.RegisterClientRequestFilterSensitiveLog = RegisterClientRequestFilterSensitiveLog; +const RegisterClientResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.RegisterClientResponseFilterSensitiveLog = RegisterClientResponseFilterSensitiveLog; +const StartDeviceAuthorizationRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.StartDeviceAuthorizationRequestFilterSensitiveLog = StartDeviceAuthorizationRequestFilterSensitiveLog; +const StartDeviceAuthorizationResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.StartDeviceAuthorizationResponseFilterSensitiveLog = StartDeviceAuthorizationResponseFilterSensitiveLog; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/protocols/Aws_restJson1.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/protocols/Aws_restJson1.js new file mode 100644 index 0000000000..26102d3ff5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/protocols/Aws_restJson1.js @@ -0,0 +1,522 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deserializeAws_restJson1StartDeviceAuthorizationCommand = exports.deserializeAws_restJson1RegisterClientCommand = exports.deserializeAws_restJson1CreateTokenCommand = exports.serializeAws_restJson1StartDeviceAuthorizationCommand = exports.serializeAws_restJson1RegisterClientCommand = exports.serializeAws_restJson1CreateTokenCommand = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const SSOOIDCServiceException_1 = require("../models/SSOOIDCServiceException"); +const serializeAws_restJson1CreateTokenCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/token"; + let body; + body = JSON.stringify({ + ...(input.clientId != null && { clientId: input.clientId }), + ...(input.clientSecret != null && { clientSecret: input.clientSecret }), + ...(input.code != null && { code: input.code }), + ...(input.deviceCode != null && { deviceCode: input.deviceCode }), + ...(input.grantType != null && { grantType: input.grantType }), + ...(input.redirectUri != null && { redirectUri: input.redirectUri }), + ...(input.refreshToken != null && { refreshToken: input.refreshToken }), + ...(input.scope != null && { scope: serializeAws_restJson1Scopes(input.scope, context) }), + }); + return new protocol_http_1.HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +exports.serializeAws_restJson1CreateTokenCommand = serializeAws_restJson1CreateTokenCommand; +const serializeAws_restJson1RegisterClientCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/client/register"; + let body; + body = JSON.stringify({ + ...(input.clientName != null && { clientName: input.clientName }), + ...(input.clientType != null && { clientType: input.clientType }), + ...(input.scopes != null && { scopes: serializeAws_restJson1Scopes(input.scopes, context) }), + }); + return new protocol_http_1.HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +exports.serializeAws_restJson1RegisterClientCommand = serializeAws_restJson1RegisterClientCommand; +const serializeAws_restJson1StartDeviceAuthorizationCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/device_authorization"; + let body; + body = JSON.stringify({ + ...(input.clientId != null && { clientId: input.clientId }), + ...(input.clientSecret != null && { clientSecret: input.clientSecret }), + ...(input.startUrl != null && { startUrl: input.startUrl }), + }); + return new protocol_http_1.HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +exports.serializeAws_restJson1StartDeviceAuthorizationCommand = serializeAws_restJson1StartDeviceAuthorizationCommand; +const deserializeAws_restJson1CreateTokenCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1CreateTokenCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body"); + if (data.accessToken != null) { + contents.accessToken = (0, smithy_client_1.expectString)(data.accessToken); + } + if (data.expiresIn != null) { + contents.expiresIn = (0, smithy_client_1.expectInt32)(data.expiresIn); + } + if (data.idToken != null) { + contents.idToken = (0, smithy_client_1.expectString)(data.idToken); + } + if (data.refreshToken != null) { + contents.refreshToken = (0, smithy_client_1.expectString)(data.refreshToken); + } + if (data.tokenType != null) { + contents.tokenType = (0, smithy_client_1.expectString)(data.tokenType); + } + return contents; +}; +exports.deserializeAws_restJson1CreateTokenCommand = deserializeAws_restJson1CreateTokenCommand; +const deserializeAws_restJson1CreateTokenCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.ssooidc#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "AuthorizationPendingException": + case "com.amazonaws.ssooidc#AuthorizationPendingException": + throw await deserializeAws_restJson1AuthorizationPendingExceptionResponse(parsedOutput, context); + case "ExpiredTokenException": + case "com.amazonaws.ssooidc#ExpiredTokenException": + throw await deserializeAws_restJson1ExpiredTokenExceptionResponse(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "InvalidClientException": + case "com.amazonaws.ssooidc#InvalidClientException": + throw await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context); + case "InvalidGrantException": + case "com.amazonaws.ssooidc#InvalidGrantException": + throw await deserializeAws_restJson1InvalidGrantExceptionResponse(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "InvalidScopeException": + case "com.amazonaws.ssooidc#InvalidScopeException": + throw await deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context); + case "SlowDownException": + case "com.amazonaws.ssooidc#SlowDownException": + throw await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context); + case "UnauthorizedClientException": + case "com.amazonaws.ssooidc#UnauthorizedClientException": + throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context); + case "UnsupportedGrantTypeException": + case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": + throw await deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: SSOOIDCServiceException_1.SSOOIDCServiceException, + errorCode, + }); + } +}; +const deserializeAws_restJson1RegisterClientCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1RegisterClientCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body"); + if (data.authorizationEndpoint != null) { + contents.authorizationEndpoint = (0, smithy_client_1.expectString)(data.authorizationEndpoint); + } + if (data.clientId != null) { + contents.clientId = (0, smithy_client_1.expectString)(data.clientId); + } + if (data.clientIdIssuedAt != null) { + contents.clientIdIssuedAt = (0, smithy_client_1.expectLong)(data.clientIdIssuedAt); + } + if (data.clientSecret != null) { + contents.clientSecret = (0, smithy_client_1.expectString)(data.clientSecret); + } + if (data.clientSecretExpiresAt != null) { + contents.clientSecretExpiresAt = (0, smithy_client_1.expectLong)(data.clientSecretExpiresAt); + } + if (data.tokenEndpoint != null) { + contents.tokenEndpoint = (0, smithy_client_1.expectString)(data.tokenEndpoint); + } + return contents; +}; +exports.deserializeAws_restJson1RegisterClientCommand = deserializeAws_restJson1RegisterClientCommand; +const deserializeAws_restJson1RegisterClientCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "InvalidClientMetadataException": + case "com.amazonaws.ssooidc#InvalidClientMetadataException": + throw await deserializeAws_restJson1InvalidClientMetadataExceptionResponse(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "InvalidScopeException": + case "com.amazonaws.ssooidc#InvalidScopeException": + throw await deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: SSOOIDCServiceException_1.SSOOIDCServiceException, + errorCode, + }); + } +}; +const deserializeAws_restJson1StartDeviceAuthorizationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1StartDeviceAuthorizationCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body"); + if (data.deviceCode != null) { + contents.deviceCode = (0, smithy_client_1.expectString)(data.deviceCode); + } + if (data.expiresIn != null) { + contents.expiresIn = (0, smithy_client_1.expectInt32)(data.expiresIn); + } + if (data.interval != null) { + contents.interval = (0, smithy_client_1.expectInt32)(data.interval); + } + if (data.userCode != null) { + contents.userCode = (0, smithy_client_1.expectString)(data.userCode); + } + if (data.verificationUri != null) { + contents.verificationUri = (0, smithy_client_1.expectString)(data.verificationUri); + } + if (data.verificationUriComplete != null) { + contents.verificationUriComplete = (0, smithy_client_1.expectString)(data.verificationUriComplete); + } + return contents; +}; +exports.deserializeAws_restJson1StartDeviceAuthorizationCommand = deserializeAws_restJson1StartDeviceAuthorizationCommand; +const deserializeAws_restJson1StartDeviceAuthorizationCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "InvalidClientException": + case "com.amazonaws.ssooidc#InvalidClientException": + throw await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "SlowDownException": + case "com.amazonaws.ssooidc#SlowDownException": + throw await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context); + case "UnauthorizedClientException": + case "com.amazonaws.ssooidc#UnauthorizedClientException": + throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: SSOOIDCServiceException_1.SSOOIDCServiceException, + errorCode, + }); + } +}; +const map = smithy_client_1.map; +const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1AuthorizationPendingExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.AuthorizationPendingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1ExpiredTokenExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.ExpiredTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidClientExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.InvalidClientException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidClientMetadataExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.InvalidClientMetadataException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidGrantExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.InvalidGrantException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.InvalidRequestException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidScopeExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.InvalidScopeException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1SlowDownExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.SlowDownException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1UnauthorizedClientExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.UnauthorizedClientException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = (0, smithy_client_1.expectString)(data.error); + } + if (data.error_description != null) { + contents.error_description = (0, smithy_client_1.expectString)(data.error_description); + } + const exception = new models_0_1.UnsupportedGrantTypeException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const serializeAws_restJson1Scopes = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); +const collectBody = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; +const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +const isSerializableHeaderValue = (value) => value !== undefined && + value !== null && + value !== "" && + (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && + (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); +const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}); +const parseErrorBody = async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; +const loadRestJsonErrorCode = (output, data) => { + const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.browser.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.browser.js new file mode 100644 index 0000000000..fa9401fe71 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.browser.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const tslib_1 = require("tslib"); +const package_json_1 = tslib_1.__importDefault(require("../package.json")); +const sha256_browser_1 = require("@aws-crypto/sha256-browser"); +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const fetch_http_handler_1 = require("@aws-sdk/fetch-http-handler"); +const invalid_dependency_1 = require("@aws-sdk/invalid-dependency"); +const util_body_length_browser_1 = require("@aws-sdk/util-body-length-browser"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser"); +const runtimeConfig_shared_1 = require("./runtimeConfig.shared"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const util_defaults_mode_browser_1 = require("@aws-sdk/util-defaults-mode-browser"); +const getRuntimeConfig = (config) => { + const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"), + requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? sha256_browser_1.Sha256, + streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js new file mode 100644 index 0000000000..f7f601840e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const tslib_1 = require("tslib"); +const package_json_1 = tslib_1.__importDefault(require("../package.json")); +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const hash_node_1 = require("@aws-sdk/hash-node"); +const middleware_retry_1 = require("@aws-sdk/middleware-retry"); +const node_config_provider_1 = require("@aws-sdk/node-config-provider"); +const node_http_handler_1 = require("@aws-sdk/node-http-handler"); +const util_body_length_node_1 = require("@aws-sdk/util-body-length-node"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node"); +const runtimeConfig_shared_1 = require("./runtimeConfig.shared"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const util_defaults_mode_node_1 = require("@aws-sdk/util-defaults-mode-node"); +const smithy_client_2 = require("@aws-sdk/smithy-client"); +const getRuntimeConfig = (config) => { + (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? + (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.native.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.native.js new file mode 100644 index 0000000000..34c5f8ece1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.native.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const sha256_js_1 = require("@aws-crypto/sha256-js"); +const runtimeConfig_browser_1 = require("./runtimeConfig.browser"); +const getRuntimeConfig = (config) => { + const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? sha256_js_1.Sha256, + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js new file mode 100644 index 0000000000..ffee75c19d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const url_parser_1 = require("@aws-sdk/url-parser"); +const util_base64_1 = require("@aws-sdk/util-base64"); +const util_utf8_1 = require("@aws-sdk/util-utf8"); +const endpointResolver_1 = require("./endpoint/endpointResolver"); +const getRuntimeConfig = (config) => ({ + apiVersion: "2019-06-10", + base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64, + base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + serviceId: config?.serviceId ?? "SSO OIDC", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, +}); +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDC.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDC.js new file mode 100644 index 0000000000..4a6360b81f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDC.js @@ -0,0 +1,48 @@ +import { CreateTokenCommand } from "./commands/CreateTokenCommand"; +import { RegisterClientCommand, } from "./commands/RegisterClientCommand"; +import { StartDeviceAuthorizationCommand, } from "./commands/StartDeviceAuthorizationCommand"; +import { SSOOIDCClient } from "./SSOOIDCClient"; +export class SSOOIDC extends SSOOIDCClient { + createToken(args, optionsOrCb, cb) { + const command = new CreateTokenCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + registerClient(args, optionsOrCb, cb) { + const command = new RegisterClientCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + startDeviceAuthorization(args, optionsOrCb, cb) { + const command = new StartDeviceAuthorizationCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js new file mode 100644 index 0000000000..9232aa476e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js @@ -0,0 +1,33 @@ +import { resolveRegionConfig } from "@aws-sdk/config-resolver"; +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; +import { resolveEndpointConfig } from "@aws-sdk/middleware-endpoint"; +import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { getRetryPlugin, resolveRetryConfig } from "@aws-sdk/middleware-retry"; +import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent"; +import { Client as __Client, } from "@aws-sdk/smithy-client"; +import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +export class SSOOIDCClient extends __Client { + constructor(configuration) { + const _config_0 = __getRuntimeConfig(configuration); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveRegionConfig(_config_1); + const _config_3 = resolveEndpointConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveUserAgentConfig(_config_5); + super(_config_6); + this.config = _config_6; + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + } + destroy() { + super.destroy(); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenCommand.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenCommand.js new file mode 100644 index 0000000000..937e0561af --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_restJson1CreateTokenCommand, serializeAws_restJson1CreateTokenCommand, } from "../protocols/Aws_restJson1"; +export class CreateTokenCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, CreateTokenCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOOIDCClient"; + const commandName = "CreateTokenCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: CreateTokenRequestFilterSensitiveLog, + outputFilterSensitiveLog: CreateTokenResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_restJson1CreateTokenCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_restJson1CreateTokenCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/RegisterClientCommand.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/RegisterClientCommand.js new file mode 100644 index 0000000000..9732c63dbc --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/RegisterClientCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { RegisterClientRequestFilterSensitiveLog, RegisterClientResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_restJson1RegisterClientCommand, serializeAws_restJson1RegisterClientCommand, } from "../protocols/Aws_restJson1"; +export class RegisterClientCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, RegisterClientCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOOIDCClient"; + const commandName = "RegisterClientCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: RegisterClientRequestFilterSensitiveLog, + outputFilterSensitiveLog: RegisterClientResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_restJson1RegisterClientCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_restJson1RegisterClientCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/StartDeviceAuthorizationCommand.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/StartDeviceAuthorizationCommand.js new file mode 100644 index 0000000000..211050fb91 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/StartDeviceAuthorizationCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { StartDeviceAuthorizationRequestFilterSensitiveLog, StartDeviceAuthorizationResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_restJson1StartDeviceAuthorizationCommand, serializeAws_restJson1StartDeviceAuthorizationCommand, } from "../protocols/Aws_restJson1"; +export class StartDeviceAuthorizationCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, StartDeviceAuthorizationCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOOIDCClient"; + const commandName = "StartDeviceAuthorizationCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: StartDeviceAuthorizationRequestFilterSensitiveLog, + outputFilterSensitiveLog: StartDeviceAuthorizationResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_restJson1StartDeviceAuthorizationCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_restJson1StartDeviceAuthorizationCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/index.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/index.js new file mode 100644 index 0000000000..53f139a07f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/index.js @@ -0,0 +1,3 @@ +export * from "./CreateTokenCommand"; +export * from "./RegisterClientCommand"; +export * from "./StartDeviceAuthorizationCommand"; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/EndpointParameters.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/EndpointParameters.js new file mode 100644 index 0000000000..67e1cf3bf6 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/EndpointParameters.js @@ -0,0 +1,8 @@ +export const resolveClientEndpointParameters = (options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "awsssooidc", + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/endpointResolver.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/endpointResolver.js new file mode 100644 index 0000000000..f7d9738dd1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/endpointResolver.js @@ -0,0 +1,8 @@ +import { resolveEndpoint } from "@aws-sdk/util-endpoints"; +import { ruleSet } from "./ruleset"; +export const defaultEndpointResolver = (endpointParams, context = {}) => { + return resolveEndpoint(ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/ruleset.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/ruleset.js new file mode 100644 index 0000000000..6dbbfac481 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/ruleset.js @@ -0,0 +1,4 @@ +const p = "required", q = "fn", r = "argv", s = "ref"; +const a = "PartitionResult", b = "tree", c = "error", d = "endpoint", e = { [p]: false, "type": "String" }, f = { [p]: true, "default": false, "type": "Boolean" }, g = { [s]: "Endpoint" }, h = { [q]: "booleanEquals", [r]: [{ [s]: "UseFIPS" }, true] }, i = { [q]: "booleanEquals", [r]: [{ [s]: "UseDualStack" }, true] }, j = {}, k = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsFIPS"] }] }, l = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsDualStack"] }] }, m = [g], n = [h], o = [i]; +const _data = { version: "1.0", parameters: { Region: e, UseDualStack: f, UseFIPS: f, Endpoint: e }, rules: [{ conditions: [{ [q]: "aws.partition", [r]: [{ [s]: "Region" }], assign: a }], type: b, rules: [{ conditions: [{ [q]: "isSet", [r]: m }, { [q]: "parseURL", [r]: m, assign: "url" }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: g, properties: j, headers: j }, type: d }] }] }, { conditions: [h, i], type: b, rules: [{ conditions: [k, l], type: b, rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [k], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }; +export const ruleSet = _data; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/index.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/index.js new file mode 100644 index 0000000000..c757666012 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/index.js @@ -0,0 +1,5 @@ +export * from "./SSOOIDC"; +export * from "./SSOOIDCClient"; +export * from "./commands"; +export * from "./models"; +export { SSOOIDCServiceException } from "./models/SSOOIDCServiceException"; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/SSOOIDCServiceException.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/SSOOIDCServiceException.js new file mode 100644 index 0000000000..346fac28f4 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/SSOOIDCServiceException.js @@ -0,0 +1,7 @@ +import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client"; +export class SSOOIDCServiceException extends __ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, SSOOIDCServiceException.prototype); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/index.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/index.js new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/index.js @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/models_0.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/models_0.js new file mode 100644 index 0000000000..7eee4f56a8 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/models_0.js @@ -0,0 +1,187 @@ +import { SSOOIDCServiceException as __BaseException } from "./SSOOIDCServiceException"; +export class AccessDeniedException extends __BaseException { + constructor(opts) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts, + }); + this.name = "AccessDeniedException"; + this.$fault = "client"; + Object.setPrototypeOf(this, AccessDeniedException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class AuthorizationPendingException extends __BaseException { + constructor(opts) { + super({ + name: "AuthorizationPendingException", + $fault: "client", + ...opts, + }); + this.name = "AuthorizationPendingException"; + this.$fault = "client"; + Object.setPrototypeOf(this, AuthorizationPendingException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class ExpiredTokenException extends __BaseException { + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts, + }); + this.name = "ExpiredTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ExpiredTokenException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class InternalServerException extends __BaseException { + constructor(opts) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + this.name = "InternalServerException"; + this.$fault = "server"; + Object.setPrototypeOf(this, InternalServerException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class InvalidClientException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidClientException", + $fault: "client", + ...opts, + }); + this.name = "InvalidClientException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class InvalidGrantException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidGrantException", + $fault: "client", + ...opts, + }); + this.name = "InvalidGrantException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidGrantException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class InvalidRequestException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts, + }); + this.name = "InvalidRequestException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidRequestException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class InvalidScopeException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidScopeException", + $fault: "client", + ...opts, + }); + this.name = "InvalidScopeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidScopeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class SlowDownException extends __BaseException { + constructor(opts) { + super({ + name: "SlowDownException", + $fault: "client", + ...opts, + }); + this.name = "SlowDownException"; + this.$fault = "client"; + Object.setPrototypeOf(this, SlowDownException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class UnauthorizedClientException extends __BaseException { + constructor(opts) { + super({ + name: "UnauthorizedClientException", + $fault: "client", + ...opts, + }); + this.name = "UnauthorizedClientException"; + this.$fault = "client"; + Object.setPrototypeOf(this, UnauthorizedClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class UnsupportedGrantTypeException extends __BaseException { + constructor(opts) { + super({ + name: "UnsupportedGrantTypeException", + $fault: "client", + ...opts, + }); + this.name = "UnsupportedGrantTypeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export class InvalidClientMetadataException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidClientMetadataException", + $fault: "client", + ...opts, + }); + this.name = "InvalidClientMetadataException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidClientMetadataException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +} +export const CreateTokenRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const CreateTokenResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const RegisterClientRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const RegisterClientResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const StartDeviceAuthorizationRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const StartDeviceAuthorizationResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js new file mode 100644 index 0000000000..b0a815c900 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js @@ -0,0 +1,513 @@ +import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http"; +import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client"; +import { AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidClientMetadataException, InvalidGrantException, InvalidRequestException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException, } from "../models/models_0"; +import { SSOOIDCServiceException as __BaseException } from "../models/SSOOIDCServiceException"; +export const serializeAws_restJson1CreateTokenCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/token"; + let body; + body = JSON.stringify({ + ...(input.clientId != null && { clientId: input.clientId }), + ...(input.clientSecret != null && { clientSecret: input.clientSecret }), + ...(input.code != null && { code: input.code }), + ...(input.deviceCode != null && { deviceCode: input.deviceCode }), + ...(input.grantType != null && { grantType: input.grantType }), + ...(input.redirectUri != null && { redirectUri: input.redirectUri }), + ...(input.refreshToken != null && { refreshToken: input.refreshToken }), + ...(input.scope != null && { scope: serializeAws_restJson1Scopes(input.scope, context) }), + }); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +export const serializeAws_restJson1RegisterClientCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/client/register"; + let body; + body = JSON.stringify({ + ...(input.clientName != null && { clientName: input.clientName }), + ...(input.clientType != null && { clientType: input.clientType }), + ...(input.scopes != null && { scopes: serializeAws_restJson1Scopes(input.scopes, context) }), + }); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +export const serializeAws_restJson1StartDeviceAuthorizationCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/device_authorization"; + let body; + body = JSON.stringify({ + ...(input.clientId != null && { clientId: input.clientId }), + ...(input.clientSecret != null && { clientSecret: input.clientSecret }), + ...(input.startUrl != null && { startUrl: input.startUrl }), + }); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +export const deserializeAws_restJson1CreateTokenCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1CreateTokenCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.accessToken != null) { + contents.accessToken = __expectString(data.accessToken); + } + if (data.expiresIn != null) { + contents.expiresIn = __expectInt32(data.expiresIn); + } + if (data.idToken != null) { + contents.idToken = __expectString(data.idToken); + } + if (data.refreshToken != null) { + contents.refreshToken = __expectString(data.refreshToken); + } + if (data.tokenType != null) { + contents.tokenType = __expectString(data.tokenType); + } + return contents; +}; +const deserializeAws_restJson1CreateTokenCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.ssooidc#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "AuthorizationPendingException": + case "com.amazonaws.ssooidc#AuthorizationPendingException": + throw await deserializeAws_restJson1AuthorizationPendingExceptionResponse(parsedOutput, context); + case "ExpiredTokenException": + case "com.amazonaws.ssooidc#ExpiredTokenException": + throw await deserializeAws_restJson1ExpiredTokenExceptionResponse(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "InvalidClientException": + case "com.amazonaws.ssooidc#InvalidClientException": + throw await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context); + case "InvalidGrantException": + case "com.amazonaws.ssooidc#InvalidGrantException": + throw await deserializeAws_restJson1InvalidGrantExceptionResponse(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "InvalidScopeException": + case "com.amazonaws.ssooidc#InvalidScopeException": + throw await deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context); + case "SlowDownException": + case "com.amazonaws.ssooidc#SlowDownException": + throw await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context); + case "UnauthorizedClientException": + case "com.amazonaws.ssooidc#UnauthorizedClientException": + throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context); + case "UnsupportedGrantTypeException": + case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": + throw await deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_restJson1RegisterClientCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1RegisterClientCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.authorizationEndpoint != null) { + contents.authorizationEndpoint = __expectString(data.authorizationEndpoint); + } + if (data.clientId != null) { + contents.clientId = __expectString(data.clientId); + } + if (data.clientIdIssuedAt != null) { + contents.clientIdIssuedAt = __expectLong(data.clientIdIssuedAt); + } + if (data.clientSecret != null) { + contents.clientSecret = __expectString(data.clientSecret); + } + if (data.clientSecretExpiresAt != null) { + contents.clientSecretExpiresAt = __expectLong(data.clientSecretExpiresAt); + } + if (data.tokenEndpoint != null) { + contents.tokenEndpoint = __expectString(data.tokenEndpoint); + } + return contents; +}; +const deserializeAws_restJson1RegisterClientCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "InvalidClientMetadataException": + case "com.amazonaws.ssooidc#InvalidClientMetadataException": + throw await deserializeAws_restJson1InvalidClientMetadataExceptionResponse(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "InvalidScopeException": + case "com.amazonaws.ssooidc#InvalidScopeException": + throw await deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_restJson1StartDeviceAuthorizationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1StartDeviceAuthorizationCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.deviceCode != null) { + contents.deviceCode = __expectString(data.deviceCode); + } + if (data.expiresIn != null) { + contents.expiresIn = __expectInt32(data.expiresIn); + } + if (data.interval != null) { + contents.interval = __expectInt32(data.interval); + } + if (data.userCode != null) { + contents.userCode = __expectString(data.userCode); + } + if (data.verificationUri != null) { + contents.verificationUri = __expectString(data.verificationUri); + } + if (data.verificationUriComplete != null) { + contents.verificationUriComplete = __expectString(data.verificationUriComplete); + } + return contents; +}; +const deserializeAws_restJson1StartDeviceAuthorizationCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "InvalidClientException": + case "com.amazonaws.ssooidc#InvalidClientException": + throw await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "SlowDownException": + case "com.amazonaws.ssooidc#SlowDownException": + throw await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context); + case "UnauthorizedClientException": + case "com.amazonaws.ssooidc#UnauthorizedClientException": + throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +const map = __map; +const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1AuthorizationPendingExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new AuthorizationPendingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1ExpiredTokenExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new ExpiredTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidClientExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new InvalidClientException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidClientMetadataExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new InvalidClientMetadataException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidGrantExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new InvalidGrantException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new InvalidRequestException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1InvalidScopeExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new InvalidScopeException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1SlowDownExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new SlowDownException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1UnauthorizedClientExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new UnauthorizedClientException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.error != null) { + contents.error = __expectString(data.error); + } + if (data.error_description != null) { + contents.error_description = __expectString(data.error_description); + } + const exception = new UnsupportedGrantTypeException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const serializeAws_restJson1Scopes = (input, context) => { + return input + .filter((e) => e != null) + .map((entry) => { + return entry; + }); +}; +const deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); +const collectBody = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; +const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +const isSerializableHeaderValue = (value) => value !== undefined && + value !== null && + value !== "" && + (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && + (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); +const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}); +const parseErrorBody = async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; +const loadRestJsonErrorCode = (output, data) => { + const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.browser.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.browser.js new file mode 100644 index 0000000000..3313abae07 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.browser.js @@ -0,0 +1,33 @@ +import packageInfo from "../package.json"; +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser"; +export const getRuntimeConfig = (config) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js new file mode 100644 index 0000000000..4a65531560 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js @@ -0,0 +1,40 @@ +import packageInfo from "../package.json"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@aws-sdk/config-resolver"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; +export const getRuntimeConfig = (config) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.native.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.native.js new file mode 100644 index 0000000000..0b54695282 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.native.js @@ -0,0 +1,11 @@ +import { Sha256 } from "@aws-crypto/sha256-js"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; +export const getRuntimeConfig = (config) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js new file mode 100644 index 0000000000..fafc68a6b9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js @@ -0,0 +1,17 @@ +import { NoOpLogger } from "@aws-sdk/smithy-client"; +import { parseUrl } from "@aws-sdk/url-parser"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +export const getRuntimeConfig = (config) => ({ + apiVersion: "2019-06-10", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "SSO OIDC", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, +}); diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDC.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDC.d.ts new file mode 100644 index 0000000000..0574ea8c82 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDC.d.ts @@ -0,0 +1,71 @@ +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; +import { CreateTokenCommandInput, CreateTokenCommandOutput } from "./commands/CreateTokenCommand"; +import { RegisterClientCommandInput, RegisterClientCommandOutput } from "./commands/RegisterClientCommand"; +import { StartDeviceAuthorizationCommandInput, StartDeviceAuthorizationCommandOutput } from "./commands/StartDeviceAuthorizationCommand"; +import { SSOOIDCClient } from "./SSOOIDCClient"; +/** + *

AWS IAM Identity Center (successor to AWS Single Sign-On) OpenID Connect (OIDC) is a web service that enables a client (such as AWS CLI + * or a native application) to register with IAM Identity Center. The service also enables the client to + * fetch the user’s access token upon successful authentication and authorization with + * IAM Identity Center.

+ * + *

Although AWS Single Sign-On was renamed, the sso and + * identitystore API namespaces will continue to retain their original name for + * backward compatibility purposes. For more information, see IAM Identity Center rename.

+ *
+ *

+ * Considerations for Using This Guide + *

+ *

Before you begin using this guide, we recommend that you first review the following + * important information about how the IAM Identity Center OIDC service works.

+ *
    + *
  • + *

    The IAM Identity Center OIDC service currently implements only the portions of the OAuth 2.0 + * Device Authorization Grant standard (https://tools.ietf.org/html/rfc8628) that are necessary to enable single + * sign-on authentication with the AWS CLI. Support for other OIDC flows frequently needed + * for native applications, such as Authorization Code Flow (+ PKCE), will be addressed in + * future releases.

    + *
  • + *
  • + *

    The service emits only OIDC access tokens, such that obtaining a new token (For + * example, token refresh) requires explicit user re-authentication.

    + *
  • + *
  • + *

    The access tokens provided by this service grant access to all AWS account + * entitlements assigned to an IAM Identity Center user, not just a particular application.

    + *
  • + *
  • + *

    The documentation in this guide does not describe the mechanism to convert the access + * token into AWS Auth (“sigv4”) credentials for use with IAM-protected AWS service + * endpoints. For more information, see GetRoleCredentials in the IAM Identity Center Portal API Reference + * Guide.

    + *
  • + *
+ * + *

For general information about IAM Identity Center, see What is + * IAM Identity Center? in the IAM Identity Center User Guide.

+ */ +export declare class SSOOIDC extends SSOOIDCClient { + /** + *

Creates and returns an access token for the authorized client. The access token issued + * will be used to fetch short-term credentials for the assigned roles in the AWS + * account.

+ */ + createToken(args: CreateTokenCommandInput, options?: __HttpHandlerOptions): Promise; + createToken(args: CreateTokenCommandInput, cb: (err: any, data?: CreateTokenCommandOutput) => void): void; + createToken(args: CreateTokenCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateTokenCommandOutput) => void): void; + /** + *

Registers a client with IAM Identity Center. This allows clients to initiate device authorization. + * The output should be persisted for reuse through many authentication requests.

+ */ + registerClient(args: RegisterClientCommandInput, options?: __HttpHandlerOptions): Promise; + registerClient(args: RegisterClientCommandInput, cb: (err: any, data?: RegisterClientCommandOutput) => void): void; + registerClient(args: RegisterClientCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: RegisterClientCommandOutput) => void): void; + /** + *

Initiates device authorization by requesting a pair of verification codes from the + * authorization service.

+ */ + startDeviceAuthorization(args: StartDeviceAuthorizationCommandInput, options?: __HttpHandlerOptions): Promise; + startDeviceAuthorization(args: StartDeviceAuthorizationCommandInput, cb: (err: any, data?: StartDeviceAuthorizationCommandOutput) => void): void; + startDeviceAuthorization(args: StartDeviceAuthorizationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: StartDeviceAuthorizationCommandOutput) => void): void; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDCClient.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDCClient.d.ts new file mode 100644 index 0000000000..6558d18d81 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/SSOOIDCClient.d.ts @@ -0,0 +1,177 @@ +import { RegionInputConfig, RegionResolvedConfig } from "@aws-sdk/config-resolver"; +import { EndpointInputConfig, EndpointResolvedConfig } from "@aws-sdk/middleware-endpoint"; +import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header"; +import { RetryInputConfig, RetryResolvedConfig } from "@aws-sdk/middleware-retry"; +import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@aws-sdk/smithy-client"; +import { BodyLengthCalculator as __BodyLengthCalculator, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types"; +import { CreateTokenCommandInput, CreateTokenCommandOutput } from "./commands/CreateTokenCommand"; +import { RegisterClientCommandInput, RegisterClientCommandOutput } from "./commands/RegisterClientCommand"; +import { StartDeviceAuthorizationCommandInput, StartDeviceAuthorizationCommandOutput } from "./commands/StartDeviceAuthorizationCommand"; +import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters"; +export declare type ServiceInputTypes = CreateTokenCommandInput | RegisterClientCommandInput | StartDeviceAuthorizationCommandInput; +export declare type ServiceOutputTypes = CreateTokenCommandOutput | RegisterClientCommandOutput | StartDeviceAuthorizationCommandOutput; +export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandler; + /** + * A constructor for a class implementing the {@link __Checksum} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + /** + * The runtime environment. + * @internal + */ + runtime?: string; + /** + * Disable dyanamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + /** + * Specifies which retry algorithm to use. + */ + retryMode?: string | __Provider; + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** + * The {@link __DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} +declare type SSOOIDCClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig & RetryInputConfig & HostHeaderInputConfig & UserAgentInputConfig & ClientInputEndpointParameters; +/** + * The configuration interface of SSOOIDCClient class constructor that set the region, credentials and other options. + */ +export interface SSOOIDCClientConfig extends SSOOIDCClientConfigType { +} +declare type SSOOIDCClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & RegionResolvedConfig & EndpointResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters; +/** + * The resolved configuration interface of SSOOIDCClient class. This is resolved and normalized from the {@link SSOOIDCClientConfig | constructor configuration interface}. + */ +export interface SSOOIDCClientResolvedConfig extends SSOOIDCClientResolvedConfigType { +} +/** + *

AWS IAM Identity Center (successor to AWS Single Sign-On) OpenID Connect (OIDC) is a web service that enables a client (such as AWS CLI + * or a native application) to register with IAM Identity Center. The service also enables the client to + * fetch the user’s access token upon successful authentication and authorization with + * IAM Identity Center.

+ * + *

Although AWS Single Sign-On was renamed, the sso and + * identitystore API namespaces will continue to retain their original name for + * backward compatibility purposes. For more information, see IAM Identity Center rename.

+ *
+ *

+ * Considerations for Using This Guide + *

+ *

Before you begin using this guide, we recommend that you first review the following + * important information about how the IAM Identity Center OIDC service works.

+ *
    + *
  • + *

    The IAM Identity Center OIDC service currently implements only the portions of the OAuth 2.0 + * Device Authorization Grant standard (https://tools.ietf.org/html/rfc8628) that are necessary to enable single + * sign-on authentication with the AWS CLI. Support for other OIDC flows frequently needed + * for native applications, such as Authorization Code Flow (+ PKCE), will be addressed in + * future releases.

    + *
  • + *
  • + *

    The service emits only OIDC access tokens, such that obtaining a new token (For + * example, token refresh) requires explicit user re-authentication.

    + *
  • + *
  • + *

    The access tokens provided by this service grant access to all AWS account + * entitlements assigned to an IAM Identity Center user, not just a particular application.

    + *
  • + *
  • + *

    The documentation in this guide does not describe the mechanism to convert the access + * token into AWS Auth (“sigv4”) credentials for use with IAM-protected AWS service + * endpoints. For more information, see GetRoleCredentials in the IAM Identity Center Portal API Reference + * Guide.

    + *
  • + *
+ * + *

For general information about IAM Identity Center, see What is + * IAM Identity Center? in the IAM Identity Center User Guide.

+ */ +export declare class SSOOIDCClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, SSOOIDCClientResolvedConfig> { + /** + * The resolved configuration of SSOOIDCClient class. This is resolved and normalized from the {@link SSOOIDCClientConfig | constructor configuration interface}. + */ + readonly config: SSOOIDCClientResolvedConfig; + constructor(configuration: SSOOIDCClientConfig); + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/CreateTokenCommand.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/CreateTokenCommand.d.ts new file mode 100644 index 0000000000..a21ff8eab0 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/CreateTokenCommand.d.ts @@ -0,0 +1,39 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { CreateTokenRequest, CreateTokenResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, SSOOIDCClientResolvedConfig } from "../SSOOIDCClient"; +export interface CreateTokenCommandInput extends CreateTokenRequest { +} +export interface CreateTokenCommandOutput extends CreateTokenResponse, __MetadataBearer { +} +/** + *

Creates and returns an access token for the authorized client. The access token issued + * will be used to fetch short-term credentials for the assigned roles in the AWS + * account.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SSOOIDCClient, CreateTokenCommand } from "@aws-sdk/client-sso-oidc"; // ES Modules import + * // const { SSOOIDCClient, CreateTokenCommand } = require("@aws-sdk/client-sso-oidc"); // CommonJS import + * const client = new SSOOIDCClient(config); + * const command = new CreateTokenCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link CreateTokenCommandInput} for command's `input` shape. + * @see {@link CreateTokenCommandOutput} for command's `response` shape. + * @see {@link SSOOIDCClientResolvedConfig | config} for SSOOIDCClient's `config` shape. + * + */ +export declare class CreateTokenCommand extends $Command { + readonly input: CreateTokenCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: CreateTokenCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: SSOOIDCClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/RegisterClientCommand.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/RegisterClientCommand.d.ts new file mode 100644 index 0000000000..307eda6d5e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/RegisterClientCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { RegisterClientRequest, RegisterClientResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, SSOOIDCClientResolvedConfig } from "../SSOOIDCClient"; +export interface RegisterClientCommandInput extends RegisterClientRequest { +} +export interface RegisterClientCommandOutput extends RegisterClientResponse, __MetadataBearer { +} +/** + *

Registers a client with IAM Identity Center. This allows clients to initiate device authorization. + * The output should be persisted for reuse through many authentication requests.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SSOOIDCClient, RegisterClientCommand } from "@aws-sdk/client-sso-oidc"; // ES Modules import + * // const { SSOOIDCClient, RegisterClientCommand } = require("@aws-sdk/client-sso-oidc"); // CommonJS import + * const client = new SSOOIDCClient(config); + * const command = new RegisterClientCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link RegisterClientCommandInput} for command's `input` shape. + * @see {@link RegisterClientCommandOutput} for command's `response` shape. + * @see {@link SSOOIDCClientResolvedConfig | config} for SSOOIDCClient's `config` shape. + * + */ +export declare class RegisterClientCommand extends $Command { + readonly input: RegisterClientCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: RegisterClientCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: SSOOIDCClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/StartDeviceAuthorizationCommand.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/StartDeviceAuthorizationCommand.d.ts new file mode 100644 index 0000000000..96d6f80a59 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/StartDeviceAuthorizationCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { StartDeviceAuthorizationRequest, StartDeviceAuthorizationResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, SSOOIDCClientResolvedConfig } from "../SSOOIDCClient"; +export interface StartDeviceAuthorizationCommandInput extends StartDeviceAuthorizationRequest { +} +export interface StartDeviceAuthorizationCommandOutput extends StartDeviceAuthorizationResponse, __MetadataBearer { +} +/** + *

Initiates device authorization by requesting a pair of verification codes from the + * authorization service.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SSOOIDCClient, StartDeviceAuthorizationCommand } from "@aws-sdk/client-sso-oidc"; // ES Modules import + * // const { SSOOIDCClient, StartDeviceAuthorizationCommand } = require("@aws-sdk/client-sso-oidc"); // CommonJS import + * const client = new SSOOIDCClient(config); + * const command = new StartDeviceAuthorizationCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link StartDeviceAuthorizationCommandInput} for command's `input` shape. + * @see {@link StartDeviceAuthorizationCommandOutput} for command's `response` shape. + * @see {@link SSOOIDCClientResolvedConfig | config} for SSOOIDCClient's `config` shape. + * + */ +export declare class StartDeviceAuthorizationCommand extends $Command { + readonly input: StartDeviceAuthorizationCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: StartDeviceAuthorizationCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: SSOOIDCClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/index.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/index.d.ts new file mode 100644 index 0000000000..53f139a07f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/commands/index.d.ts @@ -0,0 +1,3 @@ +export * from "./CreateTokenCommand"; +export * from "./RegisterClientCommand"; +export * from "./StartDeviceAuthorizationCommand"; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/EndpointParameters.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/EndpointParameters.d.ts new file mode 100644 index 0000000000..fd716b2afe --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/EndpointParameters.d.ts @@ -0,0 +1,19 @@ +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@aws-sdk/types"; +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} +export declare type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; +export declare const resolveClientEndpointParameters: (options: T & ClientInputEndpointParameters) => T & ClientInputEndpointParameters & { + defaultSigningName: string; +}; +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/endpointResolver.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/endpointResolver.d.ts new file mode 100644 index 0000000000..62107b6db3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/endpointResolver.d.ts @@ -0,0 +1,5 @@ +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParameters } from "./EndpointParameters"; +export declare const defaultEndpointResolver: (endpointParams: EndpointParameters, context?: { + logger?: Logger; +}) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/ruleset.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/ruleset.d.ts new file mode 100644 index 0000000000..a822ad761a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/endpoint/ruleset.d.ts @@ -0,0 +1,2 @@ +import { RuleSetObject } from "@aws-sdk/util-endpoints"; +export declare const ruleSet: RuleSetObject; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/index.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/index.d.ts new file mode 100644 index 0000000000..c757666012 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/index.d.ts @@ -0,0 +1,5 @@ +export * from "./SSOOIDC"; +export * from "./SSOOIDCClient"; +export * from "./commands"; +export * from "./models"; +export { SSOOIDCServiceException } from "./models/SSOOIDCServiceException"; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/SSOOIDCServiceException.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/SSOOIDCServiceException.d.ts new file mode 100644 index 0000000000..e9c746e83c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/SSOOIDCServiceException.d.ts @@ -0,0 +1,10 @@ +import { ServiceException as __ServiceException, ServiceExceptionOptions as __ServiceExceptionOptions } from "@aws-sdk/smithy-client"; +/** + * Base exception class for all service exceptions from SSOOIDC service. + */ +export declare class SSOOIDCServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions); +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/index.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/index.d.ts new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/index.d.ts @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/models_0.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/models_0.d.ts new file mode 100644 index 0000000000..b16ea37b0a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/models/models_0.d.ts @@ -0,0 +1,371 @@ +import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client"; +import { SSOOIDCServiceException as __BaseException } from "./SSOOIDCServiceException"; +/** + *

You do not have sufficient access to perform this action.

+ */ +export declare class AccessDeniedException extends __BaseException { + readonly name: "AccessDeniedException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that a request to authorize a client with an access user session token is + * pending.

+ */ +export declare class AuthorizationPendingException extends __BaseException { + readonly name: "AuthorizationPendingException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +export interface CreateTokenRequest { + /** + *

The unique identifier string for each client. This value should come from the persisted + * result of the RegisterClient API.

+ */ + clientId: string | undefined; + /** + *

A secret string generated for the client. This value should come from the persisted result + * of the RegisterClient API.

+ */ + clientSecret: string | undefined; + /** + *

Supports grant types for the authorization code, refresh token, and device code request. + * For device code requests, specify the following value:

+ * + *

+ * urn:ietf:params:oauth:grant-type:device_code + * + *

+ * + *

For information about how to obtain the device code, see the StartDeviceAuthorization topic.

+ */ + grantType: string | undefined; + /** + *

Used only when calling this API for the device code grant type. This short-term code is + * used to identify this authentication attempt. This should come from an in-memory reference to + * the result of the StartDeviceAuthorization API.

+ */ + deviceCode?: string; + /** + *

The authorization code received from the authorization service. This parameter is required + * to perform an authorization grant request to get access to a token.

+ */ + code?: string; + /** + *

Currently, refreshToken is not yet implemented and is not supported. For more + * information about the features and limitations of the current IAM Identity Center OIDC implementation, + * see Considerations for Using this Guide in the IAM Identity Center + * OIDC API Reference.

+ *

The token used to obtain an access token in the event that the access token is invalid or + * expired.

+ */ + refreshToken?: string; + /** + *

The list of scopes that is defined by the client. Upon authorization, this list is used to + * restrict permissions when granting an access token.

+ */ + scope?: string[]; + /** + *

The location of the application that will receive the authorization code. Users authorize + * the service to send the request to this location.

+ */ + redirectUri?: string; +} +export interface CreateTokenResponse { + /** + *

An opaque token to access IAM Identity Center resources assigned to a user.

+ */ + accessToken?: string; + /** + *

Used to notify the client that the returned token is an access token. The supported type + * is BearerToken.

+ */ + tokenType?: string; + /** + *

Indicates the time in seconds when an access token will expire.

+ */ + expiresIn?: number; + /** + *

Currently, refreshToken is not yet implemented and is not supported. For more + * information about the features and limitations of the current IAM Identity Center OIDC implementation, + * see Considerations for Using this Guide in the IAM Identity Center + * OIDC API Reference.

+ *

A token that, if present, can be used to refresh a previously issued access token that + * might have expired.

+ */ + refreshToken?: string; + /** + *

Currently, idToken is not yet implemented and is not supported. For more + * information about the features and limitations of the current IAM Identity Center OIDC implementation, + * see Considerations for Using this Guide in the IAM Identity Center + * OIDC API Reference.

+ *

The identifier of the user that associated with the access token, if present.

+ */ + idToken?: string; +} +/** + *

Indicates that the token issued by the service is expired and is no longer valid.

+ */ +export declare class ExpiredTokenException extends __BaseException { + readonly name: "ExpiredTokenException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that an error from the service occurred while trying to process a + * request.

+ */ +export declare class InternalServerException extends __BaseException { + readonly name: "InternalServerException"; + readonly $fault: "server"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that the clientId or clientSecret in the request is + * invalid. For example, this can occur when a client sends an incorrect clientId or + * an expired clientSecret.

+ */ +export declare class InvalidClientException extends __BaseException { + readonly name: "InvalidClientException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that a request contains an invalid grant. This can occur if a client makes a + * CreateToken request with an invalid grant type.

+ */ +export declare class InvalidGrantException extends __BaseException { + readonly name: "InvalidGrantException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that something is wrong with the input to the request. For example, a required + * parameter might be missing or out of range.

+ */ +export declare class InvalidRequestException extends __BaseException { + readonly name: "InvalidRequestException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that the scope provided in the request is invalid.

+ */ +export declare class InvalidScopeException extends __BaseException { + readonly name: "InvalidScopeException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that the client is making the request too frequently and is more than the + * service can handle.

+ */ +export declare class SlowDownException extends __BaseException { + readonly name: "SlowDownException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that the client is not currently authorized to make the request. This can happen + * when a clientId is not issued for a public client.

+ */ +export declare class UnauthorizedClientException extends __BaseException { + readonly name: "UnauthorizedClientException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that the grant type in the request is not supported by the service.

+ */ +export declare class UnsupportedGrantTypeException extends __BaseException { + readonly name: "UnsupportedGrantTypeException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that the client information sent in the request during registration is + * invalid.

+ */ +export declare class InvalidClientMetadataException extends __BaseException { + readonly name: "InvalidClientMetadataException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +export interface RegisterClientRequest { + /** + *

The friendly name of the client.

+ */ + clientName: string | undefined; + /** + *

The type of client. The service supports only public as a client type. + * Anything other than public will be rejected by the service.

+ */ + clientType: string | undefined; + /** + *

The list of scopes that are defined by the client. Upon authorization, this list is used + * to restrict permissions when granting an access token.

+ */ + scopes?: string[]; +} +export interface RegisterClientResponse { + /** + *

The unique identifier string for each client. This client uses this identifier to get + * authenticated by the service in subsequent calls.

+ */ + clientId?: string; + /** + *

A secret string generated for the client. The client will use this string to get + * authenticated by the service in subsequent calls.

+ */ + clientSecret?: string; + /** + *

Indicates the time at which the clientId and clientSecret were + * issued.

+ */ + clientIdIssuedAt?: number; + /** + *

Indicates the time at which the clientId and clientSecret will + * become invalid.

+ */ + clientSecretExpiresAt?: number; + /** + *

The endpoint where the client can request authorization.

+ */ + authorizationEndpoint?: string; + /** + *

The endpoint where the client can get an access token.

+ */ + tokenEndpoint?: string; +} +export interface StartDeviceAuthorizationRequest { + /** + *

The unique identifier string for the client that is registered with IAM Identity Center. This value + * should come from the persisted result of the RegisterClient API + * operation.

+ */ + clientId: string | undefined; + /** + *

A secret string that is generated for the client. This value should come from the + * persisted result of the RegisterClient API operation.

+ */ + clientSecret: string | undefined; + /** + *

The URL for the AWS access portal. For more information, see Using + * the AWS access portal in the IAM Identity Center User Guide.

+ */ + startUrl: string | undefined; +} +export interface StartDeviceAuthorizationResponse { + /** + *

The short-lived code that is used by the device when polling for a session token.

+ */ + deviceCode?: string; + /** + *

A one-time user verification code. This is needed to authorize an in-use device.

+ */ + userCode?: string; + /** + *

The URI of the verification page that takes the userCode to authorize the + * device.

+ */ + verificationUri?: string; + /** + *

An alternate URL that the client can use to automatically launch a browser. This process + * skips the manual step in which the user visits the verification page and enters their + * code.

+ */ + verificationUriComplete?: string; + /** + *

Indicates the number of seconds in which the verification code will become invalid.

+ */ + expiresIn?: number; + /** + *

Indicates the number of seconds the client must wait between attempts when polling for a + * session.

+ */ + interval?: number; +} +/** + * @internal + */ +export declare const CreateTokenRequestFilterSensitiveLog: (obj: CreateTokenRequest) => any; +/** + * @internal + */ +export declare const CreateTokenResponseFilterSensitiveLog: (obj: CreateTokenResponse) => any; +/** + * @internal + */ +export declare const RegisterClientRequestFilterSensitiveLog: (obj: RegisterClientRequest) => any; +/** + * @internal + */ +export declare const RegisterClientResponseFilterSensitiveLog: (obj: RegisterClientResponse) => any; +/** + * @internal + */ +export declare const StartDeviceAuthorizationRequestFilterSensitiveLog: (obj: StartDeviceAuthorizationRequest) => any; +/** + * @internal + */ +export declare const StartDeviceAuthorizationResponseFilterSensitiveLog: (obj: StartDeviceAuthorizationResponse) => any; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/protocols/Aws_restJson1.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/protocols/Aws_restJson1.d.ts new file mode 100644 index 0000000000..bab2b5a74b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/protocols/Aws_restJson1.d.ts @@ -0,0 +1,11 @@ +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { SerdeContext as __SerdeContext } from "@aws-sdk/types"; +import { CreateTokenCommandInput, CreateTokenCommandOutput } from "../commands/CreateTokenCommand"; +import { RegisterClientCommandInput, RegisterClientCommandOutput } from "../commands/RegisterClientCommand"; +import { StartDeviceAuthorizationCommandInput, StartDeviceAuthorizationCommandOutput } from "../commands/StartDeviceAuthorizationCommand"; +export declare const serializeAws_restJson1CreateTokenCommand: (input: CreateTokenCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1RegisterClientCommand: (input: RegisterClientCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1StartDeviceAuthorizationCommand: (input: StartDeviceAuthorizationCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const deserializeAws_restJson1CreateTokenCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_restJson1RegisterClientCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_restJson1StartDeviceAuthorizationCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.browser.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.browser.d.ts new file mode 100644 index 0000000000..1068a24b15 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.browser.d.ts @@ -0,0 +1,35 @@ +import { FetchHttpHandler as RequestHandler } from "@aws-sdk/fetch-http-handler"; +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: ((string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider) & (string | import("@aws-sdk/types").Provider | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider)) | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.d.ts new file mode 100644 index 0000000000..1965d39687 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.d.ts @@ -0,0 +1,35 @@ +import { NodeHttpHandler as RequestHandler } from "@aws-sdk/node-http-handler"; +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: ((string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider) & (string | import("@aws-sdk/types").Provider | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider)) | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.native.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.native.d.ts new file mode 100644 index 0000000000..7098771460 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.native.d.ts @@ -0,0 +1,34 @@ +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => { + runtime: string; + sha256: import("@aws-sdk/types").HashConstructor; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | import("@aws-sdk/fetch-http-handler").FetchHttpHandler; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + streamCollector: import("@aws-sdk/types").StreamCollector; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + maxAttempts: number | import("@aws-sdk/types").Provider; + retryMode: string | import("@aws-sdk/types").Provider; + logger: import("@aws-sdk/types").Logger; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + serviceId: string; + region: string | import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + defaultsMode: import("@aws-sdk/smithy-client").DefaultsMode | import("@aws-sdk/types").Provider; + endpoint?: string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.shared.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.shared.d.ts new file mode 100644 index 0000000000..1e80996817 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/runtimeConfig.shared.d.ts @@ -0,0 +1,18 @@ +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => { + apiVersion: string; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + urlParser: import("@aws-sdk/types").UrlParser; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDC.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDC.d.ts new file mode 100644 index 0000000000..9187bfe317 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDC.d.ts @@ -0,0 +1,55 @@ +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; +import { + CreateTokenCommandInput, + CreateTokenCommandOutput, +} from "./commands/CreateTokenCommand"; +import { + RegisterClientCommandInput, + RegisterClientCommandOutput, +} from "./commands/RegisterClientCommand"; +import { + StartDeviceAuthorizationCommandInput, + StartDeviceAuthorizationCommandOutput, +} from "./commands/StartDeviceAuthorizationCommand"; +import { SSOOIDCClient } from "./SSOOIDCClient"; +export declare class SSOOIDC extends SSOOIDCClient { + createToken( + args: CreateTokenCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createToken( + args: CreateTokenCommandInput, + cb: (err: any, data?: CreateTokenCommandOutput) => void + ): void; + createToken( + args: CreateTokenCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateTokenCommandOutput) => void + ): void; + registerClient( + args: RegisterClientCommandInput, + options?: __HttpHandlerOptions + ): Promise; + registerClient( + args: RegisterClientCommandInput, + cb: (err: any, data?: RegisterClientCommandOutput) => void + ): void; + registerClient( + args: RegisterClientCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: RegisterClientCommandOutput) => void + ): void; + startDeviceAuthorization( + args: StartDeviceAuthorizationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + startDeviceAuthorization( + args: StartDeviceAuthorizationCommandInput, + cb: (err: any, data?: StartDeviceAuthorizationCommandOutput) => void + ): void; + startDeviceAuthorization( + args: StartDeviceAuthorizationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartDeviceAuthorizationCommandOutput) => void + ): void; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDCClient.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDCClient.d.ts new file mode 100644 index 0000000000..88f2cdfcdc --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/SSOOIDCClient.d.ts @@ -0,0 +1,122 @@ +import { + RegionInputConfig, + RegionResolvedConfig, +} from "@aws-sdk/config-resolver"; +import { + EndpointInputConfig, + EndpointResolvedConfig, +} from "@aws-sdk/middleware-endpoint"; +import { + HostHeaderInputConfig, + HostHeaderResolvedConfig, +} from "@aws-sdk/middleware-host-header"; +import { + RetryInputConfig, + RetryResolvedConfig, +} from "@aws-sdk/middleware-retry"; +import { + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@aws-sdk/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + ChecksumConstructor as __ChecksumConstructor, + Decoder as __Decoder, + Encoder as __Encoder, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@aws-sdk/types"; +import { + CreateTokenCommandInput, + CreateTokenCommandOutput, +} from "./commands/CreateTokenCommand"; +import { + RegisterClientCommandInput, + RegisterClientCommandOutput, +} from "./commands/RegisterClientCommand"; +import { + StartDeviceAuthorizationCommandInput, + StartDeviceAuthorizationCommandOutput, +} from "./commands/StartDeviceAuthorizationCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, +} from "./endpoint/EndpointParameters"; +export declare type ServiceInputTypes = + | CreateTokenCommandInput + | RegisterClientCommandInput + | StartDeviceAuthorizationCommandInput; +export declare type ServiceOutputTypes = + | CreateTokenCommandOutput + | RegisterClientCommandOutput + | StartDeviceAuthorizationCommandOutput; +export interface ClientDefaults + extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + requestHandler?: __HttpHandler; + sha256?: __ChecksumConstructor | __HashConstructor; + urlParser?: __UrlParser; + bodyLengthChecker?: __BodyLengthCalculator; + streamCollector?: __StreamCollector; + base64Decoder?: __Decoder; + base64Encoder?: __Encoder; + utf8Decoder?: __Decoder; + utf8Encoder?: __Encoder; + runtime?: string; + disableHostPrefix?: boolean; + maxAttempts?: number | __Provider; + retryMode?: string | __Provider; + logger?: __Logger; + useDualstackEndpoint?: boolean | __Provider; + useFipsEndpoint?: boolean | __Provider; + serviceId?: string; + region?: string | __Provider; + defaultUserAgentProvider?: Provider<__UserAgent>; + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} +declare type SSOOIDCClientConfigType = Partial< + __SmithyConfiguration<__HttpHandlerOptions> +> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + UserAgentInputConfig & + ClientInputEndpointParameters; +export interface SSOOIDCClientConfig extends SSOOIDCClientConfigType {} +declare type SSOOIDCClientResolvedConfigType = + __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + UserAgentResolvedConfig & + ClientResolvedEndpointParameters; +export interface SSOOIDCClientResolvedConfig + extends SSOOIDCClientResolvedConfigType {} +export declare class SSOOIDCClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + SSOOIDCClientResolvedConfig +> { + readonly config: SSOOIDCClientResolvedConfig; + constructor(configuration: SSOOIDCClientConfig); + destroy(): void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/CreateTokenCommand.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/CreateTokenCommand.d.ts new file mode 100644 index 0000000000..87206df08d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/CreateTokenCommand.d.ts @@ -0,0 +1,34 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { CreateTokenRequest, CreateTokenResponse } from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + SSOOIDCClientResolvedConfig, +} from "../SSOOIDCClient"; +export interface CreateTokenCommandInput extends CreateTokenRequest {} +export interface CreateTokenCommandOutput + extends CreateTokenResponse, + __MetadataBearer {} +export declare class CreateTokenCommand extends $Command< + CreateTokenCommandInput, + CreateTokenCommandOutput, + SSOOIDCClientResolvedConfig +> { + readonly input: CreateTokenCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: CreateTokenCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: SSOOIDCClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/RegisterClientCommand.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/RegisterClientCommand.d.ts new file mode 100644 index 0000000000..c678f3f027 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/RegisterClientCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + RegisterClientRequest, + RegisterClientResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + SSOOIDCClientResolvedConfig, +} from "../SSOOIDCClient"; +export interface RegisterClientCommandInput extends RegisterClientRequest {} +export interface RegisterClientCommandOutput + extends RegisterClientResponse, + __MetadataBearer {} +export declare class RegisterClientCommand extends $Command< + RegisterClientCommandInput, + RegisterClientCommandOutput, + SSOOIDCClientResolvedConfig +> { + readonly input: RegisterClientCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: RegisterClientCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: SSOOIDCClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/StartDeviceAuthorizationCommand.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/StartDeviceAuthorizationCommand.d.ts new file mode 100644 index 0000000000..dff78e9e91 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/StartDeviceAuthorizationCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + StartDeviceAuthorizationRequest, + StartDeviceAuthorizationResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + SSOOIDCClientResolvedConfig, +} from "../SSOOIDCClient"; +export interface StartDeviceAuthorizationCommandInput + extends StartDeviceAuthorizationRequest {} +export interface StartDeviceAuthorizationCommandOutput + extends StartDeviceAuthorizationResponse, + __MetadataBearer {} +export declare class StartDeviceAuthorizationCommand extends $Command< + StartDeviceAuthorizationCommandInput, + StartDeviceAuthorizationCommandOutput, + SSOOIDCClientResolvedConfig +> { + readonly input: StartDeviceAuthorizationCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: StartDeviceAuthorizationCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: SSOOIDCClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StartDeviceAuthorizationCommandInput, + StartDeviceAuthorizationCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/index.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/index.d.ts new file mode 100644 index 0000000000..53f139a07f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/commands/index.d.ts @@ -0,0 +1,3 @@ +export * from "./CreateTokenCommand"; +export * from "./RegisterClientCommand"; +export * from "./StartDeviceAuthorizationCommand"; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/EndpointParameters.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/EndpointParameters.d.ts new file mode 100644 index 0000000000..07bea1ea11 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/EndpointParameters.d.ts @@ -0,0 +1,34 @@ +import { + Endpoint, + EndpointParameters as __EndpointParameters, + EndpointV2, + Provider, +} from "@aws-sdk/types"; +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: + | string + | Provider + | Endpoint + | Provider + | EndpointV2 + | Provider; +} +export declare type ClientResolvedEndpointParameters = + ClientInputEndpointParameters & { + defaultSigningName: string; + }; +export declare const resolveClientEndpointParameters: ( + options: T & ClientInputEndpointParameters +) => T & + ClientInputEndpointParameters & { + defaultSigningName: string; + }; +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/endpointResolver.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/endpointResolver.d.ts new file mode 100644 index 0000000000..4c971a7f41 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/endpointResolver.d.ts @@ -0,0 +1,8 @@ +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParameters } from "./EndpointParameters"; +export declare const defaultEndpointResolver: ( + endpointParams: EndpointParameters, + context?: { + logger?: Logger; + } +) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/ruleset.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/ruleset.d.ts new file mode 100644 index 0000000000..a822ad761a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/endpoint/ruleset.d.ts @@ -0,0 +1,2 @@ +import { RuleSetObject } from "@aws-sdk/util-endpoints"; +export declare const ruleSet: RuleSetObject; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..c757666012 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/index.d.ts @@ -0,0 +1,5 @@ +export * from "./SSOOIDC"; +export * from "./SSOOIDCClient"; +export * from "./commands"; +export * from "./models"; +export { SSOOIDCServiceException } from "./models/SSOOIDCServiceException"; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/SSOOIDCServiceException.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/SSOOIDCServiceException.d.ts new file mode 100644 index 0000000000..21470ed01e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/SSOOIDCServiceException.d.ts @@ -0,0 +1,7 @@ +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@aws-sdk/smithy-client"; +export declare class SSOOIDCServiceException extends __ServiceException { + constructor(options: __ServiceExceptionOptions); +} diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/index.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/index.d.ts new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/index.d.ts @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/models_0.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/models_0.d.ts new file mode 100644 index 0000000000..f1c2d19ea1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/models/models_0.d.ts @@ -0,0 +1,169 @@ +import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client"; +import { SSOOIDCServiceException as __BaseException } from "./SSOOIDCServiceException"; +export declare class AccessDeniedException extends __BaseException { + readonly name: "AccessDeniedException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class AuthorizationPendingException extends __BaseException { + readonly name: "AuthorizationPendingException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export interface CreateTokenRequest { + clientId: string | undefined; + clientSecret: string | undefined; + grantType: string | undefined; + deviceCode?: string; + code?: string; + refreshToken?: string; + scope?: string[]; + redirectUri?: string; +} +export interface CreateTokenResponse { + accessToken?: string; + tokenType?: string; + expiresIn?: number; + refreshToken?: string; + idToken?: string; +} +export declare class ExpiredTokenException extends __BaseException { + readonly name: "ExpiredTokenException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class InternalServerException extends __BaseException { + readonly name: "InternalServerException"; + readonly $fault: "server"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class InvalidClientException extends __BaseException { + readonly name: "InvalidClientException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class InvalidGrantException extends __BaseException { + readonly name: "InvalidGrantException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class InvalidRequestException extends __BaseException { + readonly name: "InvalidRequestException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class InvalidScopeException extends __BaseException { + readonly name: "InvalidScopeException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class SlowDownException extends __BaseException { + readonly name: "SlowDownException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor(opts: __ExceptionOptionType); +} +export declare class UnauthorizedClientException extends __BaseException { + readonly name: "UnauthorizedClientException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class UnsupportedGrantTypeException extends __BaseException { + readonly name: "UnsupportedGrantTypeException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class InvalidClientMetadataException extends __BaseException { + readonly name: "InvalidClientMetadataException"; + readonly $fault: "client"; + error?: string; + error_description?: string; + constructor( + opts: __ExceptionOptionType + ); +} +export interface RegisterClientRequest { + clientName: string | undefined; + clientType: string | undefined; + scopes?: string[]; +} +export interface RegisterClientResponse { + clientId?: string; + clientSecret?: string; + clientIdIssuedAt?: number; + clientSecretExpiresAt?: number; + authorizationEndpoint?: string; + tokenEndpoint?: string; +} +export interface StartDeviceAuthorizationRequest { + clientId: string | undefined; + clientSecret: string | undefined; + startUrl: string | undefined; +} +export interface StartDeviceAuthorizationResponse { + deviceCode?: string; + userCode?: string; + verificationUri?: string; + verificationUriComplete?: string; + expiresIn?: number; + interval?: number; +} +export declare const CreateTokenRequestFilterSensitiveLog: ( + obj: CreateTokenRequest +) => any; +export declare const CreateTokenResponseFilterSensitiveLog: ( + obj: CreateTokenResponse +) => any; +export declare const RegisterClientRequestFilterSensitiveLog: ( + obj: RegisterClientRequest +) => any; +export declare const RegisterClientResponseFilterSensitiveLog: ( + obj: RegisterClientResponse +) => any; +export declare const StartDeviceAuthorizationRequestFilterSensitiveLog: ( + obj: StartDeviceAuthorizationRequest +) => any; +export declare const StartDeviceAuthorizationResponseFilterSensitiveLog: ( + obj: StartDeviceAuthorizationResponse +) => any; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/protocols/Aws_restJson1.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/protocols/Aws_restJson1.d.ts new file mode 100644 index 0000000000..db9de74ecc --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/protocols/Aws_restJson1.d.ts @@ -0,0 +1,41 @@ +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, +} from "@aws-sdk/protocol-http"; +import { SerdeContext as __SerdeContext } from "@aws-sdk/types"; +import { + CreateTokenCommandInput, + CreateTokenCommandOutput, +} from "../commands/CreateTokenCommand"; +import { + RegisterClientCommandInput, + RegisterClientCommandOutput, +} from "../commands/RegisterClientCommand"; +import { + StartDeviceAuthorizationCommandInput, + StartDeviceAuthorizationCommandOutput, +} from "../commands/StartDeviceAuthorizationCommand"; +export declare const serializeAws_restJson1CreateTokenCommand: ( + input: CreateTokenCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1RegisterClientCommand: ( + input: RegisterClientCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1StartDeviceAuthorizationCommand: ( + input: StartDeviceAuthorizationCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const deserializeAws_restJson1CreateTokenCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_restJson1RegisterClientCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_restJson1StartDeviceAuthorizationCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.browser.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.browser.d.ts new file mode 100644 index 0000000000..ea516d82b9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.browser.d.ts @@ -0,0 +1,67 @@ +import { FetchHttpHandler as RequestHandler } from "@aws-sdk/fetch-http-handler"; +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").ResolvedDefaultsMode + >; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: + | (( + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + ) & + ( + | string + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").EndpointV2 + > + )) + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.d.ts new file mode 100644 index 0000000000..ed4b45fae6 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.d.ts @@ -0,0 +1,67 @@ +import { NodeHttpHandler as RequestHandler } from "@aws-sdk/node-http-handler"; +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").ResolvedDefaultsMode + >; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: + | (( + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + ) & + ( + | string + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").EndpointV2 + > + )) + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.native.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.native.d.ts new file mode 100644 index 0000000000..a0bf151804 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.native.d.ts @@ -0,0 +1,56 @@ +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => { + runtime: string; + sha256: import("@aws-sdk/types").HashConstructor; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | import("@aws-sdk/fetch-http-handler").FetchHttpHandler; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + streamCollector: import("@aws-sdk/types").StreamCollector; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + maxAttempts: number | import("@aws-sdk/types").Provider; + retryMode: string | import("@aws-sdk/types").Provider; + logger: import("@aws-sdk/types").Logger; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + serviceId: string; + region: string | import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + defaultsMode: + | import("@aws-sdk/smithy-client").DefaultsMode + | import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").DefaultsMode + >; + endpoint?: + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.shared.d.ts b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.shared.d.ts new file mode 100644 index 0000000000..04512321aa --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/dist-types/ts3.4/runtimeConfig.shared.d.ts @@ -0,0 +1,18 @@ +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => { + apiVersion: string; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + urlParser: import("@aws-sdk/types").UrlParser; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; +}; diff --git a/server/node_modules/@aws-sdk/client-sso-oidc/package.json b/server/node_modules/@aws-sdk/client-sso-oidc/package.json new file mode 100644 index 0000000000..8337fcace9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso-oidc/package.json @@ -0,0 +1,99 @@ +{ + "name": "@aws-sdk/client-sso-oidc", + "description": "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native", + "version": "3.264.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:docs": "typedoc", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "generate:client": "node ../../scripts/generate-clients/single-service --solo sso-oidc" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/fetch-http-handler": "3.257.0", + "@aws-sdk/hash-node": "3.257.0", + "@aws-sdk/invalid-dependency": "3.257.0", + "@aws-sdk/middleware-content-length": "3.257.0", + "@aws-sdk/middleware-endpoint": "3.264.0", + "@aws-sdk/middleware-host-header": "3.257.0", + "@aws-sdk/middleware-logger": "3.257.0", + "@aws-sdk/middleware-recursion-detection": "3.257.0", + "@aws-sdk/middleware-retry": "3.259.0", + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/middleware-user-agent": "3.257.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/node-http-handler": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/smithy-client": "3.261.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.261.0", + "@aws-sdk/util-defaults-mode-node": "3.261.0", + "@aws-sdk/util-endpoints": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "@aws-sdk/util-user-agent-browser": "3.257.0", + "@aws-sdk/util-user-agent-node": "3.259.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/service-client-documentation-generator": "3.208.0", + "@tsconfig/node14": "1.0.3", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "overrides": { + "typedoc": { + "typescript": "~4.6.2" + } + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-sso-oidc" + } +} diff --git a/server/node_modules/@aws-sdk/client-sso/LICENSE b/server/node_modules/@aws-sdk/client-sso/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/client-sso/README.md b/server/node_modules/@aws-sdk/client-sso/README.md new file mode 100644 index 0000000000..0d65f61b9d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/README.md @@ -0,0 +1,223 @@ + + +# @aws-sdk/client-sso + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sso/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sso.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso) + +## Description + +AWS SDK for JavaScript SSO Client for Node.js, Browser and React Native. + +

AWS IAM Identity Center (successor to AWS Single Sign-On) Portal is a web service that makes it easy for you to assign user access to +IAM Identity Center resources such as the AWS access portal. Users can get AWS account applications and roles +assigned to them and get federated into the application.

+ + +

Although AWS Single Sign-On was renamed, the sso and +identitystore API namespaces will continue to retain their original name for +backward compatibility purposes. For more information, see IAM Identity Center rename.

+
+ +

This reference guide describes the IAM Identity Center Portal operations that you can call +programatically and includes detailed information on data types and errors.

+ + +

AWS provides SDKs that consist of libraries and sample code for various programming +languages and platforms, such as Java, Ruby, .Net, iOS, or Android. The SDKs provide a +convenient way to create programmatic access to IAM Identity Center and other AWS services. For more +information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sso +using your favorite package manager: + +- `npm install @aws-sdk/client-sso` +- `yarn add @aws-sdk/client-sso` +- `pnpm add @aws-sdk/client-sso` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SSOClient` and +the commands you need, for example `GetRoleCredentialsCommand`: + +```js +// ES5 example +const { SSOClient, GetRoleCredentialsCommand } = require("@aws-sdk/client-sso"); +``` + +```ts +// ES6+ example +import { SSOClient, GetRoleCredentialsCommand } from "@aws-sdk/client-sso"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new SSOClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetRoleCredentialsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sso"; +const client = new AWS.SSO({ region: "REGION" }); + +// async/await. +try { + const data = await client.getRoleCredentials(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getRoleCredentials(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getRoleCredentials(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sso` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/SSO.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/SSO.js new file mode 100644 index 0000000000..d7e0b07f9f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/SSO.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSO = void 0; +const GetRoleCredentialsCommand_1 = require("./commands/GetRoleCredentialsCommand"); +const ListAccountRolesCommand_1 = require("./commands/ListAccountRolesCommand"); +const ListAccountsCommand_1 = require("./commands/ListAccountsCommand"); +const LogoutCommand_1 = require("./commands/LogoutCommand"); +const SSOClient_1 = require("./SSOClient"); +class SSO extends SSOClient_1.SSOClient { + getRoleCredentials(args, optionsOrCb, cb) { + const command = new GetRoleCredentialsCommand_1.GetRoleCredentialsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listAccountRoles(args, optionsOrCb, cb) { + const command = new ListAccountRolesCommand_1.ListAccountRolesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listAccounts(args, optionsOrCb, cb) { + const command = new ListAccountsCommand_1.ListAccountsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + logout(args, optionsOrCb, cb) { + const command = new LogoutCommand_1.LogoutCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } +} +exports.SSO = SSO; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/SSOClient.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/SSOClient.js new file mode 100644 index 0000000000..88e5a59ab9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/SSOClient.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSOClient = void 0; +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const middleware_content_length_1 = require("@aws-sdk/middleware-content-length"); +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_host_header_1 = require("@aws-sdk/middleware-host-header"); +const middleware_logger_1 = require("@aws-sdk/middleware-logger"); +const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection"); +const middleware_retry_1 = require("@aws-sdk/middleware-retry"); +const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const EndpointParameters_1 = require("./endpoint/EndpointParameters"); +const runtimeConfig_1 = require("./runtimeConfig"); +class SSOClient extends smithy_client_1.Client { + constructor(configuration) { + const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration); + const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); + const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); + const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); + const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); + const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_5); + super(_config_6); + this.config = _config_6; + this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); + } + destroy() { + super.destroy(); + } +} +exports.SSOClient = SSOClient; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/GetRoleCredentialsCommand.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/GetRoleCredentialsCommand.js new file mode 100644 index 0000000000..fe9d0fbb7c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/GetRoleCredentialsCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetRoleCredentialsCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_restJson1_1 = require("../protocols/Aws_restJson1"); +class GetRoleCredentialsCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetRoleCredentialsCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOClient"; + const commandName = "GetRoleCredentialsCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetRoleCredentialsRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetRoleCredentialsResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_restJson1_1.serializeAws_restJson1GetRoleCredentialsCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_restJson1_1.deserializeAws_restJson1GetRoleCredentialsCommand)(output, context); + } +} +exports.GetRoleCredentialsCommand = GetRoleCredentialsCommand; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/ListAccountRolesCommand.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/ListAccountRolesCommand.js new file mode 100644 index 0000000000..0f6a970730 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/ListAccountRolesCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListAccountRolesCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_restJson1_1 = require("../protocols/Aws_restJson1"); +class ListAccountRolesCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListAccountRolesCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOClient"; + const commandName = "ListAccountRolesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.ListAccountRolesRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.ListAccountRolesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_restJson1_1.serializeAws_restJson1ListAccountRolesCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_restJson1_1.deserializeAws_restJson1ListAccountRolesCommand)(output, context); + } +} +exports.ListAccountRolesCommand = ListAccountRolesCommand; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/ListAccountsCommand.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/ListAccountsCommand.js new file mode 100644 index 0000000000..6eb8738117 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/ListAccountsCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListAccountsCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_restJson1_1 = require("../protocols/Aws_restJson1"); +class ListAccountsCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListAccountsCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOClient"; + const commandName = "ListAccountsCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.ListAccountsRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.ListAccountsResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_restJson1_1.serializeAws_restJson1ListAccountsCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_restJson1_1.deserializeAws_restJson1ListAccountsCommand)(output, context); + } +} +exports.ListAccountsCommand = ListAccountsCommand; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/LogoutCommand.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/LogoutCommand.js new file mode 100644 index 0000000000..c102fb2b00 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/LogoutCommand.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LogoutCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_restJson1_1 = require("../protocols/Aws_restJson1"); +class LogoutCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, LogoutCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOClient"; + const commandName = "LogoutCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.LogoutRequestFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_restJson1_1.serializeAws_restJson1LogoutCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_restJson1_1.deserializeAws_restJson1LogoutCommand)(output, context); + } +} +exports.LogoutCommand = LogoutCommand; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/index.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/index.js new file mode 100644 index 0000000000..7164b095bb --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/commands/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./GetRoleCredentialsCommand"), exports); +tslib_1.__exportStar(require("./ListAccountRolesCommand"), exports); +tslib_1.__exportStar(require("./ListAccountsCommand"), exports); +tslib_1.__exportStar(require("./LogoutCommand"), exports); diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/EndpointParameters.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/EndpointParameters.js new file mode 100644 index 0000000000..c9424215b9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/EndpointParameters.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveClientEndpointParameters = void 0; +const resolveClientEndpointParameters = (options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "awsssoportal", + }; +}; +exports.resolveClientEndpointParameters = resolveClientEndpointParameters; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js new file mode 100644 index 0000000000..482fab141e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = require("@aws-sdk/util-endpoints"); +const ruleset_1 = require("./ruleset"); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; +exports.defaultEndpointResolver = defaultEndpointResolver; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js new file mode 100644 index 0000000000..2bc2df7d0d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ruleSet = void 0; +const p = "required", q = "fn", r = "argv", s = "ref"; +const a = "PartitionResult", b = "tree", c = "error", d = "endpoint", e = { [p]: false, "type": "String" }, f = { [p]: true, "default": false, "type": "Boolean" }, g = { [s]: "Endpoint" }, h = { [q]: "booleanEquals", [r]: [{ [s]: "UseFIPS" }, true] }, i = { [q]: "booleanEquals", [r]: [{ [s]: "UseDualStack" }, true] }, j = {}, k = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsFIPS"] }] }, l = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsDualStack"] }] }, m = [g], n = [h], o = [i]; +const _data = { version: "1.0", parameters: { Region: e, UseDualStack: f, UseFIPS: f, Endpoint: e }, rules: [{ conditions: [{ [q]: "aws.partition", [r]: [{ [s]: "Region" }], assign: a }], type: b, rules: [{ conditions: [{ [q]: "isSet", [r]: m }, { [q]: "parseURL", [r]: m, assign: "url" }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: g, properties: j, headers: j }, type: d }] }] }, { conditions: [h, i], type: b, rules: [{ conditions: [k, l], type: b, rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [k], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }; +exports.ruleSet = _data; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/index.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/index.js new file mode 100644 index 0000000000..c9757c5ab0 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSOServiceException = void 0; +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./SSO"), exports); +tslib_1.__exportStar(require("./SSOClient"), exports); +tslib_1.__exportStar(require("./commands"), exports); +tslib_1.__exportStar(require("./models"), exports); +tslib_1.__exportStar(require("./pagination"), exports); +var SSOServiceException_1 = require("./models/SSOServiceException"); +Object.defineProperty(exports, "SSOServiceException", { enumerable: true, get: function () { return SSOServiceException_1.SSOServiceException; } }); diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/models/SSOServiceException.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/models/SSOServiceException.js new file mode 100644 index 0000000000..9bf0b5b779 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/models/SSOServiceException.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SSOServiceException = void 0; +const smithy_client_1 = require("@aws-sdk/smithy-client"); +class SSOServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, SSOServiceException.prototype); + } +} +exports.SSOServiceException = SSOServiceException; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/models/index.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/models/index.js new file mode 100644 index 0000000000..8ced418bca --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/models/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./models_0"), exports); diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/models/models_0.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/models/models_0.js new file mode 100644 index 0000000000..46312275c8 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/models/models_0.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LogoutRequestFilterSensitiveLog = exports.ListAccountsResponseFilterSensitiveLog = exports.ListAccountsRequestFilterSensitiveLog = exports.ListAccountRolesResponseFilterSensitiveLog = exports.RoleInfoFilterSensitiveLog = exports.ListAccountRolesRequestFilterSensitiveLog = exports.GetRoleCredentialsResponseFilterSensitiveLog = exports.RoleCredentialsFilterSensitiveLog = exports.GetRoleCredentialsRequestFilterSensitiveLog = exports.AccountInfoFilterSensitiveLog = exports.UnauthorizedException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.InvalidRequestException = void 0; +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const SSOServiceException_1 = require("./SSOServiceException"); +class InvalidRequestException extends SSOServiceException_1.SSOServiceException { + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts, + }); + this.name = "InvalidRequestException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidRequestException.prototype); + } +} +exports.InvalidRequestException = InvalidRequestException; +class ResourceNotFoundException extends SSOServiceException_1.SSOServiceException { + constructor(opts) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + this.name = "ResourceNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + } +} +exports.ResourceNotFoundException = ResourceNotFoundException; +class TooManyRequestsException extends SSOServiceException_1.SSOServiceException { + constructor(opts) { + super({ + name: "TooManyRequestsException", + $fault: "client", + ...opts, + }); + this.name = "TooManyRequestsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, TooManyRequestsException.prototype); + } +} +exports.TooManyRequestsException = TooManyRequestsException; +class UnauthorizedException extends SSOServiceException_1.SSOServiceException { + constructor(opts) { + super({ + name: "UnauthorizedException", + $fault: "client", + ...opts, + }); + this.name = "UnauthorizedException"; + this.$fault = "client"; + Object.setPrototypeOf(this, UnauthorizedException.prototype); + } +} +exports.UnauthorizedException = UnauthorizedException; +const AccountInfoFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.AccountInfoFilterSensitiveLog = AccountInfoFilterSensitiveLog; +const GetRoleCredentialsRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.accessToken && { accessToken: smithy_client_1.SENSITIVE_STRING }), +}); +exports.GetRoleCredentialsRequestFilterSensitiveLog = GetRoleCredentialsRequestFilterSensitiveLog; +const RoleCredentialsFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.secretAccessKey && { secretAccessKey: smithy_client_1.SENSITIVE_STRING }), + ...(obj.sessionToken && { sessionToken: smithy_client_1.SENSITIVE_STRING }), +}); +exports.RoleCredentialsFilterSensitiveLog = RoleCredentialsFilterSensitiveLog; +const GetRoleCredentialsResponseFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.roleCredentials && { roleCredentials: (0, exports.RoleCredentialsFilterSensitiveLog)(obj.roleCredentials) }), +}); +exports.GetRoleCredentialsResponseFilterSensitiveLog = GetRoleCredentialsResponseFilterSensitiveLog; +const ListAccountRolesRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.accessToken && { accessToken: smithy_client_1.SENSITIVE_STRING }), +}); +exports.ListAccountRolesRequestFilterSensitiveLog = ListAccountRolesRequestFilterSensitiveLog; +const RoleInfoFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.RoleInfoFilterSensitiveLog = RoleInfoFilterSensitiveLog; +const ListAccountRolesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.ListAccountRolesResponseFilterSensitiveLog = ListAccountRolesResponseFilterSensitiveLog; +const ListAccountsRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.accessToken && { accessToken: smithy_client_1.SENSITIVE_STRING }), +}); +exports.ListAccountsRequestFilterSensitiveLog = ListAccountsRequestFilterSensitiveLog; +const ListAccountsResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.ListAccountsResponseFilterSensitiveLog = ListAccountsResponseFilterSensitiveLog; +const LogoutRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.accessToken && { accessToken: smithy_client_1.SENSITIVE_STRING }), +}); +exports.LogoutRequestFilterSensitiveLog = LogoutRequestFilterSensitiveLog; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/Interfaces.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/Interfaces.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/Interfaces.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/ListAccountRolesPaginator.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/ListAccountRolesPaginator.js new file mode 100644 index 0000000000..7a44449751 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/ListAccountRolesPaginator.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.paginateListAccountRoles = void 0; +const ListAccountRolesCommand_1 = require("../commands/ListAccountRolesCommand"); +const SSO_1 = require("../SSO"); +const SSOClient_1 = require("../SSOClient"); +const makePagedClientRequest = async (client, input, ...args) => { + return await client.send(new ListAccountRolesCommand_1.ListAccountRolesCommand(input), ...args); +}; +const makePagedRequest = async (client, input, ...args) => { + return await client.listAccountRoles(input, ...args); +}; +async function* paginateListAccountRoles(config, input, ...additionalArguments) { + let token = config.startingToken || undefined; + let hasNext = true; + let page; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SSO_1.SSO) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } + else if (config.client instanceof SSOClient_1.SSOClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } + else { + throw new Error("Invalid client, expected SSO | SSOClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return undefined; +} +exports.paginateListAccountRoles = paginateListAccountRoles; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/ListAccountsPaginator.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/ListAccountsPaginator.js new file mode 100644 index 0000000000..ec02045bd6 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/ListAccountsPaginator.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.paginateListAccounts = void 0; +const ListAccountsCommand_1 = require("../commands/ListAccountsCommand"); +const SSO_1 = require("../SSO"); +const SSOClient_1 = require("../SSOClient"); +const makePagedClientRequest = async (client, input, ...args) => { + return await client.send(new ListAccountsCommand_1.ListAccountsCommand(input), ...args); +}; +const makePagedRequest = async (client, input, ...args) => { + return await client.listAccounts(input, ...args); +}; +async function* paginateListAccounts(config, input, ...additionalArguments) { + let token = config.startingToken || undefined; + let hasNext = true; + let page; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SSO_1.SSO) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } + else if (config.client instanceof SSOClient_1.SSOClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } + else { + throw new Error("Invalid client, expected SSO | SSOClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return undefined; +} +exports.paginateListAccounts = paginateListAccounts; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/index.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/index.js new file mode 100644 index 0000000000..ebb311a1de --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/pagination/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./Interfaces"), exports); +tslib_1.__exportStar(require("./ListAccountRolesPaginator"), exports); +tslib_1.__exportStar(require("./ListAccountsPaginator"), exports); diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/protocols/Aws_restJson1.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/protocols/Aws_restJson1.js new file mode 100644 index 0000000000..181d3ab455 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/protocols/Aws_restJson1.js @@ -0,0 +1,417 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deserializeAws_restJson1LogoutCommand = exports.deserializeAws_restJson1ListAccountsCommand = exports.deserializeAws_restJson1ListAccountRolesCommand = exports.deserializeAws_restJson1GetRoleCredentialsCommand = exports.serializeAws_restJson1LogoutCommand = exports.serializeAws_restJson1ListAccountsCommand = exports.serializeAws_restJson1ListAccountRolesCommand = exports.serializeAws_restJson1GetRoleCredentialsCommand = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const SSOServiceException_1 = require("../models/SSOServiceException"); +const serializeAws_restJson1GetRoleCredentialsCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = map({}, isSerializableHeaderValue, { + "x-amz-sso_bearer_token": input.accessToken, + }); + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/federation/credentials"; + const query = map({ + role_name: [, (0, smithy_client_1.expectNonNull)(input.roleName, `roleName`)], + account_id: [, (0, smithy_client_1.expectNonNull)(input.accountId, `accountId`)], + }); + let body; + return new protocol_http_1.HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; +exports.serializeAws_restJson1GetRoleCredentialsCommand = serializeAws_restJson1GetRoleCredentialsCommand; +const serializeAws_restJson1ListAccountRolesCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = map({}, isSerializableHeaderValue, { + "x-amz-sso_bearer_token": input.accessToken, + }); + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/roles"; + const query = map({ + next_token: [, input.nextToken], + max_result: [() => input.maxResults !== void 0, () => input.maxResults.toString()], + account_id: [, (0, smithy_client_1.expectNonNull)(input.accountId, `accountId`)], + }); + let body; + return new protocol_http_1.HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; +exports.serializeAws_restJson1ListAccountRolesCommand = serializeAws_restJson1ListAccountRolesCommand; +const serializeAws_restJson1ListAccountsCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = map({}, isSerializableHeaderValue, { + "x-amz-sso_bearer_token": input.accessToken, + }); + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/accounts"; + const query = map({ + next_token: [, input.nextToken], + max_result: [() => input.maxResults !== void 0, () => input.maxResults.toString()], + }); + let body; + return new protocol_http_1.HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; +exports.serializeAws_restJson1ListAccountsCommand = serializeAws_restJson1ListAccountsCommand; +const serializeAws_restJson1LogoutCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = map({}, isSerializableHeaderValue, { + "x-amz-sso_bearer_token": input.accessToken, + }); + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/logout"; + let body; + return new protocol_http_1.HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +exports.serializeAws_restJson1LogoutCommand = serializeAws_restJson1LogoutCommand; +const deserializeAws_restJson1GetRoleCredentialsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1GetRoleCredentialsCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body"); + if (data.roleCredentials != null) { + contents.roleCredentials = deserializeAws_restJson1RoleCredentials(data.roleCredentials, context); + } + return contents; +}; +exports.deserializeAws_restJson1GetRoleCredentialsCommand = deserializeAws_restJson1GetRoleCredentialsCommand; +const deserializeAws_restJson1GetRoleCredentialsCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidRequestException": + case "com.amazonaws.sso#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.sso#ResourceNotFoundException": + throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.sso#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.sso#UnauthorizedException": + throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: SSOServiceException_1.SSOServiceException, + errorCode, + }); + } +}; +const deserializeAws_restJson1ListAccountRolesCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1ListAccountRolesCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body"); + if (data.nextToken != null) { + contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken); + } + if (data.roleList != null) { + contents.roleList = deserializeAws_restJson1RoleListType(data.roleList, context); + } + return contents; +}; +exports.deserializeAws_restJson1ListAccountRolesCommand = deserializeAws_restJson1ListAccountRolesCommand; +const deserializeAws_restJson1ListAccountRolesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidRequestException": + case "com.amazonaws.sso#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.sso#ResourceNotFoundException": + throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.sso#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.sso#UnauthorizedException": + throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: SSOServiceException_1.SSOServiceException, + errorCode, + }); + } +}; +const deserializeAws_restJson1ListAccountsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1ListAccountsCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body"); + if (data.accountList != null) { + contents.accountList = deserializeAws_restJson1AccountListType(data.accountList, context); + } + if (data.nextToken != null) { + contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken); + } + return contents; +}; +exports.deserializeAws_restJson1ListAccountsCommand = deserializeAws_restJson1ListAccountsCommand; +const deserializeAws_restJson1ListAccountsCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidRequestException": + case "com.amazonaws.sso#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.sso#ResourceNotFoundException": + throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.sso#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.sso#UnauthorizedException": + throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: SSOServiceException_1.SSOServiceException, + errorCode, + }); + } +}; +const deserializeAws_restJson1LogoutCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1LogoutCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +exports.deserializeAws_restJson1LogoutCommand = deserializeAws_restJson1LogoutCommand; +const deserializeAws_restJson1LogoutCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidRequestException": + case "com.amazonaws.sso#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.sso#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.sso#UnauthorizedException": + throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody, + exceptionCtor: SSOServiceException_1.SSOServiceException, + errorCode, + }); + } +}; +const map = smithy_client_1.map; +const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.message != null) { + contents.message = (0, smithy_client_1.expectString)(data.message); + } + const exception = new models_0_1.InvalidRequestException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.message != null) { + contents.message = (0, smithy_client_1.expectString)(data.message); + } + const exception = new models_0_1.ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.message != null) { + contents.message = (0, smithy_client_1.expectString)(data.message); + } + const exception = new models_0_1.TooManyRequestsException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.message != null) { + contents.message = (0, smithy_client_1.expectString)(data.message); + } + const exception = new models_0_1.UnauthorizedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body); +}; +const deserializeAws_restJson1AccountInfo = (output, context) => { + return { + accountId: (0, smithy_client_1.expectString)(output.accountId), + accountName: (0, smithy_client_1.expectString)(output.accountName), + emailAddress: (0, smithy_client_1.expectString)(output.emailAddress), + }; +}; +const deserializeAws_restJson1AccountListType = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_restJson1AccountInfo(entry, context); + }); + return retVal; +}; +const deserializeAws_restJson1RoleCredentials = (output, context) => { + return { + accessKeyId: (0, smithy_client_1.expectString)(output.accessKeyId), + expiration: (0, smithy_client_1.expectLong)(output.expiration), + secretAccessKey: (0, smithy_client_1.expectString)(output.secretAccessKey), + sessionToken: (0, smithy_client_1.expectString)(output.sessionToken), + }; +}; +const deserializeAws_restJson1RoleInfo = (output, context) => { + return { + accountId: (0, smithy_client_1.expectString)(output.accountId), + roleName: (0, smithy_client_1.expectString)(output.roleName), + }; +}; +const deserializeAws_restJson1RoleListType = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_restJson1RoleInfo(entry, context); + }); + return retVal; +}; +const deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); +const collectBody = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; +const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +const isSerializableHeaderValue = (value) => value !== undefined && + value !== null && + value !== "" && + (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && + (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); +const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}); +const parseErrorBody = async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; +const loadRestJsonErrorCode = (output, data) => { + const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.browser.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.browser.js new file mode 100644 index 0000000000..fa9401fe71 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.browser.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const tslib_1 = require("tslib"); +const package_json_1 = tslib_1.__importDefault(require("../package.json")); +const sha256_browser_1 = require("@aws-crypto/sha256-browser"); +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const fetch_http_handler_1 = require("@aws-sdk/fetch-http-handler"); +const invalid_dependency_1 = require("@aws-sdk/invalid-dependency"); +const util_body_length_browser_1 = require("@aws-sdk/util-body-length-browser"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser"); +const runtimeConfig_shared_1 = require("./runtimeConfig.shared"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const util_defaults_mode_browser_1 = require("@aws-sdk/util-defaults-mode-browser"); +const getRuntimeConfig = (config) => { + const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"), + requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? sha256_browser_1.Sha256, + streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js new file mode 100644 index 0000000000..f7f601840e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const tslib_1 = require("tslib"); +const package_json_1 = tslib_1.__importDefault(require("../package.json")); +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const hash_node_1 = require("@aws-sdk/hash-node"); +const middleware_retry_1 = require("@aws-sdk/middleware-retry"); +const node_config_provider_1 = require("@aws-sdk/node-config-provider"); +const node_http_handler_1 = require("@aws-sdk/node-http-handler"); +const util_body_length_node_1 = require("@aws-sdk/util-body-length-node"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node"); +const runtimeConfig_shared_1 = require("./runtimeConfig.shared"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const util_defaults_mode_node_1 = require("@aws-sdk/util-defaults-mode-node"); +const smithy_client_2 = require("@aws-sdk/smithy-client"); +const getRuntimeConfig = (config) => { + (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? + (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.native.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.native.js new file mode 100644 index 0000000000..34c5f8ece1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.native.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const sha256_js_1 = require("@aws-crypto/sha256-js"); +const runtimeConfig_browser_1 = require("./runtimeConfig.browser"); +const getRuntimeConfig = (config) => { + const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? sha256_js_1.Sha256, + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js b/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js new file mode 100644 index 0000000000..c2aba98cc2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const url_parser_1 = require("@aws-sdk/url-parser"); +const util_base64_1 = require("@aws-sdk/util-base64"); +const util_utf8_1 = require("@aws-sdk/util-utf8"); +const endpointResolver_1 = require("./endpoint/endpointResolver"); +const getRuntimeConfig = (config) => ({ + apiVersion: "2019-06-10", + base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64, + base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + serviceId: config?.serviceId ?? "SSO", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, +}); +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/SSO.js b/server/node_modules/@aws-sdk/client-sso/dist-es/SSO.js new file mode 100644 index 0000000000..e3a0ca8be8 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/SSO.js @@ -0,0 +1,63 @@ +import { GetRoleCredentialsCommand, } from "./commands/GetRoleCredentialsCommand"; +import { ListAccountRolesCommand, } from "./commands/ListAccountRolesCommand"; +import { ListAccountsCommand, } from "./commands/ListAccountsCommand"; +import { LogoutCommand } from "./commands/LogoutCommand"; +import { SSOClient } from "./SSOClient"; +export class SSO extends SSOClient { + getRoleCredentials(args, optionsOrCb, cb) { + const command = new GetRoleCredentialsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listAccountRoles(args, optionsOrCb, cb) { + const command = new ListAccountRolesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + listAccounts(args, optionsOrCb, cb) { + const command = new ListAccountsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + logout(args, optionsOrCb, cb) { + const command = new LogoutCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js b/server/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js new file mode 100644 index 0000000000..9e6da0e20f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js @@ -0,0 +1,33 @@ +import { resolveRegionConfig } from "@aws-sdk/config-resolver"; +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; +import { resolveEndpointConfig } from "@aws-sdk/middleware-endpoint"; +import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { getRetryPlugin, resolveRetryConfig } from "@aws-sdk/middleware-retry"; +import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent"; +import { Client as __Client, } from "@aws-sdk/smithy-client"; +import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +export class SSOClient extends __Client { + constructor(configuration) { + const _config_0 = __getRuntimeConfig(configuration); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveRegionConfig(_config_1); + const _config_3 = resolveEndpointConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveUserAgentConfig(_config_5); + super(_config_6); + this.config = _config_6; + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + } + destroy() { + super.destroy(); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js new file mode 100644 index 0000000000..951df5c37f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_restJson1GetRoleCredentialsCommand, serializeAws_restJson1GetRoleCredentialsCommand, } from "../protocols/Aws_restJson1"; +export class GetRoleCredentialsCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetRoleCredentialsCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOClient"; + const commandName = "GetRoleCredentialsCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetRoleCredentialsRequestFilterSensitiveLog, + outputFilterSensitiveLog: GetRoleCredentialsResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_restJson1GetRoleCredentialsCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_restJson1GetRoleCredentialsCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountRolesCommand.js b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountRolesCommand.js new file mode 100644 index 0000000000..ffd1625531 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountRolesCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { ListAccountRolesRequestFilterSensitiveLog, ListAccountRolesResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_restJson1ListAccountRolesCommand, serializeAws_restJson1ListAccountRolesCommand, } from "../protocols/Aws_restJson1"; +export class ListAccountRolesCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListAccountRolesCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOClient"; + const commandName = "ListAccountRolesCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListAccountRolesRequestFilterSensitiveLog, + outputFilterSensitiveLog: ListAccountRolesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_restJson1ListAccountRolesCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_restJson1ListAccountRolesCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountsCommand.js b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountsCommand.js new file mode 100644 index 0000000000..620064d175 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountsCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { ListAccountsRequestFilterSensitiveLog, ListAccountsResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_restJson1ListAccountsCommand, serializeAws_restJson1ListAccountsCommand, } from "../protocols/Aws_restJson1"; +export class ListAccountsCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListAccountsCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOClient"; + const commandName = "ListAccountsCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListAccountsRequestFilterSensitiveLog, + outputFilterSensitiveLog: ListAccountsResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_restJson1ListAccountsCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_restJson1ListAccountsCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/commands/LogoutCommand.js b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/LogoutCommand.js new file mode 100644 index 0000000000..c4a52b190d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/LogoutCommand.js @@ -0,0 +1,42 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { LogoutRequestFilterSensitiveLog } from "../models/models_0"; +import { deserializeAws_restJson1LogoutCommand, serializeAws_restJson1LogoutCommand } from "../protocols/Aws_restJson1"; +export class LogoutCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, LogoutCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOClient"; + const commandName = "LogoutCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: LogoutRequestFilterSensitiveLog, + outputFilterSensitiveLog: (output) => output, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_restJson1LogoutCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_restJson1LogoutCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/commands/index.js b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/index.js new file mode 100644 index 0000000000..0ab890d362 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/commands/index.js @@ -0,0 +1,4 @@ +export * from "./GetRoleCredentialsCommand"; +export * from "./ListAccountRolesCommand"; +export * from "./ListAccountsCommand"; +export * from "./LogoutCommand"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js b/server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js new file mode 100644 index 0000000000..ddb138faee --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js @@ -0,0 +1,8 @@ +export const resolveClientEndpointParameters = (options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "awsssoportal", + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js b/server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js new file mode 100644 index 0000000000..f7d9738dd1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js @@ -0,0 +1,8 @@ +import { resolveEndpoint } from "@aws-sdk/util-endpoints"; +import { ruleSet } from "./ruleset"; +export const defaultEndpointResolver = (endpointParams, context = {}) => { + return resolveEndpoint(ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js b/server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js new file mode 100644 index 0000000000..1283e49b30 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js @@ -0,0 +1,4 @@ +const p = "required", q = "fn", r = "argv", s = "ref"; +const a = "PartitionResult", b = "tree", c = "error", d = "endpoint", e = { [p]: false, "type": "String" }, f = { [p]: true, "default": false, "type": "Boolean" }, g = { [s]: "Endpoint" }, h = { [q]: "booleanEquals", [r]: [{ [s]: "UseFIPS" }, true] }, i = { [q]: "booleanEquals", [r]: [{ [s]: "UseDualStack" }, true] }, j = {}, k = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsFIPS"] }] }, l = { [q]: "booleanEquals", [r]: [true, { [q]: "getAttr", [r]: [{ [s]: a }, "supportsDualStack"] }] }, m = [g], n = [h], o = [i]; +const _data = { version: "1.0", parameters: { Region: e, UseDualStack: f, UseFIPS: f, Endpoint: e }, rules: [{ conditions: [{ [q]: "aws.partition", [r]: [{ [s]: "Region" }], assign: a }], type: b, rules: [{ conditions: [{ [q]: "isSet", [r]: m }, { [q]: "parseURL", [r]: m, assign: "url" }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: g, properties: j, headers: j }, type: d }] }] }, { conditions: [h, i], type: b, rules: [{ conditions: [k, l], type: b, rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [k], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [l], type: b, rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: j, headers: j }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: j, headers: j }, type: d }] }] }; +export const ruleSet = _data; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/index.js b/server/node_modules/@aws-sdk/client-sso/dist-es/index.js new file mode 100644 index 0000000000..26389df911 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/index.js @@ -0,0 +1,6 @@ +export * from "./SSO"; +export * from "./SSOClient"; +export * from "./commands"; +export * from "./models"; +export * from "./pagination"; +export { SSOServiceException } from "./models/SSOServiceException"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js b/server/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js new file mode 100644 index 0000000000..add21c40dd --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js @@ -0,0 +1,7 @@ +import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client"; +export class SSOServiceException extends __ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, SSOServiceException.prototype); + } +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/models/index.js b/server/node_modules/@aws-sdk/client-sso/dist-es/models/index.js new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/models/index.js @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js b/server/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js new file mode 100644 index 0000000000..fb243be9ca --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js @@ -0,0 +1,87 @@ +import { SENSITIVE_STRING } from "@aws-sdk/smithy-client"; +import { SSOServiceException as __BaseException } from "./SSOServiceException"; +export class InvalidRequestException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts, + }); + this.name = "InvalidRequestException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidRequestException.prototype); + } +} +export class ResourceNotFoundException extends __BaseException { + constructor(opts) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + this.name = "ResourceNotFoundException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + } +} +export class TooManyRequestsException extends __BaseException { + constructor(opts) { + super({ + name: "TooManyRequestsException", + $fault: "client", + ...opts, + }); + this.name = "TooManyRequestsException"; + this.$fault = "client"; + Object.setPrototypeOf(this, TooManyRequestsException.prototype); + } +} +export class UnauthorizedException extends __BaseException { + constructor(opts) { + super({ + name: "UnauthorizedException", + $fault: "client", + ...opts, + }); + this.name = "UnauthorizedException"; + this.$fault = "client"; + Object.setPrototypeOf(this, UnauthorizedException.prototype); + } +} +export const AccountInfoFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetRoleCredentialsRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.accessToken && { accessToken: SENSITIVE_STRING }), +}); +export const RoleCredentialsFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.secretAccessKey && { secretAccessKey: SENSITIVE_STRING }), + ...(obj.sessionToken && { sessionToken: SENSITIVE_STRING }), +}); +export const GetRoleCredentialsResponseFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) }), +}); +export const ListAccountRolesRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.accessToken && { accessToken: SENSITIVE_STRING }), +}); +export const RoleInfoFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const ListAccountRolesResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const ListAccountsRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.accessToken && { accessToken: SENSITIVE_STRING }), +}); +export const ListAccountsResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const LogoutRequestFilterSensitiveLog = (obj) => ({ + ...obj, + ...(obj.accessToken && { accessToken: SENSITIVE_STRING }), +}); diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/Interfaces.js b/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/Interfaces.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/Interfaces.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountRolesPaginator.js b/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountRolesPaginator.js new file mode 100644 index 0000000000..3eb1bff5a7 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountRolesPaginator.js @@ -0,0 +1,32 @@ +import { ListAccountRolesCommand, } from "../commands/ListAccountRolesCommand"; +import { SSO } from "../SSO"; +import { SSOClient } from "../SSOClient"; +const makePagedClientRequest = async (client, input, ...args) => { + return await client.send(new ListAccountRolesCommand(input), ...args); +}; +const makePagedRequest = async (client, input, ...args) => { + return await client.listAccountRoles(input, ...args); +}; +export async function* paginateListAccountRoles(config, input, ...additionalArguments) { + let token = config.startingToken || undefined; + let hasNext = true; + let page; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SSO) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } + else if (config.client instanceof SSOClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } + else { + throw new Error("Invalid client, expected SSO | SSOClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return undefined; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountsPaginator.js b/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountsPaginator.js new file mode 100644 index 0000000000..bad94e2ef1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountsPaginator.js @@ -0,0 +1,32 @@ +import { ListAccountsCommand, } from "../commands/ListAccountsCommand"; +import { SSO } from "../SSO"; +import { SSOClient } from "../SSOClient"; +const makePagedClientRequest = async (client, input, ...args) => { + return await client.send(new ListAccountsCommand(input), ...args); +}; +const makePagedRequest = async (client, input, ...args) => { + return await client.listAccounts(input, ...args); +}; +export async function* paginateListAccounts(config, input, ...additionalArguments) { + let token = config.startingToken || undefined; + let hasNext = true; + let page; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SSO) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } + else if (config.client instanceof SSOClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } + else { + throw new Error("Invalid client, expected SSO | SSOClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return undefined; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/index.js b/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/index.js new file mode 100644 index 0000000000..1e7866f7f3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/pagination/index.js @@ -0,0 +1,3 @@ +export * from "./Interfaces"; +export * from "./ListAccountRolesPaginator"; +export * from "./ListAccountsPaginator"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js b/server/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js new file mode 100644 index 0000000000..dbccf195bb --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js @@ -0,0 +1,406 @@ +import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http"; +import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client"; +import { InvalidRequestException, ResourceNotFoundException, TooManyRequestsException, UnauthorizedException, } from "../models/models_0"; +import { SSOServiceException as __BaseException } from "../models/SSOServiceException"; +export const serializeAws_restJson1GetRoleCredentialsCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = map({}, isSerializableHeaderValue, { + "x-amz-sso_bearer_token": input.accessToken, + }); + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/federation/credentials"; + const query = map({ + role_name: [, __expectNonNull(input.roleName, `roleName`)], + account_id: [, __expectNonNull(input.accountId, `accountId`)], + }); + let body; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; +export const serializeAws_restJson1ListAccountRolesCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = map({}, isSerializableHeaderValue, { + "x-amz-sso_bearer_token": input.accessToken, + }); + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/roles"; + const query = map({ + next_token: [, input.nextToken], + max_result: [() => input.maxResults !== void 0, () => input.maxResults.toString()], + account_id: [, __expectNonNull(input.accountId, `accountId`)], + }); + let body; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; +export const serializeAws_restJson1ListAccountsCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = map({}, isSerializableHeaderValue, { + "x-amz-sso_bearer_token": input.accessToken, + }); + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/accounts"; + const query = map({ + next_token: [, input.nextToken], + max_result: [() => input.maxResults !== void 0, () => input.maxResults.toString()], + }); + let body; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; +export const serializeAws_restJson1LogoutCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = map({}, isSerializableHeaderValue, { + "x-amz-sso_bearer_token": input.accessToken, + }); + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/logout"; + let body; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +export const deserializeAws_restJson1GetRoleCredentialsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1GetRoleCredentialsCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.roleCredentials != null) { + contents.roleCredentials = deserializeAws_restJson1RoleCredentials(data.roleCredentials, context); + } + return contents; +}; +const deserializeAws_restJson1GetRoleCredentialsCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidRequestException": + case "com.amazonaws.sso#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.sso#ResourceNotFoundException": + throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.sso#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.sso#UnauthorizedException": + throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_restJson1ListAccountRolesCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1ListAccountRolesCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.nextToken != null) { + contents.nextToken = __expectString(data.nextToken); + } + if (data.roleList != null) { + contents.roleList = deserializeAws_restJson1RoleListType(data.roleList, context); + } + return contents; +}; +const deserializeAws_restJson1ListAccountRolesCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidRequestException": + case "com.amazonaws.sso#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.sso#ResourceNotFoundException": + throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.sso#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.sso#UnauthorizedException": + throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_restJson1ListAccountsCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1ListAccountsCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.accountList != null) { + contents.accountList = deserializeAws_restJson1AccountListType(data.accountList, context); + } + if (data.nextToken != null) { + contents.nextToken = __expectString(data.nextToken); + } + return contents; +}; +const deserializeAws_restJson1ListAccountsCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidRequestException": + case "com.amazonaws.sso#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.sso#ResourceNotFoundException": + throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.sso#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.sso#UnauthorizedException": + throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_restJson1LogoutCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1LogoutCommandError(output, context); + } + const contents = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; +const deserializeAws_restJson1LogoutCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidRequestException": + case "com.amazonaws.sso#InvalidRequestException": + throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.sso#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.sso#UnauthorizedException": + throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +const map = __map; +const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new InvalidRequestException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new TooManyRequestsException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => { + const contents = map({}); + const data = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new UnauthorizedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; +const deserializeAws_restJson1AccountInfo = (output, context) => { + return { + accountId: __expectString(output.accountId), + accountName: __expectString(output.accountName), + emailAddress: __expectString(output.emailAddress), + }; +}; +const deserializeAws_restJson1AccountListType = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_restJson1AccountInfo(entry, context); + }); + return retVal; +}; +const deserializeAws_restJson1RoleCredentials = (output, context) => { + return { + accessKeyId: __expectString(output.accessKeyId), + expiration: __expectLong(output.expiration), + secretAccessKey: __expectString(output.secretAccessKey), + sessionToken: __expectString(output.sessionToken), + }; +}; +const deserializeAws_restJson1RoleInfo = (output, context) => { + return { + accountId: __expectString(output.accountId), + roleName: __expectString(output.roleName), + }; +}; +const deserializeAws_restJson1RoleListType = (output, context) => { + const retVal = (output || []) + .filter((e) => e != null) + .map((entry) => { + if (entry === null) { + return null; + } + return deserializeAws_restJson1RoleInfo(entry, context); + }); + return retVal; +}; +const deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); +const collectBody = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; +const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +const isSerializableHeaderValue = (value) => value !== undefined && + value !== null && + value !== "" && + (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && + (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); +const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}); +const parseErrorBody = async (errorBody, context) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; +const loadRestJsonErrorCode = (output, data) => { + const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.browser.js b/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.browser.js new file mode 100644 index 0000000000..3313abae07 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.browser.js @@ -0,0 +1,33 @@ +import packageInfo from "../package.json"; +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser"; +export const getRuntimeConfig = (config) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js b/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js new file mode 100644 index 0000000000..4a65531560 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js @@ -0,0 +1,40 @@ +import packageInfo from "../package.json"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@aws-sdk/config-resolver"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; +export const getRuntimeConfig = (config) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.native.js b/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.native.js new file mode 100644 index 0000000000..0b54695282 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.native.js @@ -0,0 +1,11 @@ +import { Sha256 } from "@aws-crypto/sha256-js"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; +export const getRuntimeConfig = (config) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js b/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js new file mode 100644 index 0000000000..b16985b223 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js @@ -0,0 +1,17 @@ +import { NoOpLogger } from "@aws-sdk/smithy-client"; +import { parseUrl } from "@aws-sdk/url-parser"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +export const getRuntimeConfig = (config) => ({ + apiVersion: "2019-06-10", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "SSO", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, +}); diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/SSO.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/SSO.d.ts new file mode 100644 index 0000000000..efdf8182d3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/SSO.d.ts @@ -0,0 +1,71 @@ +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; +import { GetRoleCredentialsCommandInput, GetRoleCredentialsCommandOutput } from "./commands/GetRoleCredentialsCommand"; +import { ListAccountRolesCommandInput, ListAccountRolesCommandOutput } from "./commands/ListAccountRolesCommand"; +import { ListAccountsCommandInput, ListAccountsCommandOutput } from "./commands/ListAccountsCommand"; +import { LogoutCommandInput, LogoutCommandOutput } from "./commands/LogoutCommand"; +import { SSOClient } from "./SSOClient"; +/** + *

AWS IAM Identity Center (successor to AWS Single Sign-On) Portal is a web service that makes it easy for you to assign user access to + * IAM Identity Center resources such as the AWS access portal. Users can get AWS account applications and roles + * assigned to them and get federated into the application.

+ * + * + *

Although AWS Single Sign-On was renamed, the sso and + * identitystore API namespaces will continue to retain their original name for + * backward compatibility purposes. For more information, see IAM Identity Center rename.

+ *
+ * + *

This reference guide describes the IAM Identity Center Portal operations that you can call + * programatically and includes detailed information on data types and errors.

+ * + * + *

AWS provides SDKs that consist of libraries and sample code for various programming + * languages and platforms, such as Java, Ruby, .Net, iOS, or Android. The SDKs provide a + * convenient way to create programmatic access to IAM Identity Center and other AWS services. For more + * information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.

+ *
+ */ +export declare class SSO extends SSOClient { + /** + *

Returns the STS short-term credentials for a given role name that is assigned to the + * user.

+ */ + getRoleCredentials(args: GetRoleCredentialsCommandInput, options?: __HttpHandlerOptions): Promise; + getRoleCredentials(args: GetRoleCredentialsCommandInput, cb: (err: any, data?: GetRoleCredentialsCommandOutput) => void): void; + getRoleCredentials(args: GetRoleCredentialsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetRoleCredentialsCommandOutput) => void): void; + /** + *

Lists all roles that are assigned to the user for a given AWS account.

+ */ + listAccountRoles(args: ListAccountRolesCommandInput, options?: __HttpHandlerOptions): Promise; + listAccountRoles(args: ListAccountRolesCommandInput, cb: (err: any, data?: ListAccountRolesCommandOutput) => void): void; + listAccountRoles(args: ListAccountRolesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListAccountRolesCommandOutput) => void): void; + /** + *

Lists all AWS accounts assigned to the user. These AWS accounts are assigned by the + * administrator of the account. For more information, see Assign User Access in the IAM Identity Center User Guide. This operation + * returns a paginated response.

+ */ + listAccounts(args: ListAccountsCommandInput, options?: __HttpHandlerOptions): Promise; + listAccounts(args: ListAccountsCommandInput, cb: (err: any, data?: ListAccountsCommandOutput) => void): void; + listAccounts(args: ListAccountsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListAccountsCommandOutput) => void): void; + /** + *

Removes the locally stored SSO tokens from the client-side cache and sends an API call to + * the IAM Identity Center service to invalidate the corresponding server-side IAM Identity Center sign in + * session.

+ * + * + *

If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM Identity Center sign in session is + * used to obtain an IAM session, as specified in the corresponding IAM Identity Center permission set. + * More specifically, IAM Identity Center assumes an IAM role in the target account on behalf of the user, + * and the corresponding temporary AWS credentials are returned to the client.

+ * + *

After user logout, any existing IAM role sessions that were created by using IAM Identity Center + * permission sets continue based on the duration configured in the permission set. + * For more information, see User + * authentications in the IAM Identity Center User + * Guide.

+ *
+ */ + logout(args: LogoutCommandInput, options?: __HttpHandlerOptions): Promise; + logout(args: LogoutCommandInput, cb: (err: any, data?: LogoutCommandOutput) => void): void; + logout(args: LogoutCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: LogoutCommandOutput) => void): void; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/SSOClient.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/SSOClient.d.ts new file mode 100644 index 0000000000..c7565afa0a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/SSOClient.d.ts @@ -0,0 +1,157 @@ +import { RegionInputConfig, RegionResolvedConfig } from "@aws-sdk/config-resolver"; +import { EndpointInputConfig, EndpointResolvedConfig } from "@aws-sdk/middleware-endpoint"; +import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header"; +import { RetryInputConfig, RetryResolvedConfig } from "@aws-sdk/middleware-retry"; +import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@aws-sdk/smithy-client"; +import { BodyLengthCalculator as __BodyLengthCalculator, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types"; +import { GetRoleCredentialsCommandInput, GetRoleCredentialsCommandOutput } from "./commands/GetRoleCredentialsCommand"; +import { ListAccountRolesCommandInput, ListAccountRolesCommandOutput } from "./commands/ListAccountRolesCommand"; +import { ListAccountsCommandInput, ListAccountsCommandOutput } from "./commands/ListAccountsCommand"; +import { LogoutCommandInput, LogoutCommandOutput } from "./commands/LogoutCommand"; +import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters"; +export declare type ServiceInputTypes = GetRoleCredentialsCommandInput | ListAccountRolesCommandInput | ListAccountsCommandInput | LogoutCommandInput; +export declare type ServiceOutputTypes = GetRoleCredentialsCommandOutput | ListAccountRolesCommandOutput | ListAccountsCommandOutput | LogoutCommandOutput; +export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandler; + /** + * A constructor for a class implementing the {@link __Checksum} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + /** + * The runtime environment. + * @internal + */ + runtime?: string; + /** + * Disable dyanamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + /** + * Specifies which retry algorithm to use. + */ + retryMode?: string | __Provider; + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** + * The {@link __DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} +declare type SSOClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig & RetryInputConfig & HostHeaderInputConfig & UserAgentInputConfig & ClientInputEndpointParameters; +/** + * The configuration interface of SSOClient class constructor that set the region, credentials and other options. + */ +export interface SSOClientConfig extends SSOClientConfigType { +} +declare type SSOClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & RegionResolvedConfig & EndpointResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters; +/** + * The resolved configuration interface of SSOClient class. This is resolved and normalized from the {@link SSOClientConfig | constructor configuration interface}. + */ +export interface SSOClientResolvedConfig extends SSOClientResolvedConfigType { +} +/** + *

AWS IAM Identity Center (successor to AWS Single Sign-On) Portal is a web service that makes it easy for you to assign user access to + * IAM Identity Center resources such as the AWS access portal. Users can get AWS account applications and roles + * assigned to them and get federated into the application.

+ * + * + *

Although AWS Single Sign-On was renamed, the sso and + * identitystore API namespaces will continue to retain their original name for + * backward compatibility purposes. For more information, see IAM Identity Center rename.

+ *
+ * + *

This reference guide describes the IAM Identity Center Portal operations that you can call + * programatically and includes detailed information on data types and errors.

+ * + * + *

AWS provides SDKs that consist of libraries and sample code for various programming + * languages and platforms, such as Java, Ruby, .Net, iOS, or Android. The SDKs provide a + * convenient way to create programmatic access to IAM Identity Center and other AWS services. For more + * information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.

+ *
+ */ +export declare class SSOClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, SSOClientResolvedConfig> { + /** + * The resolved configuration of SSOClient class. This is resolved and normalized from the {@link SSOClientConfig | constructor configuration interface}. + */ + readonly config: SSOClientResolvedConfig; + constructor(configuration: SSOClientConfig); + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/commands/GetRoleCredentialsCommand.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/GetRoleCredentialsCommand.d.ts new file mode 100644 index 0000000000..80890ae1d5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/GetRoleCredentialsCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { GetRoleCredentialsRequest, GetRoleCredentialsResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, SSOClientResolvedConfig } from "../SSOClient"; +export interface GetRoleCredentialsCommandInput extends GetRoleCredentialsRequest { +} +export interface GetRoleCredentialsCommandOutput extends GetRoleCredentialsResponse, __MetadataBearer { +} +/** + *

Returns the STS short-term credentials for a given role name that is assigned to the + * user.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SSOClient, GetRoleCredentialsCommand } from "@aws-sdk/client-sso"; // ES Modules import + * // const { SSOClient, GetRoleCredentialsCommand } = require("@aws-sdk/client-sso"); // CommonJS import + * const client = new SSOClient(config); + * const command = new GetRoleCredentialsCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetRoleCredentialsCommandInput} for command's `input` shape. + * @see {@link GetRoleCredentialsCommandOutput} for command's `response` shape. + * @see {@link SSOClientResolvedConfig | config} for SSOClient's `config` shape. + * + */ +export declare class GetRoleCredentialsCommand extends $Command { + readonly input: GetRoleCredentialsCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetRoleCredentialsCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: SSOClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/commands/ListAccountRolesCommand.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/ListAccountRolesCommand.d.ts new file mode 100644 index 0000000000..ad991a6ff9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/ListAccountRolesCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { ListAccountRolesRequest, ListAccountRolesResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, SSOClientResolvedConfig } from "../SSOClient"; +export interface ListAccountRolesCommandInput extends ListAccountRolesRequest { +} +export interface ListAccountRolesCommandOutput extends ListAccountRolesResponse, __MetadataBearer { +} +/** + *

Lists all roles that are assigned to the user for a given AWS account.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SSOClient, ListAccountRolesCommand } from "@aws-sdk/client-sso"; // ES Modules import + * // const { SSOClient, ListAccountRolesCommand } = require("@aws-sdk/client-sso"); // CommonJS import + * const client = new SSOClient(config); + * const command = new ListAccountRolesCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListAccountRolesCommandInput} for command's `input` shape. + * @see {@link ListAccountRolesCommandOutput} for command's `response` shape. + * @see {@link SSOClientResolvedConfig | config} for SSOClient's `config` shape. + * + */ +export declare class ListAccountRolesCommand extends $Command { + readonly input: ListAccountRolesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListAccountRolesCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: SSOClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/commands/ListAccountsCommand.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/ListAccountsCommand.d.ts new file mode 100644 index 0000000000..291430f658 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/ListAccountsCommand.d.ts @@ -0,0 +1,39 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { ListAccountsRequest, ListAccountsResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, SSOClientResolvedConfig } from "../SSOClient"; +export interface ListAccountsCommandInput extends ListAccountsRequest { +} +export interface ListAccountsCommandOutput extends ListAccountsResponse, __MetadataBearer { +} +/** + *

Lists all AWS accounts assigned to the user. These AWS accounts are assigned by the + * administrator of the account. For more information, see Assign User Access in the IAM Identity Center User Guide. This operation + * returns a paginated response.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SSOClient, ListAccountsCommand } from "@aws-sdk/client-sso"; // ES Modules import + * // const { SSOClient, ListAccountsCommand } = require("@aws-sdk/client-sso"); // CommonJS import + * const client = new SSOClient(config); + * const command = new ListAccountsCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListAccountsCommandInput} for command's `input` shape. + * @see {@link ListAccountsCommandOutput} for command's `response` shape. + * @see {@link SSOClientResolvedConfig | config} for SSOClient's `config` shape. + * + */ +export declare class ListAccountsCommand extends $Command { + readonly input: ListAccountsCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListAccountsCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: SSOClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/commands/LogoutCommand.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/LogoutCommand.d.ts new file mode 100644 index 0000000000..4faf96d415 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/LogoutCommand.d.ts @@ -0,0 +1,52 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { LogoutRequest } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, SSOClientResolvedConfig } from "../SSOClient"; +export interface LogoutCommandInput extends LogoutRequest { +} +export interface LogoutCommandOutput extends __MetadataBearer { +} +/** + *

Removes the locally stored SSO tokens from the client-side cache and sends an API call to + * the IAM Identity Center service to invalidate the corresponding server-side IAM Identity Center sign in + * session.

+ * + * + *

If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM Identity Center sign in session is + * used to obtain an IAM session, as specified in the corresponding IAM Identity Center permission set. + * More specifically, IAM Identity Center assumes an IAM role in the target account on behalf of the user, + * and the corresponding temporary AWS credentials are returned to the client.

+ * + *

After user logout, any existing IAM role sessions that were created by using IAM Identity Center + * permission sets continue based on the duration configured in the permission set. + * For more information, see User + * authentications in the IAM Identity Center User + * Guide.

+ *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { SSOClient, LogoutCommand } from "@aws-sdk/client-sso"; // ES Modules import + * // const { SSOClient, LogoutCommand } = require("@aws-sdk/client-sso"); // CommonJS import + * const client = new SSOClient(config); + * const command = new LogoutCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link LogoutCommandInput} for command's `input` shape. + * @see {@link LogoutCommandOutput} for command's `response` shape. + * @see {@link SSOClientResolvedConfig | config} for SSOClient's `config` shape. + * + */ +export declare class LogoutCommand extends $Command { + readonly input: LogoutCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: LogoutCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: SSOClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/commands/index.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/index.d.ts new file mode 100644 index 0000000000..0ab890d362 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/commands/index.d.ts @@ -0,0 +1,4 @@ +export * from "./GetRoleCredentialsCommand"; +export * from "./ListAccountRolesCommand"; +export * from "./ListAccountsCommand"; +export * from "./LogoutCommand"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/EndpointParameters.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/EndpointParameters.d.ts new file mode 100644 index 0000000000..fd716b2afe --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/EndpointParameters.d.ts @@ -0,0 +1,19 @@ +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@aws-sdk/types"; +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} +export declare type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; +export declare const resolveClientEndpointParameters: (options: T & ClientInputEndpointParameters) => T & ClientInputEndpointParameters & { + defaultSigningName: string; +}; +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/endpointResolver.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/endpointResolver.d.ts new file mode 100644 index 0000000000..62107b6db3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/endpointResolver.d.ts @@ -0,0 +1,5 @@ +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParameters } from "./EndpointParameters"; +export declare const defaultEndpointResolver: (endpointParams: EndpointParameters, context?: { + logger?: Logger; +}) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/ruleset.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/ruleset.d.ts new file mode 100644 index 0000000000..a822ad761a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/endpoint/ruleset.d.ts @@ -0,0 +1,2 @@ +import { RuleSetObject } from "@aws-sdk/util-endpoints"; +export declare const ruleSet: RuleSetObject; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/index.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/index.d.ts new file mode 100644 index 0000000000..26389df911 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/index.d.ts @@ -0,0 +1,6 @@ +export * from "./SSO"; +export * from "./SSOClient"; +export * from "./commands"; +export * from "./models"; +export * from "./pagination"; +export { SSOServiceException } from "./models/SSOServiceException"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/models/SSOServiceException.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/models/SSOServiceException.d.ts new file mode 100644 index 0000000000..b9dccd19d3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/models/SSOServiceException.d.ts @@ -0,0 +1,10 @@ +import { ServiceException as __ServiceException, ServiceExceptionOptions as __ServiceExceptionOptions } from "@aws-sdk/smithy-client"; +/** + * Base exception class for all service exceptions from SSO service. + */ +export declare class SSOServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions); +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/models/index.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/models/index.d.ts new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/models/index.d.ts @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/models/models_0.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/models/models_0.d.ts new file mode 100644 index 0000000000..e786e2c9eb --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/models/models_0.d.ts @@ -0,0 +1,229 @@ +import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client"; +import { SSOServiceException as __BaseException } from "./SSOServiceException"; +/** + *

Provides information about your AWS account.

+ */ +export interface AccountInfo { + /** + *

The identifier of the AWS account that is assigned to the user.

+ */ + accountId?: string; + /** + *

The display name of the AWS account that is assigned to the user.

+ */ + accountName?: string; + /** + *

The email address of the AWS account that is assigned to the user.

+ */ + emailAddress?: string; +} +export interface GetRoleCredentialsRequest { + /** + *

The friendly name of the role that is assigned to the user.

+ */ + roleName: string | undefined; + /** + *

The identifier for the AWS account that is assigned to the user.

+ */ + accountId: string | undefined; + /** + *

The token issued by the CreateToken API call. For more information, see + * CreateToken in the IAM Identity Center OIDC API Reference Guide.

+ */ + accessToken: string | undefined; +} +/** + *

Provides information about the role credentials that are assigned to the user.

+ */ +export interface RoleCredentials { + /** + *

The identifier used for the temporary security credentials. For more information, see + * Using Temporary Security Credentials to Request Access to AWS Resources in the + * AWS IAM User Guide.

+ */ + accessKeyId?: string; + /** + *

The key that is used to sign the request. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the + * AWS IAM User Guide.

+ */ + secretAccessKey?: string; + /** + *

The token used for temporary credentials. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the + * AWS IAM User Guide.

+ */ + sessionToken?: string; + /** + *

The date on which temporary security credentials expire.

+ */ + expiration?: number; +} +export interface GetRoleCredentialsResponse { + /** + *

The credentials for the role that is assigned to the user.

+ */ + roleCredentials?: RoleCredentials; +} +/** + *

Indicates that a problem occurred with the input to the request. For example, a required + * parameter might be missing or out of range.

+ */ +export declare class InvalidRequestException extends __BaseException { + readonly name: "InvalidRequestException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

The specified resource doesn't exist.

+ */ +export declare class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that the request is being made too frequently and is more than what the server + * can handle.

+ */ +export declare class TooManyRequestsException extends __BaseException { + readonly name: "TooManyRequestsException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

Indicates that the request is not authorized. This can happen due to an invalid access + * token in the request.

+ */ +export declare class UnauthorizedException extends __BaseException { + readonly name: "UnauthorizedException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +export interface ListAccountRolesRequest { + /** + *

The page token from the previous response output when you request subsequent pages.

+ */ + nextToken?: string; + /** + *

The number of items that clients can request per page.

+ */ + maxResults?: number; + /** + *

The token issued by the CreateToken API call. For more information, see + * CreateToken in the IAM Identity Center OIDC API Reference Guide.

+ */ + accessToken: string | undefined; + /** + *

The identifier for the AWS account that is assigned to the user.

+ */ + accountId: string | undefined; +} +/** + *

Provides information about the role that is assigned to the user.

+ */ +export interface RoleInfo { + /** + *

The friendly name of the role that is assigned to the user.

+ */ + roleName?: string; + /** + *

The identifier of the AWS account assigned to the user.

+ */ + accountId?: string; +} +export interface ListAccountRolesResponse { + /** + *

The page token client that is used to retrieve the list of accounts.

+ */ + nextToken?: string; + /** + *

A paginated response with the list of roles and the next token if more results are + * available.

+ */ + roleList?: RoleInfo[]; +} +export interface ListAccountsRequest { + /** + *

(Optional) When requesting subsequent pages, this is the page token from the previous + * response output.

+ */ + nextToken?: string; + /** + *

This is the number of items clients can request per page.

+ */ + maxResults?: number; + /** + *

The token issued by the CreateToken API call. For more information, see + * CreateToken in the IAM Identity Center OIDC API Reference Guide.

+ */ + accessToken: string | undefined; +} +export interface ListAccountsResponse { + /** + *

The page token client that is used to retrieve the list of accounts.

+ */ + nextToken?: string; + /** + *

A paginated response with the list of account information and the next token if more + * results are available.

+ */ + accountList?: AccountInfo[]; +} +export interface LogoutRequest { + /** + *

The token issued by the CreateToken API call. For more information, see + * CreateToken in the IAM Identity Center OIDC API Reference Guide.

+ */ + accessToken: string | undefined; +} +/** + * @internal + */ +export declare const AccountInfoFilterSensitiveLog: (obj: AccountInfo) => any; +/** + * @internal + */ +export declare const GetRoleCredentialsRequestFilterSensitiveLog: (obj: GetRoleCredentialsRequest) => any; +/** + * @internal + */ +export declare const RoleCredentialsFilterSensitiveLog: (obj: RoleCredentials) => any; +/** + * @internal + */ +export declare const GetRoleCredentialsResponseFilterSensitiveLog: (obj: GetRoleCredentialsResponse) => any; +/** + * @internal + */ +export declare const ListAccountRolesRequestFilterSensitiveLog: (obj: ListAccountRolesRequest) => any; +/** + * @internal + */ +export declare const RoleInfoFilterSensitiveLog: (obj: RoleInfo) => any; +/** + * @internal + */ +export declare const ListAccountRolesResponseFilterSensitiveLog: (obj: ListAccountRolesResponse) => any; +/** + * @internal + */ +export declare const ListAccountsRequestFilterSensitiveLog: (obj: ListAccountsRequest) => any; +/** + * @internal + */ +export declare const ListAccountsResponseFilterSensitiveLog: (obj: ListAccountsResponse) => any; +/** + * @internal + */ +export declare const LogoutRequestFilterSensitiveLog: (obj: LogoutRequest) => any; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/Interfaces.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/Interfaces.d.ts new file mode 100644 index 0000000000..2de86d3e13 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/Interfaces.d.ts @@ -0,0 +1,6 @@ +import { PaginationConfiguration } from "@aws-sdk/types"; +import { SSO } from "../SSO"; +import { SSOClient } from "../SSOClient"; +export interface SSOPaginationConfiguration extends PaginationConfiguration { + client: SSO | SSOClient; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/ListAccountRolesPaginator.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/ListAccountRolesPaginator.d.ts new file mode 100644 index 0000000000..2ecc53a6ae --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/ListAccountRolesPaginator.d.ts @@ -0,0 +1,4 @@ +import { Paginator } from "@aws-sdk/types"; +import { ListAccountRolesCommandInput, ListAccountRolesCommandOutput } from "../commands/ListAccountRolesCommand"; +import { SSOPaginationConfiguration } from "./Interfaces"; +export declare function paginateListAccountRoles(config: SSOPaginationConfiguration, input: ListAccountRolesCommandInput, ...additionalArguments: any): Paginator; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/ListAccountsPaginator.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/ListAccountsPaginator.d.ts new file mode 100644 index 0000000000..4f5929d673 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/ListAccountsPaginator.d.ts @@ -0,0 +1,4 @@ +import { Paginator } from "@aws-sdk/types"; +import { ListAccountsCommandInput, ListAccountsCommandOutput } from "../commands/ListAccountsCommand"; +import { SSOPaginationConfiguration } from "./Interfaces"; +export declare function paginateListAccounts(config: SSOPaginationConfiguration, input: ListAccountsCommandInput, ...additionalArguments: any): Paginator; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/index.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/index.d.ts new file mode 100644 index 0000000000..1e7866f7f3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/pagination/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Interfaces"; +export * from "./ListAccountRolesPaginator"; +export * from "./ListAccountsPaginator"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/protocols/Aws_restJson1.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/protocols/Aws_restJson1.d.ts new file mode 100644 index 0000000000..4fb18d321d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/protocols/Aws_restJson1.d.ts @@ -0,0 +1,14 @@ +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { SerdeContext as __SerdeContext } from "@aws-sdk/types"; +import { GetRoleCredentialsCommandInput, GetRoleCredentialsCommandOutput } from "../commands/GetRoleCredentialsCommand"; +import { ListAccountRolesCommandInput, ListAccountRolesCommandOutput } from "../commands/ListAccountRolesCommand"; +import { ListAccountsCommandInput, ListAccountsCommandOutput } from "../commands/ListAccountsCommand"; +import { LogoutCommandInput, LogoutCommandOutput } from "../commands/LogoutCommand"; +export declare const serializeAws_restJson1GetRoleCredentialsCommand: (input: GetRoleCredentialsCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1ListAccountRolesCommand: (input: ListAccountRolesCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1ListAccountsCommand: (input: ListAccountsCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1LogoutCommand: (input: LogoutCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const deserializeAws_restJson1GetRoleCredentialsCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_restJson1ListAccountRolesCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_restJson1ListAccountsCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_restJson1LogoutCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.browser.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.browser.d.ts new file mode 100644 index 0000000000..32b712d25e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.browser.d.ts @@ -0,0 +1,35 @@ +import { FetchHttpHandler as RequestHandler } from "@aws-sdk/fetch-http-handler"; +import { SSOClientConfig } from "./SSOClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: SSOClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: ((string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider) & (string | import("@aws-sdk/types").Provider | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider)) | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.d.ts new file mode 100644 index 0000000000..e161e31e0a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.d.ts @@ -0,0 +1,35 @@ +import { NodeHttpHandler as RequestHandler } from "@aws-sdk/node-http-handler"; +import { SSOClientConfig } from "./SSOClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: SSOClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: ((string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider) & (string | import("@aws-sdk/types").Provider | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider)) | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.native.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.native.d.ts new file mode 100644 index 0000000000..ae7e9c19d3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.native.d.ts @@ -0,0 +1,34 @@ +import { SSOClientConfig } from "./SSOClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: SSOClientConfig) => { + runtime: string; + sha256: import("@aws-sdk/types").HashConstructor; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | import("@aws-sdk/fetch-http-handler").FetchHttpHandler; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + streamCollector: import("@aws-sdk/types").StreamCollector; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + maxAttempts: number | import("@aws-sdk/types").Provider; + retryMode: string | import("@aws-sdk/types").Provider; + logger: import("@aws-sdk/types").Logger; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + serviceId: string; + region: string | import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + defaultsMode: import("@aws-sdk/smithy-client").DefaultsMode | import("@aws-sdk/types").Provider; + endpoint?: string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.shared.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.shared.d.ts new file mode 100644 index 0000000000..d37d387b34 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/runtimeConfig.shared.d.ts @@ -0,0 +1,18 @@ +import { SSOClientConfig } from "./SSOClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: SSOClientConfig) => { + apiVersion: string; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + urlParser: import("@aws-sdk/types").UrlParser; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSO.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSO.d.ts new file mode 100644 index 0000000000..1b14ab9124 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSO.d.ts @@ -0,0 +1,72 @@ +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; +import { + GetRoleCredentialsCommandInput, + GetRoleCredentialsCommandOutput, +} from "./commands/GetRoleCredentialsCommand"; +import { + ListAccountRolesCommandInput, + ListAccountRolesCommandOutput, +} from "./commands/ListAccountRolesCommand"; +import { + ListAccountsCommandInput, + ListAccountsCommandOutput, +} from "./commands/ListAccountsCommand"; +import { + LogoutCommandInput, + LogoutCommandOutput, +} from "./commands/LogoutCommand"; +import { SSOClient } from "./SSOClient"; +export declare class SSO extends SSOClient { + getRoleCredentials( + args: GetRoleCredentialsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getRoleCredentials( + args: GetRoleCredentialsCommandInput, + cb: (err: any, data?: GetRoleCredentialsCommandOutput) => void + ): void; + getRoleCredentials( + args: GetRoleCredentialsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetRoleCredentialsCommandOutput) => void + ): void; + listAccountRoles( + args: ListAccountRolesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listAccountRoles( + args: ListAccountRolesCommandInput, + cb: (err: any, data?: ListAccountRolesCommandOutput) => void + ): void; + listAccountRoles( + args: ListAccountRolesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAccountRolesCommandOutput) => void + ): void; + listAccounts( + args: ListAccountsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listAccounts( + args: ListAccountsCommandInput, + cb: (err: any, data?: ListAccountsCommandOutput) => void + ): void; + listAccounts( + args: ListAccountsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAccountsCommandOutput) => void + ): void; + logout( + args: LogoutCommandInput, + options?: __HttpHandlerOptions + ): Promise; + logout( + args: LogoutCommandInput, + cb: (err: any, data?: LogoutCommandOutput) => void + ): void; + logout( + args: LogoutCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: LogoutCommandOutput) => void + ): void; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSOClient.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSOClient.d.ts new file mode 100644 index 0000000000..f006976c91 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/SSOClient.d.ts @@ -0,0 +1,127 @@ +import { + RegionInputConfig, + RegionResolvedConfig, +} from "@aws-sdk/config-resolver"; +import { + EndpointInputConfig, + EndpointResolvedConfig, +} from "@aws-sdk/middleware-endpoint"; +import { + HostHeaderInputConfig, + HostHeaderResolvedConfig, +} from "@aws-sdk/middleware-host-header"; +import { + RetryInputConfig, + RetryResolvedConfig, +} from "@aws-sdk/middleware-retry"; +import { + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@aws-sdk/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + ChecksumConstructor as __ChecksumConstructor, + Decoder as __Decoder, + Encoder as __Encoder, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@aws-sdk/types"; +import { + GetRoleCredentialsCommandInput, + GetRoleCredentialsCommandOutput, +} from "./commands/GetRoleCredentialsCommand"; +import { + ListAccountRolesCommandInput, + ListAccountRolesCommandOutput, +} from "./commands/ListAccountRolesCommand"; +import { + ListAccountsCommandInput, + ListAccountsCommandOutput, +} from "./commands/ListAccountsCommand"; +import { + LogoutCommandInput, + LogoutCommandOutput, +} from "./commands/LogoutCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, +} from "./endpoint/EndpointParameters"; +export declare type ServiceInputTypes = + | GetRoleCredentialsCommandInput + | ListAccountRolesCommandInput + | ListAccountsCommandInput + | LogoutCommandInput; +export declare type ServiceOutputTypes = + | GetRoleCredentialsCommandOutput + | ListAccountRolesCommandOutput + | ListAccountsCommandOutput + | LogoutCommandOutput; +export interface ClientDefaults + extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + requestHandler?: __HttpHandler; + sha256?: __ChecksumConstructor | __HashConstructor; + urlParser?: __UrlParser; + bodyLengthChecker?: __BodyLengthCalculator; + streamCollector?: __StreamCollector; + base64Decoder?: __Decoder; + base64Encoder?: __Encoder; + utf8Decoder?: __Decoder; + utf8Encoder?: __Encoder; + runtime?: string; + disableHostPrefix?: boolean; + maxAttempts?: number | __Provider; + retryMode?: string | __Provider; + logger?: __Logger; + useDualstackEndpoint?: boolean | __Provider; + useFipsEndpoint?: boolean | __Provider; + serviceId?: string; + region?: string | __Provider; + defaultUserAgentProvider?: Provider<__UserAgent>; + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} +declare type SSOClientConfigType = Partial< + __SmithyConfiguration<__HttpHandlerOptions> +> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + UserAgentInputConfig & + ClientInputEndpointParameters; +export interface SSOClientConfig extends SSOClientConfigType {} +declare type SSOClientResolvedConfigType = + __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + UserAgentResolvedConfig & + ClientResolvedEndpointParameters; +export interface SSOClientResolvedConfig extends SSOClientResolvedConfigType {} +export declare class SSOClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + SSOClientResolvedConfig +> { + readonly config: SSOClientResolvedConfig; + constructor(configuration: SSOClientConfig); + destroy(): void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/GetRoleCredentialsCommand.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/GetRoleCredentialsCommand.d.ts new file mode 100644 index 0000000000..1284388e6a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/GetRoleCredentialsCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + GetRoleCredentialsRequest, + GetRoleCredentialsResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + SSOClientResolvedConfig, +} from "../SSOClient"; +export interface GetRoleCredentialsCommandInput + extends GetRoleCredentialsRequest {} +export interface GetRoleCredentialsCommandOutput + extends GetRoleCredentialsResponse, + __MetadataBearer {} +export declare class GetRoleCredentialsCommand extends $Command< + GetRoleCredentialsCommandInput, + GetRoleCredentialsCommandOutput, + SSOClientResolvedConfig +> { + readonly input: GetRoleCredentialsCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetRoleCredentialsCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: SSOClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/ListAccountRolesCommand.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/ListAccountRolesCommand.d.ts new file mode 100644 index 0000000000..88079fae04 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/ListAccountRolesCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + ListAccountRolesRequest, + ListAccountRolesResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + SSOClientResolvedConfig, +} from "../SSOClient"; +export interface ListAccountRolesCommandInput extends ListAccountRolesRequest {} +export interface ListAccountRolesCommandOutput + extends ListAccountRolesResponse, + __MetadataBearer {} +export declare class ListAccountRolesCommand extends $Command< + ListAccountRolesCommandInput, + ListAccountRolesCommandOutput, + SSOClientResolvedConfig +> { + readonly input: ListAccountRolesCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListAccountRolesCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: SSOClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/ListAccountsCommand.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/ListAccountsCommand.d.ts new file mode 100644 index 0000000000..1dce103b4d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/ListAccountsCommand.d.ts @@ -0,0 +1,34 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { ListAccountsRequest, ListAccountsResponse } from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + SSOClientResolvedConfig, +} from "../SSOClient"; +export interface ListAccountsCommandInput extends ListAccountsRequest {} +export interface ListAccountsCommandOutput + extends ListAccountsResponse, + __MetadataBearer {} +export declare class ListAccountsCommand extends $Command< + ListAccountsCommandInput, + ListAccountsCommandOutput, + SSOClientResolvedConfig +> { + readonly input: ListAccountsCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: ListAccountsCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: SSOClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/LogoutCommand.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/LogoutCommand.d.ts new file mode 100644 index 0000000000..e500d6d276 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/LogoutCommand.d.ts @@ -0,0 +1,32 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { LogoutRequest } from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + SSOClientResolvedConfig, +} from "../SSOClient"; +export interface LogoutCommandInput extends LogoutRequest {} +export interface LogoutCommandOutput extends __MetadataBearer {} +export declare class LogoutCommand extends $Command< + LogoutCommandInput, + LogoutCommandOutput, + SSOClientResolvedConfig +> { + readonly input: LogoutCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: LogoutCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: SSOClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/index.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/index.d.ts new file mode 100644 index 0000000000..0ab890d362 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/commands/index.d.ts @@ -0,0 +1,4 @@ +export * from "./GetRoleCredentialsCommand"; +export * from "./ListAccountRolesCommand"; +export * from "./ListAccountsCommand"; +export * from "./LogoutCommand"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/EndpointParameters.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/EndpointParameters.d.ts new file mode 100644 index 0000000000..07bea1ea11 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/EndpointParameters.d.ts @@ -0,0 +1,34 @@ +import { + Endpoint, + EndpointParameters as __EndpointParameters, + EndpointV2, + Provider, +} from "@aws-sdk/types"; +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: + | string + | Provider + | Endpoint + | Provider + | EndpointV2 + | Provider; +} +export declare type ClientResolvedEndpointParameters = + ClientInputEndpointParameters & { + defaultSigningName: string; + }; +export declare const resolveClientEndpointParameters: ( + options: T & ClientInputEndpointParameters +) => T & + ClientInputEndpointParameters & { + defaultSigningName: string; + }; +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/endpointResolver.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/endpointResolver.d.ts new file mode 100644 index 0000000000..4c971a7f41 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/endpointResolver.d.ts @@ -0,0 +1,8 @@ +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParameters } from "./EndpointParameters"; +export declare const defaultEndpointResolver: ( + endpointParams: EndpointParameters, + context?: { + logger?: Logger; + } +) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/ruleset.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/ruleset.d.ts new file mode 100644 index 0000000000..a822ad761a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/endpoint/ruleset.d.ts @@ -0,0 +1,2 @@ +import { RuleSetObject } from "@aws-sdk/util-endpoints"; +export declare const ruleSet: RuleSetObject; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..26389df911 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/index.d.ts @@ -0,0 +1,6 @@ +export * from "./SSO"; +export * from "./SSOClient"; +export * from "./commands"; +export * from "./models"; +export * from "./pagination"; +export { SSOServiceException } from "./models/SSOServiceException"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/SSOServiceException.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/SSOServiceException.d.ts new file mode 100644 index 0000000000..6b2e544246 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/SSOServiceException.d.ts @@ -0,0 +1,7 @@ +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@aws-sdk/smithy-client"; +export declare class SSOServiceException extends __ServiceException { + constructor(options: __ServiceExceptionOptions); +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/index.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/index.d.ts new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/index.d.ts @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/models_0.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/models_0.d.ts new file mode 100644 index 0000000000..d55bddd986 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/models/models_0.d.ts @@ -0,0 +1,101 @@ +import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client"; +import { SSOServiceException as __BaseException } from "./SSOServiceException"; +export interface AccountInfo { + accountId?: string; + accountName?: string; + emailAddress?: string; +} +export interface GetRoleCredentialsRequest { + roleName: string | undefined; + accountId: string | undefined; + accessToken: string | undefined; +} +export interface RoleCredentials { + accessKeyId?: string; + secretAccessKey?: string; + sessionToken?: string; + expiration?: number; +} +export interface GetRoleCredentialsResponse { + roleCredentials?: RoleCredentials; +} +export declare class InvalidRequestException extends __BaseException { + readonly name: "InvalidRequestException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class TooManyRequestsException extends __BaseException { + readonly name: "TooManyRequestsException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class UnauthorizedException extends __BaseException { + readonly name: "UnauthorizedException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export interface ListAccountRolesRequest { + nextToken?: string; + maxResults?: number; + accessToken: string | undefined; + accountId: string | undefined; +} +export interface RoleInfo { + roleName?: string; + accountId?: string; +} +export interface ListAccountRolesResponse { + nextToken?: string; + roleList?: RoleInfo[]; +} +export interface ListAccountsRequest { + nextToken?: string; + maxResults?: number; + accessToken: string | undefined; +} +export interface ListAccountsResponse { + nextToken?: string; + accountList?: AccountInfo[]; +} +export interface LogoutRequest { + accessToken: string | undefined; +} +export declare const AccountInfoFilterSensitiveLog: (obj: AccountInfo) => any; +export declare const GetRoleCredentialsRequestFilterSensitiveLog: ( + obj: GetRoleCredentialsRequest +) => any; +export declare const RoleCredentialsFilterSensitiveLog: ( + obj: RoleCredentials +) => any; +export declare const GetRoleCredentialsResponseFilterSensitiveLog: ( + obj: GetRoleCredentialsResponse +) => any; +export declare const ListAccountRolesRequestFilterSensitiveLog: ( + obj: ListAccountRolesRequest +) => any; +export declare const RoleInfoFilterSensitiveLog: (obj: RoleInfo) => any; +export declare const ListAccountRolesResponseFilterSensitiveLog: ( + obj: ListAccountRolesResponse +) => any; +export declare const ListAccountsRequestFilterSensitiveLog: ( + obj: ListAccountsRequest +) => any; +export declare const ListAccountsResponseFilterSensitiveLog: ( + obj: ListAccountsResponse +) => any; +export declare const LogoutRequestFilterSensitiveLog: ( + obj: LogoutRequest +) => any; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/Interfaces.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/Interfaces.d.ts new file mode 100644 index 0000000000..8ef1fecc01 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/Interfaces.d.ts @@ -0,0 +1,6 @@ +import { PaginationConfiguration } from "@aws-sdk/types"; +import { SSO } from "../SSO"; +import { SSOClient } from "../SSOClient"; +export interface SSOPaginationConfiguration extends PaginationConfiguration { + client: SSO | SSOClient; +} diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/ListAccountRolesPaginator.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/ListAccountRolesPaginator.d.ts new file mode 100644 index 0000000000..b67f306db9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/ListAccountRolesPaginator.d.ts @@ -0,0 +1,11 @@ +import { Paginator } from "@aws-sdk/types"; +import { + ListAccountRolesCommandInput, + ListAccountRolesCommandOutput, +} from "../commands/ListAccountRolesCommand"; +import { SSOPaginationConfiguration } from "./Interfaces"; +export declare function paginateListAccountRoles( + config: SSOPaginationConfiguration, + input: ListAccountRolesCommandInput, + ...additionalArguments: any +): Paginator; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/ListAccountsPaginator.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/ListAccountsPaginator.d.ts new file mode 100644 index 0000000000..86d942b59f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/ListAccountsPaginator.d.ts @@ -0,0 +1,11 @@ +import { Paginator } from "@aws-sdk/types"; +import { + ListAccountsCommandInput, + ListAccountsCommandOutput, +} from "../commands/ListAccountsCommand"; +import { SSOPaginationConfiguration } from "./Interfaces"; +export declare function paginateListAccounts( + config: SSOPaginationConfiguration, + input: ListAccountsCommandInput, + ...additionalArguments: any +): Paginator; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/index.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/index.d.ts new file mode 100644 index 0000000000..1e7866f7f3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/pagination/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Interfaces"; +export * from "./ListAccountRolesPaginator"; +export * from "./ListAccountsPaginator"; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/protocols/Aws_restJson1.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/protocols/Aws_restJson1.d.ts new file mode 100644 index 0000000000..9bc3c135a9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/protocols/Aws_restJson1.d.ts @@ -0,0 +1,53 @@ +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, +} from "@aws-sdk/protocol-http"; +import { SerdeContext as __SerdeContext } from "@aws-sdk/types"; +import { + GetRoleCredentialsCommandInput, + GetRoleCredentialsCommandOutput, +} from "../commands/GetRoleCredentialsCommand"; +import { + ListAccountRolesCommandInput, + ListAccountRolesCommandOutput, +} from "../commands/ListAccountRolesCommand"; +import { + ListAccountsCommandInput, + ListAccountsCommandOutput, +} from "../commands/ListAccountsCommand"; +import { + LogoutCommandInput, + LogoutCommandOutput, +} from "../commands/LogoutCommand"; +export declare const serializeAws_restJson1GetRoleCredentialsCommand: ( + input: GetRoleCredentialsCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1ListAccountRolesCommand: ( + input: ListAccountRolesCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1ListAccountsCommand: ( + input: ListAccountsCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_restJson1LogoutCommand: ( + input: LogoutCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const deserializeAws_restJson1GetRoleCredentialsCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_restJson1ListAccountRolesCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_restJson1ListAccountsCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_restJson1LogoutCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.browser.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.browser.d.ts new file mode 100644 index 0000000000..6606898723 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.browser.d.ts @@ -0,0 +1,67 @@ +import { FetchHttpHandler as RequestHandler } from "@aws-sdk/fetch-http-handler"; +import { SSOClientConfig } from "./SSOClient"; +export declare const getRuntimeConfig: (config: SSOClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").ResolvedDefaultsMode + >; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: + | (( + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + ) & + ( + | string + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").EndpointV2 + > + )) + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.d.ts new file mode 100644 index 0000000000..fc6a3bbb36 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.d.ts @@ -0,0 +1,67 @@ +import { NodeHttpHandler as RequestHandler } from "@aws-sdk/node-http-handler"; +import { SSOClientConfig } from "./SSOClient"; +export declare const getRuntimeConfig: (config: SSOClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").ResolvedDefaultsMode + >; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: + | (( + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + ) & + ( + | string + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").EndpointV2 + > + )) + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.native.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.native.d.ts new file mode 100644 index 0000000000..8b972d4ec8 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.native.d.ts @@ -0,0 +1,56 @@ +import { SSOClientConfig } from "./SSOClient"; +export declare const getRuntimeConfig: (config: SSOClientConfig) => { + runtime: string; + sha256: import("@aws-sdk/types").HashConstructor; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | import("@aws-sdk/fetch-http-handler").FetchHttpHandler; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + streamCollector: import("@aws-sdk/types").StreamCollector; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + maxAttempts: number | import("@aws-sdk/types").Provider; + retryMode: string | import("@aws-sdk/types").Provider; + logger: import("@aws-sdk/types").Logger; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + serviceId: string; + region: string | import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + defaultsMode: + | import("@aws-sdk/smithy-client").DefaultsMode + | import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").DefaultsMode + >; + endpoint?: + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.shared.d.ts b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.shared.d.ts new file mode 100644 index 0000000000..467b8fadaf --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/dist-types/ts3.4/runtimeConfig.shared.d.ts @@ -0,0 +1,18 @@ +import { SSOClientConfig } from "./SSOClient"; +export declare const getRuntimeConfig: (config: SSOClientConfig) => { + apiVersion: string; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + urlParser: import("@aws-sdk/types").UrlParser; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; +}; diff --git a/server/node_modules/@aws-sdk/client-sso/package.json b/server/node_modules/@aws-sdk/client-sso/package.json new file mode 100644 index 0000000000..cf7d104f3e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sso/package.json @@ -0,0 +1,99 @@ +{ + "name": "@aws-sdk/client-sso", + "description": "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", + "version": "3.264.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:docs": "typedoc", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "generate:client": "node ../../scripts/generate-clients/single-service --solo sso" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/fetch-http-handler": "3.257.0", + "@aws-sdk/hash-node": "3.257.0", + "@aws-sdk/invalid-dependency": "3.257.0", + "@aws-sdk/middleware-content-length": "3.257.0", + "@aws-sdk/middleware-endpoint": "3.264.0", + "@aws-sdk/middleware-host-header": "3.257.0", + "@aws-sdk/middleware-logger": "3.257.0", + "@aws-sdk/middleware-recursion-detection": "3.257.0", + "@aws-sdk/middleware-retry": "3.259.0", + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/middleware-user-agent": "3.257.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/node-http-handler": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/smithy-client": "3.261.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.261.0", + "@aws-sdk/util-defaults-mode-node": "3.261.0", + "@aws-sdk/util-endpoints": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "@aws-sdk/util-user-agent-browser": "3.257.0", + "@aws-sdk/util-user-agent-node": "3.259.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/service-client-documentation-generator": "3.208.0", + "@tsconfig/node14": "1.0.3", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "overrides": { + "typedoc": { + "typescript": "~4.6.2" + } + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-sso" + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/LICENSE b/server/node_modules/@aws-sdk/client-sts/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/client-sts/README.md b/server/node_modules/@aws-sdk/client-sts/README.md new file mode 100644 index 0000000000..85a734f8ac --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/README.md @@ -0,0 +1,210 @@ + + +# @aws-sdk/client-sts + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sts/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sts) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sts.svg)](https://www.npmjs.com/package/@aws-sdk/client-sts) + +## Description + +AWS SDK for JavaScript STS Client for Node.js, Browser and React Native. + +Security Token Service + +

Security Token Service (STS) enables you to request temporary, limited-privilege +credentials for Identity and Access Management (IAM) users or for users that you +authenticate (federated users). This guide provides descriptions of the STS API. For +more information about using this service, see Temporary Security Credentials.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sts +using your favorite package manager: + +- `npm install @aws-sdk/client-sts` +- `yarn add @aws-sdk/client-sts` +- `pnpm add @aws-sdk/client-sts` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `STSClient` and +the commands you need, for example `AssumeRoleCommand`: + +```js +// ES5 example +const { STSClient, AssumeRoleCommand } = require("@aws-sdk/client-sts"); +``` + +```ts +// ES6+ example +import { STSClient, AssumeRoleCommand } from "@aws-sdk/client-sts"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new STSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssumeRoleCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sts"; +const client = new AWS.STS({ region: "REGION" }); + +// async/await. +try { + const data = await client.assumeRole(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .assumeRole(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.assumeRole(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sts` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/STS.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/STS.js new file mode 100644 index 0000000000..5cc6dda06c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/STS.js @@ -0,0 +1,127 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.STS = void 0; +const AssumeRoleCommand_1 = require("./commands/AssumeRoleCommand"); +const AssumeRoleWithSAMLCommand_1 = require("./commands/AssumeRoleWithSAMLCommand"); +const AssumeRoleWithWebIdentityCommand_1 = require("./commands/AssumeRoleWithWebIdentityCommand"); +const DecodeAuthorizationMessageCommand_1 = require("./commands/DecodeAuthorizationMessageCommand"); +const GetAccessKeyInfoCommand_1 = require("./commands/GetAccessKeyInfoCommand"); +const GetCallerIdentityCommand_1 = require("./commands/GetCallerIdentityCommand"); +const GetFederationTokenCommand_1 = require("./commands/GetFederationTokenCommand"); +const GetSessionTokenCommand_1 = require("./commands/GetSessionTokenCommand"); +const STSClient_1 = require("./STSClient"); +class STS extends STSClient_1.STSClient { + assumeRole(args, optionsOrCb, cb) { + const command = new AssumeRoleCommand_1.AssumeRoleCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + assumeRoleWithSAML(args, optionsOrCb, cb) { + const command = new AssumeRoleWithSAMLCommand_1.AssumeRoleWithSAMLCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + assumeRoleWithWebIdentity(args, optionsOrCb, cb) { + const command = new AssumeRoleWithWebIdentityCommand_1.AssumeRoleWithWebIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + decodeAuthorizationMessage(args, optionsOrCb, cb) { + const command = new DecodeAuthorizationMessageCommand_1.DecodeAuthorizationMessageCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getAccessKeyInfo(args, optionsOrCb, cb) { + const command = new GetAccessKeyInfoCommand_1.GetAccessKeyInfoCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getCallerIdentity(args, optionsOrCb, cb) { + const command = new GetCallerIdentityCommand_1.GetCallerIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getFederationToken(args, optionsOrCb, cb) { + const command = new GetFederationTokenCommand_1.GetFederationTokenCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getSessionToken(args, optionsOrCb, cb) { + const command = new GetSessionTokenCommand_1.GetSessionTokenCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } +} +exports.STS = STS; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js new file mode 100644 index 0000000000..28e0f14a1d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.STSClient = void 0; +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const middleware_content_length_1 = require("@aws-sdk/middleware-content-length"); +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_host_header_1 = require("@aws-sdk/middleware-host-header"); +const middleware_logger_1 = require("@aws-sdk/middleware-logger"); +const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection"); +const middleware_retry_1 = require("@aws-sdk/middleware-retry"); +const middleware_sdk_sts_1 = require("@aws-sdk/middleware-sdk-sts"); +const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const EndpointParameters_1 = require("./endpoint/EndpointParameters"); +const runtimeConfig_1 = require("./runtimeConfig"); +class STSClient extends smithy_client_1.Client { + constructor(configuration) { + const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration); + const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); + const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); + const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); + const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); + const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, middleware_sdk_sts_1.resolveStsAuthConfig)(_config_5, { stsClientCtor: STSClient }); + const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6); + super(_config_7); + this.config = _config_7; + this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); + } + destroy() { + super.destroy(); + } +} +exports.STSClient = STSClient; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleCommand.js new file mode 100644 index 0000000000..0a50a32c1a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleCommand.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssumeRoleCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_query_1 = require("../protocols/Aws_query"); +class AssumeRoleCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, AssumeRoleCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "AssumeRoleCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.AssumeRoleRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.AssumeRoleResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_query_1.serializeAws_queryAssumeRoleCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_query_1.deserializeAws_queryAssumeRoleCommand)(output, context); + } +} +exports.AssumeRoleCommand = AssumeRoleCommand; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleWithSAMLCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleWithSAMLCommand.js new file mode 100644 index 0000000000..847eae009f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleWithSAMLCommand.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssumeRoleWithSAMLCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_query_1 = require("../protocols/Aws_query"); +class AssumeRoleWithSAMLCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, AssumeRoleWithSAMLCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "AssumeRoleWithSAMLCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.AssumeRoleWithSAMLRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.AssumeRoleWithSAMLResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_query_1.serializeAws_queryAssumeRoleWithSAMLCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_query_1.deserializeAws_queryAssumeRoleWithSAMLCommand)(output, context); + } +} +exports.AssumeRoleWithSAMLCommand = AssumeRoleWithSAMLCommand; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleWithWebIdentityCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleWithWebIdentityCommand.js new file mode 100644 index 0000000000..1aa6545f2c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/AssumeRoleWithWebIdentityCommand.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssumeRoleWithWebIdentityCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_query_1 = require("../protocols/Aws_query"); +class AssumeRoleWithWebIdentityCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, AssumeRoleWithWebIdentityCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "AssumeRoleWithWebIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.AssumeRoleWithWebIdentityRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.AssumeRoleWithWebIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_query_1.serializeAws_queryAssumeRoleWithWebIdentityCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_query_1.deserializeAws_queryAssumeRoleWithWebIdentityCommand)(output, context); + } +} +exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/DecodeAuthorizationMessageCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/DecodeAuthorizationMessageCommand.js new file mode 100644 index 0000000000..5924bf52a2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/DecodeAuthorizationMessageCommand.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DecodeAuthorizationMessageCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_query_1 = require("../protocols/Aws_query"); +class DecodeAuthorizationMessageCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DecodeAuthorizationMessageCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "DecodeAuthorizationMessageCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.DecodeAuthorizationMessageRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.DecodeAuthorizationMessageResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_query_1.serializeAws_queryDecodeAuthorizationMessageCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_query_1.deserializeAws_queryDecodeAuthorizationMessageCommand)(output, context); + } +} +exports.DecodeAuthorizationMessageCommand = DecodeAuthorizationMessageCommand; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetAccessKeyInfoCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetAccessKeyInfoCommand.js new file mode 100644 index 0000000000..4c109f7169 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetAccessKeyInfoCommand.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetAccessKeyInfoCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_query_1 = require("../protocols/Aws_query"); +class GetAccessKeyInfoCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetAccessKeyInfoCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "GetAccessKeyInfoCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetAccessKeyInfoRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetAccessKeyInfoResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_query_1.serializeAws_queryGetAccessKeyInfoCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_query_1.deserializeAws_queryGetAccessKeyInfoCommand)(output, context); + } +} +exports.GetAccessKeyInfoCommand = GetAccessKeyInfoCommand; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetCallerIdentityCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetCallerIdentityCommand.js new file mode 100644 index 0000000000..1458613429 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetCallerIdentityCommand.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetCallerIdentityCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_query_1 = require("../protocols/Aws_query"); +class GetCallerIdentityCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetCallerIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "GetCallerIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetCallerIdentityRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetCallerIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_query_1.serializeAws_queryGetCallerIdentityCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_query_1.deserializeAws_queryGetCallerIdentityCommand)(output, context); + } +} +exports.GetCallerIdentityCommand = GetCallerIdentityCommand; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetFederationTokenCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetFederationTokenCommand.js new file mode 100644 index 0000000000..3ab969efd2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetFederationTokenCommand.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetFederationTokenCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_query_1 = require("../protocols/Aws_query"); +class GetFederationTokenCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetFederationTokenCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "GetFederationTokenCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetFederationTokenRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetFederationTokenResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_query_1.serializeAws_queryGetFederationTokenCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_query_1.deserializeAws_queryGetFederationTokenCommand)(output, context); + } +} +exports.GetFederationTokenCommand = GetFederationTokenCommand; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetSessionTokenCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetSessionTokenCommand.js new file mode 100644 index 0000000000..fe26e705b4 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/GetSessionTokenCommand.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetSessionTokenCommand = void 0; +const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint"); +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const models_0_1 = require("../models/models_0"); +const Aws_query_1 = require("../protocols/Aws_query"); +class GetSessionTokenCommand extends smithy_client_1.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetSessionTokenCommand.getEndpointParameterInstructions())); + this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "GetSessionTokenCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: models_0_1.GetSessionTokenRequestFilterSensitiveLog, + outputFilterSensitiveLog: models_0_1.GetSessionTokenResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return (0, Aws_query_1.serializeAws_queryGetSessionTokenCommand)(input, context); + } + deserialize(output, context) { + return (0, Aws_query_1.deserializeAws_queryGetSessionTokenCommand)(output, context); + } +} +exports.GetSessionTokenCommand = GetSessionTokenCommand; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/index.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/index.js new file mode 100644 index 0000000000..f2bea9d207 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/commands/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./AssumeRoleCommand"), exports); +tslib_1.__exportStar(require("./AssumeRoleWithSAMLCommand"), exports); +tslib_1.__exportStar(require("./AssumeRoleWithWebIdentityCommand"), exports); +tslib_1.__exportStar(require("./DecodeAuthorizationMessageCommand"), exports); +tslib_1.__exportStar(require("./GetAccessKeyInfoCommand"), exports); +tslib_1.__exportStar(require("./GetCallerIdentityCommand"), exports); +tslib_1.__exportStar(require("./GetFederationTokenCommand"), exports); +tslib_1.__exportStar(require("./GetSessionTokenCommand"), exports); diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/defaultRoleAssumers.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/defaultRoleAssumers.js new file mode 100644 index 0000000000..c99813b5b3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/defaultRoleAssumers.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decorateDefaultCredentialProvider = exports.getDefaultRoleAssumerWithWebIdentity = exports.getDefaultRoleAssumer = void 0; +const defaultStsRoleAssumers_1 = require("./defaultStsRoleAssumers"); +const STSClient_1 = require("./STSClient"); +const getCustomizableStsClientCtor = (baseCtor, customizations) => { + if (!customizations) + return baseCtor; + else + return class CustomizableSTSClient extends baseCtor { + constructor(config) { + super(config); + for (const customization of customizations) { + this.middlewareStack.use(customization); + } + } + }; +}; +const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => (0, defaultStsRoleAssumers_1.getDefaultRoleAssumer)(stsOptions, getCustomizableStsClientCtor(STSClient_1.STSClient, stsPlugins)); +exports.getDefaultRoleAssumer = getDefaultRoleAssumer; +const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => (0, defaultStsRoleAssumers_1.getDefaultRoleAssumerWithWebIdentity)(stsOptions, getCustomizableStsClientCtor(STSClient_1.STSClient, stsPlugins)); +exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity; +const decorateDefaultCredentialProvider = (provider) => (input) => provider({ + roleAssumer: (0, exports.getDefaultRoleAssumer)(input), + roleAssumerWithWebIdentity: (0, exports.getDefaultRoleAssumerWithWebIdentity)(input), + ...input, +}); +exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/defaultStsRoleAssumers.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/defaultStsRoleAssumers.js new file mode 100644 index 0000000000..186e9ad8f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/defaultStsRoleAssumers.js @@ -0,0 +1,76 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decorateDefaultCredentialProvider = exports.getDefaultRoleAssumerWithWebIdentity = exports.getDefaultRoleAssumer = void 0; +const AssumeRoleCommand_1 = require("./commands/AssumeRoleCommand"); +const AssumeRoleWithWebIdentityCommand_1 = require("./commands/AssumeRoleWithWebIdentityCommand"); +const ASSUME_ROLE_DEFAULT_REGION = "us-east-1"; +const decorateDefaultRegion = (region) => { + if (typeof region !== "function") { + return region === undefined ? ASSUME_ROLE_DEFAULT_REGION : region; + } + return async () => { + try { + return await region(); + } + catch (e) { + return ASSUME_ROLE_DEFAULT_REGION; + } + }; +}; +const getDefaultRoleAssumer = (stsOptions, stsClientCtor) => { + let stsClient; + let closureSourceCreds; + return async (sourceCreds, params) => { + closureSourceCreds = sourceCreds; + if (!stsClient) { + const { logger, region, requestHandler } = stsOptions; + stsClient = new stsClientCtor({ + logger, + credentialDefaultProvider: () => async () => closureSourceCreds, + region: decorateDefaultRegion(region || stsOptions.region), + ...(requestHandler ? { requestHandler } : {}), + }); + } + const { Credentials } = await stsClient.send(new AssumeRoleCommand_1.AssumeRoleCommand(params)); + if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { + throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); + } + return { + accessKeyId: Credentials.AccessKeyId, + secretAccessKey: Credentials.SecretAccessKey, + sessionToken: Credentials.SessionToken, + expiration: Credentials.Expiration, + }; + }; +}; +exports.getDefaultRoleAssumer = getDefaultRoleAssumer; +const getDefaultRoleAssumerWithWebIdentity = (stsOptions, stsClientCtor) => { + let stsClient; + return async (params) => { + if (!stsClient) { + const { logger, region, requestHandler } = stsOptions; + stsClient = new stsClientCtor({ + logger, + region: decorateDefaultRegion(region || stsOptions.region), + ...(requestHandler ? { requestHandler } : {}), + }); + } + const { Credentials } = await stsClient.send(new AssumeRoleWithWebIdentityCommand_1.AssumeRoleWithWebIdentityCommand(params)); + if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { + throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`); + } + return { + accessKeyId: Credentials.AccessKeyId, + secretAccessKey: Credentials.SecretAccessKey, + sessionToken: Credentials.SessionToken, + expiration: Credentials.Expiration, + }; + }; +}; +exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity; +const decorateDefaultCredentialProvider = (provider) => (input) => provider({ + roleAssumer: (0, exports.getDefaultRoleAssumer)(input, input.stsClientCtor), + roleAssumerWithWebIdentity: (0, exports.getDefaultRoleAssumerWithWebIdentity)(input, input.stsClientCtor), + ...input, +}); +exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js new file mode 100644 index 0000000000..20ed973b8b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveClientEndpointParameters = void 0; +const resolveClientEndpointParameters = (options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + useGlobalEndpoint: options.useGlobalEndpoint ?? false, + defaultSigningName: "sts", + }; +}; +exports.resolveClientEndpointParameters = resolveClientEndpointParameters; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js new file mode 100644 index 0000000000..482fab141e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultEndpointResolver = void 0; +const util_endpoints_1 = require("@aws-sdk/util-endpoints"); +const ruleset_1 = require("./ruleset"); +const defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; +exports.defaultEndpointResolver = defaultEndpointResolver; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js new file mode 100644 index 0000000000..1eda306e35 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ruleSet = void 0; +const G = "required", H = "type", I = "fn", J = "argv", K = "ref", L = "properties", M = "headers"; +const a = false, b = true, c = "PartitionResult", d = "tree", e = "booleanEquals", f = "stringEquals", g = "sigv4", h = "us-east-1", i = "sts", j = "endpoint", k = "https://sts.{Region}.{PartitionResult#dnsSuffix}", l = "error", m = "getAttr", n = { [G]: false, [H]: "String" }, o = { [G]: true, "default": false, [H]: "Boolean" }, p = { [K]: "Region" }, q = { [K]: "UseFIPS" }, r = { [K]: "UseDualStack" }, s = { [I]: "isSet", [J]: [{ [K]: "Endpoint" }] }, t = { [K]: "Endpoint" }, u = { "url": "https://sts.amazonaws.com", [L]: { "authSchemes": [{ "name": g, "signingRegion": h, "signingName": i }] }, [M]: {} }, v = {}, w = { "conditions": [{ [I]: f, [J]: [p, "aws-global"] }], [j]: u, [H]: j }, x = { [I]: e, [J]: [q, true] }, y = { [I]: e, [J]: [r, true] }, z = { [I]: e, [J]: [true, { [I]: m, [J]: [{ [K]: c }, "supportsFIPS"] }] }, A = { [K]: c }, B = { [I]: e, [J]: [true, { [I]: m, [J]: [A, "supportsDualStack"] }] }, C = { "url": k, [L]: {}, [M]: {} }, D = [t], E = [x], F = [y]; +const _data = { version: "1.0", parameters: { Region: n, UseDualStack: o, UseFIPS: o, Endpoint: n, UseGlobalEndpoint: o }, rules: [{ conditions: [{ [I]: "aws.partition", [J]: [p], assign: c }], [H]: d, rules: [{ conditions: [{ [I]: e, [J]: [{ [K]: "UseGlobalEndpoint" }, b] }, { [I]: e, [J]: [q, a] }, { [I]: e, [J]: [r, a] }, { [I]: "not", [J]: [s] }], [H]: d, rules: [{ conditions: [{ [I]: f, [J]: [p, "ap-northeast-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "ap-south-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "ap-southeast-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "ap-southeast-2"] }], endpoint: u, [H]: j }, w, { conditions: [{ [I]: f, [J]: [p, "ca-central-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-central-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-north-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-west-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-west-2"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-west-3"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "sa-east-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, h] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "us-east-2"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "us-west-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "us-west-2"] }], endpoint: u, [H]: j }, { endpoint: { url: k, [L]: { authSchemes: [{ name: g, signingRegion: "{Region}", signingName: i }] }, [M]: v }, [H]: j }] }, { conditions: [s, { [I]: "parseURL", [J]: D, assign: "url" }], [H]: d, rules: [{ conditions: E, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [H]: l }, { [H]: d, rules: [{ conditions: F, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [H]: l }, { endpoint: { url: t, [L]: v, [M]: v }, [H]: j }] }] }, { conditions: [x, y], [H]: d, rules: [{ conditions: [z, B], [H]: d, rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", [L]: v, [M]: v }, [H]: j }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [H]: l }] }, { conditions: E, [H]: d, rules: [{ conditions: [z], [H]: d, rules: [{ [H]: d, rules: [{ conditions: [{ [I]: f, [J]: ["aws-us-gov", { [I]: m, [J]: [A, "name"] }] }], endpoint: C, [H]: j }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", [L]: v, [M]: v }, [H]: j }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", [H]: l }] }, { conditions: F, [H]: d, rules: [{ conditions: [B], [H]: d, rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", [L]: v, [M]: v }, [H]: j }] }, { error: "DualStack is enabled but this partition does not support DualStack", [H]: l }] }, { [H]: d, rules: [w, { endpoint: C, [H]: j }] }] }] }; +exports.ruleSet = _data; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/index.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/index.js new file mode 100644 index 0000000000..8dfd5519e4 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.STSServiceException = void 0; +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./STS"), exports); +tslib_1.__exportStar(require("./STSClient"), exports); +tslib_1.__exportStar(require("./commands"), exports); +tslib_1.__exportStar(require("./defaultRoleAssumers"), exports); +tslib_1.__exportStar(require("./models"), exports); +var STSServiceException_1 = require("./models/STSServiceException"); +Object.defineProperty(exports, "STSServiceException", { enumerable: true, get: function () { return STSServiceException_1.STSServiceException; } }); diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/models/STSServiceException.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/models/STSServiceException.js new file mode 100644 index 0000000000..d5c19e04c9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/models/STSServiceException.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.STSServiceException = void 0; +const smithy_client_1 = require("@aws-sdk/smithy-client"); +class STSServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, STSServiceException.prototype); + } +} +exports.STSServiceException = STSServiceException; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/models/index.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/models/index.js new file mode 100644 index 0000000000..8ced418bca --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/models/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./models_0"), exports); diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/models/models_0.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/models/models_0.js new file mode 100644 index 0000000000..fbc6ddbcaa --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/models/models_0.js @@ -0,0 +1,192 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetSessionTokenResponseFilterSensitiveLog = exports.GetSessionTokenRequestFilterSensitiveLog = exports.GetFederationTokenResponseFilterSensitiveLog = exports.FederatedUserFilterSensitiveLog = exports.GetFederationTokenRequestFilterSensitiveLog = exports.GetCallerIdentityResponseFilterSensitiveLog = exports.GetCallerIdentityRequestFilterSensitiveLog = exports.GetAccessKeyInfoResponseFilterSensitiveLog = exports.GetAccessKeyInfoRequestFilterSensitiveLog = exports.DecodeAuthorizationMessageResponseFilterSensitiveLog = exports.DecodeAuthorizationMessageRequestFilterSensitiveLog = exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = exports.AssumeRoleWithSAMLResponseFilterSensitiveLog = exports.AssumeRoleWithSAMLRequestFilterSensitiveLog = exports.AssumeRoleResponseFilterSensitiveLog = exports.CredentialsFilterSensitiveLog = exports.AssumeRoleRequestFilterSensitiveLog = exports.TagFilterSensitiveLog = exports.PolicyDescriptorTypeFilterSensitiveLog = exports.AssumedRoleUserFilterSensitiveLog = exports.InvalidAuthorizationMessageException = exports.IDPCommunicationErrorException = exports.InvalidIdentityTokenException = exports.IDPRejectedClaimException = exports.RegionDisabledException = exports.PackedPolicyTooLargeException = exports.MalformedPolicyDocumentException = exports.ExpiredTokenException = void 0; +const STSServiceException_1 = require("./STSServiceException"); +class ExpiredTokenException extends STSServiceException_1.STSServiceException { + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts, + }); + this.name = "ExpiredTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ExpiredTokenException.prototype); + } +} +exports.ExpiredTokenException = ExpiredTokenException; +class MalformedPolicyDocumentException extends STSServiceException_1.STSServiceException { + constructor(opts) { + super({ + name: "MalformedPolicyDocumentException", + $fault: "client", + ...opts, + }); + this.name = "MalformedPolicyDocumentException"; + this.$fault = "client"; + Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype); + } +} +exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException; +class PackedPolicyTooLargeException extends STSServiceException_1.STSServiceException { + constructor(opts) { + super({ + name: "PackedPolicyTooLargeException", + $fault: "client", + ...opts, + }); + this.name = "PackedPolicyTooLargeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype); + } +} +exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException; +class RegionDisabledException extends STSServiceException_1.STSServiceException { + constructor(opts) { + super({ + name: "RegionDisabledException", + $fault: "client", + ...opts, + }); + this.name = "RegionDisabledException"; + this.$fault = "client"; + Object.setPrototypeOf(this, RegionDisabledException.prototype); + } +} +exports.RegionDisabledException = RegionDisabledException; +class IDPRejectedClaimException extends STSServiceException_1.STSServiceException { + constructor(opts) { + super({ + name: "IDPRejectedClaimException", + $fault: "client", + ...opts, + }); + this.name = "IDPRejectedClaimException"; + this.$fault = "client"; + Object.setPrototypeOf(this, IDPRejectedClaimException.prototype); + } +} +exports.IDPRejectedClaimException = IDPRejectedClaimException; +class InvalidIdentityTokenException extends STSServiceException_1.STSServiceException { + constructor(opts) { + super({ + name: "InvalidIdentityTokenException", + $fault: "client", + ...opts, + }); + this.name = "InvalidIdentityTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype); + } +} +exports.InvalidIdentityTokenException = InvalidIdentityTokenException; +class IDPCommunicationErrorException extends STSServiceException_1.STSServiceException { + constructor(opts) { + super({ + name: "IDPCommunicationErrorException", + $fault: "client", + ...opts, + }); + this.name = "IDPCommunicationErrorException"; + this.$fault = "client"; + Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype); + } +} +exports.IDPCommunicationErrorException = IDPCommunicationErrorException; +class InvalidAuthorizationMessageException extends STSServiceException_1.STSServiceException { + constructor(opts) { + super({ + name: "InvalidAuthorizationMessageException", + $fault: "client", + ...opts, + }); + this.name = "InvalidAuthorizationMessageException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidAuthorizationMessageException.prototype); + } +} +exports.InvalidAuthorizationMessageException = InvalidAuthorizationMessageException; +const AssumedRoleUserFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.AssumedRoleUserFilterSensitiveLog = AssumedRoleUserFilterSensitiveLog; +const PolicyDescriptorTypeFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.PolicyDescriptorTypeFilterSensitiveLog = PolicyDescriptorTypeFilterSensitiveLog; +const TagFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.TagFilterSensitiveLog = TagFilterSensitiveLog; +const AssumeRoleRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.AssumeRoleRequestFilterSensitiveLog = AssumeRoleRequestFilterSensitiveLog; +const CredentialsFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.CredentialsFilterSensitiveLog = CredentialsFilterSensitiveLog; +const AssumeRoleResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.AssumeRoleResponseFilterSensitiveLog = AssumeRoleResponseFilterSensitiveLog; +const AssumeRoleWithSAMLRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.AssumeRoleWithSAMLRequestFilterSensitiveLog = AssumeRoleWithSAMLRequestFilterSensitiveLog; +const AssumeRoleWithSAMLResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.AssumeRoleWithSAMLResponseFilterSensitiveLog = AssumeRoleWithSAMLResponseFilterSensitiveLog; +const AssumeRoleWithWebIdentityRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = AssumeRoleWithWebIdentityRequestFilterSensitiveLog; +const AssumeRoleWithWebIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = AssumeRoleWithWebIdentityResponseFilterSensitiveLog; +const DecodeAuthorizationMessageRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.DecodeAuthorizationMessageRequestFilterSensitiveLog = DecodeAuthorizationMessageRequestFilterSensitiveLog; +const DecodeAuthorizationMessageResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.DecodeAuthorizationMessageResponseFilterSensitiveLog = DecodeAuthorizationMessageResponseFilterSensitiveLog; +const GetAccessKeyInfoRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetAccessKeyInfoRequestFilterSensitiveLog = GetAccessKeyInfoRequestFilterSensitiveLog; +const GetAccessKeyInfoResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetAccessKeyInfoResponseFilterSensitiveLog = GetAccessKeyInfoResponseFilterSensitiveLog; +const GetCallerIdentityRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetCallerIdentityRequestFilterSensitiveLog = GetCallerIdentityRequestFilterSensitiveLog; +const GetCallerIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetCallerIdentityResponseFilterSensitiveLog = GetCallerIdentityResponseFilterSensitiveLog; +const GetFederationTokenRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetFederationTokenRequestFilterSensitiveLog = GetFederationTokenRequestFilterSensitiveLog; +const FederatedUserFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.FederatedUserFilterSensitiveLog = FederatedUserFilterSensitiveLog; +const GetFederationTokenResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetFederationTokenResponseFilterSensitiveLog = GetFederationTokenResponseFilterSensitiveLog; +const GetSessionTokenRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetSessionTokenRequestFilterSensitiveLog = GetSessionTokenRequestFilterSensitiveLog; +const GetSessionTokenResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +exports.GetSessionTokenResponseFilterSensitiveLog = GetSessionTokenResponseFilterSensitiveLog; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/protocols/Aws_query.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/protocols/Aws_query.js new file mode 100644 index 0000000000..9c0993ac7b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/protocols/Aws_query.js @@ -0,0 +1,1083 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deserializeAws_queryGetSessionTokenCommand = exports.deserializeAws_queryGetFederationTokenCommand = exports.deserializeAws_queryGetCallerIdentityCommand = exports.deserializeAws_queryGetAccessKeyInfoCommand = exports.deserializeAws_queryDecodeAuthorizationMessageCommand = exports.deserializeAws_queryAssumeRoleWithWebIdentityCommand = exports.deserializeAws_queryAssumeRoleWithSAMLCommand = exports.deserializeAws_queryAssumeRoleCommand = exports.serializeAws_queryGetSessionTokenCommand = exports.serializeAws_queryGetFederationTokenCommand = exports.serializeAws_queryGetCallerIdentityCommand = exports.serializeAws_queryGetAccessKeyInfoCommand = exports.serializeAws_queryDecodeAuthorizationMessageCommand = exports.serializeAws_queryAssumeRoleWithWebIdentityCommand = exports.serializeAws_queryAssumeRoleWithSAMLCommand = exports.serializeAws_queryAssumeRoleCommand = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const fast_xml_parser_1 = require("fast-xml-parser"); +const models_0_1 = require("../models/models_0"); +const STSServiceException_1 = require("../models/STSServiceException"); +const serializeAws_queryAssumeRoleCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryAssumeRoleRequest(input, context), + Action: "AssumeRole", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_queryAssumeRoleCommand = serializeAws_queryAssumeRoleCommand; +const serializeAws_queryAssumeRoleWithSAMLCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryAssumeRoleWithSAMLRequest(input, context), + Action: "AssumeRoleWithSAML", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_queryAssumeRoleWithSAMLCommand = serializeAws_queryAssumeRoleWithSAMLCommand; +const serializeAws_queryAssumeRoleWithWebIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryAssumeRoleWithWebIdentityRequest(input, context), + Action: "AssumeRoleWithWebIdentity", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_queryAssumeRoleWithWebIdentityCommand = serializeAws_queryAssumeRoleWithWebIdentityCommand; +const serializeAws_queryDecodeAuthorizationMessageCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryDecodeAuthorizationMessageRequest(input, context), + Action: "DecodeAuthorizationMessage", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_queryDecodeAuthorizationMessageCommand = serializeAws_queryDecodeAuthorizationMessageCommand; +const serializeAws_queryGetAccessKeyInfoCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryGetAccessKeyInfoRequest(input, context), + Action: "GetAccessKeyInfo", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_queryGetAccessKeyInfoCommand = serializeAws_queryGetAccessKeyInfoCommand; +const serializeAws_queryGetCallerIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryGetCallerIdentityRequest(input, context), + Action: "GetCallerIdentity", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_queryGetCallerIdentityCommand = serializeAws_queryGetCallerIdentityCommand; +const serializeAws_queryGetFederationTokenCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryGetFederationTokenRequest(input, context), + Action: "GetFederationToken", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_queryGetFederationTokenCommand = serializeAws_queryGetFederationTokenCommand; +const serializeAws_queryGetSessionTokenCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryGetSessionTokenRequest(input, context), + Action: "GetSessionToken", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +exports.serializeAws_queryGetSessionTokenCommand = serializeAws_queryGetSessionTokenCommand; +const deserializeAws_queryAssumeRoleCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryAssumeRoleCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryAssumeRoleResponse(data.AssumeRoleResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_queryAssumeRoleCommand = deserializeAws_queryAssumeRoleCommand; +const deserializeAws_queryAssumeRoleCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExpiredTokenException": + case "com.amazonaws.sts#ExpiredTokenException": + throw await deserializeAws_queryExpiredTokenExceptionResponse(parsedOutput, context); + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context); + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: STSServiceException_1.STSServiceException, + errorCode, + }); + } +}; +const deserializeAws_queryAssumeRoleWithSAMLCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryAssumeRoleWithSAMLCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryAssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_queryAssumeRoleWithSAMLCommand = deserializeAws_queryAssumeRoleWithSAMLCommand; +const deserializeAws_queryAssumeRoleWithSAMLCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExpiredTokenException": + case "com.amazonaws.sts#ExpiredTokenException": + throw await deserializeAws_queryExpiredTokenExceptionResponse(parsedOutput, context); + case "IDPRejectedClaim": + case "com.amazonaws.sts#IDPRejectedClaimException": + throw await deserializeAws_queryIDPRejectedClaimExceptionResponse(parsedOutput, context); + case "InvalidIdentityToken": + case "com.amazonaws.sts#InvalidIdentityTokenException": + throw await deserializeAws_queryInvalidIdentityTokenExceptionResponse(parsedOutput, context); + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context); + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: STSServiceException_1.STSServiceException, + errorCode, + }); + } +}; +const deserializeAws_queryAssumeRoleWithWebIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryAssumeRoleWithWebIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryAssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_queryAssumeRoleWithWebIdentityCommand = deserializeAws_queryAssumeRoleWithWebIdentityCommand; +const deserializeAws_queryAssumeRoleWithWebIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExpiredTokenException": + case "com.amazonaws.sts#ExpiredTokenException": + throw await deserializeAws_queryExpiredTokenExceptionResponse(parsedOutput, context); + case "IDPCommunicationError": + case "com.amazonaws.sts#IDPCommunicationErrorException": + throw await deserializeAws_queryIDPCommunicationErrorExceptionResponse(parsedOutput, context); + case "IDPRejectedClaim": + case "com.amazonaws.sts#IDPRejectedClaimException": + throw await deserializeAws_queryIDPRejectedClaimExceptionResponse(parsedOutput, context); + case "InvalidIdentityToken": + case "com.amazonaws.sts#InvalidIdentityTokenException": + throw await deserializeAws_queryInvalidIdentityTokenExceptionResponse(parsedOutput, context); + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context); + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: STSServiceException_1.STSServiceException, + errorCode, + }); + } +}; +const deserializeAws_queryDecodeAuthorizationMessageCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryDecodeAuthorizationMessageCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryDecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_queryDecodeAuthorizationMessageCommand = deserializeAws_queryDecodeAuthorizationMessageCommand; +const deserializeAws_queryDecodeAuthorizationMessageCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidAuthorizationMessageException": + case "com.amazonaws.sts#InvalidAuthorizationMessageException": + throw await deserializeAws_queryInvalidAuthorizationMessageExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: STSServiceException_1.STSServiceException, + errorCode, + }); + } +}; +const deserializeAws_queryGetAccessKeyInfoCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryGetAccessKeyInfoCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryGetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_queryGetAccessKeyInfoCommand = deserializeAws_queryGetAccessKeyInfoCommand; +const deserializeAws_queryGetAccessKeyInfoCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: STSServiceException_1.STSServiceException, + errorCode, + }); +}; +const deserializeAws_queryGetCallerIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryGetCallerIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryGetCallerIdentityResponse(data.GetCallerIdentityResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_queryGetCallerIdentityCommand = deserializeAws_queryGetCallerIdentityCommand; +const deserializeAws_queryGetCallerIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: STSServiceException_1.STSServiceException, + errorCode, + }); +}; +const deserializeAws_queryGetFederationTokenCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryGetFederationTokenCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryGetFederationTokenResponse(data.GetFederationTokenResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_queryGetFederationTokenCommand = deserializeAws_queryGetFederationTokenCommand; +const deserializeAws_queryGetFederationTokenCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context); + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: STSServiceException_1.STSServiceException, + errorCode, + }); + } +}; +const deserializeAws_queryGetSessionTokenCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryGetSessionTokenCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryGetSessionTokenResponse(data.GetSessionTokenResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +exports.deserializeAws_queryGetSessionTokenCommand = deserializeAws_queryGetSessionTokenCommand; +const deserializeAws_queryGetSessionTokenCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + (0, smithy_client_1.throwDefaultError)({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: STSServiceException_1.STSServiceException, + errorCode, + }); + } +}; +const deserializeAws_queryExpiredTokenExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryExpiredTokenException(body.Error, context); + const exception = new models_0_1.ExpiredTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_queryIDPCommunicationErrorExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryIDPCommunicationErrorException(body.Error, context); + const exception = new models_0_1.IDPCommunicationErrorException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_queryIDPRejectedClaimExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryIDPRejectedClaimException(body.Error, context); + const exception = new models_0_1.IDPRejectedClaimException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_queryInvalidAuthorizationMessageExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryInvalidAuthorizationMessageException(body.Error, context); + const exception = new models_0_1.InvalidAuthorizationMessageException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_queryInvalidIdentityTokenExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryInvalidIdentityTokenException(body.Error, context); + const exception = new models_0_1.InvalidIdentityTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_queryMalformedPolicyDocumentExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryMalformedPolicyDocumentException(body.Error, context); + const exception = new models_0_1.MalformedPolicyDocumentException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_queryPackedPolicyTooLargeExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryPackedPolicyTooLargeException(body.Error, context); + const exception = new models_0_1.PackedPolicyTooLargeException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const deserializeAws_queryRegionDisabledExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryRegionDisabledException(body.Error, context); + const exception = new models_0_1.RegionDisabledException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return (0, smithy_client_1.decorateServiceException)(exception, body); +}; +const serializeAws_queryAssumeRoleRequest = (input, context) => { + const entries = {}; + if (input.RoleArn != null) { + entries["RoleArn"] = input.RoleArn; + } + if (input.RoleSessionName != null) { + entries["RoleSessionName"] = input.RoleSessionName; + } + if (input.PolicyArns != null) { + const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); + if (input.PolicyArns?.length === 0) { + entries.PolicyArns = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input.Policy != null) { + entries["Policy"] = input.Policy; + } + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + if (input.Tags != null) { + const memberEntries = serializeAws_querytagListType(input.Tags, context); + if (input.Tags?.length === 0) { + entries.Tags = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Tags.${key}`; + entries[loc] = value; + }); + } + if (input.TransitiveTagKeys != null) { + const memberEntries = serializeAws_querytagKeyListType(input.TransitiveTagKeys, context); + if (input.TransitiveTagKeys?.length === 0) { + entries.TransitiveTagKeys = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `TransitiveTagKeys.${key}`; + entries[loc] = value; + }); + } + if (input.ExternalId != null) { + entries["ExternalId"] = input.ExternalId; + } + if (input.SerialNumber != null) { + entries["SerialNumber"] = input.SerialNumber; + } + if (input.TokenCode != null) { + entries["TokenCode"] = input.TokenCode; + } + if (input.SourceIdentity != null) { + entries["SourceIdentity"] = input.SourceIdentity; + } + return entries; +}; +const serializeAws_queryAssumeRoleWithSAMLRequest = (input, context) => { + const entries = {}; + if (input.RoleArn != null) { + entries["RoleArn"] = input.RoleArn; + } + if (input.PrincipalArn != null) { + entries["PrincipalArn"] = input.PrincipalArn; + } + if (input.SAMLAssertion != null) { + entries["SAMLAssertion"] = input.SAMLAssertion; + } + if (input.PolicyArns != null) { + const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); + if (input.PolicyArns?.length === 0) { + entries.PolicyArns = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input.Policy != null) { + entries["Policy"] = input.Policy; + } + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + return entries; +}; +const serializeAws_queryAssumeRoleWithWebIdentityRequest = (input, context) => { + const entries = {}; + if (input.RoleArn != null) { + entries["RoleArn"] = input.RoleArn; + } + if (input.RoleSessionName != null) { + entries["RoleSessionName"] = input.RoleSessionName; + } + if (input.WebIdentityToken != null) { + entries["WebIdentityToken"] = input.WebIdentityToken; + } + if (input.ProviderId != null) { + entries["ProviderId"] = input.ProviderId; + } + if (input.PolicyArns != null) { + const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); + if (input.PolicyArns?.length === 0) { + entries.PolicyArns = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input.Policy != null) { + entries["Policy"] = input.Policy; + } + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + return entries; +}; +const serializeAws_queryDecodeAuthorizationMessageRequest = (input, context) => { + const entries = {}; + if (input.EncodedMessage != null) { + entries["EncodedMessage"] = input.EncodedMessage; + } + return entries; +}; +const serializeAws_queryGetAccessKeyInfoRequest = (input, context) => { + const entries = {}; + if (input.AccessKeyId != null) { + entries["AccessKeyId"] = input.AccessKeyId; + } + return entries; +}; +const serializeAws_queryGetCallerIdentityRequest = (input, context) => { + const entries = {}; + return entries; +}; +const serializeAws_queryGetFederationTokenRequest = (input, context) => { + const entries = {}; + if (input.Name != null) { + entries["Name"] = input.Name; + } + if (input.Policy != null) { + entries["Policy"] = input.Policy; + } + if (input.PolicyArns != null) { + const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); + if (input.PolicyArns?.length === 0) { + entries.PolicyArns = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + if (input.Tags != null) { + const memberEntries = serializeAws_querytagListType(input.Tags, context); + if (input.Tags?.length === 0) { + entries.Tags = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Tags.${key}`; + entries[loc] = value; + }); + } + return entries; +}; +const serializeAws_queryGetSessionTokenRequest = (input, context) => { + const entries = {}; + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + if (input.SerialNumber != null) { + entries["SerialNumber"] = input.SerialNumber; + } + if (input.TokenCode != null) { + entries["TokenCode"] = input.TokenCode; + } + return entries; +}; +const serializeAws_querypolicyDescriptorListType = (input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + const memberEntries = serializeAws_queryPolicyDescriptorType(entry, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`member.${counter}.${key}`] = value; + }); + counter++; + } + return entries; +}; +const serializeAws_queryPolicyDescriptorType = (input, context) => { + const entries = {}; + if (input.arn != null) { + entries["arn"] = input.arn; + } + return entries; +}; +const serializeAws_queryTag = (input, context) => { + const entries = {}; + if (input.Key != null) { + entries["Key"] = input.Key; + } + if (input.Value != null) { + entries["Value"] = input.Value; + } + return entries; +}; +const serializeAws_querytagKeyListType = (input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + entries[`member.${counter}`] = entry; + counter++; + } + return entries; +}; +const serializeAws_querytagListType = (input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + const memberEntries = serializeAws_queryTag(entry, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`member.${counter}.${key}`] = value; + }); + counter++; + } + return entries; +}; +const deserializeAws_queryAssumedRoleUser = (output, context) => { + const contents = { + AssumedRoleId: undefined, + Arn: undefined, + }; + if (output["AssumedRoleId"] !== undefined) { + contents.AssumedRoleId = (0, smithy_client_1.expectString)(output["AssumedRoleId"]); + } + if (output["Arn"] !== undefined) { + contents.Arn = (0, smithy_client_1.expectString)(output["Arn"]); + } + return contents; +}; +const deserializeAws_queryAssumeRoleResponse = (output, context) => { + const contents = { + Credentials: undefined, + AssumedRoleUser: undefined, + PackedPolicySize: undefined, + SourceIdentity: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + if (output["AssumedRoleUser"] !== undefined) { + contents.AssumedRoleUser = deserializeAws_queryAssumedRoleUser(output["AssumedRoleUser"], context); + } + if (output["PackedPolicySize"] !== undefined) { + contents.PackedPolicySize = (0, smithy_client_1.strictParseInt32)(output["PackedPolicySize"]); + } + if (output["SourceIdentity"] !== undefined) { + contents.SourceIdentity = (0, smithy_client_1.expectString)(output["SourceIdentity"]); + } + return contents; +}; +const deserializeAws_queryAssumeRoleWithSAMLResponse = (output, context) => { + const contents = { + Credentials: undefined, + AssumedRoleUser: undefined, + PackedPolicySize: undefined, + Subject: undefined, + SubjectType: undefined, + Issuer: undefined, + Audience: undefined, + NameQualifier: undefined, + SourceIdentity: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + if (output["AssumedRoleUser"] !== undefined) { + contents.AssumedRoleUser = deserializeAws_queryAssumedRoleUser(output["AssumedRoleUser"], context); + } + if (output["PackedPolicySize"] !== undefined) { + contents.PackedPolicySize = (0, smithy_client_1.strictParseInt32)(output["PackedPolicySize"]); + } + if (output["Subject"] !== undefined) { + contents.Subject = (0, smithy_client_1.expectString)(output["Subject"]); + } + if (output["SubjectType"] !== undefined) { + contents.SubjectType = (0, smithy_client_1.expectString)(output["SubjectType"]); + } + if (output["Issuer"] !== undefined) { + contents.Issuer = (0, smithy_client_1.expectString)(output["Issuer"]); + } + if (output["Audience"] !== undefined) { + contents.Audience = (0, smithy_client_1.expectString)(output["Audience"]); + } + if (output["NameQualifier"] !== undefined) { + contents.NameQualifier = (0, smithy_client_1.expectString)(output["NameQualifier"]); + } + if (output["SourceIdentity"] !== undefined) { + contents.SourceIdentity = (0, smithy_client_1.expectString)(output["SourceIdentity"]); + } + return contents; +}; +const deserializeAws_queryAssumeRoleWithWebIdentityResponse = (output, context) => { + const contents = { + Credentials: undefined, + SubjectFromWebIdentityToken: undefined, + AssumedRoleUser: undefined, + PackedPolicySize: undefined, + Provider: undefined, + Audience: undefined, + SourceIdentity: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + if (output["SubjectFromWebIdentityToken"] !== undefined) { + contents.SubjectFromWebIdentityToken = (0, smithy_client_1.expectString)(output["SubjectFromWebIdentityToken"]); + } + if (output["AssumedRoleUser"] !== undefined) { + contents.AssumedRoleUser = deserializeAws_queryAssumedRoleUser(output["AssumedRoleUser"], context); + } + if (output["PackedPolicySize"] !== undefined) { + contents.PackedPolicySize = (0, smithy_client_1.strictParseInt32)(output["PackedPolicySize"]); + } + if (output["Provider"] !== undefined) { + contents.Provider = (0, smithy_client_1.expectString)(output["Provider"]); + } + if (output["Audience"] !== undefined) { + contents.Audience = (0, smithy_client_1.expectString)(output["Audience"]); + } + if (output["SourceIdentity"] !== undefined) { + contents.SourceIdentity = (0, smithy_client_1.expectString)(output["SourceIdentity"]); + } + return contents; +}; +const deserializeAws_queryCredentials = (output, context) => { + const contents = { + AccessKeyId: undefined, + SecretAccessKey: undefined, + SessionToken: undefined, + Expiration: undefined, + }; + if (output["AccessKeyId"] !== undefined) { + contents.AccessKeyId = (0, smithy_client_1.expectString)(output["AccessKeyId"]); + } + if (output["SecretAccessKey"] !== undefined) { + contents.SecretAccessKey = (0, smithy_client_1.expectString)(output["SecretAccessKey"]); + } + if (output["SessionToken"] !== undefined) { + contents.SessionToken = (0, smithy_client_1.expectString)(output["SessionToken"]); + } + if (output["Expiration"] !== undefined) { + contents.Expiration = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output["Expiration"])); + } + return contents; +}; +const deserializeAws_queryDecodeAuthorizationMessageResponse = (output, context) => { + const contents = { + DecodedMessage: undefined, + }; + if (output["DecodedMessage"] !== undefined) { + contents.DecodedMessage = (0, smithy_client_1.expectString)(output["DecodedMessage"]); + } + return contents; +}; +const deserializeAws_queryExpiredTokenException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = (0, smithy_client_1.expectString)(output["message"]); + } + return contents; +}; +const deserializeAws_queryFederatedUser = (output, context) => { + const contents = { + FederatedUserId: undefined, + Arn: undefined, + }; + if (output["FederatedUserId"] !== undefined) { + contents.FederatedUserId = (0, smithy_client_1.expectString)(output["FederatedUserId"]); + } + if (output["Arn"] !== undefined) { + contents.Arn = (0, smithy_client_1.expectString)(output["Arn"]); + } + return contents; +}; +const deserializeAws_queryGetAccessKeyInfoResponse = (output, context) => { + const contents = { + Account: undefined, + }; + if (output["Account"] !== undefined) { + contents.Account = (0, smithy_client_1.expectString)(output["Account"]); + } + return contents; +}; +const deserializeAws_queryGetCallerIdentityResponse = (output, context) => { + const contents = { + UserId: undefined, + Account: undefined, + Arn: undefined, + }; + if (output["UserId"] !== undefined) { + contents.UserId = (0, smithy_client_1.expectString)(output["UserId"]); + } + if (output["Account"] !== undefined) { + contents.Account = (0, smithy_client_1.expectString)(output["Account"]); + } + if (output["Arn"] !== undefined) { + contents.Arn = (0, smithy_client_1.expectString)(output["Arn"]); + } + return contents; +}; +const deserializeAws_queryGetFederationTokenResponse = (output, context) => { + const contents = { + Credentials: undefined, + FederatedUser: undefined, + PackedPolicySize: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + if (output["FederatedUser"] !== undefined) { + contents.FederatedUser = deserializeAws_queryFederatedUser(output["FederatedUser"], context); + } + if (output["PackedPolicySize"] !== undefined) { + contents.PackedPolicySize = (0, smithy_client_1.strictParseInt32)(output["PackedPolicySize"]); + } + return contents; +}; +const deserializeAws_queryGetSessionTokenResponse = (output, context) => { + const contents = { + Credentials: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + return contents; +}; +const deserializeAws_queryIDPCommunicationErrorException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = (0, smithy_client_1.expectString)(output["message"]); + } + return contents; +}; +const deserializeAws_queryIDPRejectedClaimException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = (0, smithy_client_1.expectString)(output["message"]); + } + return contents; +}; +const deserializeAws_queryInvalidAuthorizationMessageException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = (0, smithy_client_1.expectString)(output["message"]); + } + return contents; +}; +const deserializeAws_queryInvalidIdentityTokenException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = (0, smithy_client_1.expectString)(output["message"]); + } + return contents; +}; +const deserializeAws_queryMalformedPolicyDocumentException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = (0, smithy_client_1.expectString)(output["message"]); + } + return contents; +}; +const deserializeAws_queryPackedPolicyTooLargeException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = (0, smithy_client_1.expectString)(output["message"]); + } + return contents; +}; +const deserializeAws_queryRegionDisabledException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = (0, smithy_client_1.expectString)(output["message"]); + } + return contents; +}; +const deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); +const collectBody = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; +const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new protocol_http_1.HttpRequest(contents); +}; +const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + const parser = new fast_xml_parser_1.XMLParser({ + attributeNamePrefix: "", + htmlEntities: true, + ignoreAttributes: false, + ignoreDeclaration: true, + parseTagValue: false, + trimValues: false, + tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + }); + parser.addEntity("#xD", "\r"); + parser.addEntity("#10", "\n"); + const parsedObj = parser.parse(encoded); + const textNodeName = "#text"; + const key = Object.keys(parsedObj)[0]; + const parsedObjToReturn = parsedObj[key]; + if (parsedObjToReturn[textNodeName]) { + parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; + delete parsedObjToReturn[textNodeName]; + } + return (0, smithy_client_1.getValueFromTextNode)(parsedObjToReturn); + } + return {}; +}); +const parseErrorBody = async (errorBody, context) => { + const value = await parseBody(errorBody, context); + if (value.Error) { + value.Error.message = value.Error.message ?? value.Error.Message; + } + return value; +}; +const buildFormUrlencodedString = (formEntries) => Object.entries(formEntries) + .map(([key, value]) => (0, smithy_client_1.extendedEncodeURIComponent)(key) + "=" + (0, smithy_client_1.extendedEncodeURIComponent)(value)) + .join("&"); +const loadQueryErrorCode = (output, data) => { + if (data.Error?.Code !== undefined) { + return data.Error.Code; + } + if (output.statusCode == 404) { + return "NotFound"; + } +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.browser.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.browser.js new file mode 100644 index 0000000000..9737cf8255 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.browser.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const tslib_1 = require("tslib"); +const package_json_1 = tslib_1.__importDefault(require("../package.json")); +const sha256_browser_1 = require("@aws-crypto/sha256-browser"); +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const fetch_http_handler_1 = require("@aws-sdk/fetch-http-handler"); +const invalid_dependency_1 = require("@aws-sdk/invalid-dependency"); +const util_body_length_browser_1 = require("@aws-sdk/util-body-length-browser"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser"); +const runtimeConfig_shared_1 = require("./runtimeConfig.shared"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const util_defaults_mode_browser_1 = require("@aws-sdk/util-defaults-mode-browser"); +const getRuntimeConfig = (config) => { + const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"), + requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? sha256_browser_1.Sha256, + streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js new file mode 100644 index 0000000000..f7ef25a5d9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const tslib_1 = require("tslib"); +const package_json_1 = tslib_1.__importDefault(require("../package.json")); +const defaultStsRoleAssumers_1 = require("./defaultStsRoleAssumers"); +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const credential_provider_node_1 = require("@aws-sdk/credential-provider-node"); +const hash_node_1 = require("@aws-sdk/hash-node"); +const middleware_retry_1 = require("@aws-sdk/middleware-retry"); +const node_config_provider_1 = require("@aws-sdk/node-config-provider"); +const node_http_handler_1 = require("@aws-sdk/node-http-handler"); +const util_body_length_node_1 = require("@aws-sdk/util-body-length-node"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node"); +const runtimeConfig_shared_1 = require("./runtimeConfig.shared"); +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const util_defaults_mode_node_1 = require("@aws-sdk/util-defaults-mode-node"); +const smithy_client_2 = require("@aws-sdk/smithy-client"); +const getRuntimeConfig = (config) => { + (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? (0, defaultStsRoleAssumers_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider), + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? + (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.native.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.native.js new file mode 100644 index 0000000000..34c5f8ece1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.native.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const sha256_js_1 = require("@aws-crypto/sha256-js"); +const runtimeConfig_browser_1 = require("./runtimeConfig.browser"); +const getRuntimeConfig = (config) => { + const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? sha256_js_1.Sha256, + }; +}; +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js b/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js new file mode 100644 index 0000000000..fde47b87ff --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRuntimeConfig = void 0; +const smithy_client_1 = require("@aws-sdk/smithy-client"); +const url_parser_1 = require("@aws-sdk/url-parser"); +const util_base64_1 = require("@aws-sdk/util-base64"); +const util_utf8_1 = require("@aws-sdk/util-utf8"); +const endpointResolver_1 = require("./endpoint/endpointResolver"); +const getRuntimeConfig = (config) => ({ + apiVersion: "2011-06-15", + base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64, + base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + serviceId: config?.serviceId ?? "STS", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8, +}); +exports.getRuntimeConfig = getRuntimeConfig; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/STS.js b/server/node_modules/@aws-sdk/client-sts/dist-es/STS.js new file mode 100644 index 0000000000..ceaa719ec3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/STS.js @@ -0,0 +1,123 @@ +import { AssumeRoleCommand } from "./commands/AssumeRoleCommand"; +import { AssumeRoleWithSAMLCommand, } from "./commands/AssumeRoleWithSAMLCommand"; +import { AssumeRoleWithWebIdentityCommand, } from "./commands/AssumeRoleWithWebIdentityCommand"; +import { DecodeAuthorizationMessageCommand, } from "./commands/DecodeAuthorizationMessageCommand"; +import { GetAccessKeyInfoCommand, } from "./commands/GetAccessKeyInfoCommand"; +import { GetCallerIdentityCommand, } from "./commands/GetCallerIdentityCommand"; +import { GetFederationTokenCommand, } from "./commands/GetFederationTokenCommand"; +import { GetSessionTokenCommand, } from "./commands/GetSessionTokenCommand"; +import { STSClient } from "./STSClient"; +export class STS extends STSClient { + assumeRole(args, optionsOrCb, cb) { + const command = new AssumeRoleCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + assumeRoleWithSAML(args, optionsOrCb, cb) { + const command = new AssumeRoleWithSAMLCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + assumeRoleWithWebIdentity(args, optionsOrCb, cb) { + const command = new AssumeRoleWithWebIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + decodeAuthorizationMessage(args, optionsOrCb, cb) { + const command = new DecodeAuthorizationMessageCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getAccessKeyInfo(args, optionsOrCb, cb) { + const command = new GetAccessKeyInfoCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getCallerIdentity(args, optionsOrCb, cb) { + const command = new GetCallerIdentityCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getFederationToken(args, optionsOrCb, cb) { + const command = new GetFederationTokenCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } + getSessionToken(args, optionsOrCb, cb) { + const command = new GetSessionTokenCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js b/server/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js new file mode 100644 index 0000000000..6beab4c1bc --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js @@ -0,0 +1,35 @@ +import { resolveRegionConfig } from "@aws-sdk/config-resolver"; +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; +import { resolveEndpointConfig } from "@aws-sdk/middleware-endpoint"; +import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { getRetryPlugin, resolveRetryConfig } from "@aws-sdk/middleware-retry"; +import { resolveStsAuthConfig } from "@aws-sdk/middleware-sdk-sts"; +import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent"; +import { Client as __Client, } from "@aws-sdk/smithy-client"; +import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +export class STSClient extends __Client { + constructor(configuration) { + const _config_0 = __getRuntimeConfig(configuration); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveRegionConfig(_config_1); + const _config_3 = resolveEndpointConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveStsAuthConfig(_config_5, { stsClientCtor: STSClient }); + const _config_7 = resolveUserAgentConfig(_config_6); + super(_config_7); + this.config = _config_7; + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + } + destroy() { + super.destroy(); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleCommand.js new file mode 100644 index 0000000000..411468cb23 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleCommand.js @@ -0,0 +1,45 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { AssumeRoleRequestFilterSensitiveLog, AssumeRoleResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_queryAssumeRoleCommand, serializeAws_queryAssumeRoleCommand } from "../protocols/Aws_query"; +export class AssumeRoleCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, AssumeRoleCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "AssumeRoleCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: AssumeRoleRequestFilterSensitiveLog, + outputFilterSensitiveLog: AssumeRoleResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_queryAssumeRoleCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_queryAssumeRoleCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithSAMLCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithSAMLCommand.js new file mode 100644 index 0000000000..73e588b38f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithSAMLCommand.js @@ -0,0 +1,43 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_queryAssumeRoleWithSAMLCommand, serializeAws_queryAssumeRoleWithSAMLCommand, } from "../protocols/Aws_query"; +export class AssumeRoleWithSAMLCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, AssumeRoleWithSAMLCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "AssumeRoleWithSAMLCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: AssumeRoleWithSAMLRequestFilterSensitiveLog, + outputFilterSensitiveLog: AssumeRoleWithSAMLResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_queryAssumeRoleWithSAMLCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_queryAssumeRoleWithSAMLCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithWebIdentityCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithWebIdentityCommand.js new file mode 100644 index 0000000000..30c938edf1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithWebIdentityCommand.js @@ -0,0 +1,43 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_queryAssumeRoleWithWebIdentityCommand, serializeAws_queryAssumeRoleWithWebIdentityCommand, } from "../protocols/Aws_query"; +export class AssumeRoleWithWebIdentityCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, AssumeRoleWithWebIdentityCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "AssumeRoleWithWebIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: AssumeRoleWithWebIdentityRequestFilterSensitiveLog, + outputFilterSensitiveLog: AssumeRoleWithWebIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_queryAssumeRoleWithWebIdentityCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_queryAssumeRoleWithWebIdentityCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js new file mode 100644 index 0000000000..76dc3ea1cb --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js @@ -0,0 +1,45 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { DecodeAuthorizationMessageRequestFilterSensitiveLog, DecodeAuthorizationMessageResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_queryDecodeAuthorizationMessageCommand, serializeAws_queryDecodeAuthorizationMessageCommand, } from "../protocols/Aws_query"; +export class DecodeAuthorizationMessageCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DecodeAuthorizationMessageCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "DecodeAuthorizationMessageCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: DecodeAuthorizationMessageRequestFilterSensitiveLog, + outputFilterSensitiveLog: DecodeAuthorizationMessageResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_queryDecodeAuthorizationMessageCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_queryDecodeAuthorizationMessageCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js new file mode 100644 index 0000000000..8e41363efd --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js @@ -0,0 +1,45 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetAccessKeyInfoRequestFilterSensitiveLog, GetAccessKeyInfoResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_queryGetAccessKeyInfoCommand, serializeAws_queryGetAccessKeyInfoCommand, } from "../protocols/Aws_query"; +export class GetAccessKeyInfoCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetAccessKeyInfoCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "GetAccessKeyInfoCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetAccessKeyInfoRequestFilterSensitiveLog, + outputFilterSensitiveLog: GetAccessKeyInfoResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_queryGetAccessKeyInfoCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_queryGetAccessKeyInfoCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js new file mode 100644 index 0000000000..9400dd7a62 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js @@ -0,0 +1,45 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetCallerIdentityRequestFilterSensitiveLog, GetCallerIdentityResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_queryGetCallerIdentityCommand, serializeAws_queryGetCallerIdentityCommand, } from "../protocols/Aws_query"; +export class GetCallerIdentityCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetCallerIdentityCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "GetCallerIdentityCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetCallerIdentityRequestFilterSensitiveLog, + outputFilterSensitiveLog: GetCallerIdentityResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_queryGetCallerIdentityCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_queryGetCallerIdentityCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js new file mode 100644 index 0000000000..936308b93a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js @@ -0,0 +1,45 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetFederationTokenRequestFilterSensitiveLog, GetFederationTokenResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_queryGetFederationTokenCommand, serializeAws_queryGetFederationTokenCommand, } from "../protocols/Aws_query"; +export class GetFederationTokenCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetFederationTokenCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "GetFederationTokenCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetFederationTokenRequestFilterSensitiveLog, + outputFilterSensitiveLog: GetFederationTokenResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_queryGetFederationTokenCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_queryGetFederationTokenCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js new file mode 100644 index 0000000000..875e013be1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js @@ -0,0 +1,45 @@ +import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { GetSessionTokenRequestFilterSensitiveLog, GetSessionTokenResponseFilterSensitiveLog, } from "../models/models_0"; +import { deserializeAws_queryGetSessionTokenCommand, serializeAws_queryGetSessionTokenCommand, } from "../protocols/Aws_query"; +export class GetSessionTokenCommand extends $Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetSessionTokenCommand.getEndpointParameterInstructions())); + this.middlewareStack.use(getAwsAuthPlugin(configuration)); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "STSClient"; + const commandName = "GetSessionTokenCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetSessionTokenRequestFilterSensitiveLog, + outputFilterSensitiveLog: GetSessionTokenResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return serializeAws_queryGetSessionTokenCommand(input, context); + } + deserialize(output, context) { + return deserializeAws_queryGetSessionTokenCommand(output, context); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/commands/index.js b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/index.js new file mode 100644 index 0000000000..802202ff12 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/commands/index.js @@ -0,0 +1,8 @@ +export * from "./AssumeRoleCommand"; +export * from "./AssumeRoleWithSAMLCommand"; +export * from "./AssumeRoleWithWebIdentityCommand"; +export * from "./DecodeAuthorizationMessageCommand"; +export * from "./GetAccessKeyInfoCommand"; +export * from "./GetCallerIdentityCommand"; +export * from "./GetFederationTokenCommand"; +export * from "./GetSessionTokenCommand"; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/defaultRoleAssumers.js b/server/node_modules/@aws-sdk/client-sts/dist-es/defaultRoleAssumers.js new file mode 100644 index 0000000000..aafb8c4ebb --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/defaultRoleAssumers.js @@ -0,0 +1,22 @@ +import { getDefaultRoleAssumer as StsGetDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity as StsGetDefaultRoleAssumerWithWebIdentity, } from "./defaultStsRoleAssumers"; +import { STSClient } from "./STSClient"; +const getCustomizableStsClientCtor = (baseCtor, customizations) => { + if (!customizations) + return baseCtor; + else + return class CustomizableSTSClient extends baseCtor { + constructor(config) { + super(config); + for (const customization of customizations) { + this.middlewareStack.use(customization); + } + } + }; +}; +export const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => StsGetDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)); +export const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => StsGetDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)); +export const decorateDefaultCredentialProvider = (provider) => (input) => provider({ + roleAssumer: getDefaultRoleAssumer(input), + roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input), + ...input, +}); diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js b/server/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js new file mode 100644 index 0000000000..f304082e1b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js @@ -0,0 +1,70 @@ +import { AssumeRoleCommand } from "./commands/AssumeRoleCommand"; +import { AssumeRoleWithWebIdentityCommand, } from "./commands/AssumeRoleWithWebIdentityCommand"; +const ASSUME_ROLE_DEFAULT_REGION = "us-east-1"; +const decorateDefaultRegion = (region) => { + if (typeof region !== "function") { + return region === undefined ? ASSUME_ROLE_DEFAULT_REGION : region; + } + return async () => { + try { + return await region(); + } + catch (e) { + return ASSUME_ROLE_DEFAULT_REGION; + } + }; +}; +export const getDefaultRoleAssumer = (stsOptions, stsClientCtor) => { + let stsClient; + let closureSourceCreds; + return async (sourceCreds, params) => { + closureSourceCreds = sourceCreds; + if (!stsClient) { + const { logger, region, requestHandler } = stsOptions; + stsClient = new stsClientCtor({ + logger, + credentialDefaultProvider: () => async () => closureSourceCreds, + region: decorateDefaultRegion(region || stsOptions.region), + ...(requestHandler ? { requestHandler } : {}), + }); + } + const { Credentials } = await stsClient.send(new AssumeRoleCommand(params)); + if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { + throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); + } + return { + accessKeyId: Credentials.AccessKeyId, + secretAccessKey: Credentials.SecretAccessKey, + sessionToken: Credentials.SessionToken, + expiration: Credentials.Expiration, + }; + }; +}; +export const getDefaultRoleAssumerWithWebIdentity = (stsOptions, stsClientCtor) => { + let stsClient; + return async (params) => { + if (!stsClient) { + const { logger, region, requestHandler } = stsOptions; + stsClient = new stsClientCtor({ + logger, + region: decorateDefaultRegion(region || stsOptions.region), + ...(requestHandler ? { requestHandler } : {}), + }); + } + const { Credentials } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params)); + if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { + throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`); + } + return { + accessKeyId: Credentials.AccessKeyId, + secretAccessKey: Credentials.SecretAccessKey, + sessionToken: Credentials.SessionToken, + expiration: Credentials.Expiration, + }; + }; +}; +export const decorateDefaultCredentialProvider = (provider) => (input) => provider({ + roleAssumer: getDefaultRoleAssumer(input, input.stsClientCtor), + roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input, input.stsClientCtor), + ...input, +}); diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/EndpointParameters.js b/server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/EndpointParameters.js new file mode 100644 index 0000000000..7110c4ae13 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/EndpointParameters.js @@ -0,0 +1,9 @@ +export const resolveClientEndpointParameters = (options) => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + useGlobalEndpoint: options.useGlobalEndpoint ?? false, + defaultSigningName: "sts", + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/endpointResolver.js b/server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/endpointResolver.js new file mode 100644 index 0000000000..f7d9738dd1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/endpointResolver.js @@ -0,0 +1,8 @@ +import { resolveEndpoint } from "@aws-sdk/util-endpoints"; +import { ruleSet } from "./ruleset"; +export const defaultEndpointResolver = (endpointParams, context = {}) => { + return resolveEndpoint(ruleSet, { + endpointParams: endpointParams, + logger: context.logger, + }); +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/ruleset.js b/server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/ruleset.js new file mode 100644 index 0000000000..65363e6cf2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/endpoint/ruleset.js @@ -0,0 +1,4 @@ +const G = "required", H = "type", I = "fn", J = "argv", K = "ref", L = "properties", M = "headers"; +const a = false, b = true, c = "PartitionResult", d = "tree", e = "booleanEquals", f = "stringEquals", g = "sigv4", h = "us-east-1", i = "sts", j = "endpoint", k = "https://sts.{Region}.{PartitionResult#dnsSuffix}", l = "error", m = "getAttr", n = { [G]: false, [H]: "String" }, o = { [G]: true, "default": false, [H]: "Boolean" }, p = { [K]: "Region" }, q = { [K]: "UseFIPS" }, r = { [K]: "UseDualStack" }, s = { [I]: "isSet", [J]: [{ [K]: "Endpoint" }] }, t = { [K]: "Endpoint" }, u = { "url": "https://sts.amazonaws.com", [L]: { "authSchemes": [{ "name": g, "signingRegion": h, "signingName": i }] }, [M]: {} }, v = {}, w = { "conditions": [{ [I]: f, [J]: [p, "aws-global"] }], [j]: u, [H]: j }, x = { [I]: e, [J]: [q, true] }, y = { [I]: e, [J]: [r, true] }, z = { [I]: e, [J]: [true, { [I]: m, [J]: [{ [K]: c }, "supportsFIPS"] }] }, A = { [K]: c }, B = { [I]: e, [J]: [true, { [I]: m, [J]: [A, "supportsDualStack"] }] }, C = { "url": k, [L]: {}, [M]: {} }, D = [t], E = [x], F = [y]; +const _data = { version: "1.0", parameters: { Region: n, UseDualStack: o, UseFIPS: o, Endpoint: n, UseGlobalEndpoint: o }, rules: [{ conditions: [{ [I]: "aws.partition", [J]: [p], assign: c }], [H]: d, rules: [{ conditions: [{ [I]: e, [J]: [{ [K]: "UseGlobalEndpoint" }, b] }, { [I]: e, [J]: [q, a] }, { [I]: e, [J]: [r, a] }, { [I]: "not", [J]: [s] }], [H]: d, rules: [{ conditions: [{ [I]: f, [J]: [p, "ap-northeast-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "ap-south-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "ap-southeast-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "ap-southeast-2"] }], endpoint: u, [H]: j }, w, { conditions: [{ [I]: f, [J]: [p, "ca-central-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-central-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-north-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-west-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-west-2"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "eu-west-3"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "sa-east-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, h] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "us-east-2"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "us-west-1"] }], endpoint: u, [H]: j }, { conditions: [{ [I]: f, [J]: [p, "us-west-2"] }], endpoint: u, [H]: j }, { endpoint: { url: k, [L]: { authSchemes: [{ name: g, signingRegion: "{Region}", signingName: i }] }, [M]: v }, [H]: j }] }, { conditions: [s, { [I]: "parseURL", [J]: D, assign: "url" }], [H]: d, rules: [{ conditions: E, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [H]: l }, { [H]: d, rules: [{ conditions: F, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [H]: l }, { endpoint: { url: t, [L]: v, [M]: v }, [H]: j }] }] }, { conditions: [x, y], [H]: d, rules: [{ conditions: [z, B], [H]: d, rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", [L]: v, [M]: v }, [H]: j }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [H]: l }] }, { conditions: E, [H]: d, rules: [{ conditions: [z], [H]: d, rules: [{ [H]: d, rules: [{ conditions: [{ [I]: f, [J]: ["aws-us-gov", { [I]: m, [J]: [A, "name"] }] }], endpoint: C, [H]: j }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", [L]: v, [M]: v }, [H]: j }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", [H]: l }] }, { conditions: F, [H]: d, rules: [{ conditions: [B], [H]: d, rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", [L]: v, [M]: v }, [H]: j }] }, { error: "DualStack is enabled but this partition does not support DualStack", [H]: l }] }, { [H]: d, rules: [w, { endpoint: C, [H]: j }] }] }] }; +export const ruleSet = _data; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/index.js b/server/node_modules/@aws-sdk/client-sts/dist-es/index.js new file mode 100644 index 0000000000..441fe775a2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/index.js @@ -0,0 +1,6 @@ +export * from "./STS"; +export * from "./STSClient"; +export * from "./commands"; +export * from "./defaultRoleAssumers"; +export * from "./models"; +export { STSServiceException } from "./models/STSServiceException"; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/models/STSServiceException.js b/server/node_modules/@aws-sdk/client-sts/dist-es/models/STSServiceException.js new file mode 100644 index 0000000000..27616df71b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/models/STSServiceException.js @@ -0,0 +1,7 @@ +import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client"; +export class STSServiceException extends __ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, STSServiceException.prototype); + } +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/models/index.js b/server/node_modules/@aws-sdk/client-sts/dist-es/models/index.js new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/models/index.js @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/models/models_0.js b/server/node_modules/@aws-sdk/client-sts/dist-es/models/models_0.js new file mode 100644 index 0000000000..5ea5bc7b4b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/models/models_0.js @@ -0,0 +1,160 @@ +import { STSServiceException as __BaseException } from "./STSServiceException"; +export class ExpiredTokenException extends __BaseException { + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts, + }); + this.name = "ExpiredTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, ExpiredTokenException.prototype); + } +} +export class MalformedPolicyDocumentException extends __BaseException { + constructor(opts) { + super({ + name: "MalformedPolicyDocumentException", + $fault: "client", + ...opts, + }); + this.name = "MalformedPolicyDocumentException"; + this.$fault = "client"; + Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype); + } +} +export class PackedPolicyTooLargeException extends __BaseException { + constructor(opts) { + super({ + name: "PackedPolicyTooLargeException", + $fault: "client", + ...opts, + }); + this.name = "PackedPolicyTooLargeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype); + } +} +export class RegionDisabledException extends __BaseException { + constructor(opts) { + super({ + name: "RegionDisabledException", + $fault: "client", + ...opts, + }); + this.name = "RegionDisabledException"; + this.$fault = "client"; + Object.setPrototypeOf(this, RegionDisabledException.prototype); + } +} +export class IDPRejectedClaimException extends __BaseException { + constructor(opts) { + super({ + name: "IDPRejectedClaimException", + $fault: "client", + ...opts, + }); + this.name = "IDPRejectedClaimException"; + this.$fault = "client"; + Object.setPrototypeOf(this, IDPRejectedClaimException.prototype); + } +} +export class InvalidIdentityTokenException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidIdentityTokenException", + $fault: "client", + ...opts, + }); + this.name = "InvalidIdentityTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype); + } +} +export class IDPCommunicationErrorException extends __BaseException { + constructor(opts) { + super({ + name: "IDPCommunicationErrorException", + $fault: "client", + ...opts, + }); + this.name = "IDPCommunicationErrorException"; + this.$fault = "client"; + Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype); + } +} +export class InvalidAuthorizationMessageException extends __BaseException { + constructor(opts) { + super({ + name: "InvalidAuthorizationMessageException", + $fault: "client", + ...opts, + }); + this.name = "InvalidAuthorizationMessageException"; + this.$fault = "client"; + Object.setPrototypeOf(this, InvalidAuthorizationMessageException.prototype); + } +} +export const AssumedRoleUserFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const PolicyDescriptorTypeFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const TagFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const AssumeRoleRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const CredentialsFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const AssumeRoleResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const AssumeRoleWithSAMLRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const AssumeRoleWithSAMLResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const AssumeRoleWithWebIdentityRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const AssumeRoleWithWebIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const DecodeAuthorizationMessageRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const DecodeAuthorizationMessageResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetAccessKeyInfoRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetAccessKeyInfoResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetCallerIdentityRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetCallerIdentityResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetFederationTokenRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const FederatedUserFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetFederationTokenResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetSessionTokenRequestFilterSensitiveLog = (obj) => ({ + ...obj, +}); +export const GetSessionTokenResponseFilterSensitiveLog = (obj) => ({ + ...obj, +}); diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js b/server/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js new file mode 100644 index 0000000000..43a65a4ee5 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js @@ -0,0 +1,1064 @@ +import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http"; +import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, getValueFromTextNode as __getValueFromTextNode, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client"; +import { XMLParser } from "fast-xml-parser"; +import { ExpiredTokenException, IDPCommunicationErrorException, IDPRejectedClaimException, InvalidAuthorizationMessageException, InvalidIdentityTokenException, MalformedPolicyDocumentException, PackedPolicyTooLargeException, RegionDisabledException, } from "../models/models_0"; +import { STSServiceException as __BaseException } from "../models/STSServiceException"; +export const serializeAws_queryAssumeRoleCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryAssumeRoleRequest(input, context), + Action: "AssumeRole", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_queryAssumeRoleWithSAMLCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryAssumeRoleWithSAMLRequest(input, context), + Action: "AssumeRoleWithSAML", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_queryAssumeRoleWithWebIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryAssumeRoleWithWebIdentityRequest(input, context), + Action: "AssumeRoleWithWebIdentity", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_queryDecodeAuthorizationMessageCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryDecodeAuthorizationMessageRequest(input, context), + Action: "DecodeAuthorizationMessage", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_queryGetAccessKeyInfoCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryGetAccessKeyInfoRequest(input, context), + Action: "GetAccessKeyInfo", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_queryGetCallerIdentityCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryGetCallerIdentityRequest(input, context), + Action: "GetCallerIdentity", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_queryGetFederationTokenCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryGetFederationTokenRequest(input, context), + Action: "GetFederationToken", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const serializeAws_queryGetSessionTokenCommand = async (input, context) => { + const headers = { + "content-type": "application/x-www-form-urlencoded", + }; + let body; + body = buildFormUrlencodedString({ + ...serializeAws_queryGetSessionTokenRequest(input, context), + Action: "GetSessionToken", + Version: "2011-06-15", + }); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; +export const deserializeAws_queryAssumeRoleCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryAssumeRoleCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryAssumeRoleResponse(data.AssumeRoleResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_queryAssumeRoleCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExpiredTokenException": + case "com.amazonaws.sts#ExpiredTokenException": + throw await deserializeAws_queryExpiredTokenExceptionResponse(parsedOutput, context); + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context); + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_queryAssumeRoleWithSAMLCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryAssumeRoleWithSAMLCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryAssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_queryAssumeRoleWithSAMLCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExpiredTokenException": + case "com.amazonaws.sts#ExpiredTokenException": + throw await deserializeAws_queryExpiredTokenExceptionResponse(parsedOutput, context); + case "IDPRejectedClaim": + case "com.amazonaws.sts#IDPRejectedClaimException": + throw await deserializeAws_queryIDPRejectedClaimExceptionResponse(parsedOutput, context); + case "InvalidIdentityToken": + case "com.amazonaws.sts#InvalidIdentityTokenException": + throw await deserializeAws_queryInvalidIdentityTokenExceptionResponse(parsedOutput, context); + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context); + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_queryAssumeRoleWithWebIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryAssumeRoleWithWebIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryAssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_queryAssumeRoleWithWebIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ExpiredTokenException": + case "com.amazonaws.sts#ExpiredTokenException": + throw await deserializeAws_queryExpiredTokenExceptionResponse(parsedOutput, context); + case "IDPCommunicationError": + case "com.amazonaws.sts#IDPCommunicationErrorException": + throw await deserializeAws_queryIDPCommunicationErrorExceptionResponse(parsedOutput, context); + case "IDPRejectedClaim": + case "com.amazonaws.sts#IDPRejectedClaimException": + throw await deserializeAws_queryIDPRejectedClaimExceptionResponse(parsedOutput, context); + case "InvalidIdentityToken": + case "com.amazonaws.sts#InvalidIdentityTokenException": + throw await deserializeAws_queryInvalidIdentityTokenExceptionResponse(parsedOutput, context); + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context); + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_queryDecodeAuthorizationMessageCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryDecodeAuthorizationMessageCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryDecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_queryDecodeAuthorizationMessageCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidAuthorizationMessageException": + case "com.amazonaws.sts#InvalidAuthorizationMessageException": + throw await deserializeAws_queryInvalidAuthorizationMessageExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_queryGetAccessKeyInfoCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryGetAccessKeyInfoCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryGetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_queryGetAccessKeyInfoCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: __BaseException, + errorCode, + }); +}; +export const deserializeAws_queryGetCallerIdentityCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryGetCallerIdentityCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryGetCallerIdentityResponse(data.GetCallerIdentityResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_queryGetCallerIdentityCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: __BaseException, + errorCode, + }); +}; +export const deserializeAws_queryGetFederationTokenCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryGetFederationTokenCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryGetFederationTokenResponse(data.GetFederationTokenResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_queryGetFederationTokenCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context); + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +export const deserializeAws_queryGetSessionTokenCommand = async (output, context) => { + if (output.statusCode >= 300) { + return deserializeAws_queryGetSessionTokenCommandError(output, context); + } + const data = await parseBody(output.body, context); + let contents = {}; + contents = deserializeAws_queryGetSessionTokenResponse(data.GetSessionTokenResult, context); + const response = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; +const deserializeAws_queryGetSessionTokenCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadQueryErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "RegionDisabledException": + case "com.amazonaws.sts#RegionDisabledException": + throw await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody: parsedBody.Error, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; +const deserializeAws_queryExpiredTokenExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryExpiredTokenException(body.Error, context); + const exception = new ExpiredTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_queryIDPCommunicationErrorExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryIDPCommunicationErrorException(body.Error, context); + const exception = new IDPCommunicationErrorException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_queryIDPRejectedClaimExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryIDPRejectedClaimException(body.Error, context); + const exception = new IDPRejectedClaimException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_queryInvalidAuthorizationMessageExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryInvalidAuthorizationMessageException(body.Error, context); + const exception = new InvalidAuthorizationMessageException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_queryInvalidIdentityTokenExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryInvalidIdentityTokenException(body.Error, context); + const exception = new InvalidIdentityTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_queryMalformedPolicyDocumentExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryMalformedPolicyDocumentException(body.Error, context); + const exception = new MalformedPolicyDocumentException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_queryPackedPolicyTooLargeExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryPackedPolicyTooLargeException(body.Error, context); + const exception = new PackedPolicyTooLargeException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const deserializeAws_queryRegionDisabledExceptionResponse = async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = deserializeAws_queryRegionDisabledException(body.Error, context); + const exception = new RegionDisabledException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; +const serializeAws_queryAssumeRoleRequest = (input, context) => { + const entries = {}; + if (input.RoleArn != null) { + entries["RoleArn"] = input.RoleArn; + } + if (input.RoleSessionName != null) { + entries["RoleSessionName"] = input.RoleSessionName; + } + if (input.PolicyArns != null) { + const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); + if (input.PolicyArns?.length === 0) { + entries.PolicyArns = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input.Policy != null) { + entries["Policy"] = input.Policy; + } + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + if (input.Tags != null) { + const memberEntries = serializeAws_querytagListType(input.Tags, context); + if (input.Tags?.length === 0) { + entries.Tags = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Tags.${key}`; + entries[loc] = value; + }); + } + if (input.TransitiveTagKeys != null) { + const memberEntries = serializeAws_querytagKeyListType(input.TransitiveTagKeys, context); + if (input.TransitiveTagKeys?.length === 0) { + entries.TransitiveTagKeys = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `TransitiveTagKeys.${key}`; + entries[loc] = value; + }); + } + if (input.ExternalId != null) { + entries["ExternalId"] = input.ExternalId; + } + if (input.SerialNumber != null) { + entries["SerialNumber"] = input.SerialNumber; + } + if (input.TokenCode != null) { + entries["TokenCode"] = input.TokenCode; + } + if (input.SourceIdentity != null) { + entries["SourceIdentity"] = input.SourceIdentity; + } + return entries; +}; +const serializeAws_queryAssumeRoleWithSAMLRequest = (input, context) => { + const entries = {}; + if (input.RoleArn != null) { + entries["RoleArn"] = input.RoleArn; + } + if (input.PrincipalArn != null) { + entries["PrincipalArn"] = input.PrincipalArn; + } + if (input.SAMLAssertion != null) { + entries["SAMLAssertion"] = input.SAMLAssertion; + } + if (input.PolicyArns != null) { + const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); + if (input.PolicyArns?.length === 0) { + entries.PolicyArns = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input.Policy != null) { + entries["Policy"] = input.Policy; + } + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + return entries; +}; +const serializeAws_queryAssumeRoleWithWebIdentityRequest = (input, context) => { + const entries = {}; + if (input.RoleArn != null) { + entries["RoleArn"] = input.RoleArn; + } + if (input.RoleSessionName != null) { + entries["RoleSessionName"] = input.RoleSessionName; + } + if (input.WebIdentityToken != null) { + entries["WebIdentityToken"] = input.WebIdentityToken; + } + if (input.ProviderId != null) { + entries["ProviderId"] = input.ProviderId; + } + if (input.PolicyArns != null) { + const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); + if (input.PolicyArns?.length === 0) { + entries.PolicyArns = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input.Policy != null) { + entries["Policy"] = input.Policy; + } + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + return entries; +}; +const serializeAws_queryDecodeAuthorizationMessageRequest = (input, context) => { + const entries = {}; + if (input.EncodedMessage != null) { + entries["EncodedMessage"] = input.EncodedMessage; + } + return entries; +}; +const serializeAws_queryGetAccessKeyInfoRequest = (input, context) => { + const entries = {}; + if (input.AccessKeyId != null) { + entries["AccessKeyId"] = input.AccessKeyId; + } + return entries; +}; +const serializeAws_queryGetCallerIdentityRequest = (input, context) => { + const entries = {}; + return entries; +}; +const serializeAws_queryGetFederationTokenRequest = (input, context) => { + const entries = {}; + if (input.Name != null) { + entries["Name"] = input.Name; + } + if (input.Policy != null) { + entries["Policy"] = input.Policy; + } + if (input.PolicyArns != null) { + const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); + if (input.PolicyArns?.length === 0) { + entries.PolicyArns = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `PolicyArns.${key}`; + entries[loc] = value; + }); + } + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + if (input.Tags != null) { + const memberEntries = serializeAws_querytagListType(input.Tags, context); + if (input.Tags?.length === 0) { + entries.Tags = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Tags.${key}`; + entries[loc] = value; + }); + } + return entries; +}; +const serializeAws_queryGetSessionTokenRequest = (input, context) => { + const entries = {}; + if (input.DurationSeconds != null) { + entries["DurationSeconds"] = input.DurationSeconds; + } + if (input.SerialNumber != null) { + entries["SerialNumber"] = input.SerialNumber; + } + if (input.TokenCode != null) { + entries["TokenCode"] = input.TokenCode; + } + return entries; +}; +const serializeAws_querypolicyDescriptorListType = (input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + const memberEntries = serializeAws_queryPolicyDescriptorType(entry, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`member.${counter}.${key}`] = value; + }); + counter++; + } + return entries; +}; +const serializeAws_queryPolicyDescriptorType = (input, context) => { + const entries = {}; + if (input.arn != null) { + entries["arn"] = input.arn; + } + return entries; +}; +const serializeAws_queryTag = (input, context) => { + const entries = {}; + if (input.Key != null) { + entries["Key"] = input.Key; + } + if (input.Value != null) { + entries["Value"] = input.Value; + } + return entries; +}; +const serializeAws_querytagKeyListType = (input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + entries[`member.${counter}`] = entry; + counter++; + } + return entries; +}; +const serializeAws_querytagListType = (input, context) => { + const entries = {}; + let counter = 1; + for (const entry of input) { + if (entry === null) { + continue; + } + const memberEntries = serializeAws_queryTag(entry, context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`member.${counter}.${key}`] = value; + }); + counter++; + } + return entries; +}; +const deserializeAws_queryAssumedRoleUser = (output, context) => { + const contents = { + AssumedRoleId: undefined, + Arn: undefined, + }; + if (output["AssumedRoleId"] !== undefined) { + contents.AssumedRoleId = __expectString(output["AssumedRoleId"]); + } + if (output["Arn"] !== undefined) { + contents.Arn = __expectString(output["Arn"]); + } + return contents; +}; +const deserializeAws_queryAssumeRoleResponse = (output, context) => { + const contents = { + Credentials: undefined, + AssumedRoleUser: undefined, + PackedPolicySize: undefined, + SourceIdentity: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + if (output["AssumedRoleUser"] !== undefined) { + contents.AssumedRoleUser = deserializeAws_queryAssumedRoleUser(output["AssumedRoleUser"], context); + } + if (output["PackedPolicySize"] !== undefined) { + contents.PackedPolicySize = __strictParseInt32(output["PackedPolicySize"]); + } + if (output["SourceIdentity"] !== undefined) { + contents.SourceIdentity = __expectString(output["SourceIdentity"]); + } + return contents; +}; +const deserializeAws_queryAssumeRoleWithSAMLResponse = (output, context) => { + const contents = { + Credentials: undefined, + AssumedRoleUser: undefined, + PackedPolicySize: undefined, + Subject: undefined, + SubjectType: undefined, + Issuer: undefined, + Audience: undefined, + NameQualifier: undefined, + SourceIdentity: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + if (output["AssumedRoleUser"] !== undefined) { + contents.AssumedRoleUser = deserializeAws_queryAssumedRoleUser(output["AssumedRoleUser"], context); + } + if (output["PackedPolicySize"] !== undefined) { + contents.PackedPolicySize = __strictParseInt32(output["PackedPolicySize"]); + } + if (output["Subject"] !== undefined) { + contents.Subject = __expectString(output["Subject"]); + } + if (output["SubjectType"] !== undefined) { + contents.SubjectType = __expectString(output["SubjectType"]); + } + if (output["Issuer"] !== undefined) { + contents.Issuer = __expectString(output["Issuer"]); + } + if (output["Audience"] !== undefined) { + contents.Audience = __expectString(output["Audience"]); + } + if (output["NameQualifier"] !== undefined) { + contents.NameQualifier = __expectString(output["NameQualifier"]); + } + if (output["SourceIdentity"] !== undefined) { + contents.SourceIdentity = __expectString(output["SourceIdentity"]); + } + return contents; +}; +const deserializeAws_queryAssumeRoleWithWebIdentityResponse = (output, context) => { + const contents = { + Credentials: undefined, + SubjectFromWebIdentityToken: undefined, + AssumedRoleUser: undefined, + PackedPolicySize: undefined, + Provider: undefined, + Audience: undefined, + SourceIdentity: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + if (output["SubjectFromWebIdentityToken"] !== undefined) { + contents.SubjectFromWebIdentityToken = __expectString(output["SubjectFromWebIdentityToken"]); + } + if (output["AssumedRoleUser"] !== undefined) { + contents.AssumedRoleUser = deserializeAws_queryAssumedRoleUser(output["AssumedRoleUser"], context); + } + if (output["PackedPolicySize"] !== undefined) { + contents.PackedPolicySize = __strictParseInt32(output["PackedPolicySize"]); + } + if (output["Provider"] !== undefined) { + contents.Provider = __expectString(output["Provider"]); + } + if (output["Audience"] !== undefined) { + contents.Audience = __expectString(output["Audience"]); + } + if (output["SourceIdentity"] !== undefined) { + contents.SourceIdentity = __expectString(output["SourceIdentity"]); + } + return contents; +}; +const deserializeAws_queryCredentials = (output, context) => { + const contents = { + AccessKeyId: undefined, + SecretAccessKey: undefined, + SessionToken: undefined, + Expiration: undefined, + }; + if (output["AccessKeyId"] !== undefined) { + contents.AccessKeyId = __expectString(output["AccessKeyId"]); + } + if (output["SecretAccessKey"] !== undefined) { + contents.SecretAccessKey = __expectString(output["SecretAccessKey"]); + } + if (output["SessionToken"] !== undefined) { + contents.SessionToken = __expectString(output["SessionToken"]); + } + if (output["Expiration"] !== undefined) { + contents.Expiration = __expectNonNull(__parseRfc3339DateTimeWithOffset(output["Expiration"])); + } + return contents; +}; +const deserializeAws_queryDecodeAuthorizationMessageResponse = (output, context) => { + const contents = { + DecodedMessage: undefined, + }; + if (output["DecodedMessage"] !== undefined) { + contents.DecodedMessage = __expectString(output["DecodedMessage"]); + } + return contents; +}; +const deserializeAws_queryExpiredTokenException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = __expectString(output["message"]); + } + return contents; +}; +const deserializeAws_queryFederatedUser = (output, context) => { + const contents = { + FederatedUserId: undefined, + Arn: undefined, + }; + if (output["FederatedUserId"] !== undefined) { + contents.FederatedUserId = __expectString(output["FederatedUserId"]); + } + if (output["Arn"] !== undefined) { + contents.Arn = __expectString(output["Arn"]); + } + return contents; +}; +const deserializeAws_queryGetAccessKeyInfoResponse = (output, context) => { + const contents = { + Account: undefined, + }; + if (output["Account"] !== undefined) { + contents.Account = __expectString(output["Account"]); + } + return contents; +}; +const deserializeAws_queryGetCallerIdentityResponse = (output, context) => { + const contents = { + UserId: undefined, + Account: undefined, + Arn: undefined, + }; + if (output["UserId"] !== undefined) { + contents.UserId = __expectString(output["UserId"]); + } + if (output["Account"] !== undefined) { + contents.Account = __expectString(output["Account"]); + } + if (output["Arn"] !== undefined) { + contents.Arn = __expectString(output["Arn"]); + } + return contents; +}; +const deserializeAws_queryGetFederationTokenResponse = (output, context) => { + const contents = { + Credentials: undefined, + FederatedUser: undefined, + PackedPolicySize: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + if (output["FederatedUser"] !== undefined) { + contents.FederatedUser = deserializeAws_queryFederatedUser(output["FederatedUser"], context); + } + if (output["PackedPolicySize"] !== undefined) { + contents.PackedPolicySize = __strictParseInt32(output["PackedPolicySize"]); + } + return contents; +}; +const deserializeAws_queryGetSessionTokenResponse = (output, context) => { + const contents = { + Credentials: undefined, + }; + if (output["Credentials"] !== undefined) { + contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context); + } + return contents; +}; +const deserializeAws_queryIDPCommunicationErrorException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = __expectString(output["message"]); + } + return contents; +}; +const deserializeAws_queryIDPRejectedClaimException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = __expectString(output["message"]); + } + return contents; +}; +const deserializeAws_queryInvalidAuthorizationMessageException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = __expectString(output["message"]); + } + return contents; +}; +const deserializeAws_queryInvalidIdentityTokenException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = __expectString(output["message"]); + } + return contents; +}; +const deserializeAws_queryMalformedPolicyDocumentException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = __expectString(output["message"]); + } + return contents; +}; +const deserializeAws_queryPackedPolicyTooLargeException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = __expectString(output["message"]); + } + return contents; +}; +const deserializeAws_queryRegionDisabledException = (output, context) => { + const contents = { + message: undefined, + }; + if (output["message"] !== undefined) { + contents.message = __expectString(output["message"]); + } + return contents; +}; +const deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); +const collectBody = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; +const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const contents = { + protocol, + hostname, + port, + method: "POST", + path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path, + headers, + }; + if (resolvedHostname !== undefined) { + contents.hostname = resolvedHostname; + } + if (body !== undefined) { + contents.body = body; + } + return new __HttpRequest(contents); +}; +const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + const parser = new XMLParser({ + attributeNamePrefix: "", + htmlEntities: true, + ignoreAttributes: false, + ignoreDeclaration: true, + parseTagValue: false, + trimValues: false, + tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined), + }); + parser.addEntity("#xD", "\r"); + parser.addEntity("#10", "\n"); + const parsedObj = parser.parse(encoded); + const textNodeName = "#text"; + const key = Object.keys(parsedObj)[0]; + const parsedObjToReturn = parsedObj[key]; + if (parsedObjToReturn[textNodeName]) { + parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; + delete parsedObjToReturn[textNodeName]; + } + return __getValueFromTextNode(parsedObjToReturn); + } + return {}; +}); +const parseErrorBody = async (errorBody, context) => { + const value = await parseBody(errorBody, context); + if (value.Error) { + value.Error.message = value.Error.message ?? value.Error.Message; + } + return value; +}; +const buildFormUrlencodedString = (formEntries) => Object.entries(formEntries) + .map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value)) + .join("&"); +const loadQueryErrorCode = (output, data) => { + if (data.Error?.Code !== undefined) { + return data.Error.Code; + } + if (output.statusCode == 404) { + return "NotFound"; + } +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.browser.js b/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.browser.js new file mode 100644 index 0000000000..f1486d52d0 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.browser.js @@ -0,0 +1,34 @@ +import packageInfo from "../package.json"; +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser"; +export const getRuntimeConfig = (config) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js b/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js new file mode 100644 index 0000000000..a97980bbb3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js @@ -0,0 +1,43 @@ +import packageInfo from "../package.json"; +import { decorateDefaultCredentialProvider } from "./defaultStsRoleAssumers"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; +export const getRuntimeConfig = (config) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.native.js b/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.native.js new file mode 100644 index 0000000000..0b54695282 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.native.js @@ -0,0 +1,11 @@ +import { Sha256 } from "@aws-crypto/sha256-js"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; +export const getRuntimeConfig = (config) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js b/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js new file mode 100644 index 0000000000..ca52ac2f63 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js @@ -0,0 +1,17 @@ +import { NoOpLogger } from "@aws-sdk/smithy-client"; +import { parseUrl } from "@aws-sdk/url-parser"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8"; +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +export const getRuntimeConfig = (config) => ({ + apiVersion: "2011-06-15", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "STS", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, +}); diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/STS.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/STS.d.ts new file mode 100644 index 0000000000..b67df1f425 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/STS.d.ts @@ -0,0 +1,619 @@ +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; +import { AssumeRoleCommandInput, AssumeRoleCommandOutput } from "./commands/AssumeRoleCommand"; +import { AssumeRoleWithSAMLCommandInput, AssumeRoleWithSAMLCommandOutput } from "./commands/AssumeRoleWithSAMLCommand"; +import { AssumeRoleWithWebIdentityCommandInput, AssumeRoleWithWebIdentityCommandOutput } from "./commands/AssumeRoleWithWebIdentityCommand"; +import { DecodeAuthorizationMessageCommandInput, DecodeAuthorizationMessageCommandOutput } from "./commands/DecodeAuthorizationMessageCommand"; +import { GetAccessKeyInfoCommandInput, GetAccessKeyInfoCommandOutput } from "./commands/GetAccessKeyInfoCommand"; +import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput } from "./commands/GetCallerIdentityCommand"; +import { GetFederationTokenCommandInput, GetFederationTokenCommandOutput } from "./commands/GetFederationTokenCommand"; +import { GetSessionTokenCommandInput, GetSessionTokenCommandOutput } from "./commands/GetSessionTokenCommand"; +import { STSClient } from "./STSClient"; +/** + * Security Token Service + *

Security Token Service (STS) enables you to request temporary, limited-privilege + * credentials for Identity and Access Management (IAM) users or for users that you + * authenticate (federated users). This guide provides descriptions of the STS API. For + * more information about using this service, see Temporary Security Credentials.

+ */ +export declare class STS extends STSClient { + /** + *

Returns a set of temporary security credentials that you can use to access Amazon Web Services + * resources. These temporary credentials consist of an access key ID, a secret access key, + * and a security token. Typically, you use AssumeRole within your account or for + * cross-account access. For a comparison of AssumeRole with other API operations + * that produce temporary credentials, see Requesting Temporary Security + * Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ *

+ * Permissions + *

+ *

The temporary security credentials created by AssumeRole can be used to + * make API calls to any Amazon Web Services service with the following exception: You cannot call the + * Amazon Web Services STS GetFederationToken or GetSessionToken API + * operations.

+ *

(Optional) You can pass inline or managed session policies to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies. The plaintext that you use for both inline and managed session + * policies can't exceed 2,048 characters. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

When you create a role, you create two policies: A role trust policy that specifies + * who can assume the role and a permissions policy that specifies + * what can be done with the role. You specify the trusted principal + * who is allowed to assume the role in the role trust policy.

+ *

To assume a role from a different account, your Amazon Web Services account must be trusted by the + * role. The trust relationship is defined in the role's trust policy when the role is + * created. That trust policy states which accounts are allowed to delegate that access to + * users in the account.

+ *

A user who wants to access a role in a different account must also have permissions that + * are delegated from the user account administrator. The administrator must attach a policy + * that allows the user to call AssumeRole for the ARN of the role in the other + * account.

+ *

To allow a user to assume a role in the same account, you can do either of the + * following:

+ *
    + *
  • + *

    Attach a policy to the user that allows the user to call AssumeRole + * (as long as the role's trust policy trusts the account).

    + *
  • + *
  • + *

    Add the user as a principal directly in the role's trust policy.

    + *
  • + *
+ *

You can do either because the role’s trust policy acts as an IAM resource-based + * policy. When a resource-based policy grants access to a principal in the same account, no + * additional identity-based policy is required. For more information about trust policies and + * resource-based policies, see IAM Policies in the + * IAM User Guide.

+ *

+ * Tags + *

+ *

(Optional) You can pass tag key-value pairs to your session. These tags are called + * session tags. For more information about session tags, see Passing Session Tags in STS in the + * IAM User Guide.

+ *

An administrator must grant you the permissions necessary to pass session tags. The + * administrator can also create granular permissions to allow you to pass only specific + * session tags. For more information, see Tutorial: Using Tags + * for Attribute-Based Access Control in the + * IAM User Guide.

+ *

You can set the session tags as transitive. Transitive tags persist during role + * chaining. For more information, see Chaining Roles + * with Session Tags in the IAM User Guide.

+ *

+ * Using MFA with AssumeRole + *

+ *

(Optional) You can include multi-factor authentication (MFA) information when you call + * AssumeRole. This is useful for cross-account scenarios to ensure that the + * user that assumes the role has been authenticated with an Amazon Web Services MFA device. In that + * scenario, the trust policy of the role being assumed includes a condition that tests for + * MFA authentication. If the caller does not include valid MFA information, the request to + * assume the role is denied. The condition in a trust policy that tests for MFA + * authentication might look like the following example.

+ *

+ * "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}} + *

+ *

For more information, see Configuring MFA-Protected API Access + * in the IAM User Guide guide.

+ *

To use MFA with AssumeRole, you pass values for the + * SerialNumber and TokenCode parameters. The + * SerialNumber value identifies the user's hardware or virtual MFA device. + * The TokenCode is the time-based one-time password (TOTP) that the MFA device + * produces.

+ */ + assumeRole(args: AssumeRoleCommandInput, options?: __HttpHandlerOptions): Promise; + assumeRole(args: AssumeRoleCommandInput, cb: (err: any, data?: AssumeRoleCommandOutput) => void): void; + assumeRole(args: AssumeRoleCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AssumeRoleCommandOutput) => void): void; + /** + *

Returns a set of temporary security credentials for users who have been authenticated + * via a SAML authentication response. This operation provides a mechanism for tying an + * enterprise identity store or directory to role-based Amazon Web Services access without user-specific + * credentials or configuration. For a comparison of AssumeRoleWithSAML with the + * other API operations that produce temporary credentials, see Requesting Temporary Security + * Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ *

The temporary security credentials returned by this operation consist of an access key + * ID, a secret access key, and a security token. Applications can use these temporary + * security credentials to sign calls to Amazon Web Services services.

+ *

+ * Session Duration + *

+ *

By default, the temporary security credentials created by + * AssumeRoleWithSAML last for one hour. However, you can use the optional + * DurationSeconds parameter to specify the duration of your session. Your + * role session lasts for the duration that you specify, or until the time specified in the + * SAML authentication response's SessionNotOnOrAfter value, whichever is + * shorter. You can provide a DurationSeconds value from 900 seconds (15 minutes) + * up to the maximum session duration setting for the role. This setting can have a value from + * 1 hour to 12 hours. To learn how to view the maximum value for your role, see View the + * Maximum Session Duration Setting for a Role in the + * IAM User Guide. The maximum session duration limit applies when + * you use the AssumeRole* API operations or the assume-role* CLI + * commands. However the limit does not apply when you use those operations to create a + * console URL. For more information, see Using IAM Roles in the + * IAM User Guide.

+ * + *

+ * Role chaining limits your CLI or Amazon Web Services API role + * session to a maximum of one hour. When you use the AssumeRole API operation + * to assume a role, you can specify the duration of your role session with the + * DurationSeconds parameter. You can specify a parameter value of up to + * 43200 seconds (12 hours), depending on the maximum session duration setting for your + * role. However, if you assume a role using role chaining and provide a + * DurationSeconds parameter value greater than one hour, the operation + * fails.

+ *
+ *

+ * Permissions + *

+ *

The temporary security credentials created by AssumeRoleWithSAML can be + * used to make API calls to any Amazon Web Services service with the following exception: you cannot call + * the STS GetFederationToken or GetSessionToken API + * operations.

+ *

(Optional) You can pass inline or managed session policies to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies. The plaintext that you use for both inline and managed session + * policies can't exceed 2,048 characters. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

Calling AssumeRoleWithSAML does not require the use of Amazon Web Services security + * credentials. The identity of the caller is validated by using keys in the metadata document + * that is uploaded for the SAML provider entity for your identity provider.

+ * + *

Calling AssumeRoleWithSAML can result in an entry in your CloudTrail logs. + * The entry includes the value in the NameID element of the SAML assertion. + * We recommend that you use a NameIDType that is not associated with any + * personally identifiable information (PII). For example, you could instead use the + * persistent identifier + * (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent).

+ *
+ *

+ * Tags + *

+ *

(Optional) You can configure your IdP to pass attributes into your SAML assertion as + * session tags. Each session tag consists of a key name and an associated value. For more + * information about session tags, see Passing Session Tags in STS in the + * IAM User Guide.

+ *

You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 + * characters and the values can’t exceed 256 characters. For these and additional limits, see + * IAM + * and STS Character Limits in the IAM User Guide.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ *

You can pass a session tag with the same key as a tag that is attached to the role. When + * you do, session tags override the role's tags with the same key.

+ *

An administrator must grant you the permissions necessary to pass session tags. The + * administrator can also create granular permissions to allow you to pass only specific + * session tags. For more information, see Tutorial: Using Tags + * for Attribute-Based Access Control in the + * IAM User Guide.

+ *

You can set the session tags as transitive. Transitive tags persist during role + * chaining. For more information, see Chaining Roles + * with Session Tags in the IAM User Guide.

+ *

+ * SAML Configuration + *

+ *

Before your application can call AssumeRoleWithSAML, you must configure + * your SAML identity provider (IdP) to issue the claims required by Amazon Web Services. Additionally, you + * must use Identity and Access Management (IAM) to create a SAML provider entity in your Amazon Web Services account that + * represents your identity provider. You must also create an IAM role that specifies this + * SAML provider in its trust policy.

+ *

For more information, see the following resources:

+ * + */ + assumeRoleWithSAML(args: AssumeRoleWithSAMLCommandInput, options?: __HttpHandlerOptions): Promise; + assumeRoleWithSAML(args: AssumeRoleWithSAMLCommandInput, cb: (err: any, data?: AssumeRoleWithSAMLCommandOutput) => void): void; + assumeRoleWithSAML(args: AssumeRoleWithSAMLCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AssumeRoleWithSAMLCommandOutput) => void): void; + /** + *

Returns a set of temporary security credentials for users who have been authenticated in + * a mobile or web application with a web identity provider. Example providers include the + * OAuth 2.0 providers Login with Amazon and Facebook, or any OpenID Connect-compatible + * identity provider such as Google or Amazon Cognito federated identities.

+ * + *

For mobile applications, we recommend that you use Amazon Cognito. You can use Amazon Cognito with the + * Amazon Web Services SDK for iOS Developer Guide and the Amazon Web Services SDK for Android Developer Guide to uniquely + * identify a user. You can also supply the user with a consistent identity throughout the + * lifetime of an application.

+ *

To learn more about Amazon Cognito, see Amazon Cognito Overview in + * Amazon Web Services SDK for Android Developer Guide and Amazon Cognito Overview in the + * Amazon Web Services SDK for iOS Developer Guide.

+ *
+ *

Calling AssumeRoleWithWebIdentity does not require the use of Amazon Web Services + * security credentials. Therefore, you can distribute an application (for example, on mobile + * devices) that requests temporary security credentials without including long-term Amazon Web Services + * credentials in the application. You also don't need to deploy server-based proxy services + * that use long-term Amazon Web Services credentials. Instead, the identity of the caller is validated by + * using a token from the web identity provider. For a comparison of + * AssumeRoleWithWebIdentity with the other API operations that produce + * temporary credentials, see Requesting Temporary Security + * Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ *

The temporary security credentials returned by this API consist of an access key ID, a + * secret access key, and a security token. Applications can use these temporary security + * credentials to sign calls to Amazon Web Services service API operations.

+ *

+ * Session Duration + *

+ *

By default, the temporary security credentials created by + * AssumeRoleWithWebIdentity last for one hour. However, you can use the + * optional DurationSeconds parameter to specify the duration of your session. + * You can provide a value from 900 seconds (15 minutes) up to the maximum session duration + * setting for the role. This setting can have a value from 1 hour to 12 hours. To learn how + * to view the maximum value for your role, see View the + * Maximum Session Duration Setting for a Role in the + * IAM User Guide. The maximum session duration limit applies when + * you use the AssumeRole* API operations or the assume-role* CLI + * commands. However the limit does not apply when you use those operations to create a + * console URL. For more information, see Using IAM Roles in the + * IAM User Guide.

+ *

+ * Permissions + *

+ *

The temporary security credentials created by AssumeRoleWithWebIdentity can + * be used to make API calls to any Amazon Web Services service with the following exception: you cannot + * call the STS GetFederationToken or GetSessionToken API + * operations.

+ *

(Optional) You can pass inline or managed session policies to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies. The plaintext that you use for both inline and managed session + * policies can't exceed 2,048 characters. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

+ * Tags + *

+ *

(Optional) You can configure your IdP to pass attributes into your web identity token as + * session tags. Each session tag consists of a key name and an associated value. For more + * information about session tags, see Passing Session Tags in STS in the + * IAM User Guide.

+ *

You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 + * characters and the values can’t exceed 256 characters. For these and additional limits, see + * IAM + * and STS Character Limits in the IAM User Guide.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ *

You can pass a session tag with the same key as a tag that is attached to the role. When + * you do, the session tag overrides the role tag with the same key.

+ *

An administrator must grant you the permissions necessary to pass session tags. The + * administrator can also create granular permissions to allow you to pass only specific + * session tags. For more information, see Tutorial: Using Tags + * for Attribute-Based Access Control in the + * IAM User Guide.

+ *

You can set the session tags as transitive. Transitive tags persist during role + * chaining. For more information, see Chaining Roles + * with Session Tags in the IAM User Guide.

+ *

+ * Identities + *

+ *

Before your application can call AssumeRoleWithWebIdentity, you must have + * an identity token from a supported identity provider and create a role that the application + * can assume. The role that your application assumes must trust the identity provider that is + * associated with the identity token. In other words, the identity provider must be specified + * in the role's trust policy.

+ * + *

Calling AssumeRoleWithWebIdentity can result in an entry in your + * CloudTrail logs. The entry includes the Subject of + * the provided web identity token. We recommend that you avoid using any personally + * identifiable information (PII) in this field. For example, you could instead use a GUID + * or a pairwise identifier, as suggested + * in the OIDC specification.

+ *
+ *

For more information about how to use web identity federation and the + * AssumeRoleWithWebIdentity API, see the following resources:

+ * + */ + assumeRoleWithWebIdentity(args: AssumeRoleWithWebIdentityCommandInput, options?: __HttpHandlerOptions): Promise; + assumeRoleWithWebIdentity(args: AssumeRoleWithWebIdentityCommandInput, cb: (err: any, data?: AssumeRoleWithWebIdentityCommandOutput) => void): void; + assumeRoleWithWebIdentity(args: AssumeRoleWithWebIdentityCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AssumeRoleWithWebIdentityCommandOutput) => void): void; + /** + *

Decodes additional information about the authorization status of a request from an + * encoded message returned in response to an Amazon Web Services request.

+ *

For example, if a user is not authorized to perform an operation that he or she has + * requested, the request returns a Client.UnauthorizedOperation response (an + * HTTP 403 response). Some Amazon Web Services operations additionally return an encoded message that can + * provide details about this authorization failure.

+ * + *

Only certain Amazon Web Services operations return an encoded authorization message. The + * documentation for an individual operation indicates whether that operation returns an + * encoded message in addition to returning an HTTP code.

+ *
+ *

The message is encoded because the details of the authorization status can contain + * privileged information that the user who requested the operation should not see. To decode + * an authorization status message, a user must be granted permissions through an IAM policy to + * request the DecodeAuthorizationMessage + * (sts:DecodeAuthorizationMessage) action.

+ *

The decoded message includes the following type of information:

+ *
    + *
  • + *

    Whether the request was denied due to an explicit deny or due to the absence of an + * explicit allow. For more information, see Determining Whether a Request is Allowed or Denied in the + * IAM User Guide.

    + *
  • + *
  • + *

    The principal who made the request.

    + *
  • + *
  • + *

    The requested action.

    + *
  • + *
  • + *

    The requested resource.

    + *
  • + *
  • + *

    The values of condition keys in the context of the user's request.

    + *
  • + *
+ */ + decodeAuthorizationMessage(args: DecodeAuthorizationMessageCommandInput, options?: __HttpHandlerOptions): Promise; + decodeAuthorizationMessage(args: DecodeAuthorizationMessageCommandInput, cb: (err: any, data?: DecodeAuthorizationMessageCommandOutput) => void): void; + decodeAuthorizationMessage(args: DecodeAuthorizationMessageCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DecodeAuthorizationMessageCommandOutput) => void): void; + /** + *

Returns the account identifier for the specified access key ID.

+ *

Access keys consist of two parts: an access key ID (for example, + * AKIAIOSFODNN7EXAMPLE) and a secret access key (for example, + * wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). For more information about + * access keys, see Managing Access Keys for IAM + * Users in the IAM User Guide.

+ *

When you pass an access key ID to this operation, it returns the ID of the Amazon Web Services account + * to which the keys belong. Access key IDs beginning with AKIA are long-term + * credentials for an IAM user or the Amazon Web Services account root user. Access key IDs beginning with + * ASIA are temporary credentials that are created using STS operations. If + * the account in the response belongs to you, you can sign in as the root user and review + * your root user access keys. Then, you can pull a credentials report to + * learn which IAM user owns the keys. To learn who requested the temporary credentials for + * an ASIA access key, view the STS events in your CloudTrail logs in the + * IAM User Guide.

+ *

This operation does not indicate the state of the access key. The key might be active, + * inactive, or deleted. Active keys might not have permissions to perform an operation. + * Providing a deleted access key might return an error that the key doesn't exist.

+ */ + getAccessKeyInfo(args: GetAccessKeyInfoCommandInput, options?: __HttpHandlerOptions): Promise; + getAccessKeyInfo(args: GetAccessKeyInfoCommandInput, cb: (err: any, data?: GetAccessKeyInfoCommandOutput) => void): void; + getAccessKeyInfo(args: GetAccessKeyInfoCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetAccessKeyInfoCommandOutput) => void): void; + /** + *

Returns details about the IAM user or role whose credentials are used to call the + * operation.

+ * + *

No permissions are required to perform this operation. If an administrator adds a + * policy to your IAM user or role that explicitly denies access to the + * sts:GetCallerIdentity action, you can still perform this operation. + * Permissions are not required because the same information is returned when an IAM user + * or role is denied access. To view an example response, see I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice in the + * IAM User Guide.

+ *
+ */ + getCallerIdentity(args: GetCallerIdentityCommandInput, options?: __HttpHandlerOptions): Promise; + getCallerIdentity(args: GetCallerIdentityCommandInput, cb: (err: any, data?: GetCallerIdentityCommandOutput) => void): void; + getCallerIdentity(args: GetCallerIdentityCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetCallerIdentityCommandOutput) => void): void; + /** + *

Returns a set of temporary security credentials (consisting of an access key ID, a + * secret access key, and a security token) for a federated user. A typical use is in a proxy + * application that gets temporary security credentials on behalf of distributed applications + * inside a corporate network. You must call the GetFederationToken operation + * using the long-term security credentials of an IAM user. As a result, this call is + * appropriate in contexts where those credentials can be safely stored, usually in a + * server-based application. For a comparison of GetFederationToken with the + * other API operations that produce temporary credentials, see Requesting Temporary Security + * Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ * + *

You can create a mobile-based or browser-based app that can authenticate users using + * a web identity provider like Login with Amazon, Facebook, Google, or an OpenID + * Connect-compatible identity provider. In this case, we recommend that you use Amazon Cognito or + * AssumeRoleWithWebIdentity. For more information, see Federation Through a Web-based Identity Provider in the + * IAM User Guide.

+ *
+ *

You can also call GetFederationToken using the security credentials of an + * Amazon Web Services account root user, but we do not recommend it. Instead, we recommend that you create + * an IAM user for the purpose of the proxy application. Then attach a policy to the IAM + * user that limits federated users to only the actions and resources that they need to + * access. For more information, see IAM Best Practices in the + * IAM User Guide.

+ *

+ * Session duration + *

+ *

The temporary credentials are valid for the specified duration, from 900 seconds (15 + * minutes) up to a maximum of 129,600 seconds (36 hours). The default session duration is + * 43,200 seconds (12 hours). Temporary credentials obtained by using the Amazon Web Services account root + * user credentials have a maximum duration of 3,600 seconds (1 hour).

+ *

+ * Permissions + *

+ *

You can use the temporary credentials created by GetFederationToken in any + * Amazon Web Services service with the following exceptions:

+ *
    + *
  • + *

    You cannot call any IAM operations using the CLI or the Amazon Web Services API. This limitation does not apply to console sessions.

    + *
  • + *
  • + *

    You cannot call any STS operations except GetCallerIdentity.

    + *
  • + *
+ *

You can use temporary credentials for single sign-on (SSO) to the console.

+ *

You must pass an inline or managed session policy to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies. The plaintext that you use for both inline and managed session + * policies can't exceed 2,048 characters.

+ *

Though the session policy parameters are optional, if you do not pass a policy, then the + * resulting federated user session has no permissions. When you pass session policies, the + * session permissions are the intersection of the IAM user policies and the session + * policies that you pass. This gives you a way to further restrict the permissions for a + * federated user. You cannot use session policies to grant more permissions than those that + * are defined in the permissions policy of the IAM user. For more information, see Session + * Policies in the IAM User Guide. For information about + * using GetFederationToken to create temporary security credentials, see GetFederationToken—Federation Through a Custom Identity Broker.

+ *

You can use the credentials to access a resource that has a resource-based policy. If + * that policy specifically references the federated user session in the + * Principal element of the policy, the session has the permissions allowed by + * the policy. These permissions are granted in addition to the permissions granted by the + * session policies.

+ *

+ * Tags + *

+ *

(Optional) You can pass tag key-value pairs to your session. These are called session + * tags. For more information about session tags, see Passing Session Tags in STS in the + * IAM User Guide.

+ * + *

You can create a mobile-based or browser-based app that can authenticate users using + * a web identity provider like Login with Amazon, Facebook, Google, or an OpenID + * Connect-compatible identity provider. In this case, we recommend that you use Amazon Cognito or + * AssumeRoleWithWebIdentity. For more information, see Federation Through a Web-based Identity Provider in the + * IAM User Guide.

+ *
+ *

An administrator must grant you the permissions necessary to pass session tags. The + * administrator can also create granular permissions to allow you to pass only specific + * session tags. For more information, see Tutorial: Using Tags + * for Attribute-Based Access Control in the + * IAM User Guide.

+ *

Tag key–value pairs are not case sensitive, but case is preserved. This means that you + * cannot have separate Department and department tag keys. Assume + * that the user that you are federating has the + * Department=Marketing tag and you pass the + * department=engineering session tag. Department + * and department are not saved as separate tags, and the session tag passed in + * the request takes precedence over the user tag.

+ */ + getFederationToken(args: GetFederationTokenCommandInput, options?: __HttpHandlerOptions): Promise; + getFederationToken(args: GetFederationTokenCommandInput, cb: (err: any, data?: GetFederationTokenCommandOutput) => void): void; + getFederationToken(args: GetFederationTokenCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetFederationTokenCommandOutput) => void): void; + /** + *

Returns a set of temporary credentials for an Amazon Web Services account or IAM user. The + * credentials consist of an access key ID, a secret access key, and a security token. + * Typically, you use GetSessionToken if you want to use MFA to protect + * programmatic calls to specific Amazon Web Services API operations like Amazon EC2 StopInstances. + * MFA-enabled IAM users would need to call GetSessionToken and submit an MFA + * code that is associated with their MFA device. Using the temporary security credentials + * that are returned from the call, IAM users can then make programmatic calls to API + * operations that require MFA authentication. If you do not supply a correct MFA code, then + * the API returns an access denied error. For a comparison of GetSessionToken + * with the other API operations that produce temporary credentials, see Requesting + * Temporary Security Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ * + *

No permissions are required for users to perform this operation. The purpose of the + * sts:GetSessionToken operation is to authenticate the user using MFA. You + * cannot use policies to control authentication operations. For more information, see + * Permissions for GetSessionToken in the + * IAM User Guide.

+ *
+ *

+ * Session Duration + *

+ *

The GetSessionToken operation must be called by using the long-term Amazon Web Services + * security credentials of the Amazon Web Services account root user or an IAM user. Credentials that are + * created by IAM users are valid for the duration that you specify. This duration can range + * from 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours), with a default + * of 43,200 seconds (12 hours). Credentials based on account credentials can range from 900 + * seconds (15 minutes) up to 3,600 seconds (1 hour), with a default of 1 hour.

+ *

+ * Permissions + *

+ *

The temporary security credentials created by GetSessionToken can be used + * to make API calls to any Amazon Web Services service with the following exceptions:

+ *
    + *
  • + *

    You cannot call any IAM API operations unless MFA authentication information is + * included in the request.

    + *
  • + *
  • + *

    You cannot call any STS API except + * AssumeRole or GetCallerIdentity.

    + *
  • + *
+ * + *

We recommend that you do not call GetSessionToken with Amazon Web Services account + * root user credentials. Instead, follow our best practices by + * creating one or more IAM users, giving them the necessary permissions, and using IAM + * users for everyday interaction with Amazon Web Services.

+ *
+ *

The credentials that are returned by GetSessionToken are based on + * permissions associated with the user whose credentials were used to call the operation. If + * GetSessionToken is called using Amazon Web Services account root user credentials, the + * temporary credentials have root user permissions. Similarly, if + * GetSessionToken is called using the credentials of an IAM user, the + * temporary credentials have the same permissions as the IAM user.

+ *

For more information about using GetSessionToken to create temporary + * credentials, go to Temporary + * Credentials for Users in Untrusted Environments in the + * IAM User Guide.

+ */ + getSessionToken(args: GetSessionTokenCommandInput, options?: __HttpHandlerOptions): Promise; + getSessionToken(args: GetSessionTokenCommandInput, cb: (err: any, data?: GetSessionTokenCommandOutput) => void): void; + getSessionToken(args: GetSessionTokenCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetSessionTokenCommandOutput) => void): void; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/STSClient.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/STSClient.d.ts new file mode 100644 index 0000000000..250aa831df --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/STSClient.d.ts @@ -0,0 +1,153 @@ +import { RegionInputConfig, RegionResolvedConfig } from "@aws-sdk/config-resolver"; +import { EndpointInputConfig, EndpointResolvedConfig } from "@aws-sdk/middleware-endpoint"; +import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header"; +import { RetryInputConfig, RetryResolvedConfig } from "@aws-sdk/middleware-retry"; +import { StsAuthInputConfig, StsAuthResolvedConfig } from "@aws-sdk/middleware-sdk-sts"; +import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@aws-sdk/smithy-client"; +import { BodyLengthCalculator as __BodyLengthCalculator, ChecksumConstructor as __ChecksumConstructor, Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types"; +import { AssumeRoleCommandInput, AssumeRoleCommandOutput } from "./commands/AssumeRoleCommand"; +import { AssumeRoleWithSAMLCommandInput, AssumeRoleWithSAMLCommandOutput } from "./commands/AssumeRoleWithSAMLCommand"; +import { AssumeRoleWithWebIdentityCommandInput, AssumeRoleWithWebIdentityCommandOutput } from "./commands/AssumeRoleWithWebIdentityCommand"; +import { DecodeAuthorizationMessageCommandInput, DecodeAuthorizationMessageCommandOutput } from "./commands/DecodeAuthorizationMessageCommand"; +import { GetAccessKeyInfoCommandInput, GetAccessKeyInfoCommandOutput } from "./commands/GetAccessKeyInfoCommand"; +import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput } from "./commands/GetCallerIdentityCommand"; +import { GetFederationTokenCommandInput, GetFederationTokenCommandOutput } from "./commands/GetFederationTokenCommand"; +import { GetSessionTokenCommandInput, GetSessionTokenCommandOutput } from "./commands/GetSessionTokenCommand"; +import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters"; +export declare type ServiceInputTypes = AssumeRoleCommandInput | AssumeRoleWithSAMLCommandInput | AssumeRoleWithWebIdentityCommandInput | DecodeAuthorizationMessageCommandInput | GetAccessKeyInfoCommandInput | GetCallerIdentityCommandInput | GetFederationTokenCommandInput | GetSessionTokenCommandInput; +export declare type ServiceOutputTypes = AssumeRoleCommandOutput | AssumeRoleWithSAMLCommandOutput | AssumeRoleWithWebIdentityCommandOutput | DecodeAuthorizationMessageCommandOutput | GetAccessKeyInfoCommandOutput | GetCallerIdentityCommandOutput | GetFederationTokenCommandOutput | GetSessionTokenCommandOutput; +export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandler; + /** + * A constructor for a class implementing the {@link __Checksum} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + /** + * The runtime environment. + * @internal + */ + runtime?: string; + /** + * Disable dyanamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + /** + * Specifies which retry algorithm to use. + */ + retryMode?: string | __Provider; + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + /** + * Default credentials provider; Not available in browser runtime. + * @internal + */ + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** + * The {@link __DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} +declare type STSClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig & RetryInputConfig & HostHeaderInputConfig & StsAuthInputConfig & UserAgentInputConfig & ClientInputEndpointParameters; +/** + * The configuration interface of STSClient class constructor that set the region, credentials and other options. + */ +export interface STSClientConfig extends STSClientConfigType { +} +declare type STSClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & RegionResolvedConfig & EndpointResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & StsAuthResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters; +/** + * The resolved configuration interface of STSClient class. This is resolved and normalized from the {@link STSClientConfig | constructor configuration interface}. + */ +export interface STSClientResolvedConfig extends STSClientResolvedConfigType { +} +/** + * Security Token Service + *

Security Token Service (STS) enables you to request temporary, limited-privilege + * credentials for Identity and Access Management (IAM) users or for users that you + * authenticate (federated users). This guide provides descriptions of the STS API. For + * more information about using this service, see Temporary Security Credentials.

+ */ +export declare class STSClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig> { + /** + * The resolved configuration of STSClient class. This is resolved and normalized from the {@link STSClientConfig | constructor configuration interface}. + */ + readonly config: STSClientResolvedConfig; + constructor(configuration: STSClientConfig); + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleCommand.d.ts new file mode 100644 index 0000000000..04570bf27d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleCommand.d.ts @@ -0,0 +1,124 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { AssumeRoleRequest, AssumeRoleResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient"; +export interface AssumeRoleCommandInput extends AssumeRoleRequest { +} +export interface AssumeRoleCommandOutput extends AssumeRoleResponse, __MetadataBearer { +} +/** + *

Returns a set of temporary security credentials that you can use to access Amazon Web Services + * resources. These temporary credentials consist of an access key ID, a secret access key, + * and a security token. Typically, you use AssumeRole within your account or for + * cross-account access. For a comparison of AssumeRole with other API operations + * that produce temporary credentials, see Requesting Temporary Security + * Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ *

+ * Permissions + *

+ *

The temporary security credentials created by AssumeRole can be used to + * make API calls to any Amazon Web Services service with the following exception: You cannot call the + * Amazon Web Services STS GetFederationToken or GetSessionToken API + * operations.

+ *

(Optional) You can pass inline or managed session policies to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies. The plaintext that you use for both inline and managed session + * policies can't exceed 2,048 characters. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

When you create a role, you create two policies: A role trust policy that specifies + * who can assume the role and a permissions policy that specifies + * what can be done with the role. You specify the trusted principal + * who is allowed to assume the role in the role trust policy.

+ *

To assume a role from a different account, your Amazon Web Services account must be trusted by the + * role. The trust relationship is defined in the role's trust policy when the role is + * created. That trust policy states which accounts are allowed to delegate that access to + * users in the account.

+ *

A user who wants to access a role in a different account must also have permissions that + * are delegated from the user account administrator. The administrator must attach a policy + * that allows the user to call AssumeRole for the ARN of the role in the other + * account.

+ *

To allow a user to assume a role in the same account, you can do either of the + * following:

+ *
    + *
  • + *

    Attach a policy to the user that allows the user to call AssumeRole + * (as long as the role's trust policy trusts the account).

    + *
  • + *
  • + *

    Add the user as a principal directly in the role's trust policy.

    + *
  • + *
+ *

You can do either because the role’s trust policy acts as an IAM resource-based + * policy. When a resource-based policy grants access to a principal in the same account, no + * additional identity-based policy is required. For more information about trust policies and + * resource-based policies, see IAM Policies in the + * IAM User Guide.

+ *

+ * Tags + *

+ *

(Optional) You can pass tag key-value pairs to your session. These tags are called + * session tags. For more information about session tags, see Passing Session Tags in STS in the + * IAM User Guide.

+ *

An administrator must grant you the permissions necessary to pass session tags. The + * administrator can also create granular permissions to allow you to pass only specific + * session tags. For more information, see Tutorial: Using Tags + * for Attribute-Based Access Control in the + * IAM User Guide.

+ *

You can set the session tags as transitive. Transitive tags persist during role + * chaining. For more information, see Chaining Roles + * with Session Tags in the IAM User Guide.

+ *

+ * Using MFA with AssumeRole + *

+ *

(Optional) You can include multi-factor authentication (MFA) information when you call + * AssumeRole. This is useful for cross-account scenarios to ensure that the + * user that assumes the role has been authenticated with an Amazon Web Services MFA device. In that + * scenario, the trust policy of the role being assumed includes a condition that tests for + * MFA authentication. If the caller does not include valid MFA information, the request to + * assume the role is denied. The condition in a trust policy that tests for MFA + * authentication might look like the following example.

+ *

+ * "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}} + *

+ *

For more information, see Configuring MFA-Protected API Access + * in the IAM User Guide guide.

+ *

To use MFA with AssumeRole, you pass values for the + * SerialNumber and TokenCode parameters. The + * SerialNumber value identifies the user's hardware or virtual MFA device. + * The TokenCode is the time-based one-time password (TOTP) that the MFA device + * produces.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { STSClient, AssumeRoleCommand } from "@aws-sdk/client-sts"; // ES Modules import + * // const { STSClient, AssumeRoleCommand } = require("@aws-sdk/client-sts"); // CommonJS import + * const client = new STSClient(config); + * const command = new AssumeRoleCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link AssumeRoleCommandInput} for command's `input` shape. + * @see {@link AssumeRoleCommandOutput} for command's `response` shape. + * @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape. + * + */ +export declare class AssumeRoleCommand extends $Command { + readonly input: AssumeRoleCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: AssumeRoleCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: STSClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithSAMLCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithSAMLCommand.d.ts new file mode 100644 index 0000000000..039c2fb2c0 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithSAMLCommand.d.ts @@ -0,0 +1,165 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { AssumeRoleWithSAMLRequest, AssumeRoleWithSAMLResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient"; +export interface AssumeRoleWithSAMLCommandInput extends AssumeRoleWithSAMLRequest { +} +export interface AssumeRoleWithSAMLCommandOutput extends AssumeRoleWithSAMLResponse, __MetadataBearer { +} +/** + *

Returns a set of temporary security credentials for users who have been authenticated + * via a SAML authentication response. This operation provides a mechanism for tying an + * enterprise identity store or directory to role-based Amazon Web Services access without user-specific + * credentials or configuration. For a comparison of AssumeRoleWithSAML with the + * other API operations that produce temporary credentials, see Requesting Temporary Security + * Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ *

The temporary security credentials returned by this operation consist of an access key + * ID, a secret access key, and a security token. Applications can use these temporary + * security credentials to sign calls to Amazon Web Services services.

+ *

+ * Session Duration + *

+ *

By default, the temporary security credentials created by + * AssumeRoleWithSAML last for one hour. However, you can use the optional + * DurationSeconds parameter to specify the duration of your session. Your + * role session lasts for the duration that you specify, or until the time specified in the + * SAML authentication response's SessionNotOnOrAfter value, whichever is + * shorter. You can provide a DurationSeconds value from 900 seconds (15 minutes) + * up to the maximum session duration setting for the role. This setting can have a value from + * 1 hour to 12 hours. To learn how to view the maximum value for your role, see View the + * Maximum Session Duration Setting for a Role in the + * IAM User Guide. The maximum session duration limit applies when + * you use the AssumeRole* API operations or the assume-role* CLI + * commands. However the limit does not apply when you use those operations to create a + * console URL. For more information, see Using IAM Roles in the + * IAM User Guide.

+ * + *

+ * Role chaining limits your CLI or Amazon Web Services API role + * session to a maximum of one hour. When you use the AssumeRole API operation + * to assume a role, you can specify the duration of your role session with the + * DurationSeconds parameter. You can specify a parameter value of up to + * 43200 seconds (12 hours), depending on the maximum session duration setting for your + * role. However, if you assume a role using role chaining and provide a + * DurationSeconds parameter value greater than one hour, the operation + * fails.

+ *
+ *

+ * Permissions + *

+ *

The temporary security credentials created by AssumeRoleWithSAML can be + * used to make API calls to any Amazon Web Services service with the following exception: you cannot call + * the STS GetFederationToken or GetSessionToken API + * operations.

+ *

(Optional) You can pass inline or managed session policies to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies. The plaintext that you use for both inline and managed session + * policies can't exceed 2,048 characters. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

Calling AssumeRoleWithSAML does not require the use of Amazon Web Services security + * credentials. The identity of the caller is validated by using keys in the metadata document + * that is uploaded for the SAML provider entity for your identity provider.

+ * + *

Calling AssumeRoleWithSAML can result in an entry in your CloudTrail logs. + * The entry includes the value in the NameID element of the SAML assertion. + * We recommend that you use a NameIDType that is not associated with any + * personally identifiable information (PII). For example, you could instead use the + * persistent identifier + * (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent).

+ *
+ *

+ * Tags + *

+ *

(Optional) You can configure your IdP to pass attributes into your SAML assertion as + * session tags. Each session tag consists of a key name and an associated value. For more + * information about session tags, see Passing Session Tags in STS in the + * IAM User Guide.

+ *

You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 + * characters and the values can’t exceed 256 characters. For these and additional limits, see + * IAM + * and STS Character Limits in the IAM User Guide.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ *

You can pass a session tag with the same key as a tag that is attached to the role. When + * you do, session tags override the role's tags with the same key.

+ *

An administrator must grant you the permissions necessary to pass session tags. The + * administrator can also create granular permissions to allow you to pass only specific + * session tags. For more information, see Tutorial: Using Tags + * for Attribute-Based Access Control in the + * IAM User Guide.

+ *

You can set the session tags as transitive. Transitive tags persist during role + * chaining. For more information, see Chaining Roles + * with Session Tags in the IAM User Guide.

+ *

+ * SAML Configuration + *

+ *

Before your application can call AssumeRoleWithSAML, you must configure + * your SAML identity provider (IdP) to issue the claims required by Amazon Web Services. Additionally, you + * must use Identity and Access Management (IAM) to create a SAML provider entity in your Amazon Web Services account that + * represents your identity provider. You must also create an IAM role that specifies this + * SAML provider in its trust policy.

+ *

For more information, see the following resources:

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { STSClient, AssumeRoleWithSAMLCommand } from "@aws-sdk/client-sts"; // ES Modules import + * // const { STSClient, AssumeRoleWithSAMLCommand } = require("@aws-sdk/client-sts"); // CommonJS import + * const client = new STSClient(config); + * const command = new AssumeRoleWithSAMLCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link AssumeRoleWithSAMLCommandInput} for command's `input` shape. + * @see {@link AssumeRoleWithSAMLCommandOutput} for command's `response` shape. + * @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape. + * + */ +export declare class AssumeRoleWithSAMLCommand extends $Command { + readonly input: AssumeRoleWithSAMLCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: AssumeRoleWithSAMLCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: STSClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithWebIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithWebIdentityCommand.d.ts new file mode 100644 index 0000000000..123aceea30 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/AssumeRoleWithWebIdentityCommand.d.ts @@ -0,0 +1,169 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { AssumeRoleWithWebIdentityRequest, AssumeRoleWithWebIdentityResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient"; +export interface AssumeRoleWithWebIdentityCommandInput extends AssumeRoleWithWebIdentityRequest { +} +export interface AssumeRoleWithWebIdentityCommandOutput extends AssumeRoleWithWebIdentityResponse, __MetadataBearer { +} +/** + *

Returns a set of temporary security credentials for users who have been authenticated in + * a mobile or web application with a web identity provider. Example providers include the + * OAuth 2.0 providers Login with Amazon and Facebook, or any OpenID Connect-compatible + * identity provider such as Google or Amazon Cognito federated identities.

+ * + *

For mobile applications, we recommend that you use Amazon Cognito. You can use Amazon Cognito with the + * Amazon Web Services SDK for iOS Developer Guide and the Amazon Web Services SDK for Android Developer Guide to uniquely + * identify a user. You can also supply the user with a consistent identity throughout the + * lifetime of an application.

+ *

To learn more about Amazon Cognito, see Amazon Cognito Overview in + * Amazon Web Services SDK for Android Developer Guide and Amazon Cognito Overview in the + * Amazon Web Services SDK for iOS Developer Guide.

+ *
+ *

Calling AssumeRoleWithWebIdentity does not require the use of Amazon Web Services + * security credentials. Therefore, you can distribute an application (for example, on mobile + * devices) that requests temporary security credentials without including long-term Amazon Web Services + * credentials in the application. You also don't need to deploy server-based proxy services + * that use long-term Amazon Web Services credentials. Instead, the identity of the caller is validated by + * using a token from the web identity provider. For a comparison of + * AssumeRoleWithWebIdentity with the other API operations that produce + * temporary credentials, see Requesting Temporary Security + * Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ *

The temporary security credentials returned by this API consist of an access key ID, a + * secret access key, and a security token. Applications can use these temporary security + * credentials to sign calls to Amazon Web Services service API operations.

+ *

+ * Session Duration + *

+ *

By default, the temporary security credentials created by + * AssumeRoleWithWebIdentity last for one hour. However, you can use the + * optional DurationSeconds parameter to specify the duration of your session. + * You can provide a value from 900 seconds (15 minutes) up to the maximum session duration + * setting for the role. This setting can have a value from 1 hour to 12 hours. To learn how + * to view the maximum value for your role, see View the + * Maximum Session Duration Setting for a Role in the + * IAM User Guide. The maximum session duration limit applies when + * you use the AssumeRole* API operations or the assume-role* CLI + * commands. However the limit does not apply when you use those operations to create a + * console URL. For more information, see Using IAM Roles in the + * IAM User Guide.

+ *

+ * Permissions + *

+ *

The temporary security credentials created by AssumeRoleWithWebIdentity can + * be used to make API calls to any Amazon Web Services service with the following exception: you cannot + * call the STS GetFederationToken or GetSessionToken API + * operations.

+ *

(Optional) You can pass inline or managed session policies to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies. The plaintext that you use for both inline and managed session + * policies can't exceed 2,048 characters. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

+ * Tags + *

+ *

(Optional) You can configure your IdP to pass attributes into your web identity token as + * session tags. Each session tag consists of a key name and an associated value. For more + * information about session tags, see Passing Session Tags in STS in the + * IAM User Guide.

+ *

You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 + * characters and the values can’t exceed 256 characters. For these and additional limits, see + * IAM + * and STS Character Limits in the IAM User Guide.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ *

You can pass a session tag with the same key as a tag that is attached to the role. When + * you do, the session tag overrides the role tag with the same key.

+ *

An administrator must grant you the permissions necessary to pass session tags. The + * administrator can also create granular permissions to allow you to pass only specific + * session tags. For more information, see Tutorial: Using Tags + * for Attribute-Based Access Control in the + * IAM User Guide.

+ *

You can set the session tags as transitive. Transitive tags persist during role + * chaining. For more information, see Chaining Roles + * with Session Tags in the IAM User Guide.

+ *

+ * Identities + *

+ *

Before your application can call AssumeRoleWithWebIdentity, you must have + * an identity token from a supported identity provider and create a role that the application + * can assume. The role that your application assumes must trust the identity provider that is + * associated with the identity token. In other words, the identity provider must be specified + * in the role's trust policy.

+ * + *

Calling AssumeRoleWithWebIdentity can result in an entry in your + * CloudTrail logs. The entry includes the Subject of + * the provided web identity token. We recommend that you avoid using any personally + * identifiable information (PII) in this field. For example, you could instead use a GUID + * or a pairwise identifier, as suggested + * in the OIDC specification.

+ *
+ *

For more information about how to use web identity federation and the + * AssumeRoleWithWebIdentity API, see the following resources:

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { STSClient, AssumeRoleWithWebIdentityCommand } from "@aws-sdk/client-sts"; // ES Modules import + * // const { STSClient, AssumeRoleWithWebIdentityCommand } = require("@aws-sdk/client-sts"); // CommonJS import + * const client = new STSClient(config); + * const command = new AssumeRoleWithWebIdentityCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link AssumeRoleWithWebIdentityCommandInput} for command's `input` shape. + * @see {@link AssumeRoleWithWebIdentityCommandOutput} for command's `response` shape. + * @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape. + * + */ +export declare class AssumeRoleWithWebIdentityCommand extends $Command { + readonly input: AssumeRoleWithWebIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: AssumeRoleWithWebIdentityCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: STSClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/commands/DecodeAuthorizationMessageCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/DecodeAuthorizationMessageCommand.d.ts new file mode 100644 index 0000000000..13885d1247 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/DecodeAuthorizationMessageCommand.d.ts @@ -0,0 +1,72 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { DecodeAuthorizationMessageRequest, DecodeAuthorizationMessageResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient"; +export interface DecodeAuthorizationMessageCommandInput extends DecodeAuthorizationMessageRequest { +} +export interface DecodeAuthorizationMessageCommandOutput extends DecodeAuthorizationMessageResponse, __MetadataBearer { +} +/** + *

Decodes additional information about the authorization status of a request from an + * encoded message returned in response to an Amazon Web Services request.

+ *

For example, if a user is not authorized to perform an operation that he or she has + * requested, the request returns a Client.UnauthorizedOperation response (an + * HTTP 403 response). Some Amazon Web Services operations additionally return an encoded message that can + * provide details about this authorization failure.

+ * + *

Only certain Amazon Web Services operations return an encoded authorization message. The + * documentation for an individual operation indicates whether that operation returns an + * encoded message in addition to returning an HTTP code.

+ *
+ *

The message is encoded because the details of the authorization status can contain + * privileged information that the user who requested the operation should not see. To decode + * an authorization status message, a user must be granted permissions through an IAM policy to + * request the DecodeAuthorizationMessage + * (sts:DecodeAuthorizationMessage) action.

+ *

The decoded message includes the following type of information:

+ *
    + *
  • + *

    Whether the request was denied due to an explicit deny or due to the absence of an + * explicit allow. For more information, see Determining Whether a Request is Allowed or Denied in the + * IAM User Guide.

    + *
  • + *
  • + *

    The principal who made the request.

    + *
  • + *
  • + *

    The requested action.

    + *
  • + *
  • + *

    The requested resource.

    + *
  • + *
  • + *

    The values of condition keys in the context of the user's request.

    + *
  • + *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { STSClient, DecodeAuthorizationMessageCommand } from "@aws-sdk/client-sts"; // ES Modules import + * // const { STSClient, DecodeAuthorizationMessageCommand } = require("@aws-sdk/client-sts"); // CommonJS import + * const client = new STSClient(config); + * const command = new DecodeAuthorizationMessageCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link DecodeAuthorizationMessageCommandInput} for command's `input` shape. + * @see {@link DecodeAuthorizationMessageCommandOutput} for command's `response` shape. + * @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape. + * + */ +export declare class DecodeAuthorizationMessageCommand extends $Command { + readonly input: DecodeAuthorizationMessageCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DecodeAuthorizationMessageCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: STSClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetAccessKeyInfoCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetAccessKeyInfoCommand.d.ts new file mode 100644 index 0000000000..ada3b8cab9 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetAccessKeyInfoCommand.d.ts @@ -0,0 +1,54 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { GetAccessKeyInfoRequest, GetAccessKeyInfoResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient"; +export interface GetAccessKeyInfoCommandInput extends GetAccessKeyInfoRequest { +} +export interface GetAccessKeyInfoCommandOutput extends GetAccessKeyInfoResponse, __MetadataBearer { +} +/** + *

Returns the account identifier for the specified access key ID.

+ *

Access keys consist of two parts: an access key ID (for example, + * AKIAIOSFODNN7EXAMPLE) and a secret access key (for example, + * wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). For more information about + * access keys, see Managing Access Keys for IAM + * Users in the IAM User Guide.

+ *

When you pass an access key ID to this operation, it returns the ID of the Amazon Web Services account + * to which the keys belong. Access key IDs beginning with AKIA are long-term + * credentials for an IAM user or the Amazon Web Services account root user. Access key IDs beginning with + * ASIA are temporary credentials that are created using STS operations. If + * the account in the response belongs to you, you can sign in as the root user and review + * your root user access keys. Then, you can pull a credentials report to + * learn which IAM user owns the keys. To learn who requested the temporary credentials for + * an ASIA access key, view the STS events in your CloudTrail logs in the + * IAM User Guide.

+ *

This operation does not indicate the state of the access key. The key might be active, + * inactive, or deleted. Active keys might not have permissions to perform an operation. + * Providing a deleted access key might return an error that the key doesn't exist.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { STSClient, GetAccessKeyInfoCommand } from "@aws-sdk/client-sts"; // ES Modules import + * // const { STSClient, GetAccessKeyInfoCommand } = require("@aws-sdk/client-sts"); // CommonJS import + * const client = new STSClient(config); + * const command = new GetAccessKeyInfoCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetAccessKeyInfoCommandInput} for command's `input` shape. + * @see {@link GetAccessKeyInfoCommandOutput} for command's `response` shape. + * @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape. + * + */ +export declare class GetAccessKeyInfoCommand extends $Command { + readonly input: GetAccessKeyInfoCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetAccessKeyInfoCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: STSClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetCallerIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetCallerIdentityCommand.d.ts new file mode 100644 index 0000000000..e8f149d9fb --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetCallerIdentityCommand.d.ts @@ -0,0 +1,46 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { GetCallerIdentityRequest, GetCallerIdentityResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient"; +export interface GetCallerIdentityCommandInput extends GetCallerIdentityRequest { +} +export interface GetCallerIdentityCommandOutput extends GetCallerIdentityResponse, __MetadataBearer { +} +/** + *

Returns details about the IAM user or role whose credentials are used to call the + * operation.

+ * + *

No permissions are required to perform this operation. If an administrator adds a + * policy to your IAM user or role that explicitly denies access to the + * sts:GetCallerIdentity action, you can still perform this operation. + * Permissions are not required because the same information is returned when an IAM user + * or role is denied access. To view an example response, see I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice in the + * IAM User Guide.

+ *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { STSClient, GetCallerIdentityCommand } from "@aws-sdk/client-sts"; // ES Modules import + * // const { STSClient, GetCallerIdentityCommand } = require("@aws-sdk/client-sts"); // CommonJS import + * const client = new STSClient(config); + * const command = new GetCallerIdentityCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetCallerIdentityCommandInput} for command's `input` shape. + * @see {@link GetCallerIdentityCommandOutput} for command's `response` shape. + * @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape. + * + */ +export declare class GetCallerIdentityCommand extends $Command { + readonly input: GetCallerIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetCallerIdentityCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: STSClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetFederationTokenCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetFederationTokenCommand.d.ts new file mode 100644 index 0000000000..c501f5af2f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetFederationTokenCommand.d.ts @@ -0,0 +1,123 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { GetFederationTokenRequest, GetFederationTokenResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient"; +export interface GetFederationTokenCommandInput extends GetFederationTokenRequest { +} +export interface GetFederationTokenCommandOutput extends GetFederationTokenResponse, __MetadataBearer { +} +/** + *

Returns a set of temporary security credentials (consisting of an access key ID, a + * secret access key, and a security token) for a federated user. A typical use is in a proxy + * application that gets temporary security credentials on behalf of distributed applications + * inside a corporate network. You must call the GetFederationToken operation + * using the long-term security credentials of an IAM user. As a result, this call is + * appropriate in contexts where those credentials can be safely stored, usually in a + * server-based application. For a comparison of GetFederationToken with the + * other API operations that produce temporary credentials, see Requesting Temporary Security + * Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ * + *

You can create a mobile-based or browser-based app that can authenticate users using + * a web identity provider like Login with Amazon, Facebook, Google, or an OpenID + * Connect-compatible identity provider. In this case, we recommend that you use Amazon Cognito or + * AssumeRoleWithWebIdentity. For more information, see Federation Through a Web-based Identity Provider in the + * IAM User Guide.

+ *
+ *

You can also call GetFederationToken using the security credentials of an + * Amazon Web Services account root user, but we do not recommend it. Instead, we recommend that you create + * an IAM user for the purpose of the proxy application. Then attach a policy to the IAM + * user that limits federated users to only the actions and resources that they need to + * access. For more information, see IAM Best Practices in the + * IAM User Guide.

+ *

+ * Session duration + *

+ *

The temporary credentials are valid for the specified duration, from 900 seconds (15 + * minutes) up to a maximum of 129,600 seconds (36 hours). The default session duration is + * 43,200 seconds (12 hours). Temporary credentials obtained by using the Amazon Web Services account root + * user credentials have a maximum duration of 3,600 seconds (1 hour).

+ *

+ * Permissions + *

+ *

You can use the temporary credentials created by GetFederationToken in any + * Amazon Web Services service with the following exceptions:

+ *
    + *
  • + *

    You cannot call any IAM operations using the CLI or the Amazon Web Services API. This limitation does not apply to console sessions.

    + *
  • + *
  • + *

    You cannot call any STS operations except GetCallerIdentity.

    + *
  • + *
+ *

You can use temporary credentials for single sign-on (SSO) to the console.

+ *

You must pass an inline or managed session policy to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies. The plaintext that you use for both inline and managed session + * policies can't exceed 2,048 characters.

+ *

Though the session policy parameters are optional, if you do not pass a policy, then the + * resulting federated user session has no permissions. When you pass session policies, the + * session permissions are the intersection of the IAM user policies and the session + * policies that you pass. This gives you a way to further restrict the permissions for a + * federated user. You cannot use session policies to grant more permissions than those that + * are defined in the permissions policy of the IAM user. For more information, see Session + * Policies in the IAM User Guide. For information about + * using GetFederationToken to create temporary security credentials, see GetFederationToken—Federation Through a Custom Identity Broker.

+ *

You can use the credentials to access a resource that has a resource-based policy. If + * that policy specifically references the federated user session in the + * Principal element of the policy, the session has the permissions allowed by + * the policy. These permissions are granted in addition to the permissions granted by the + * session policies.

+ *

+ * Tags + *

+ *

(Optional) You can pass tag key-value pairs to your session. These are called session + * tags. For more information about session tags, see Passing Session Tags in STS in the + * IAM User Guide.

+ * + *

You can create a mobile-based or browser-based app that can authenticate users using + * a web identity provider like Login with Amazon, Facebook, Google, or an OpenID + * Connect-compatible identity provider. In this case, we recommend that you use Amazon Cognito or + * AssumeRoleWithWebIdentity. For more information, see Federation Through a Web-based Identity Provider in the + * IAM User Guide.

+ *
+ *

An administrator must grant you the permissions necessary to pass session tags. The + * administrator can also create granular permissions to allow you to pass only specific + * session tags. For more information, see Tutorial: Using Tags + * for Attribute-Based Access Control in the + * IAM User Guide.

+ *

Tag key–value pairs are not case sensitive, but case is preserved. This means that you + * cannot have separate Department and department tag keys. Assume + * that the user that you are federating has the + * Department=Marketing tag and you pass the + * department=engineering session tag. Department + * and department are not saved as separate tags, and the session tag passed in + * the request takes precedence over the user tag.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { STSClient, GetFederationTokenCommand } from "@aws-sdk/client-sts"; // ES Modules import + * // const { STSClient, GetFederationTokenCommand } = require("@aws-sdk/client-sts"); // CommonJS import + * const client = new STSClient(config); + * const command = new GetFederationTokenCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetFederationTokenCommandInput} for command's `input` shape. + * @see {@link GetFederationTokenCommandOutput} for command's `response` shape. + * @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape. + * + */ +export declare class GetFederationTokenCommand extends $Command { + readonly input: GetFederationTokenCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetFederationTokenCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: STSClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetSessionTokenCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetSessionTokenCommand.d.ts new file mode 100644 index 0000000000..fa8f616f9e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/GetSessionTokenCommand.d.ts @@ -0,0 +1,95 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types"; +import { GetSessionTokenRequest, GetSessionTokenResponse } from "../models/models_0"; +import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient"; +export interface GetSessionTokenCommandInput extends GetSessionTokenRequest { +} +export interface GetSessionTokenCommandOutput extends GetSessionTokenResponse, __MetadataBearer { +} +/** + *

Returns a set of temporary credentials for an Amazon Web Services account or IAM user. The + * credentials consist of an access key ID, a secret access key, and a security token. + * Typically, you use GetSessionToken if you want to use MFA to protect + * programmatic calls to specific Amazon Web Services API operations like Amazon EC2 StopInstances. + * MFA-enabled IAM users would need to call GetSessionToken and submit an MFA + * code that is associated with their MFA device. Using the temporary security credentials + * that are returned from the call, IAM users can then make programmatic calls to API + * operations that require MFA authentication. If you do not supply a correct MFA code, then + * the API returns an access denied error. For a comparison of GetSessionToken + * with the other API operations that produce temporary credentials, see Requesting + * Temporary Security Credentials and Comparing the + * Amazon Web Services STS API operations in the IAM User Guide.

+ * + *

No permissions are required for users to perform this operation. The purpose of the + * sts:GetSessionToken operation is to authenticate the user using MFA. You + * cannot use policies to control authentication operations. For more information, see + * Permissions for GetSessionToken in the + * IAM User Guide.

+ *
+ *

+ * Session Duration + *

+ *

The GetSessionToken operation must be called by using the long-term Amazon Web Services + * security credentials of the Amazon Web Services account root user or an IAM user. Credentials that are + * created by IAM users are valid for the duration that you specify. This duration can range + * from 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours), with a default + * of 43,200 seconds (12 hours). Credentials based on account credentials can range from 900 + * seconds (15 minutes) up to 3,600 seconds (1 hour), with a default of 1 hour.

+ *

+ * Permissions + *

+ *

The temporary security credentials created by GetSessionToken can be used + * to make API calls to any Amazon Web Services service with the following exceptions:

+ *
    + *
  • + *

    You cannot call any IAM API operations unless MFA authentication information is + * included in the request.

    + *
  • + *
  • + *

    You cannot call any STS API except + * AssumeRole or GetCallerIdentity.

    + *
  • + *
+ * + *

We recommend that you do not call GetSessionToken with Amazon Web Services account + * root user credentials. Instead, follow our best practices by + * creating one or more IAM users, giving them the necessary permissions, and using IAM + * users for everyday interaction with Amazon Web Services.

+ *
+ *

The credentials that are returned by GetSessionToken are based on + * permissions associated with the user whose credentials were used to call the operation. If + * GetSessionToken is called using Amazon Web Services account root user credentials, the + * temporary credentials have root user permissions. Similarly, if + * GetSessionToken is called using the credentials of an IAM user, the + * temporary credentials have the same permissions as the IAM user.

+ *

For more information about using GetSessionToken to create temporary + * credentials, go to Temporary + * Credentials for Users in Untrusted Environments in the + * IAM User Guide.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { STSClient, GetSessionTokenCommand } from "@aws-sdk/client-sts"; // ES Modules import + * // const { STSClient, GetSessionTokenCommand } = require("@aws-sdk/client-sts"); // CommonJS import + * const client = new STSClient(config); + * const command = new GetSessionTokenCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetSessionTokenCommandInput} for command's `input` shape. + * @see {@link GetSessionTokenCommandOutput} for command's `response` shape. + * @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape. + * + */ +export declare class GetSessionTokenCommand extends $Command { + readonly input: GetSessionTokenCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetSessionTokenCommandInput); + /** + * @internal + */ + resolveMiddleware(clientStack: MiddlewareStack, configuration: STSClientResolvedConfig, options?: __HttpHandlerOptions): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/commands/index.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/index.d.ts new file mode 100644 index 0000000000..802202ff12 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/commands/index.d.ts @@ -0,0 +1,8 @@ +export * from "./AssumeRoleCommand"; +export * from "./AssumeRoleWithSAMLCommand"; +export * from "./AssumeRoleWithWebIdentityCommand"; +export * from "./DecodeAuthorizationMessageCommand"; +export * from "./GetAccessKeyInfoCommand"; +export * from "./GetCallerIdentityCommand"; +export * from "./GetFederationTokenCommand"; +export * from "./GetSessionTokenCommand"; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/defaultRoleAssumers.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/defaultRoleAssumers.d.ts new file mode 100644 index 0000000000..5ff9d0d254 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/defaultRoleAssumers.d.ts @@ -0,0 +1,20 @@ +import { Pluggable } from "@aws-sdk/types"; +import { DefaultCredentialProvider, RoleAssumer, RoleAssumerWithWebIdentity } from "./defaultStsRoleAssumers"; +import { ServiceInputTypes, ServiceOutputTypes, STSClientConfig } from "./STSClient"; +/** + * The default role assumer that used by credential providers when sts:AssumeRole API is needed. + */ +export declare const getDefaultRoleAssumer: (stsOptions?: Pick, stsPlugins?: Pluggable[] | undefined) => RoleAssumer; +/** + * The default role assumer that used by credential providers when sts:AssumeRoleWithWebIdentity API is needed. + */ +export declare const getDefaultRoleAssumerWithWebIdentity: (stsOptions?: Pick, stsPlugins?: Pluggable[] | undefined) => RoleAssumerWithWebIdentity; +/** + * The default credential providers depend STS client to assume role with desired API: sts:assumeRole, + * sts:assumeRoleWithWebIdentity, etc. This function decorates the default credential provider with role assumers which + * encapsulates the process of calling STS commands. This can only be imported by AWS client packages to avoid circular + * dependencies. + * + * @internal + */ +export declare const decorateDefaultCredentialProvider: (provider: DefaultCredentialProvider) => DefaultCredentialProvider; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/defaultStsRoleAssumers.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/defaultStsRoleAssumers.d.ts new file mode 100644 index 0000000000..19b8901278 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/defaultStsRoleAssumers.d.ts @@ -0,0 +1,35 @@ +import { Credentials, Provider } from "@aws-sdk/types"; +import { AssumeRoleCommandInput } from "./commands/AssumeRoleCommand"; +import { AssumeRoleWithWebIdentityCommandInput } from "./commands/AssumeRoleWithWebIdentityCommand"; +import type { STSClient, STSClientConfig } from "./STSClient"; +/** + * @internal + */ +export declare type RoleAssumer = (sourceCreds: Credentials, params: AssumeRoleCommandInput) => Promise; +/** + * The default role assumer that used by credential providers when sts:AssumeRole API is needed. + * @internal + */ +export declare const getDefaultRoleAssumer: (stsOptions: Pick, stsClientCtor: new (options: STSClientConfig) => STSClient) => RoleAssumer; +/** + * @internal + */ +export declare type RoleAssumerWithWebIdentity = (params: AssumeRoleWithWebIdentityCommandInput) => Promise; +/** + * The default role assumer that used by credential providers when sts:AssumeRoleWithWebIdentity API is needed. + * @internal + */ +export declare const getDefaultRoleAssumerWithWebIdentity: (stsOptions: Pick, stsClientCtor: new (options: STSClientConfig) => STSClient) => RoleAssumerWithWebIdentity; +/** + * @internal + */ +export declare type DefaultCredentialProvider = (input: any) => Provider; +/** + * The default credential providers depend STS client to assume role with desired API: sts:assumeRole, + * sts:assumeRoleWithWebIdentity, etc. This function decorates the default credential provider with role assumers which + * encapsulates the process of calling STS commands. This can only be imported by AWS client packages to avoid circular + * dependencies. + * + * @internal + */ +export declare const decorateDefaultCredentialProvider: (provider: DefaultCredentialProvider) => DefaultCredentialProvider; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/EndpointParameters.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/EndpointParameters.d.ts new file mode 100644 index 0000000000..19e7150032 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/EndpointParameters.d.ts @@ -0,0 +1,21 @@ +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@aws-sdk/types"; +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; + useGlobalEndpoint?: boolean | Provider; +} +export declare type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; +export declare const resolveClientEndpointParameters: (options: T & ClientInputEndpointParameters) => T & ClientInputEndpointParameters & { + defaultSigningName: string; +}; +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; + UseGlobalEndpoint?: boolean; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/endpointResolver.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/endpointResolver.d.ts new file mode 100644 index 0000000000..62107b6db3 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/endpointResolver.d.ts @@ -0,0 +1,5 @@ +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParameters } from "./EndpointParameters"; +export declare const defaultEndpointResolver: (endpointParams: EndpointParameters, context?: { + logger?: Logger; +}) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/ruleset.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/ruleset.d.ts new file mode 100644 index 0000000000..a822ad761a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/endpoint/ruleset.d.ts @@ -0,0 +1,2 @@ +import { RuleSetObject } from "@aws-sdk/util-endpoints"; +export declare const ruleSet: RuleSetObject; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/index.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/index.d.ts new file mode 100644 index 0000000000..441fe775a2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/index.d.ts @@ -0,0 +1,6 @@ +export * from "./STS"; +export * from "./STSClient"; +export * from "./commands"; +export * from "./defaultRoleAssumers"; +export * from "./models"; +export { STSServiceException } from "./models/STSServiceException"; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/models/STSServiceException.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/models/STSServiceException.d.ts new file mode 100644 index 0000000000..828ffd869f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/models/STSServiceException.d.ts @@ -0,0 +1,10 @@ +import { ServiceException as __ServiceException, ServiceExceptionOptions as __ServiceExceptionOptions } from "@aws-sdk/smithy-client"; +/** + * Base exception class for all service exceptions from STS service. + */ +export declare class STSServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions); +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/models/index.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/models/index.d.ts new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/models/index.d.ts @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/models/models_0.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/models/models_0.d.ts new file mode 100644 index 0000000000..8749f7ad89 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/models/models_0.d.ts @@ -0,0 +1,1115 @@ +import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client"; +import { STSServiceException as __BaseException } from "./STSServiceException"; +/** + *

The identifiers for the temporary security credentials that the operation + * returns.

+ */ +export interface AssumedRoleUser { + /** + *

A unique identifier that contains the role ID and the role session name of the role that + * is being assumed. The role ID is generated by Amazon Web Services when the role is created.

+ */ + AssumedRoleId: string | undefined; + /** + *

The ARN of the temporary security credentials that are returned from the AssumeRole action. For more information about ARNs and how to use them in + * policies, see IAM Identifiers in the + * IAM User Guide.

+ */ + Arn: string | undefined; +} +/** + *

A reference to the IAM managed policy that is passed as a session policy for a role + * session or a federated user session.

+ */ +export interface PolicyDescriptorType { + /** + *

The Amazon Resource Name (ARN) of the IAM managed policy to use as a session policy + * for the role. For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services + * Service Namespaces in the Amazon Web Services General Reference.

+ */ + arn?: string; +} +/** + *

You can pass custom key-value pair attributes when you assume a role or federate a user. + * These are called session tags. You can then use the session tags to control access to + * resources. For more information, see Tagging Amazon Web Services STS Sessions in the + * IAM User Guide.

+ */ +export interface Tag { + /** + *

The key for a session tag.

+ *

You can pass up to 50 session tags. The plain text session tag keys can’t exceed 128 + * characters. For these and additional limits, see IAM + * and STS Character Limits in the IAM User Guide.

+ */ + Key: string | undefined; + /** + *

The value for a session tag.

+ *

You can pass up to 50 session tags. The plain text session tag values can’t exceed 256 + * characters. For these and additional limits, see IAM + * and STS Character Limits in the IAM User Guide.

+ */ + Value: string | undefined; +} +export interface AssumeRoleRequest { + /** + *

The Amazon Resource Name (ARN) of the role to assume.

+ */ + RoleArn: string | undefined; + /** + *

An identifier for the assumed role session.

+ *

Use the role session name to uniquely identify a session when the same role is assumed + * by different principals or for different reasons. In cross-account scenarios, the role + * session name is visible to, and can be logged by the account that owns the role. The role + * session name is also used in the ARN of the assumed role principal. This means that + * subsequent cross-account API requests that use the temporary security credentials will + * expose the role session name to the external account in their CloudTrail logs.

+ *

The regex used to validate this parameter is a string of characters + * consisting of upper- and lower-case alphanumeric characters with no spaces. You can + * also include underscores or any of the following characters: =,.@-

+ */ + RoleSessionName: string | undefined; + /** + *

The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as + * managed session policies. The policies must exist in the same account as the role.

+ *

This parameter is optional. You can provide up to 10 managed policy ARNs. However, the + * plaintext that you use for both inline and managed session policies can't exceed 2,048 + * characters. For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services + * Service Namespaces in the Amazon Web Services General Reference.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ *

Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ */ + PolicyArns?: PolicyDescriptorType[]; + /** + *

An IAM policy in JSON format that you want to use as an inline session policy.

+ *

This parameter is optional. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

The plaintext that you use for both inline and managed session policies can't exceed + * 2,048 characters. The JSON policy characters can be any ASCII character from the space + * character to the end of the valid character list (\u0020 through \u00FF). It can also + * include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) + * characters.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ */ + Policy?: string; + /** + *

The duration, in seconds, of the role session. The value specified can range from 900 + * seconds (15 minutes) up to the maximum session duration set for the role. The maximum + * session duration setting can have a value from 1 hour to 12 hours. If you specify a value + * higher than this setting or the administrator setting (whichever is lower), the operation + * fails. For example, if you specify a session duration of 12 hours, but your administrator + * set the maximum session duration to 6 hours, your operation fails.

+ *

Role chaining limits your Amazon Web Services CLI or Amazon Web Services API role session to a maximum of one hour. + * When you use the AssumeRole API operation to assume a role, you can specify + * the duration of your role session with the DurationSeconds parameter. You can + * specify a parameter value of up to 43200 seconds (12 hours), depending on the maximum + * session duration setting for your role. However, if you assume a role using role chaining + * and provide a DurationSeconds parameter value greater than one hour, the + * operation fails. To learn how to view the maximum value for your role, see View the + * Maximum Session Duration Setting for a Role in the + * IAM User Guide.

+ *

By default, the value is set to 3600 seconds.

+ * + *

The DurationSeconds parameter is separate from the duration of a console + * session that you might request using the returned credentials. The request to the + * federation endpoint for a console sign-in token takes a SessionDuration + * parameter that specifies the maximum length of the console session. For more + * information, see Creating a URL + * that Enables Federated Users to Access the Amazon Web Services Management Console in the + * IAM User Guide.

+ *
+ */ + DurationSeconds?: number; + /** + *

A list of session tags that you want to pass. Each session tag consists of a key name + * and an associated value. For more information about session tags, see Tagging Amazon Web Services STS + * Sessions in the IAM User Guide.

+ *

This parameter is optional. You can pass up to 50 session tags. The plaintext session + * tag keys can’t exceed 128 characters, and the values can’t exceed 256 characters. For these + * and additional limits, see IAM + * and STS Character Limits in the IAM User Guide.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ *

You can pass a session tag with the same key as a tag that is already attached to the + * role. When you do, session tags override a role tag with the same key.

+ *

Tag key–value pairs are not case sensitive, but case is preserved. This means that you + * cannot have separate Department and department tag keys. Assume + * that the role has the Department=Marketing tag and you pass the + * department=engineering session tag. Department + * and department are not saved as separate tags, and the session tag passed in + * the request takes precedence over the role tag.

+ *

Additionally, if you used temporary credentials to perform this operation, the new + * session inherits any transitive session tags from the calling session. If you pass a + * session tag with the same key as an inherited tag, the operation fails. To view the + * inherited tags for a session, see the CloudTrail logs. For more information, see Viewing Session Tags in CloudTrail in the + * IAM User Guide.

+ */ + Tags?: Tag[]; + /** + *

A list of keys for session tags that you want to set as transitive. If you set a tag key + * as transitive, the corresponding key and value passes to subsequent sessions in a role + * chain. For more information, see Chaining Roles + * with Session Tags in the IAM User Guide.

+ *

This parameter is optional. When you set session tags as transitive, the session policy + * and session tags packed binary limit is not affected.

+ *

If you choose not to specify a transitive tag key, then no tags are passed from this + * session to any subsequent sessions.

+ */ + TransitiveTagKeys?: string[]; + /** + *

A unique identifier that might be required when you assume a role in another account. If + * the administrator of the account to which the role belongs provided you with an external + * ID, then provide that value in the ExternalId parameter. This value can be any + * string, such as a passphrase or account number. A cross-account role is usually set up to + * trust everyone in an account. Therefore, the administrator of the trusting account might + * send an external ID to the administrator of the trusted account. That way, only someone + * with the ID can assume the role, rather than everyone in the account. For more information + * about the external ID, see How to Use an External ID + * When Granting Access to Your Amazon Web Services Resources to a Third Party in the + * IAM User Guide.

+ *

The regex used to validate this parameter is a string of + * characters consisting of upper- and lower-case alphanumeric characters with no spaces. + * You can also include underscores or any of the following characters: =,.@:/-

+ */ + ExternalId?: string; + /** + *

The identification number of the MFA device that is associated with the user who is + * making the AssumeRole call. Specify this value if the trust policy of the role + * being assumed includes a condition that requires MFA authentication. The value is either + * the serial number for a hardware device (such as GAHT12345678) or an Amazon + * Resource Name (ARN) for a virtual device (such as + * arn:aws:iam::123456789012:mfa/user).

+ *

The regex used to validate this parameter is a string of characters + * consisting of upper- and lower-case alphanumeric characters with no spaces. You can + * also include underscores or any of the following characters: =,.@-

+ */ + SerialNumber?: string; + /** + *

The value provided by the MFA device, if the trust policy of the role being assumed + * requires MFA. (In other words, if the policy includes a condition that tests for MFA). If + * the role being assumed requires MFA and if the TokenCode value is missing or + * expired, the AssumeRole call returns an "access denied" error.

+ *

The format for this parameter, as described by its regex pattern, is a sequence of six + * numeric digits.

+ */ + TokenCode?: string; + /** + *

The source identity specified by the principal that is calling the + * AssumeRole operation.

+ *

You can require users to specify a source identity when they assume a role. You do this + * by using the sts:SourceIdentity condition key in a role trust policy. You can + * use source identity information in CloudTrail logs to determine who took actions with a role. + * You can use the aws:SourceIdentity condition key to further control access to + * Amazon Web Services resources based on the value of source identity. For more information about using + * source identity, see Monitor and control + * actions taken with assumed roles in the + * IAM User Guide.

+ *

The regex used to validate this parameter is a string of characters consisting of upper- + * and lower-case alphanumeric characters with no spaces. You can also include underscores or + * any of the following characters: =,.@-. You cannot use a value that begins with the text + * aws:. This prefix is reserved for Amazon Web Services internal use.

+ */ + SourceIdentity?: string; +} +/** + *

Amazon Web Services credentials for API authentication.

+ */ +export interface Credentials { + /** + *

The access key ID that identifies the temporary security credentials.

+ */ + AccessKeyId: string | undefined; + /** + *

The secret access key that can be used to sign requests.

+ */ + SecretAccessKey: string | undefined; + /** + *

The token that users must pass to the service API to use the temporary + * credentials.

+ */ + SessionToken: string | undefined; + /** + *

The date on which the current credentials expire.

+ */ + Expiration: Date | undefined; +} +/** + *

Contains the response to a successful AssumeRole request, including + * temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

+ */ +export interface AssumeRoleResponse { + /** + *

The temporary security credentials, which include an access key ID, a secret access key, + * and a security (or session) token.

+ * + *

The size of the security token that STS API operations return is not fixed. We + * strongly recommend that you make no assumptions about the maximum size.

+ *
+ */ + Credentials?: Credentials; + /** + *

The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers that you + * can use to refer to the resulting temporary security credentials. For example, you can + * reference these credentials as a principal in a resource-based policy by using the ARN or + * assumed role ID. The ARN and ID include the RoleSessionName that you specified + * when you called AssumeRole.

+ */ + AssumedRoleUser?: AssumedRoleUser; + /** + *

A percentage value that indicates the packed size of the session policies and session + * tags combined passed in the request. The request fails if the packed size is greater than 100 percent, + * which means the policies and tags exceeded the allowed space.

+ */ + PackedPolicySize?: number; + /** + *

The source identity specified by the principal that is calling the + * AssumeRole operation.

+ *

You can require users to specify a source identity when they assume a role. You do this + * by using the sts:SourceIdentity condition key in a role trust policy. You can + * use source identity information in CloudTrail logs to determine who took actions with a role. + * You can use the aws:SourceIdentity condition key to further control access to + * Amazon Web Services resources based on the value of source identity. For more information about using + * source identity, see Monitor and control + * actions taken with assumed roles in the + * IAM User Guide.

+ *

The regex used to validate this parameter is a string of characters consisting of upper- + * and lower-case alphanumeric characters with no spaces. You can also include underscores or + * any of the following characters: =,.@-

+ */ + SourceIdentity?: string; +} +/** + *

The web identity token that was passed is expired or is not valid. Get a new identity + * token from the identity provider and then retry the request.

+ */ +export declare class ExpiredTokenException extends __BaseException { + readonly name: "ExpiredTokenException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

The request was rejected because the policy document was malformed. The error message + * describes the specific error.

+ */ +export declare class MalformedPolicyDocumentException extends __BaseException { + readonly name: "MalformedPolicyDocumentException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

The request was rejected because the total packed size of the session policies and + * session tags combined was too large. An Amazon Web Services conversion compresses the session policy + * document, session policy ARNs, and session tags into a packed binary format that has a + * separate limit. The error message indicates by percentage how close the policies and + * tags are to the upper size limit. For more information, see Passing Session Tags in STS in + * the IAM User Guide.

+ *

You could receive this error even though you meet other defined session policy and + * session tag limits. For more information, see IAM and STS Entity + * Character Limits in the IAM User Guide.

+ */ +export declare class PackedPolicyTooLargeException extends __BaseException { + readonly name: "PackedPolicyTooLargeException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

STS is not activated in the requested region for the account that is being asked to + * generate credentials. The account administrator must use the IAM console to activate STS + * in that region. For more information, see Activating and + * Deactivating Amazon Web Services STS in an Amazon Web Services Region in the IAM User + * Guide.

+ */ +export declare class RegionDisabledException extends __BaseException { + readonly name: "RegionDisabledException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +export interface AssumeRoleWithSAMLRequest { + /** + *

The Amazon Resource Name (ARN) of the role that the caller is assuming.

+ */ + RoleArn: string | undefined; + /** + *

The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the + * IdP.

+ */ + PrincipalArn: string | undefined; + /** + *

The base64 encoded SAML authentication response provided by the IdP.

+ *

For more information, see Configuring a Relying Party and + * Adding Claims in the IAM User Guide.

+ */ + SAMLAssertion: string | undefined; + /** + *

The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as + * managed session policies. The policies must exist in the same account as the role.

+ *

This parameter is optional. You can provide up to 10 managed policy ARNs. However, the + * plaintext that you use for both inline and managed session policies can't exceed 2,048 + * characters. For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services + * Service Namespaces in the Amazon Web Services General Reference.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ *

Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ */ + PolicyArns?: PolicyDescriptorType[]; + /** + *

An IAM policy in JSON format that you want to use as an inline session policy.

+ *

This parameter is optional. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

The plaintext that you use for both inline and managed session policies can't exceed + * 2,048 characters. The JSON policy characters can be any ASCII character from the space + * character to the end of the valid character list (\u0020 through \u00FF). It can also + * include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) + * characters.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ */ + Policy?: string; + /** + *

The duration, in seconds, of the role session. Your role session lasts for the duration + * that you specify for the DurationSeconds parameter, or until the time + * specified in the SAML authentication response's SessionNotOnOrAfter value, + * whichever is shorter. You can provide a DurationSeconds value from 900 seconds + * (15 minutes) up to the maximum session duration setting for the role. This setting can have + * a value from 1 hour to 12 hours. If you specify a value higher than this setting, the + * operation fails. For example, if you specify a session duration of 12 hours, but your + * administrator set the maximum session duration to 6 hours, your operation fails. To learn + * how to view the maximum value for your role, see View the + * Maximum Session Duration Setting for a Role in the + * IAM User Guide.

+ *

By default, the value is set to 3600 seconds.

+ * + *

The DurationSeconds parameter is separate from the duration of a console + * session that you might request using the returned credentials. The request to the + * federation endpoint for a console sign-in token takes a SessionDuration + * parameter that specifies the maximum length of the console session. For more + * information, see Creating a URL + * that Enables Federated Users to Access the Amazon Web Services Management Console in the + * IAM User Guide.

+ *
+ */ + DurationSeconds?: number; +} +/** + *

Contains the response to a successful AssumeRoleWithSAML request, + * including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

+ */ +export interface AssumeRoleWithSAMLResponse { + /** + *

The temporary security credentials, which include an access key ID, a secret access key, + * and a security (or session) token.

+ * + *

The size of the security token that STS API operations return is not fixed. We + * strongly recommend that you make no assumptions about the maximum size.

+ *
+ */ + Credentials?: Credentials; + /** + *

The identifiers for the temporary security credentials that the operation + * returns.

+ */ + AssumedRoleUser?: AssumedRoleUser; + /** + *

A percentage value that indicates the packed size of the session policies and session + * tags combined passed in the request. The request fails if the packed size is greater than 100 percent, + * which means the policies and tags exceeded the allowed space.

+ */ + PackedPolicySize?: number; + /** + *

The value of the NameID element in the Subject element of the + * SAML assertion.

+ */ + Subject?: string; + /** + *

The format of the name ID, as defined by the Format attribute in the + * NameID element of the SAML assertion. Typical examples of the format are + * transient or persistent.

+ *

If the format includes the prefix + * urn:oasis:names:tc:SAML:2.0:nameid-format, that prefix is removed. For + * example, urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as + * transient. If the format includes any other prefix, the format is returned + * with no modifications.

+ */ + SubjectType?: string; + /** + *

The value of the Issuer element of the SAML assertion.

+ */ + Issuer?: string; + /** + *

The value of the Recipient attribute of the + * SubjectConfirmationData element of the SAML assertion.

+ */ + Audience?: string; + /** + *

A hash value based on the concatenation of the following:

+ *
    + *
  • + *

    The Issuer response value.

    + *
  • + *
  • + *

    The Amazon Web Services account ID.

    + *
  • + *
  • + *

    The friendly name (the last part of the ARN) of the SAML provider in IAM.

    + *
  • + *
+ *

The combination of NameQualifier and Subject can be used to + * uniquely identify a federated user.

+ *

The following pseudocode shows how the hash value is calculated:

+ *

+ * BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) ) + *

+ */ + NameQualifier?: string; + /** + *

The value in the SourceIdentity attribute in the SAML assertion.

+ *

You can require users to set a source identity value when they assume a role. You do + * this by using the sts:SourceIdentity condition key in a role trust policy. + * That way, actions that are taken with the role are associated with that user. After the + * source identity is set, the value cannot be changed. It is present in the request for all + * actions that are taken by the role and persists across chained + * role sessions. You can configure your SAML identity provider to use an attribute + * associated with your users, like user name or email, as the source identity when calling + * AssumeRoleWithSAML. You do this by adding an attribute to the SAML + * assertion. For more information about using source identity, see Monitor and control + * actions taken with assumed roles in the + * IAM User Guide.

+ *

The regex used to validate this parameter is a string of characters + * consisting of upper- and lower-case alphanumeric characters with no spaces. You can + * also include underscores or any of the following characters: =,.@-

+ */ + SourceIdentity?: string; +} +/** + *

The identity provider (IdP) reported that authentication failed. This might be because + * the claim is invalid.

+ *

If this error is returned for the AssumeRoleWithWebIdentity operation, it + * can also mean that the claim has expired or has been explicitly revoked.

+ */ +export declare class IDPRejectedClaimException extends __BaseException { + readonly name: "IDPRejectedClaimException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +/** + *

The web identity token that was passed could not be validated by Amazon Web Services. Get a new + * identity token from the identity provider and then retry the request.

+ */ +export declare class InvalidIdentityTokenException extends __BaseException { + readonly name: "InvalidIdentityTokenException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +export interface AssumeRoleWithWebIdentityRequest { + /** + *

The Amazon Resource Name (ARN) of the role that the caller is assuming.

+ */ + RoleArn: string | undefined; + /** + *

An identifier for the assumed role session. Typically, you pass the name or identifier + * that is associated with the user who is using your application. That way, the temporary + * security credentials that your application will use are associated with that user. This + * session name is included as part of the ARN and assumed role ID in the + * AssumedRoleUser response element.

+ *

The regex used to validate this parameter is a string of characters + * consisting of upper- and lower-case alphanumeric characters with no spaces. You can + * also include underscores or any of the following characters: =,.@-

+ */ + RoleSessionName: string | undefined; + /** + *

The OAuth 2.0 access token or OpenID Connect ID token that is provided by the identity + * provider. Your application must get this token by authenticating the user who is using your + * application with a web identity provider before the application makes an + * AssumeRoleWithWebIdentity call.

+ */ + WebIdentityToken: string | undefined; + /** + *

The fully qualified host component of the domain name of the OAuth 2.0 identity + * provider. Do not specify this value for an OpenID Connect identity provider.

+ *

Currently www.amazon.com and graph.facebook.com are the only + * supported identity providers for OAuth 2.0 access tokens. Do not include URL schemes and + * port numbers.

+ *

Do not specify this value for OpenID Connect ID tokens.

+ */ + ProviderId?: string; + /** + *

The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as + * managed session policies. The policies must exist in the same account as the role.

+ *

This parameter is optional. You can provide up to 10 managed policy ARNs. However, the + * plaintext that you use for both inline and managed session policies can't exceed 2,048 + * characters. For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services + * Service Namespaces in the Amazon Web Services General Reference.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ *

Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ */ + PolicyArns?: PolicyDescriptorType[]; + /** + *

An IAM policy in JSON format that you want to use as an inline session policy.

+ *

This parameter is optional. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

The plaintext that you use for both inline and managed session policies can't exceed + * 2,048 characters. The JSON policy characters can be any ASCII character from the space + * character to the end of the valid character list (\u0020 through \u00FF). It can also + * include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) + * characters.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ */ + Policy?: string; + /** + *

The duration, in seconds, of the role session. The value can range from 900 seconds (15 + * minutes) up to the maximum session duration setting for the role. This setting can have a + * value from 1 hour to 12 hours. If you specify a value higher than this setting, the + * operation fails. For example, if you specify a session duration of 12 hours, but your + * administrator set the maximum session duration to 6 hours, your operation fails. To learn + * how to view the maximum value for your role, see View the + * Maximum Session Duration Setting for a Role in the + * IAM User Guide.

+ *

By default, the value is set to 3600 seconds.

+ * + *

The DurationSeconds parameter is separate from the duration of a console + * session that you might request using the returned credentials. The request to the + * federation endpoint for a console sign-in token takes a SessionDuration + * parameter that specifies the maximum length of the console session. For more + * information, see Creating a URL + * that Enables Federated Users to Access the Amazon Web Services Management Console in the + * IAM User Guide.

+ *
+ */ + DurationSeconds?: number; +} +/** + *

Contains the response to a successful AssumeRoleWithWebIdentity + * request, including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

+ */ +export interface AssumeRoleWithWebIdentityResponse { + /** + *

The temporary security credentials, which include an access key ID, a secret access key, + * and a security token.

+ * + *

The size of the security token that STS API operations return is not fixed. We + * strongly recommend that you make no assumptions about the maximum size.

+ *
+ */ + Credentials?: Credentials; + /** + *

The unique user identifier that is returned by the identity provider. This identifier is + * associated with the WebIdentityToken that was submitted with the + * AssumeRoleWithWebIdentity call. The identifier is typically unique to the + * user and the application that acquired the WebIdentityToken (pairwise + * identifier). For OpenID Connect ID tokens, this field contains the value returned by the + * identity provider as the token's sub (Subject) claim.

+ */ + SubjectFromWebIdentityToken?: string; + /** + *

The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers that you + * can use to refer to the resulting temporary security credentials. For example, you can + * reference these credentials as a principal in a resource-based policy by using the ARN or + * assumed role ID. The ARN and ID include the RoleSessionName that you specified + * when you called AssumeRole.

+ */ + AssumedRoleUser?: AssumedRoleUser; + /** + *

A percentage value that indicates the packed size of the session policies and session + * tags combined passed in the request. The request fails if the packed size is greater than 100 percent, + * which means the policies and tags exceeded the allowed space.

+ */ + PackedPolicySize?: number; + /** + *

The issuing authority of the web identity token presented. For OpenID Connect ID + * tokens, this contains the value of the iss field. For OAuth 2.0 access tokens, + * this contains the value of the ProviderId parameter that was passed in the + * AssumeRoleWithWebIdentity request.

+ */ + Provider?: string; + /** + *

The intended audience (also known as client ID) of the web identity token. This is + * traditionally the client identifier issued to the application that requested the web + * identity token.

+ */ + Audience?: string; + /** + *

The value of the source identity that is returned in the JSON web token (JWT) from the + * identity provider.

+ *

You can require users to set a source identity value when they assume a role. You do + * this by using the sts:SourceIdentity condition key in a role trust policy. + * That way, actions that are taken with the role are associated with that user. After the + * source identity is set, the value cannot be changed. It is present in the request for all + * actions that are taken by the role and persists across chained + * role sessions. You can configure your identity provider to use an attribute + * associated with your users, like user name or email, as the source identity when calling + * AssumeRoleWithWebIdentity. You do this by adding a claim to the JSON web + * token. To learn more about OIDC tokens and claims, see Using Tokens with User Pools in the Amazon Cognito Developer Guide. + * For more information about using source identity, see Monitor and control + * actions taken with assumed roles in the + * IAM User Guide.

+ *

The regex used to validate this parameter is a string of characters + * consisting of upper- and lower-case alphanumeric characters with no spaces. You can + * also include underscores or any of the following characters: =,.@-

+ */ + SourceIdentity?: string; +} +/** + *

The request could not be fulfilled because the identity provider (IDP) that + * was asked to verify the incoming identity token could not be reached. This is often a + * transient error caused by network conditions. Retry the request a limited number of + * times so that you don't exceed the request rate. If the error persists, the + * identity provider might be down or not responding.

+ */ +export declare class IDPCommunicationErrorException extends __BaseException { + readonly name: "IDPCommunicationErrorException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +export interface DecodeAuthorizationMessageRequest { + /** + *

The encoded message that was returned with the response.

+ */ + EncodedMessage: string | undefined; +} +/** + *

A document that contains additional information about the authorization status of a + * request from an encoded message that is returned in response to an Amazon Web Services request.

+ */ +export interface DecodeAuthorizationMessageResponse { + /** + *

The API returns a response with the decoded message.

+ */ + DecodedMessage?: string; +} +/** + *

The error returned if the message passed to DecodeAuthorizationMessage + * was invalid. This can happen if the token contains invalid characters, such as + * linebreaks.

+ */ +export declare class InvalidAuthorizationMessageException extends __BaseException { + readonly name: "InvalidAuthorizationMessageException"; + readonly $fault: "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType); +} +export interface GetAccessKeyInfoRequest { + /** + *

The identifier of an access key.

+ *

This parameter allows (through its regex pattern) a string of characters that can + * consist of any upper- or lowercase letter or digit.

+ */ + AccessKeyId: string | undefined; +} +export interface GetAccessKeyInfoResponse { + /** + *

The number used to identify the Amazon Web Services account.

+ */ + Account?: string; +} +export interface GetCallerIdentityRequest { +} +/** + *

Contains the response to a successful GetCallerIdentity request, + * including information about the entity making the request.

+ */ +export interface GetCallerIdentityResponse { + /** + *

The unique identifier of the calling entity. The exact value depends on the type of + * entity that is making the call. The values returned are those listed in the aws:userid column in the Principal + * table found on the Policy Variables reference + * page in the IAM User Guide.

+ */ + UserId?: string; + /** + *

The Amazon Web Services account ID number of the account that owns or contains the calling + * entity.

+ */ + Account?: string; + /** + *

The Amazon Web Services ARN associated with the calling entity.

+ */ + Arn?: string; +} +export interface GetFederationTokenRequest { + /** + *

The name of the federated user. The name is used as an identifier for the temporary + * security credentials (such as Bob). For example, you can reference the + * federated user name in a resource-based policy, such as in an Amazon S3 bucket policy.

+ *

The regex used to validate this parameter is a string of characters + * consisting of upper- and lower-case alphanumeric characters with no spaces. You can + * also include underscores or any of the following characters: =,.@-

+ */ + Name: string | undefined; + /** + *

An IAM policy in JSON format that you want to use as an inline session policy.

+ *

You must pass an inline or managed session policy to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies.

+ *

This parameter is optional. However, if you do not pass any session policies, then the + * resulting federated user session has no permissions.

+ *

When you pass session policies, the session permissions are the intersection of the + * IAM user policies and the session policies that you pass. This gives you a way to further + * restrict the permissions for a federated user. You cannot use session policies to grant + * more permissions than those that are defined in the permissions policy of the IAM user. + * For more information, see Session Policies in + * the IAM User Guide.

+ *

The resulting credentials can be used to access a resource that has a resource-based + * policy. If that policy specifically references the federated user session in the + * Principal element of the policy, the session has the permissions allowed by + * the policy. These permissions are granted in addition to the permissions that are granted + * by the session policies.

+ *

The plaintext that you use for both inline and managed session policies can't exceed + * 2,048 characters. The JSON policy characters can be any ASCII character from the space + * character to the end of the valid character list (\u0020 through \u00FF). It can also + * include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) + * characters.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ */ + Policy?: string; + /** + *

The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as a + * managed session policy. The policies must exist in the same account as the IAM user that + * is requesting federated access.

+ *

You must pass an inline or managed session policy to + * this operation. You can pass a single JSON policy document to use as an inline session + * policy. You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use as + * managed session policies. The plaintext that you use for both inline and managed session + * policies can't exceed 2,048 characters. You can provide up to 10 managed policy ARNs. For + * more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services + * Service Namespaces in the Amazon Web Services General Reference.

+ *

This parameter is optional. However, if you do not pass any session policies, then the + * resulting federated user session has no permissions.

+ *

When you pass session policies, the session permissions are the intersection of the + * IAM user policies and the session policies that you pass. This gives you a way to further + * restrict the permissions for a federated user. You cannot use session policies to grant + * more permissions than those that are defined in the permissions policy of the IAM user. + * For more information, see Session Policies in + * the IAM User Guide.

+ *

The resulting credentials can be used to access a resource that has a resource-based + * policy. If that policy specifically references the federated user session in the + * Principal element of the policy, the session has the permissions allowed by + * the policy. These permissions are granted in addition to the permissions that are granted + * by the session policies.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ */ + PolicyArns?: PolicyDescriptorType[]; + /** + *

The duration, in seconds, that the session should last. Acceptable durations for + * federation sessions range from 900 seconds (15 minutes) to 129,600 seconds (36 hours), with + * 43,200 seconds (12 hours) as the default. Sessions obtained using Amazon Web Services account root user + * credentials are restricted to a maximum of 3,600 seconds (one hour). If the specified + * duration is longer than one hour, the session obtained by using root user credentials + * defaults to one hour.

+ */ + DurationSeconds?: number; + /** + *

A list of session tags. Each session tag consists of a key name and an associated value. + * For more information about session tags, see Passing Session Tags in STS in the + * IAM User Guide.

+ *

This parameter is optional. You can pass up to 50 session tags. The plaintext session + * tag keys can’t exceed 128 characters and the values can’t exceed 256 characters. For these + * and additional limits, see IAM + * and STS Character Limits in the IAM User Guide.

+ * + *

An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, + * and session tags into a packed binary format that has a separate limit. Your request can + * fail for this limit even if your plaintext meets the other requirements. The + * PackedPolicySize response element indicates by percentage how close the + * policies and tags for your request are to the upper size limit.

+ *
+ *

You can pass a session tag with the same key as a tag that is already attached to the + * user you are federating. When you do, session tags override a user tag with the same key.

+ *

Tag key–value pairs are not case sensitive, but case is preserved. This means that you + * cannot have separate Department and department tag keys. Assume + * that the role has the Department=Marketing tag and you pass the + * department=engineering session tag. Department + * and department are not saved as separate tags, and the session tag passed in + * the request takes precedence over the role tag.

+ */ + Tags?: Tag[]; +} +/** + *

Identifiers for the federated user that is associated with the credentials.

+ */ +export interface FederatedUser { + /** + *

The string that identifies the federated user associated with the credentials, similar + * to the unique ID of an IAM user.

+ */ + FederatedUserId: string | undefined; + /** + *

The ARN that specifies the federated user that is associated with the credentials. For + * more information about ARNs and how to use them in policies, see IAM + * Identifiers in the IAM User Guide.

+ */ + Arn: string | undefined; +} +/** + *

Contains the response to a successful GetFederationToken request, + * including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

+ */ +export interface GetFederationTokenResponse { + /** + *

The temporary security credentials, which include an access key ID, a secret access key, + * and a security (or session) token.

+ * + *

The size of the security token that STS API operations return is not fixed. We + * strongly recommend that you make no assumptions about the maximum size.

+ *
+ */ + Credentials?: Credentials; + /** + *

Identifiers for the federated user associated with the credentials (such as + * arn:aws:sts::123456789012:federated-user/Bob or + * 123456789012:Bob). You can use the federated user's ARN in your + * resource-based policies, such as an Amazon S3 bucket policy.

+ */ + FederatedUser?: FederatedUser; + /** + *

A percentage value that indicates the packed size of the session policies and session + * tags combined passed in the request. The request fails if the packed size is greater than 100 percent, + * which means the policies and tags exceeded the allowed space.

+ */ + PackedPolicySize?: number; +} +export interface GetSessionTokenRequest { + /** + *

The duration, in seconds, that the credentials should remain valid. Acceptable durations + * for IAM user sessions range from 900 seconds (15 minutes) to 129,600 seconds (36 hours), + * with 43,200 seconds (12 hours) as the default. Sessions for Amazon Web Services account owners are + * restricted to a maximum of 3,600 seconds (one hour). If the duration is longer than one + * hour, the session for Amazon Web Services account owners defaults to one hour.

+ */ + DurationSeconds?: number; + /** + *

The identification number of the MFA device that is associated with the IAM user who + * is making the GetSessionToken call. Specify this value if the IAM user has a + * policy that requires MFA authentication. The value is either the serial number for a + * hardware device (such as GAHT12345678) or an Amazon Resource Name (ARN) for a + * virtual device (such as arn:aws:iam::123456789012:mfa/user). You can find the + * device for an IAM user by going to the Amazon Web Services Management Console and viewing the user's security + * credentials.

+ *

The regex used to validate this parameter is a string of + * characters consisting of upper- and lower-case alphanumeric characters with no spaces. + * You can also include underscores or any of the following characters: =,.@:/-

+ */ + SerialNumber?: string; + /** + *

The value provided by the MFA device, if MFA is required. If any policy requires the + * IAM user to submit an MFA code, specify this value. If MFA authentication is required, + * the user must provide a code when requesting a set of temporary security credentials. A + * user who fails to provide the code receives an "access denied" response when requesting + * resources that require MFA authentication.

+ *

The format for this parameter, as described by its regex pattern, is a sequence of six + * numeric digits.

+ */ + TokenCode?: string; +} +/** + *

Contains the response to a successful GetSessionToken request, + * including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.

+ */ +export interface GetSessionTokenResponse { + /** + *

The temporary security credentials, which include an access key ID, a secret access key, + * and a security (or session) token.

+ * + *

The size of the security token that STS API operations return is not fixed. We + * strongly recommend that you make no assumptions about the maximum size.

+ *
+ */ + Credentials?: Credentials; +} +/** + * @internal + */ +export declare const AssumedRoleUserFilterSensitiveLog: (obj: AssumedRoleUser) => any; +/** + * @internal + */ +export declare const PolicyDescriptorTypeFilterSensitiveLog: (obj: PolicyDescriptorType) => any; +/** + * @internal + */ +export declare const TagFilterSensitiveLog: (obj: Tag) => any; +/** + * @internal + */ +export declare const AssumeRoleRequestFilterSensitiveLog: (obj: AssumeRoleRequest) => any; +/** + * @internal + */ +export declare const CredentialsFilterSensitiveLog: (obj: Credentials) => any; +/** + * @internal + */ +export declare const AssumeRoleResponseFilterSensitiveLog: (obj: AssumeRoleResponse) => any; +/** + * @internal + */ +export declare const AssumeRoleWithSAMLRequestFilterSensitiveLog: (obj: AssumeRoleWithSAMLRequest) => any; +/** + * @internal + */ +export declare const AssumeRoleWithSAMLResponseFilterSensitiveLog: (obj: AssumeRoleWithSAMLResponse) => any; +/** + * @internal + */ +export declare const AssumeRoleWithWebIdentityRequestFilterSensitiveLog: (obj: AssumeRoleWithWebIdentityRequest) => any; +/** + * @internal + */ +export declare const AssumeRoleWithWebIdentityResponseFilterSensitiveLog: (obj: AssumeRoleWithWebIdentityResponse) => any; +/** + * @internal + */ +export declare const DecodeAuthorizationMessageRequestFilterSensitiveLog: (obj: DecodeAuthorizationMessageRequest) => any; +/** + * @internal + */ +export declare const DecodeAuthorizationMessageResponseFilterSensitiveLog: (obj: DecodeAuthorizationMessageResponse) => any; +/** + * @internal + */ +export declare const GetAccessKeyInfoRequestFilterSensitiveLog: (obj: GetAccessKeyInfoRequest) => any; +/** + * @internal + */ +export declare const GetAccessKeyInfoResponseFilterSensitiveLog: (obj: GetAccessKeyInfoResponse) => any; +/** + * @internal + */ +export declare const GetCallerIdentityRequestFilterSensitiveLog: (obj: GetCallerIdentityRequest) => any; +/** + * @internal + */ +export declare const GetCallerIdentityResponseFilterSensitiveLog: (obj: GetCallerIdentityResponse) => any; +/** + * @internal + */ +export declare const GetFederationTokenRequestFilterSensitiveLog: (obj: GetFederationTokenRequest) => any; +/** + * @internal + */ +export declare const FederatedUserFilterSensitiveLog: (obj: FederatedUser) => any; +/** + * @internal + */ +export declare const GetFederationTokenResponseFilterSensitiveLog: (obj: GetFederationTokenResponse) => any; +/** + * @internal + */ +export declare const GetSessionTokenRequestFilterSensitiveLog: (obj: GetSessionTokenRequest) => any; +/** + * @internal + */ +export declare const GetSessionTokenResponseFilterSensitiveLog: (obj: GetSessionTokenResponse) => any; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/protocols/Aws_query.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/protocols/Aws_query.d.ts new file mode 100644 index 0000000000..e7b683aec1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/protocols/Aws_query.d.ts @@ -0,0 +1,26 @@ +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { SerdeContext as __SerdeContext } from "@aws-sdk/types"; +import { AssumeRoleCommandInput, AssumeRoleCommandOutput } from "../commands/AssumeRoleCommand"; +import { AssumeRoleWithSAMLCommandInput, AssumeRoleWithSAMLCommandOutput } from "../commands/AssumeRoleWithSAMLCommand"; +import { AssumeRoleWithWebIdentityCommandInput, AssumeRoleWithWebIdentityCommandOutput } from "../commands/AssumeRoleWithWebIdentityCommand"; +import { DecodeAuthorizationMessageCommandInput, DecodeAuthorizationMessageCommandOutput } from "../commands/DecodeAuthorizationMessageCommand"; +import { GetAccessKeyInfoCommandInput, GetAccessKeyInfoCommandOutput } from "../commands/GetAccessKeyInfoCommand"; +import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput } from "../commands/GetCallerIdentityCommand"; +import { GetFederationTokenCommandInput, GetFederationTokenCommandOutput } from "../commands/GetFederationTokenCommand"; +import { GetSessionTokenCommandInput, GetSessionTokenCommandOutput } from "../commands/GetSessionTokenCommand"; +export declare const serializeAws_queryAssumeRoleCommand: (input: AssumeRoleCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_queryAssumeRoleWithSAMLCommand: (input: AssumeRoleWithSAMLCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_queryAssumeRoleWithWebIdentityCommand: (input: AssumeRoleWithWebIdentityCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_queryDecodeAuthorizationMessageCommand: (input: DecodeAuthorizationMessageCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_queryGetAccessKeyInfoCommand: (input: GetAccessKeyInfoCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_queryGetCallerIdentityCommand: (input: GetCallerIdentityCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_queryGetFederationTokenCommand: (input: GetFederationTokenCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const serializeAws_queryGetSessionTokenCommand: (input: GetSessionTokenCommandInput, context: __SerdeContext) => Promise<__HttpRequest>; +export declare const deserializeAws_queryAssumeRoleCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_queryAssumeRoleWithSAMLCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_queryAssumeRoleWithWebIdentityCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_queryDecodeAuthorizationMessageCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_queryGetAccessKeyInfoCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_queryGetCallerIdentityCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_queryGetFederationTokenCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; +export declare const deserializeAws_queryGetSessionTokenCommand: (output: __HttpResponse, context: __SerdeContext) => Promise; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.browser.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.browser.d.ts new file mode 100644 index 0000000000..f5df2bdcbb --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.browser.d.ts @@ -0,0 +1,43 @@ +import { FetchHttpHandler as RequestHandler } from "@aws-sdk/fetch-http-handler"; +import { STSClientConfig } from "./STSClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: STSClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + credentialDefaultProvider: (input: any) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: ((string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider) & (string | import("@aws-sdk/types").Provider | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider)) | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + credentials?: import("@aws-sdk/types").AwsCredentialIdentity | import("@aws-sdk/types").Provider | undefined; + signer?: import("@aws-sdk/types").RequestSigner | ((authScheme?: import("@aws-sdk/types").AuthScheme | undefined) => Promise) | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: (new (options: import("@aws-sdk/signature-v4").SignatureV4Init & import("@aws-sdk/signature-v4").SignatureV4CryptoInit) => import("@aws-sdk/types").RequestSigner) | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; + useGlobalEndpoint?: boolean | import("@aws-sdk/types").Provider | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts new file mode 100644 index 0000000000..ce21809bc1 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.d.ts @@ -0,0 +1,43 @@ +import { NodeHttpHandler as RequestHandler } from "@aws-sdk/node-http-handler"; +import { STSClientConfig } from "./STSClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: STSClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + credentialDefaultProvider: import("./defaultStsRoleAssumers").DefaultCredentialProvider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: ((string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider) & (string | import("@aws-sdk/types").Provider | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider)) | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + credentials?: import("@aws-sdk/types").AwsCredentialIdentity | import("@aws-sdk/types").Provider | undefined; + signer?: import("@aws-sdk/types").RequestSigner | ((authScheme?: import("@aws-sdk/types").AuthScheme | undefined) => Promise) | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: (new (options: import("@aws-sdk/signature-v4").SignatureV4Init & import("@aws-sdk/signature-v4").SignatureV4CryptoInit) => import("@aws-sdk/types").RequestSigner) | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; + useGlobalEndpoint?: boolean | import("@aws-sdk/types").Provider | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.native.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.native.d.ts new file mode 100644 index 0000000000..6e648e69d8 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.native.d.ts @@ -0,0 +1,42 @@ +import { STSClientConfig } from "./STSClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: STSClientConfig) => { + runtime: string; + sha256: import("@aws-sdk/types").HashConstructor; + requestHandler: (import("@aws-sdk/types").RequestHandler & import("@aws-sdk/protocol-http").HttpHandler) | import("@aws-sdk/fetch-http-handler").FetchHttpHandler; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + streamCollector: import("@aws-sdk/types").StreamCollector; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + maxAttempts: number | import("@aws-sdk/types").Provider; + retryMode: string | import("@aws-sdk/types").Provider; + logger: import("@aws-sdk/types").Logger; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + serviceId: string; + region: string | import("@aws-sdk/types").Provider; + credentialDefaultProvider: (input: any) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider; + defaultsMode: import("@aws-sdk/smithy-client").DefaultsMode | import("@aws-sdk/types").Provider; + endpoint?: string | import("@aws-sdk/types").Endpoint | import("@aws-sdk/types").Provider | import("@aws-sdk/types").EndpointV2 | import("@aws-sdk/types").Provider | undefined; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined; + credentials?: import("@aws-sdk/types").AwsCredentialIdentity | import("@aws-sdk/types").Provider | undefined; + signer?: import("@aws-sdk/types").RequestSigner | ((authScheme?: import("@aws-sdk/types").AuthScheme | undefined) => Promise) | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: (new (options: import("@aws-sdk/signature-v4").SignatureV4Init & import("@aws-sdk/signature-v4").SignatureV4CryptoInit) => import("@aws-sdk/types").RequestSigner) | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; + useGlobalEndpoint?: boolean | import("@aws-sdk/types").Provider | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.shared.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.shared.d.ts new file mode 100644 index 0000000000..b19ed57c76 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/runtimeConfig.shared.d.ts @@ -0,0 +1,18 @@ +import { STSClientConfig } from "./STSClient"; +/** + * @internal + */ +export declare const getRuntimeConfig: (config: STSClientConfig) => { + apiVersion: string; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + }) => import("@aws-sdk/types").EndpointV2; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + urlParser: import("@aws-sdk/types").UrlParser; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STS.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STS.d.ts new file mode 100644 index 0000000000..acfd5d1b0a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STS.d.ts @@ -0,0 +1,140 @@ +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; +import { + AssumeRoleCommandInput, + AssumeRoleCommandOutput, +} from "./commands/AssumeRoleCommand"; +import { + AssumeRoleWithSAMLCommandInput, + AssumeRoleWithSAMLCommandOutput, +} from "./commands/AssumeRoleWithSAMLCommand"; +import { + AssumeRoleWithWebIdentityCommandInput, + AssumeRoleWithWebIdentityCommandOutput, +} from "./commands/AssumeRoleWithWebIdentityCommand"; +import { + DecodeAuthorizationMessageCommandInput, + DecodeAuthorizationMessageCommandOutput, +} from "./commands/DecodeAuthorizationMessageCommand"; +import { + GetAccessKeyInfoCommandInput, + GetAccessKeyInfoCommandOutput, +} from "./commands/GetAccessKeyInfoCommand"; +import { + GetCallerIdentityCommandInput, + GetCallerIdentityCommandOutput, +} from "./commands/GetCallerIdentityCommand"; +import { + GetFederationTokenCommandInput, + GetFederationTokenCommandOutput, +} from "./commands/GetFederationTokenCommand"; +import { + GetSessionTokenCommandInput, + GetSessionTokenCommandOutput, +} from "./commands/GetSessionTokenCommand"; +import { STSClient } from "./STSClient"; +export declare class STS extends STSClient { + assumeRole( + args: AssumeRoleCommandInput, + options?: __HttpHandlerOptions + ): Promise; + assumeRole( + args: AssumeRoleCommandInput, + cb: (err: any, data?: AssumeRoleCommandOutput) => void + ): void; + assumeRole( + args: AssumeRoleCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: AssumeRoleCommandOutput) => void + ): void; + assumeRoleWithSAML( + args: AssumeRoleWithSAMLCommandInput, + options?: __HttpHandlerOptions + ): Promise; + assumeRoleWithSAML( + args: AssumeRoleWithSAMLCommandInput, + cb: (err: any, data?: AssumeRoleWithSAMLCommandOutput) => void + ): void; + assumeRoleWithSAML( + args: AssumeRoleWithSAMLCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: AssumeRoleWithSAMLCommandOutput) => void + ): void; + assumeRoleWithWebIdentity( + args: AssumeRoleWithWebIdentityCommandInput, + options?: __HttpHandlerOptions + ): Promise; + assumeRoleWithWebIdentity( + args: AssumeRoleWithWebIdentityCommandInput, + cb: (err: any, data?: AssumeRoleWithWebIdentityCommandOutput) => void + ): void; + assumeRoleWithWebIdentity( + args: AssumeRoleWithWebIdentityCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: AssumeRoleWithWebIdentityCommandOutput) => void + ): void; + decodeAuthorizationMessage( + args: DecodeAuthorizationMessageCommandInput, + options?: __HttpHandlerOptions + ): Promise; + decodeAuthorizationMessage( + args: DecodeAuthorizationMessageCommandInput, + cb: (err: any, data?: DecodeAuthorizationMessageCommandOutput) => void + ): void; + decodeAuthorizationMessage( + args: DecodeAuthorizationMessageCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DecodeAuthorizationMessageCommandOutput) => void + ): void; + getAccessKeyInfo( + args: GetAccessKeyInfoCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getAccessKeyInfo( + args: GetAccessKeyInfoCommandInput, + cb: (err: any, data?: GetAccessKeyInfoCommandOutput) => void + ): void; + getAccessKeyInfo( + args: GetAccessKeyInfoCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetAccessKeyInfoCommandOutput) => void + ): void; + getCallerIdentity( + args: GetCallerIdentityCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getCallerIdentity( + args: GetCallerIdentityCommandInput, + cb: (err: any, data?: GetCallerIdentityCommandOutput) => void + ): void; + getCallerIdentity( + args: GetCallerIdentityCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetCallerIdentityCommandOutput) => void + ): void; + getFederationToken( + args: GetFederationTokenCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getFederationToken( + args: GetFederationTokenCommandInput, + cb: (err: any, data?: GetFederationTokenCommandOutput) => void + ): void; + getFederationToken( + args: GetFederationTokenCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetFederationTokenCommandOutput) => void + ): void; + getSessionToken( + args: GetSessionTokenCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getSessionToken( + args: GetSessionTokenCommandInput, + cb: (err: any, data?: GetSessionTokenCommandOutput) => void + ): void; + getSessionToken( + args: GetSessionTokenCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetSessionTokenCommandOutput) => void + ): void; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STSClient.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STSClient.d.ts new file mode 100644 index 0000000000..d9197e19e4 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/STSClient.d.ts @@ -0,0 +1,159 @@ +import { + RegionInputConfig, + RegionResolvedConfig, +} from "@aws-sdk/config-resolver"; +import { + EndpointInputConfig, + EndpointResolvedConfig, +} from "@aws-sdk/middleware-endpoint"; +import { + HostHeaderInputConfig, + HostHeaderResolvedConfig, +} from "@aws-sdk/middleware-host-header"; +import { + RetryInputConfig, + RetryResolvedConfig, +} from "@aws-sdk/middleware-retry"; +import { + StsAuthInputConfig, + StsAuthResolvedConfig, +} from "@aws-sdk/middleware-sdk-sts"; +import { + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@aws-sdk/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + ChecksumConstructor as __ChecksumConstructor, + Credentials as __Credentials, + Decoder as __Decoder, + Encoder as __Encoder, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@aws-sdk/types"; +import { + AssumeRoleCommandInput, + AssumeRoleCommandOutput, +} from "./commands/AssumeRoleCommand"; +import { + AssumeRoleWithSAMLCommandInput, + AssumeRoleWithSAMLCommandOutput, +} from "./commands/AssumeRoleWithSAMLCommand"; +import { + AssumeRoleWithWebIdentityCommandInput, + AssumeRoleWithWebIdentityCommandOutput, +} from "./commands/AssumeRoleWithWebIdentityCommand"; +import { + DecodeAuthorizationMessageCommandInput, + DecodeAuthorizationMessageCommandOutput, +} from "./commands/DecodeAuthorizationMessageCommand"; +import { + GetAccessKeyInfoCommandInput, + GetAccessKeyInfoCommandOutput, +} from "./commands/GetAccessKeyInfoCommand"; +import { + GetCallerIdentityCommandInput, + GetCallerIdentityCommandOutput, +} from "./commands/GetCallerIdentityCommand"; +import { + GetFederationTokenCommandInput, + GetFederationTokenCommandOutput, +} from "./commands/GetFederationTokenCommand"; +import { + GetSessionTokenCommandInput, + GetSessionTokenCommandOutput, +} from "./commands/GetSessionTokenCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, +} from "./endpoint/EndpointParameters"; +export declare type ServiceInputTypes = + | AssumeRoleCommandInput + | AssumeRoleWithSAMLCommandInput + | AssumeRoleWithWebIdentityCommandInput + | DecodeAuthorizationMessageCommandInput + | GetAccessKeyInfoCommandInput + | GetCallerIdentityCommandInput + | GetFederationTokenCommandInput + | GetSessionTokenCommandInput; +export declare type ServiceOutputTypes = + | AssumeRoleCommandOutput + | AssumeRoleWithSAMLCommandOutput + | AssumeRoleWithWebIdentityCommandOutput + | DecodeAuthorizationMessageCommandOutput + | GetAccessKeyInfoCommandOutput + | GetCallerIdentityCommandOutput + | GetFederationTokenCommandOutput + | GetSessionTokenCommandOutput; +export interface ClientDefaults + extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + requestHandler?: __HttpHandler; + sha256?: __ChecksumConstructor | __HashConstructor; + urlParser?: __UrlParser; + bodyLengthChecker?: __BodyLengthCalculator; + streamCollector?: __StreamCollector; + base64Decoder?: __Decoder; + base64Encoder?: __Encoder; + utf8Decoder?: __Decoder; + utf8Encoder?: __Encoder; + runtime?: string; + disableHostPrefix?: boolean; + maxAttempts?: number | __Provider; + retryMode?: string | __Provider; + logger?: __Logger; + useDualstackEndpoint?: boolean | __Provider; + useFipsEndpoint?: boolean | __Provider; + serviceId?: string; + region?: string | __Provider; + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + defaultUserAgentProvider?: Provider<__UserAgent>; + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} +declare type STSClientConfigType = Partial< + __SmithyConfiguration<__HttpHandlerOptions> +> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + StsAuthInputConfig & + UserAgentInputConfig & + ClientInputEndpointParameters; +export interface STSClientConfig extends STSClientConfigType {} +declare type STSClientResolvedConfigType = + __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + StsAuthResolvedConfig & + UserAgentResolvedConfig & + ClientResolvedEndpointParameters; +export interface STSClientResolvedConfig extends STSClientResolvedConfigType {} +export declare class STSClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + STSClientResolvedConfig +> { + readonly config: STSClientResolvedConfig; + constructor(configuration: STSClientConfig); + destroy(): void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleCommand.d.ts new file mode 100644 index 0000000000..0ae339b083 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleCommand.d.ts @@ -0,0 +1,34 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { AssumeRoleRequest, AssumeRoleResponse } from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + STSClientResolvedConfig, +} from "../STSClient"; +export interface AssumeRoleCommandInput extends AssumeRoleRequest {} +export interface AssumeRoleCommandOutput + extends AssumeRoleResponse, + __MetadataBearer {} +export declare class AssumeRoleCommand extends $Command< + AssumeRoleCommandInput, + AssumeRoleCommandOutput, + STSClientResolvedConfig +> { + readonly input: AssumeRoleCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: AssumeRoleCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: STSClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts new file mode 100644 index 0000000000..d6853d4633 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + AssumeRoleWithSAMLRequest, + AssumeRoleWithSAMLResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + STSClientResolvedConfig, +} from "../STSClient"; +export interface AssumeRoleWithSAMLCommandInput + extends AssumeRoleWithSAMLRequest {} +export interface AssumeRoleWithSAMLCommandOutput + extends AssumeRoleWithSAMLResponse, + __MetadataBearer {} +export declare class AssumeRoleWithSAMLCommand extends $Command< + AssumeRoleWithSAMLCommandInput, + AssumeRoleWithSAMLCommandOutput, + STSClientResolvedConfig +> { + readonly input: AssumeRoleWithSAMLCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: AssumeRoleWithSAMLCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: STSClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts new file mode 100644 index 0000000000..c110fb6971 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + AssumeRoleWithWebIdentityRequest, + AssumeRoleWithWebIdentityResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + STSClientResolvedConfig, +} from "../STSClient"; +export interface AssumeRoleWithWebIdentityCommandInput + extends AssumeRoleWithWebIdentityRequest {} +export interface AssumeRoleWithWebIdentityCommandOutput + extends AssumeRoleWithWebIdentityResponse, + __MetadataBearer {} +export declare class AssumeRoleWithWebIdentityCommand extends $Command< + AssumeRoleWithWebIdentityCommandInput, + AssumeRoleWithWebIdentityCommandOutput, + STSClientResolvedConfig +> { + readonly input: AssumeRoleWithWebIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: AssumeRoleWithWebIdentityCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: STSClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + AssumeRoleWithWebIdentityCommandInput, + AssumeRoleWithWebIdentityCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts new file mode 100644 index 0000000000..ed33ce57b4 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts @@ -0,0 +1,41 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + DecodeAuthorizationMessageRequest, + DecodeAuthorizationMessageResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + STSClientResolvedConfig, +} from "../STSClient"; +export interface DecodeAuthorizationMessageCommandInput + extends DecodeAuthorizationMessageRequest {} +export interface DecodeAuthorizationMessageCommandOutput + extends DecodeAuthorizationMessageResponse, + __MetadataBearer {} +export declare class DecodeAuthorizationMessageCommand extends $Command< + DecodeAuthorizationMessageCommandInput, + DecodeAuthorizationMessageCommandOutput, + STSClientResolvedConfig +> { + readonly input: DecodeAuthorizationMessageCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: DecodeAuthorizationMessageCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: STSClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DecodeAuthorizationMessageCommandInput, + DecodeAuthorizationMessageCommandOutput + >; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts new file mode 100644 index 0000000000..dd7273115f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + GetAccessKeyInfoRequest, + GetAccessKeyInfoResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + STSClientResolvedConfig, +} from "../STSClient"; +export interface GetAccessKeyInfoCommandInput extends GetAccessKeyInfoRequest {} +export interface GetAccessKeyInfoCommandOutput + extends GetAccessKeyInfoResponse, + __MetadataBearer {} +export declare class GetAccessKeyInfoCommand extends $Command< + GetAccessKeyInfoCommandInput, + GetAccessKeyInfoCommandOutput, + STSClientResolvedConfig +> { + readonly input: GetAccessKeyInfoCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetAccessKeyInfoCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: STSClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetCallerIdentityCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetCallerIdentityCommand.d.ts new file mode 100644 index 0000000000..4513744f83 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetCallerIdentityCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + GetCallerIdentityRequest, + GetCallerIdentityResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + STSClientResolvedConfig, +} from "../STSClient"; +export interface GetCallerIdentityCommandInput + extends GetCallerIdentityRequest {} +export interface GetCallerIdentityCommandOutput + extends GetCallerIdentityResponse, + __MetadataBearer {} +export declare class GetCallerIdentityCommand extends $Command< + GetCallerIdentityCommandInput, + GetCallerIdentityCommandOutput, + STSClientResolvedConfig +> { + readonly input: GetCallerIdentityCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetCallerIdentityCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: STSClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetFederationTokenCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetFederationTokenCommand.d.ts new file mode 100644 index 0000000000..08b951cb4f --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetFederationTokenCommand.d.ts @@ -0,0 +1,38 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + GetFederationTokenRequest, + GetFederationTokenResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + STSClientResolvedConfig, +} from "../STSClient"; +export interface GetFederationTokenCommandInput + extends GetFederationTokenRequest {} +export interface GetFederationTokenCommandOutput + extends GetFederationTokenResponse, + __MetadataBearer {} +export declare class GetFederationTokenCommand extends $Command< + GetFederationTokenCommandInput, + GetFederationTokenCommandOutput, + STSClientResolvedConfig +> { + readonly input: GetFederationTokenCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetFederationTokenCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: STSClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetSessionTokenCommand.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetSessionTokenCommand.d.ts new file mode 100644 index 0000000000..16b028a417 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/GetSessionTokenCommand.d.ts @@ -0,0 +1,37 @@ +import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + Handler, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { + GetSessionTokenRequest, + GetSessionTokenResponse, +} from "../models/models_0"; +import { + ServiceInputTypes, + ServiceOutputTypes, + STSClientResolvedConfig, +} from "../STSClient"; +export interface GetSessionTokenCommandInput extends GetSessionTokenRequest {} +export interface GetSessionTokenCommandOutput + extends GetSessionTokenResponse, + __MetadataBearer {} +export declare class GetSessionTokenCommand extends $Command< + GetSessionTokenCommandInput, + GetSessionTokenCommandOutput, + STSClientResolvedConfig +> { + readonly input: GetSessionTokenCommandInput; + static getEndpointParameterInstructions(): EndpointParameterInstructions; + constructor(input: GetSessionTokenCommandInput); + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: STSClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler; + private serialize; + private deserialize; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/index.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/index.d.ts new file mode 100644 index 0000000000..802202ff12 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/commands/index.d.ts @@ -0,0 +1,8 @@ +export * from "./AssumeRoleCommand"; +export * from "./AssumeRoleWithSAMLCommand"; +export * from "./AssumeRoleWithWebIdentityCommand"; +export * from "./DecodeAuthorizationMessageCommand"; +export * from "./GetAccessKeyInfoCommand"; +export * from "./GetCallerIdentityCommand"; +export * from "./GetFederationTokenCommand"; +export * from "./GetSessionTokenCommand"; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultRoleAssumers.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultRoleAssumers.d.ts new file mode 100644 index 0000000000..b17b86b31d --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultRoleAssumers.d.ts @@ -0,0 +1,22 @@ +import { Pluggable } from "@aws-sdk/types"; +import { + DefaultCredentialProvider, + RoleAssumer, + RoleAssumerWithWebIdentity, +} from "./defaultStsRoleAssumers"; +import { + ServiceInputTypes, + ServiceOutputTypes, + STSClientConfig, +} from "./STSClient"; +export declare const getDefaultRoleAssumer: ( + stsOptions?: Pick, + stsPlugins?: Pluggable[] | undefined +) => RoleAssumer; +export declare const getDefaultRoleAssumerWithWebIdentity: ( + stsOptions?: Pick, + stsPlugins?: Pluggable[] | undefined +) => RoleAssumerWithWebIdentity; +export declare const decorateDefaultCredentialProvider: ( + provider: DefaultCredentialProvider +) => DefaultCredentialProvider; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultStsRoleAssumers.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultStsRoleAssumers.d.ts new file mode 100644 index 0000000000..0e327f3012 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultStsRoleAssumers.d.ts @@ -0,0 +1,25 @@ +import { Credentials, Provider } from "@aws-sdk/types"; +import { AssumeRoleCommandInput } from "./commands/AssumeRoleCommand"; +import { AssumeRoleWithWebIdentityCommandInput } from "./commands/AssumeRoleWithWebIdentityCommand"; +import { STSClient, STSClientConfig } from "./STSClient"; +export declare type RoleAssumer = ( + sourceCreds: Credentials, + params: AssumeRoleCommandInput +) => Promise; +export declare const getDefaultRoleAssumer: ( + stsOptions: Pick, + stsClientCtor: new (options: STSClientConfig) => STSClient +) => RoleAssumer; +export declare type RoleAssumerWithWebIdentity = ( + params: AssumeRoleWithWebIdentityCommandInput +) => Promise; +export declare const getDefaultRoleAssumerWithWebIdentity: ( + stsOptions: Pick, + stsClientCtor: new (options: STSClientConfig) => STSClient +) => RoleAssumerWithWebIdentity; +export declare type DefaultCredentialProvider = ( + input: any +) => Provider; +export declare const decorateDefaultCredentialProvider: ( + provider: DefaultCredentialProvider +) => DefaultCredentialProvider; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/EndpointParameters.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/EndpointParameters.d.ts new file mode 100644 index 0000000000..0e92f9de14 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/EndpointParameters.d.ts @@ -0,0 +1,36 @@ +import { + Endpoint, + EndpointParameters as __EndpointParameters, + EndpointV2, + Provider, +} from "@aws-sdk/types"; +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: + | string + | Provider + | Endpoint + | Provider + | EndpointV2 + | Provider; + useGlobalEndpoint?: boolean | Provider; +} +export declare type ClientResolvedEndpointParameters = + ClientInputEndpointParameters & { + defaultSigningName: string; + }; +export declare const resolveClientEndpointParameters: ( + options: T & ClientInputEndpointParameters +) => T & + ClientInputEndpointParameters & { + defaultSigningName: string; + }; +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; + UseGlobalEndpoint?: boolean; +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/endpointResolver.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/endpointResolver.d.ts new file mode 100644 index 0000000000..4c971a7f41 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/endpointResolver.d.ts @@ -0,0 +1,8 @@ +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParameters } from "./EndpointParameters"; +export declare const defaultEndpointResolver: ( + endpointParams: EndpointParameters, + context?: { + logger?: Logger; + } +) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/ruleset.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/ruleset.d.ts new file mode 100644 index 0000000000..a822ad761a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/endpoint/ruleset.d.ts @@ -0,0 +1,2 @@ +import { RuleSetObject } from "@aws-sdk/util-endpoints"; +export declare const ruleSet: RuleSetObject; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..441fe775a2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/index.d.ts @@ -0,0 +1,6 @@ +export * from "./STS"; +export * from "./STSClient"; +export * from "./commands"; +export * from "./defaultRoleAssumers"; +export * from "./models"; +export { STSServiceException } from "./models/STSServiceException"; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/STSServiceException.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/STSServiceException.d.ts new file mode 100644 index 0000000000..5255fd172c --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/STSServiceException.d.ts @@ -0,0 +1,7 @@ +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@aws-sdk/smithy-client"; +export declare class STSServiceException extends __ServiceException { + constructor(options: __ServiceExceptionOptions); +} diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/index.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/index.d.ts new file mode 100644 index 0000000000..09c5d6e09b --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/index.d.ts @@ -0,0 +1 @@ +export * from "./models_0"; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/models_0.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/models_0.d.ts new file mode 100644 index 0000000000..50164423de --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/models/models_0.d.ts @@ -0,0 +1,238 @@ +import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client"; +import { STSServiceException as __BaseException } from "./STSServiceException"; +export interface AssumedRoleUser { + AssumedRoleId: string | undefined; + Arn: string | undefined; +} +export interface PolicyDescriptorType { + arn?: string; +} +export interface Tag { + Key: string | undefined; + Value: string | undefined; +} +export interface AssumeRoleRequest { + RoleArn: string | undefined; + RoleSessionName: string | undefined; + PolicyArns?: PolicyDescriptorType[]; + Policy?: string; + DurationSeconds?: number; + Tags?: Tag[]; + TransitiveTagKeys?: string[]; + ExternalId?: string; + SerialNumber?: string; + TokenCode?: string; + SourceIdentity?: string; +} +export interface Credentials { + AccessKeyId: string | undefined; + SecretAccessKey: string | undefined; + SessionToken: string | undefined; + Expiration: Date | undefined; +} +export interface AssumeRoleResponse { + Credentials?: Credentials; + AssumedRoleUser?: AssumedRoleUser; + PackedPolicySize?: number; + SourceIdentity?: string; +} +export declare class ExpiredTokenException extends __BaseException { + readonly name: "ExpiredTokenException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class MalformedPolicyDocumentException extends __BaseException { + readonly name: "MalformedPolicyDocumentException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType< + MalformedPolicyDocumentException, + __BaseException + > + ); +} +export declare class PackedPolicyTooLargeException extends __BaseException { + readonly name: "PackedPolicyTooLargeException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class RegionDisabledException extends __BaseException { + readonly name: "RegionDisabledException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export interface AssumeRoleWithSAMLRequest { + RoleArn: string | undefined; + PrincipalArn: string | undefined; + SAMLAssertion: string | undefined; + PolicyArns?: PolicyDescriptorType[]; + Policy?: string; + DurationSeconds?: number; +} +export interface AssumeRoleWithSAMLResponse { + Credentials?: Credentials; + AssumedRoleUser?: AssumedRoleUser; + PackedPolicySize?: number; + Subject?: string; + SubjectType?: string; + Issuer?: string; + Audience?: string; + NameQualifier?: string; + SourceIdentity?: string; +} +export declare class IDPRejectedClaimException extends __BaseException { + readonly name: "IDPRejectedClaimException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export declare class InvalidIdentityTokenException extends __BaseException { + readonly name: "InvalidIdentityTokenException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export interface AssumeRoleWithWebIdentityRequest { + RoleArn: string | undefined; + RoleSessionName: string | undefined; + WebIdentityToken: string | undefined; + ProviderId?: string; + PolicyArns?: PolicyDescriptorType[]; + Policy?: string; + DurationSeconds?: number; +} +export interface AssumeRoleWithWebIdentityResponse { + Credentials?: Credentials; + SubjectFromWebIdentityToken?: string; + AssumedRoleUser?: AssumedRoleUser; + PackedPolicySize?: number; + Provider?: string; + Audience?: string; + SourceIdentity?: string; +} +export declare class IDPCommunicationErrorException extends __BaseException { + readonly name: "IDPCommunicationErrorException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType + ); +} +export interface DecodeAuthorizationMessageRequest { + EncodedMessage: string | undefined; +} +export interface DecodeAuthorizationMessageResponse { + DecodedMessage?: string; +} +export declare class InvalidAuthorizationMessageException extends __BaseException { + readonly name: "InvalidAuthorizationMessageException"; + readonly $fault: "client"; + constructor( + opts: __ExceptionOptionType< + InvalidAuthorizationMessageException, + __BaseException + > + ); +} +export interface GetAccessKeyInfoRequest { + AccessKeyId: string | undefined; +} +export interface GetAccessKeyInfoResponse { + Account?: string; +} +export interface GetCallerIdentityRequest {} +export interface GetCallerIdentityResponse { + UserId?: string; + Account?: string; + Arn?: string; +} +export interface GetFederationTokenRequest { + Name: string | undefined; + Policy?: string; + PolicyArns?: PolicyDescriptorType[]; + DurationSeconds?: number; + Tags?: Tag[]; +} +export interface FederatedUser { + FederatedUserId: string | undefined; + Arn: string | undefined; +} +export interface GetFederationTokenResponse { + Credentials?: Credentials; + FederatedUser?: FederatedUser; + PackedPolicySize?: number; +} +export interface GetSessionTokenRequest { + DurationSeconds?: number; + SerialNumber?: string; + TokenCode?: string; +} +export interface GetSessionTokenResponse { + Credentials?: Credentials; +} +export declare const AssumedRoleUserFilterSensitiveLog: ( + obj: AssumedRoleUser +) => any; +export declare const PolicyDescriptorTypeFilterSensitiveLog: ( + obj: PolicyDescriptorType +) => any; +export declare const TagFilterSensitiveLog: (obj: Tag) => any; +export declare const AssumeRoleRequestFilterSensitiveLog: ( + obj: AssumeRoleRequest +) => any; +export declare const CredentialsFilterSensitiveLog: (obj: Credentials) => any; +export declare const AssumeRoleResponseFilterSensitiveLog: ( + obj: AssumeRoleResponse +) => any; +export declare const AssumeRoleWithSAMLRequestFilterSensitiveLog: ( + obj: AssumeRoleWithSAMLRequest +) => any; +export declare const AssumeRoleWithSAMLResponseFilterSensitiveLog: ( + obj: AssumeRoleWithSAMLResponse +) => any; +export declare const AssumeRoleWithWebIdentityRequestFilterSensitiveLog: ( + obj: AssumeRoleWithWebIdentityRequest +) => any; +export declare const AssumeRoleWithWebIdentityResponseFilterSensitiveLog: ( + obj: AssumeRoleWithWebIdentityResponse +) => any; +export declare const DecodeAuthorizationMessageRequestFilterSensitiveLog: ( + obj: DecodeAuthorizationMessageRequest +) => any; +export declare const DecodeAuthorizationMessageResponseFilterSensitiveLog: ( + obj: DecodeAuthorizationMessageResponse +) => any; +export declare const GetAccessKeyInfoRequestFilterSensitiveLog: ( + obj: GetAccessKeyInfoRequest +) => any; +export declare const GetAccessKeyInfoResponseFilterSensitiveLog: ( + obj: GetAccessKeyInfoResponse +) => any; +export declare const GetCallerIdentityRequestFilterSensitiveLog: ( + obj: GetCallerIdentityRequest +) => any; +export declare const GetCallerIdentityResponseFilterSensitiveLog: ( + obj: GetCallerIdentityResponse +) => any; +export declare const GetFederationTokenRequestFilterSensitiveLog: ( + obj: GetFederationTokenRequest +) => any; +export declare const FederatedUserFilterSensitiveLog: ( + obj: FederatedUser +) => any; +export declare const GetFederationTokenResponseFilterSensitiveLog: ( + obj: GetFederationTokenResponse +) => any; +export declare const GetSessionTokenRequestFilterSensitiveLog: ( + obj: GetSessionTokenRequest +) => any; +export declare const GetSessionTokenResponseFilterSensitiveLog: ( + obj: GetSessionTokenResponse +) => any; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/protocols/Aws_query.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/protocols/Aws_query.d.ts new file mode 100644 index 0000000000..30add1138e --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/protocols/Aws_query.d.ts @@ -0,0 +1,101 @@ +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse, +} from "@aws-sdk/protocol-http"; +import { SerdeContext as __SerdeContext } from "@aws-sdk/types"; +import { + AssumeRoleCommandInput, + AssumeRoleCommandOutput, +} from "../commands/AssumeRoleCommand"; +import { + AssumeRoleWithSAMLCommandInput, + AssumeRoleWithSAMLCommandOutput, +} from "../commands/AssumeRoleWithSAMLCommand"; +import { + AssumeRoleWithWebIdentityCommandInput, + AssumeRoleWithWebIdentityCommandOutput, +} from "../commands/AssumeRoleWithWebIdentityCommand"; +import { + DecodeAuthorizationMessageCommandInput, + DecodeAuthorizationMessageCommandOutput, +} from "../commands/DecodeAuthorizationMessageCommand"; +import { + GetAccessKeyInfoCommandInput, + GetAccessKeyInfoCommandOutput, +} from "../commands/GetAccessKeyInfoCommand"; +import { + GetCallerIdentityCommandInput, + GetCallerIdentityCommandOutput, +} from "../commands/GetCallerIdentityCommand"; +import { + GetFederationTokenCommandInput, + GetFederationTokenCommandOutput, +} from "../commands/GetFederationTokenCommand"; +import { + GetSessionTokenCommandInput, + GetSessionTokenCommandOutput, +} from "../commands/GetSessionTokenCommand"; +export declare const serializeAws_queryAssumeRoleCommand: ( + input: AssumeRoleCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_queryAssumeRoleWithSAMLCommand: ( + input: AssumeRoleWithSAMLCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_queryAssumeRoleWithWebIdentityCommand: ( + input: AssumeRoleWithWebIdentityCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_queryDecodeAuthorizationMessageCommand: ( + input: DecodeAuthorizationMessageCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_queryGetAccessKeyInfoCommand: ( + input: GetAccessKeyInfoCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_queryGetCallerIdentityCommand: ( + input: GetCallerIdentityCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_queryGetFederationTokenCommand: ( + input: GetFederationTokenCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const serializeAws_queryGetSessionTokenCommand: ( + input: GetSessionTokenCommandInput, + context: __SerdeContext +) => Promise<__HttpRequest>; +export declare const deserializeAws_queryAssumeRoleCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_queryAssumeRoleWithSAMLCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_queryAssumeRoleWithWebIdentityCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_queryDecodeAuthorizationMessageCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_queryGetAccessKeyInfoCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_queryGetCallerIdentityCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_queryGetFederationTokenCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; +export declare const deserializeAws_queryGetSessionTokenCommand: ( + output: __HttpResponse, + context: __SerdeContext +) => Promise; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.browser.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.browser.d.ts new file mode 100644 index 0000000000..bab458973a --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.browser.d.ts @@ -0,0 +1,95 @@ +import { FetchHttpHandler as RequestHandler } from "@aws-sdk/fetch-http-handler"; +import { STSClientConfig } from "./STSClient"; +export declare const getRuntimeConfig: (config: STSClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").ResolvedDefaultsMode + >; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + credentialDefaultProvider: ( + input: any + ) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: + | (( + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + ) & + ( + | string + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").EndpointV2 + > + )) + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + credentials?: + | import("@aws-sdk/types").AwsCredentialIdentity + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").AwsCredentialIdentity + > + | undefined; + signer?: + | import("@aws-sdk/types").RequestSigner + | (( + authScheme?: import("@aws-sdk/types").AuthScheme | undefined + ) => Promise) + | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: + | (new ( + options: import("@aws-sdk/signature-v4").SignatureV4Init & + import("@aws-sdk/signature-v4").SignatureV4CryptoInit + ) => import("@aws-sdk/types").RequestSigner) + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; + useGlobalEndpoint?: + | boolean + | import("@aws-sdk/types").Provider + | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts new file mode 100644 index 0000000000..316451c5e2 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.d.ts @@ -0,0 +1,93 @@ +import { NodeHttpHandler as RequestHandler } from "@aws-sdk/node-http-handler"; +import { STSClientConfig } from "./STSClient"; +export declare const getRuntimeConfig: (config: STSClientConfig) => { + runtime: string; + defaultsMode: import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").ResolvedDefaultsMode + >; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + credentialDefaultProvider: import("./defaultStsRoleAssumers").DefaultCredentialProvider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + maxAttempts: number | import("@aws-sdk/types").Provider; + region: string | import("@aws-sdk/types").Provider; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | RequestHandler; + retryMode: string | import("@aws-sdk/types").Provider; + sha256: import("@aws-sdk/types").HashConstructor; + streamCollector: import("@aws-sdk/types").StreamCollector; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + endpoint?: + | (( + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + ) & + ( + | string + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").EndpointV2 + > + )) + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + credentials?: + | import("@aws-sdk/types").AwsCredentialIdentity + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").AwsCredentialIdentity + > + | undefined; + signer?: + | import("@aws-sdk/types").RequestSigner + | (( + authScheme?: import("@aws-sdk/types").AuthScheme | undefined + ) => Promise) + | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: + | (new ( + options: import("@aws-sdk/signature-v4").SignatureV4Init & + import("@aws-sdk/signature-v4").SignatureV4CryptoInit + ) => import("@aws-sdk/types").RequestSigner) + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; + useGlobalEndpoint?: + | boolean + | import("@aws-sdk/types").Provider + | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.native.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.native.d.ts new file mode 100644 index 0000000000..e61224ce26 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.native.d.ts @@ -0,0 +1,84 @@ +import { STSClientConfig } from "./STSClient"; +export declare const getRuntimeConfig: (config: STSClientConfig) => { + runtime: string; + sha256: import("@aws-sdk/types").HashConstructor; + requestHandler: + | (import("@aws-sdk/types").RequestHandler< + any, + any, + import("@aws-sdk/types").HttpHandlerOptions + > & + import("@aws-sdk/protocol-http").HttpHandler) + | import("@aws-sdk/fetch-http-handler").FetchHttpHandler; + apiVersion: string; + urlParser: import("@aws-sdk/types").UrlParser; + bodyLengthChecker: import("@aws-sdk/types").BodyLengthCalculator; + streamCollector: import("@aws-sdk/types").StreamCollector; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + maxAttempts: number | import("@aws-sdk/types").Provider; + retryMode: string | import("@aws-sdk/types").Provider; + logger: import("@aws-sdk/types").Logger; + useDualstackEndpoint: boolean | import("@aws-sdk/types").Provider; + useFipsEndpoint: boolean | import("@aws-sdk/types").Provider; + serviceId: string; + region: string | import("@aws-sdk/types").Provider; + credentialDefaultProvider: ( + input: any + ) => import("@aws-sdk/types").Provider; + defaultUserAgentProvider: import("@aws-sdk/types").Provider< + import("@aws-sdk/types").UserAgent + >; + defaultsMode: + | import("@aws-sdk/smithy-client").DefaultsMode + | import("@aws-sdk/types").Provider< + import("@aws-sdk/smithy-client").DefaultsMode + >; + endpoint?: + | string + | import("@aws-sdk/types").Endpoint + | import("@aws-sdk/types").Provider + | import("@aws-sdk/types").EndpointV2 + | import("@aws-sdk/types").Provider + | undefined; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + tls?: boolean | undefined; + retryStrategy?: + | import("@aws-sdk/types").RetryStrategy + | import("@aws-sdk/types").RetryStrategyV2 + | undefined; + credentials?: + | import("@aws-sdk/types").AwsCredentialIdentity + | import("@aws-sdk/types").Provider< + import("@aws-sdk/types").AwsCredentialIdentity + > + | undefined; + signer?: + | import("@aws-sdk/types").RequestSigner + | (( + authScheme?: import("@aws-sdk/types").AuthScheme | undefined + ) => Promise) + | undefined; + signingEscapePath?: boolean | undefined; + systemClockOffset?: number | undefined; + signingRegion?: string | undefined; + signerConstructor?: + | (new ( + options: import("@aws-sdk/signature-v4").SignatureV4Init & + import("@aws-sdk/signature-v4").SignatureV4CryptoInit + ) => import("@aws-sdk/types").RequestSigner) + | undefined; + customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined; + useGlobalEndpoint?: + | boolean + | import("@aws-sdk/types").Provider + | undefined; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.shared.d.ts b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.shared.d.ts new file mode 100644 index 0000000000..4c89a78509 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/runtimeConfig.shared.d.ts @@ -0,0 +1,18 @@ +import { STSClientConfig } from "./STSClient"; +export declare const getRuntimeConfig: (config: STSClientConfig) => { + apiVersion: string; + base64Decoder: import("@aws-sdk/types").Decoder; + base64Encoder: import("@aws-sdk/types").Encoder; + disableHostPrefix: boolean; + endpointProvider: ( + endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, + context?: { + logger?: import("@aws-sdk/types").Logger | undefined; + } + ) => import("@aws-sdk/types").EndpointV2; + logger: import("@aws-sdk/types").Logger; + serviceId: string; + urlParser: import("@aws-sdk/types").UrlParser; + utf8Decoder: import("@aws-sdk/types").Decoder; + utf8Encoder: import("@aws-sdk/types").Encoder; +}; diff --git a/server/node_modules/@aws-sdk/client-sts/package.json b/server/node_modules/@aws-sdk/client-sts/package.json new file mode 100644 index 0000000000..2ddc3bc6a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/client-sts/package.json @@ -0,0 +1,105 @@ +{ + "name": "@aws-sdk/client-sts", + "description": "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native", + "version": "3.264.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:docs": "typedoc", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "generate:client": "node ../../scripts/generate-clients/single-service --solo sts", + "test": "yarn test:unit", + "test:unit": "jest" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/credential-provider-node": "3.264.0", + "@aws-sdk/fetch-http-handler": "3.257.0", + "@aws-sdk/hash-node": "3.257.0", + "@aws-sdk/invalid-dependency": "3.257.0", + "@aws-sdk/middleware-content-length": "3.257.0", + "@aws-sdk/middleware-endpoint": "3.264.0", + "@aws-sdk/middleware-host-header": "3.257.0", + "@aws-sdk/middleware-logger": "3.257.0", + "@aws-sdk/middleware-recursion-detection": "3.257.0", + "@aws-sdk/middleware-retry": "3.259.0", + "@aws-sdk/middleware-sdk-sts": "3.257.0", + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/middleware-signing": "3.257.0", + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/middleware-user-agent": "3.257.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/node-http-handler": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/smithy-client": "3.261.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.261.0", + "@aws-sdk/util-defaults-mode-node": "3.261.0", + "@aws-sdk/util-endpoints": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "@aws-sdk/util-user-agent-browser": "3.257.0", + "@aws-sdk/util-user-agent-node": "3.259.0", + "@aws-sdk/util-utf8": "3.254.0", + "fast-xml-parser": "4.0.11", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/service-client-documentation-generator": "3.208.0", + "@tsconfig/node14": "1.0.3", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "overrides": { + "typedoc": { + "typescript": "~4.6.2" + } + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-sts" + } +} diff --git a/server/node_modules/@aws-sdk/config-resolver/LICENSE b/server/node_modules/@aws-sdk/config-resolver/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/config-resolver/README.md b/server/node_modules/@aws-sdk/config-resolver/README.md new file mode 100644 index 0000000000..6a92b2fe70 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/config-resolver + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/config-resolver/latest.svg)](https://www.npmjs.com/package/@aws-sdk/config-resolver) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/config-resolver.svg)](https://www.npmjs.com/package/@aws-sdk/config-resolver) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js new file mode 100644 index 0000000000..314e01035b --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_DUALSTACK_ENDPOINT = exports.CONFIG_USE_DUALSTACK_ENDPOINT = exports.ENV_USE_DUALSTACK_ENDPOINT = void 0; +const util_config_provider_1 = require("@aws-sdk/util-config-provider"); +exports.ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; +exports.CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; +exports.DEFAULT_USE_DUALSTACK_ENDPOINT = false; +exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.ENV), + configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), + default: false, +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/NodeUseFipsEndpointConfigOptions.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/NodeUseFipsEndpointConfigOptions.js new file mode 100644 index 0000000000..e1e55adcc7 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/NodeUseFipsEndpointConfigOptions.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_FIPS_ENDPOINT = exports.CONFIG_USE_FIPS_ENDPOINT = exports.ENV_USE_FIPS_ENDPOINT = void 0; +const util_config_provider_1 = require("@aws-sdk/util-config-provider"); +exports.ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; +exports.CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; +exports.DEFAULT_USE_FIPS_ENDPOINT = false; +exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.ENV), + configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), + default: false, +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/index.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/index.js new file mode 100644 index 0000000000..027f270ad7 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./NodeUseDualstackEndpointConfigOptions"), exports); +tslib_1.__exportStar(require("./NodeUseFipsEndpointConfigOptions"), exports); +tslib_1.__exportStar(require("./resolveCustomEndpointsConfig"), exports); +tslib_1.__exportStar(require("./resolveEndpointsConfig"), exports); diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/resolveCustomEndpointsConfig.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/resolveCustomEndpointsConfig.js new file mode 100644 index 0000000000..74a6fbe2b3 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/resolveCustomEndpointsConfig.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveCustomEndpointsConfig = void 0; +const util_middleware_1 = require("@aws-sdk/util-middleware"); +const resolveCustomEndpointsConfig = (input) => { + var _a, _b; + const { endpoint, urlParser } = input; + return { + ...input, + tls: (_a = input.tls) !== null && _a !== void 0 ? _a : true, + endpoint: (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), + isCustomEndpoint: true, + useDualstackEndpoint: (0, util_middleware_1.normalizeProvider)((_b = input.useDualstackEndpoint) !== null && _b !== void 0 ? _b : false), + }; +}; +exports.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/resolveEndpointsConfig.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/resolveEndpointsConfig.js new file mode 100644 index 0000000000..ac60f32a8e --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/resolveEndpointsConfig.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveEndpointsConfig = void 0; +const util_middleware_1 = require("@aws-sdk/util-middleware"); +const getEndpointFromRegion_1 = require("./utils/getEndpointFromRegion"); +const resolveEndpointsConfig = (input) => { + var _a, _b; + const useDualstackEndpoint = (0, util_middleware_1.normalizeProvider)((_a = input.useDualstackEndpoint) !== null && _a !== void 0 ? _a : false); + const { endpoint, useFipsEndpoint, urlParser } = input; + return { + ...input, + tls: (_b = input.tls) !== null && _b !== void 0 ? _b : true, + endpoint: endpoint + ? (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) + : () => (0, getEndpointFromRegion_1.getEndpointFromRegion)({ ...input, useDualstackEndpoint, useFipsEndpoint }), + isCustomEndpoint: !!endpoint, + useDualstackEndpoint, + }; +}; +exports.resolveEndpointsConfig = resolveEndpointsConfig; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/utils/getEndpointFromRegion.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/utils/getEndpointFromRegion.js new file mode 100644 index 0000000000..f7a1df77b9 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/utils/getEndpointFromRegion.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEndpointFromRegion = void 0; +const getEndpointFromRegion = async (input) => { + var _a; + const { tls = true } = input; + const region = await input.region(); + const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); + if (!dnsHostRegex.test(region)) { + throw new Error("Invalid region in client config"); + } + const useDualstackEndpoint = await input.useDualstackEndpoint(); + const useFipsEndpoint = await input.useFipsEndpoint(); + const { hostname } = (_a = (await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint }))) !== null && _a !== void 0 ? _a : {}; + if (!hostname) { + throw new Error("Cannot resolve hostname from client config"); + } + return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); +}; +exports.getEndpointFromRegion = getEndpointFromRegion; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/index.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/index.js new file mode 100644 index 0000000000..d91ea20b38 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./endpointsConfig"), exports); +tslib_1.__exportStar(require("./regionConfig"), exports); +tslib_1.__exportStar(require("./regionInfo"), exports); diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/config.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/config.js new file mode 100644 index 0000000000..2ad79b6f97 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/config.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NODE_REGION_CONFIG_FILE_OPTIONS = exports.NODE_REGION_CONFIG_OPTIONS = exports.REGION_INI_NAME = exports.REGION_ENV_NAME = void 0; +exports.REGION_ENV_NAME = "AWS_REGION"; +exports.REGION_INI_NAME = "region"; +exports.NODE_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[exports.REGION_ENV_NAME], + configFileSelector: (profile) => profile[exports.REGION_INI_NAME], + default: () => { + throw new Error("Region is missing"); + }, +}; +exports.NODE_REGION_CONFIG_FILE_OPTIONS = { + preferredFile: "credentials", +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/getRealRegion.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/getRealRegion.js new file mode 100644 index 0000000000..49b5cbd499 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/getRealRegion.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRealRegion = void 0; +const isFipsRegion_1 = require("./isFipsRegion"); +const getRealRegion = (region) => (0, isFipsRegion_1.isFipsRegion)(region) + ? ["fips-aws-global", "aws-fips"].includes(region) + ? "us-east-1" + : region.replace(/fips-(dkr-|prod-)?|-fips/, "") + : region; +exports.getRealRegion = getRealRegion; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/index.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/index.js new file mode 100644 index 0000000000..74a28f2b56 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./config"), exports); +tslib_1.__exportStar(require("./resolveRegionConfig"), exports); diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/isFipsRegion.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/isFipsRegion.js new file mode 100644 index 0000000000..011d0a2c6e --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/isFipsRegion.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isFipsRegion = void 0; +const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); +exports.isFipsRegion = isFipsRegion; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/resolveRegionConfig.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/resolveRegionConfig.js new file mode 100644 index 0000000000..ff5eec87f7 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/resolveRegionConfig.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveRegionConfig = void 0; +const getRealRegion_1 = require("./getRealRegion"); +const isFipsRegion_1 = require("./isFipsRegion"); +const resolveRegionConfig = (input) => { + const { region, useFipsEndpoint } = input; + if (!region) { + throw new Error("Region is missing"); + } + return { + ...input, + region: async () => { + if (typeof region === "string") { + return (0, getRealRegion_1.getRealRegion)(region); + } + const providedRegion = await region(); + return (0, getRealRegion_1.getRealRegion)(providedRegion); + }, + useFipsEndpoint: async () => { + const providedRegion = typeof region === "string" ? region : await region(); + if ((0, isFipsRegion_1.isFipsRegion)(providedRegion)) { + return true; + } + return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); + }, + }; +}; +exports.resolveRegionConfig = resolveRegionConfig; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/EndpointVariant.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/EndpointVariant.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/EndpointVariant.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/EndpointVariantTag.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/EndpointVariantTag.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/EndpointVariantTag.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/PartitionHash.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/PartitionHash.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/PartitionHash.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/RegionHash.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/RegionHash.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/RegionHash.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getHostnameFromVariants.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getHostnameFromVariants.js new file mode 100644 index 0000000000..578a463254 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getHostnameFromVariants.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getHostnameFromVariants = void 0; +const getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => { + var _a; + return (_a = variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))) === null || _a === void 0 ? void 0 : _a.hostname; +}; +exports.getHostnameFromVariants = getHostnameFromVariants; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getRegionInfo.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getRegionInfo.js new file mode 100644 index 0000000000..4c534c0b74 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getRegionInfo.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRegionInfo = void 0; +const getHostnameFromVariants_1 = require("./getHostnameFromVariants"); +const getResolvedHostname_1 = require("./getResolvedHostname"); +const getResolvedPartition_1 = require("./getResolvedPartition"); +const getResolvedSigningRegion_1 = require("./getResolvedSigningRegion"); +const getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash, }) => { + var _a, _b, _c, _d, _e, _f; + const partition = (0, getResolvedPartition_1.getResolvedPartition)(region, { partitionHash }); + const resolvedRegion = region in regionHash ? region : (_b = (_a = partitionHash[partition]) === null || _a === void 0 ? void 0 : _a.endpoint) !== null && _b !== void 0 ? _b : region; + const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; + const regionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_c = regionHash[resolvedRegion]) === null || _c === void 0 ? void 0 : _c.variants, hostnameOptions); + const partitionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_d = partitionHash[partition]) === null || _d === void 0 ? void 0 : _d.variants, hostnameOptions); + const hostname = (0, getResolvedHostname_1.getResolvedHostname)(resolvedRegion, { regionHostname, partitionHostname }); + if (hostname === undefined) { + throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); + } + const signingRegion = (0, getResolvedSigningRegion_1.getResolvedSigningRegion)(hostname, { + signingRegion: (_e = regionHash[resolvedRegion]) === null || _e === void 0 ? void 0 : _e.signingRegion, + regionRegex: partitionHash[partition].regionRegex, + useFipsEndpoint, + }); + return { + partition, + signingService, + hostname, + ...(signingRegion && { signingRegion }), + ...(((_f = regionHash[resolvedRegion]) === null || _f === void 0 ? void 0 : _f.signingService) && { + signingService: regionHash[resolvedRegion].signingService, + }), + }; +}; +exports.getRegionInfo = getRegionInfo; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedHostname.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedHostname.js new file mode 100644 index 0000000000..70c7c90e6b --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedHostname.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getResolvedHostname = void 0; +const getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname + ? regionHostname + : partitionHostname + ? partitionHostname.replace("{region}", resolvedRegion) + : undefined; +exports.getResolvedHostname = getResolvedHostname; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedPartition.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedPartition.js new file mode 100644 index 0000000000..d5fa1b38c7 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedPartition.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getResolvedPartition = void 0; +const getResolvedPartition = (region, { partitionHash }) => { var _a; return (_a = Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region))) !== null && _a !== void 0 ? _a : "aws"; }; +exports.getResolvedPartition = getResolvedPartition; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedSigningRegion.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedSigningRegion.js new file mode 100644 index 0000000000..980ddfa9ef --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/getResolvedSigningRegion.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getResolvedSigningRegion = void 0; +const getResolvedSigningRegion = (hostname, { signingRegion, regionRegex, useFipsEndpoint }) => { + if (signingRegion) { + return signingRegion; + } + else if (useFipsEndpoint) { + const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\."); + const regionRegexmatchArray = hostname.match(regionRegexJs); + if (regionRegexmatchArray) { + return regionRegexmatchArray[0].slice(1, -1); + } + } +}; +exports.getResolvedSigningRegion = getResolvedSigningRegion; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/index.js b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/index.js new file mode 100644 index 0000000000..2737a5f2ac --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-cjs/regionInfo/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./PartitionHash"), exports); +tslib_1.__exportStar(require("./RegionHash"), exports); +tslib_1.__exportStar(require("./getRegionInfo"), exports); diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js new file mode 100644 index 0000000000..c8ebf54c18 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js @@ -0,0 +1,9 @@ +import { booleanSelector, SelectorType } from "@aws-sdk/util-config-provider"; +export const ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; +export const CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; +export const DEFAULT_USE_DUALSTACK_ENDPOINT = false; +export const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV), + configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG), + default: false, +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js new file mode 100644 index 0000000000..a1ab15bf99 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js @@ -0,0 +1,9 @@ +import { booleanSelector, SelectorType } from "@aws-sdk/util-config-provider"; +export const ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; +export const CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; +export const DEFAULT_USE_FIPS_ENDPOINT = false; +export const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV), + configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG), + default: false, +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/index.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/index.js new file mode 100644 index 0000000000..1424c22f2a --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/index.js @@ -0,0 +1,4 @@ +export * from "./NodeUseDualstackEndpointConfigOptions"; +export * from "./NodeUseFipsEndpointConfigOptions"; +export * from "./resolveCustomEndpointsConfig"; +export * from "./resolveEndpointsConfig"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js new file mode 100644 index 0000000000..f09c1a01f8 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js @@ -0,0 +1,11 @@ +import { normalizeProvider } from "@aws-sdk/util-middleware"; +export const resolveCustomEndpointsConfig = (input) => { + const { endpoint, urlParser } = input; + return { + ...input, + tls: input.tls ?? true, + endpoint: normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), + isCustomEndpoint: true, + useDualstackEndpoint: normalizeProvider(input.useDualstackEndpoint ?? false), + }; +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js new file mode 100644 index 0000000000..b0967bed9b --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js @@ -0,0 +1,15 @@ +import { normalizeProvider } from "@aws-sdk/util-middleware"; +import { getEndpointFromRegion } from "./utils/getEndpointFromRegion"; +export const resolveEndpointsConfig = (input) => { + const useDualstackEndpoint = normalizeProvider(input.useDualstackEndpoint ?? false); + const { endpoint, useFipsEndpoint, urlParser } = input; + return { + ...input, + tls: input.tls ?? true, + endpoint: endpoint + ? normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) + : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }), + isCustomEndpoint: !!endpoint, + useDualstackEndpoint, + }; +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/utils/getEndpointFromRegion.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/utils/getEndpointFromRegion.js new file mode 100644 index 0000000000..5627c32e4f --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/endpointsConfig/utils/getEndpointFromRegion.js @@ -0,0 +1,15 @@ +export const getEndpointFromRegion = async (input) => { + const { tls = true } = input; + const region = await input.region(); + const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); + if (!dnsHostRegex.test(region)) { + throw new Error("Invalid region in client config"); + } + const useDualstackEndpoint = await input.useDualstackEndpoint(); + const useFipsEndpoint = await input.useFipsEndpoint(); + const { hostname } = (await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint })) ?? {}; + if (!hostname) { + throw new Error("Cannot resolve hostname from client config"); + } + return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/index.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/index.js new file mode 100644 index 0000000000..61456a77c2 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/index.js @@ -0,0 +1,3 @@ +export * from "./endpointsConfig"; +export * from "./regionConfig"; +export * from "./regionInfo"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/config.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/config.js new file mode 100644 index 0000000000..7db98960dc --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/config.js @@ -0,0 +1,12 @@ +export const REGION_ENV_NAME = "AWS_REGION"; +export const REGION_INI_NAME = "region"; +export const NODE_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[REGION_ENV_NAME], + configFileSelector: (profile) => profile[REGION_INI_NAME], + default: () => { + throw new Error("Region is missing"); + }, +}; +export const NODE_REGION_CONFIG_FILE_OPTIONS = { + preferredFile: "credentials", +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/getRealRegion.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/getRealRegion.js new file mode 100644 index 0000000000..8d1246bf4f --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/getRealRegion.js @@ -0,0 +1,6 @@ +import { isFipsRegion } from "./isFipsRegion"; +export const getRealRegion = (region) => isFipsRegion(region) + ? ["fips-aws-global", "aws-fips"].includes(region) + ? "us-east-1" + : region.replace(/fips-(dkr-|prod-)?|-fips/, "") + : region; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/index.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/index.js new file mode 100644 index 0000000000..83675f7738 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/index.js @@ -0,0 +1,2 @@ +export * from "./config"; +export * from "./resolveRegionConfig"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/isFipsRegion.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/isFipsRegion.js new file mode 100644 index 0000000000..d758967d82 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/isFipsRegion.js @@ -0,0 +1 @@ +export const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/resolveRegionConfig.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/resolveRegionConfig.js new file mode 100644 index 0000000000..0028a55de6 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionConfig/resolveRegionConfig.js @@ -0,0 +1,25 @@ +import { getRealRegion } from "./getRealRegion"; +import { isFipsRegion } from "./isFipsRegion"; +export const resolveRegionConfig = (input) => { + const { region, useFipsEndpoint } = input; + if (!region) { + throw new Error("Region is missing"); + } + return { + ...input, + region: async () => { + if (typeof region === "string") { + return getRealRegion(region); + } + const providedRegion = await region(); + return getRealRegion(providedRegion); + }, + useFipsEndpoint: async () => { + const providedRegion = typeof region === "string" ? region : await region(); + if (isFipsRegion(providedRegion)) { + return true; + } + return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); + }, + }; +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/EndpointVariant.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/EndpointVariant.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/EndpointVariant.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/EndpointVariantTag.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/EndpointVariantTag.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/EndpointVariantTag.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/PartitionHash.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/PartitionHash.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/PartitionHash.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/RegionHash.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/RegionHash.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/RegionHash.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getHostnameFromVariants.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getHostnameFromVariants.js new file mode 100644 index 0000000000..84fc50e851 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getHostnameFromVariants.js @@ -0,0 +1 @@ +export const getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))?.hostname; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getRegionInfo.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getRegionInfo.js new file mode 100644 index 0000000000..c39e2f7436 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getRegionInfo.js @@ -0,0 +1,29 @@ +import { getHostnameFromVariants } from "./getHostnameFromVariants"; +import { getResolvedHostname } from "./getResolvedHostname"; +import { getResolvedPartition } from "./getResolvedPartition"; +import { getResolvedSigningRegion } from "./getResolvedSigningRegion"; +export const getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash, }) => { + const partition = getResolvedPartition(region, { partitionHash }); + const resolvedRegion = region in regionHash ? region : partitionHash[partition]?.endpoint ?? region; + const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; + const regionHostname = getHostnameFromVariants(regionHash[resolvedRegion]?.variants, hostnameOptions); + const partitionHostname = getHostnameFromVariants(partitionHash[partition]?.variants, hostnameOptions); + const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname }); + if (hostname === undefined) { + throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); + } + const signingRegion = getResolvedSigningRegion(hostname, { + signingRegion: regionHash[resolvedRegion]?.signingRegion, + regionRegex: partitionHash[partition].regionRegex, + useFipsEndpoint, + }); + return { + partition, + signingService, + hostname, + ...(signingRegion && { signingRegion }), + ...(regionHash[resolvedRegion]?.signingService && { + signingService: regionHash[resolvedRegion].signingService, + }), + }; +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedHostname.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedHostname.js new file mode 100644 index 0000000000..35fb988159 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedHostname.js @@ -0,0 +1,5 @@ +export const getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname + ? regionHostname + : partitionHostname + ? partitionHostname.replace("{region}", resolvedRegion) + : undefined; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedPartition.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedPartition.js new file mode 100644 index 0000000000..3d7bc557e9 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedPartition.js @@ -0,0 +1 @@ +export const getResolvedPartition = (region, { partitionHash }) => Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedSigningRegion.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedSigningRegion.js new file mode 100644 index 0000000000..7977e0009d --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/getResolvedSigningRegion.js @@ -0,0 +1,12 @@ +export const getResolvedSigningRegion = (hostname, { signingRegion, regionRegex, useFipsEndpoint }) => { + if (signingRegion) { + return signingRegion; + } + else if (useFipsEndpoint) { + const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\."); + const regionRegexmatchArray = hostname.match(regionRegexJs); + if (regionRegexmatchArray) { + return regionRegexmatchArray[0].slice(1, -1); + } + } +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/index.js b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/index.js new file mode 100644 index 0000000000..e29686a33d --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-es/regionInfo/index.js @@ -0,0 +1,3 @@ +export * from "./PartitionHash"; +export * from "./RegionHash"; +export * from "./getRegionInfo"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts new file mode 100644 index 0000000000..ca963bcc3c --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts @@ -0,0 +1,5 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +export declare const ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; +export declare const CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; +export declare const DEFAULT_USE_DUALSTACK_ENDPOINT = false; +export declare const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts new file mode 100644 index 0000000000..a94e7ffd46 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts @@ -0,0 +1,5 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +export declare const ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; +export declare const CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; +export declare const DEFAULT_USE_FIPS_ENDPOINT = false; +export declare const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/index.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/index.d.ts new file mode 100644 index 0000000000..1424c22f2a --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/index.d.ts @@ -0,0 +1,4 @@ +export * from "./NodeUseDualstackEndpointConfigOptions"; +export * from "./NodeUseFipsEndpointConfigOptions"; +export * from "./resolveCustomEndpointsConfig"; +export * from "./resolveEndpointsConfig"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/resolveCustomEndpointsConfig.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/resolveCustomEndpointsConfig.d.ts new file mode 100644 index 0000000000..819a9d3c62 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/resolveCustomEndpointsConfig.d.ts @@ -0,0 +1,20 @@ +import { Endpoint, Provider, UrlParser } from "@aws-sdk/types"; +import { EndpointsInputConfig, EndpointsResolvedConfig } from "./resolveEndpointsConfig"; +export interface CustomEndpointsInputConfig extends EndpointsInputConfig { + /** + * The fully qualified endpoint of the webservice. + */ + endpoint: string | Endpoint | Provider; +} +interface PreviouslyResolved { + urlParser: UrlParser; +} +export interface CustomEndpointsResolvedConfig extends EndpointsResolvedConfig { + /** + * Whether the endpoint is specified by caller. + * @internal + */ + isCustomEndpoint: true; +} +export declare const resolveCustomEndpointsConfig: (input: T & CustomEndpointsInputConfig & PreviouslyResolved) => T & CustomEndpointsResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/resolveEndpointsConfig.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/resolveEndpointsConfig.d.ts new file mode 100644 index 0000000000..a93793deee --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/resolveEndpointsConfig.d.ts @@ -0,0 +1,43 @@ +import { Endpoint, Provider, RegionInfoProvider, UrlParser } from "@aws-sdk/types"; +export interface EndpointsInputConfig { + /** + * The fully qualified endpoint of the webservice. This is only required when using + * a custom endpoint (for example, when using a local version of S3). + */ + endpoint?: string | Endpoint | Provider; + /** + * Whether TLS is enabled for requests. + */ + tls?: boolean; + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | Provider; +} +interface PreviouslyResolved { + regionInfoProvider: RegionInfoProvider; + urlParser: UrlParser; + region: Provider; + useFipsEndpoint: Provider; +} +export interface EndpointsResolvedConfig extends Required { + /** + * Resolved value for input {@link EndpointsInputConfig.endpoint} + */ + endpoint: Provider; + /** + * Whether the endpoint is specified by caller. + * @internal + */ + isCustomEndpoint?: boolean; + /** + * Resolved value for input {@link EndpointsInputConfig.useDualstackEndpoint} + */ + useDualstackEndpoint: Provider; +} +/** + * @deprecated endpoints rulesets use @aws-sdk/middleware-endpoint resolveEndpointConfig. + * All generated clients should migrate to Endpoints 2.0 endpointRuleSet traits. + */ +export declare const resolveEndpointsConfig: (input: T & EndpointsInputConfig & PreviouslyResolved) => T & EndpointsResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/utils/getEndpointFromRegion.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/utils/getEndpointFromRegion.d.ts new file mode 100644 index 0000000000..e2f20bba0c --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/utils/getEndpointFromRegion.d.ts @@ -0,0 +1,11 @@ +import { Provider, RegionInfoProvider, UrlParser } from "@aws-sdk/types"; +interface GetEndpointFromRegionOptions { + region: Provider; + tls?: boolean; + regionInfoProvider: RegionInfoProvider; + urlParser: UrlParser; + useDualstackEndpoint: Provider; + useFipsEndpoint: Provider; +} +export declare const getEndpointFromRegion: (input: GetEndpointFromRegionOptions) => Promise; +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/index.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/index.d.ts new file mode 100644 index 0000000000..61456a77c2 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/index.d.ts @@ -0,0 +1,3 @@ +export * from "./endpointsConfig"; +export * from "./regionConfig"; +export * from "./regionInfo"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/config.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/config.d.ts new file mode 100644 index 0000000000..e15b97e93e --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/config.d.ts @@ -0,0 +1,5 @@ +import { LoadedConfigSelectors, LocalConfigOptions } from "@aws-sdk/node-config-provider"; +export declare const REGION_ENV_NAME = "AWS_REGION"; +export declare const REGION_INI_NAME = "region"; +export declare const NODE_REGION_CONFIG_OPTIONS: LoadedConfigSelectors; +export declare const NODE_REGION_CONFIG_FILE_OPTIONS: LocalConfigOptions; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/getRealRegion.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/getRealRegion.d.ts new file mode 100644 index 0000000000..f06119bd11 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/getRealRegion.d.ts @@ -0,0 +1 @@ +export declare const getRealRegion: (region: string) => string; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/index.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/index.d.ts new file mode 100644 index 0000000000..83675f7738 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/index.d.ts @@ -0,0 +1,2 @@ +export * from "./config"; +export * from "./resolveRegionConfig"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/isFipsRegion.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/isFipsRegion.d.ts new file mode 100644 index 0000000000..13d34f2922 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/isFipsRegion.d.ts @@ -0,0 +1 @@ +export declare const isFipsRegion: (region: string) => boolean; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/resolveRegionConfig.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/resolveRegionConfig.d.ts new file mode 100644 index 0000000000..f60345e0ca --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/resolveRegionConfig.d.ts @@ -0,0 +1,25 @@ +import { Provider } from "@aws-sdk/types"; +export interface RegionInputConfig { + /** + * The AWS region to which this client will send requests + */ + region?: string | Provider; + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | Provider; +} +interface PreviouslyResolved { +} +export interface RegionResolvedConfig { + /** + * Resolved value for input config {@link RegionInputConfig.region} + */ + region: Provider; + /** + * Resolved value for input {@link RegionInputConfig.useFipsEndpoint} + */ + useFipsEndpoint: Provider; +} +export declare const resolveRegionConfig: (input: T & RegionInputConfig & PreviouslyResolved) => T & RegionResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/EndpointVariant.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/EndpointVariant.d.ts new file mode 100644 index 0000000000..05d0a00e03 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/EndpointVariant.d.ts @@ -0,0 +1,8 @@ +import { EndpointVariantTag } from "./EndpointVariantTag"; +/** + * Provides hostname information for specific host label. + */ +export declare type EndpointVariant = { + hostname: string; + tags: EndpointVariantTag[]; +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/EndpointVariantTag.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/EndpointVariantTag.d.ts new file mode 100644 index 0000000000..62ee6867c1 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/EndpointVariantTag.d.ts @@ -0,0 +1,5 @@ +/** + * The tag which mentions which area variant is providing information for. + * Can be either "fips" or "dualstack". + */ +export declare type EndpointVariantTag = "fips" | "dualstack"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/PartitionHash.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/PartitionHash.d.ts new file mode 100644 index 0000000000..95753a595f --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/PartitionHash.d.ts @@ -0,0 +1,12 @@ +import { EndpointVariant } from "./EndpointVariant"; +/** + * The hash of partition with the information specific to that partition. + * The information includes the list of regions belonging to that partition, + * and the hostname to be used for the partition. + */ +export declare type PartitionHash = Record; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/RegionHash.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/RegionHash.d.ts new file mode 100644 index 0000000000..0fb2e354ec --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/RegionHash.d.ts @@ -0,0 +1,10 @@ +import { EndpointVariant } from "./EndpointVariant"; +/** + * The hash of region with the information specific to that region. + * The information can include hostname, signingService and signingRegion. + */ +export declare type RegionHash = Record; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getHostnameFromVariants.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getHostnameFromVariants.d.ts new file mode 100644 index 0000000000..38dd2fba4c --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getHostnameFromVariants.d.ts @@ -0,0 +1,6 @@ +import { EndpointVariant } from "./EndpointVariant"; +export interface GetHostnameFromVariantsOptions { + useFipsEndpoint: boolean; + useDualstackEndpoint: boolean; +} +export declare const getHostnameFromVariants: (variants: EndpointVariant[] | undefined, { useFipsEndpoint, useDualstackEndpoint }: GetHostnameFromVariantsOptions) => string | undefined; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getRegionInfo.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getRegionInfo.d.ts new file mode 100644 index 0000000000..8bf80656dd --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getRegionInfo.d.ts @@ -0,0 +1,11 @@ +import { RegionInfo } from "@aws-sdk/types"; +import { PartitionHash } from "./PartitionHash"; +import { RegionHash } from "./RegionHash"; +export interface GetRegionInfoOptions { + useFipsEndpoint?: boolean; + useDualstackEndpoint?: boolean; + signingService: string; + regionHash: RegionHash; + partitionHash: PartitionHash; +} +export declare const getRegionInfo: (region: string, { useFipsEndpoint, useDualstackEndpoint, signingService, regionHash, partitionHash, }: GetRegionInfoOptions) => RegionInfo; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedHostname.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedHostname.d.ts new file mode 100644 index 0000000000..6d0aa533a9 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedHostname.d.ts @@ -0,0 +1,5 @@ +export interface GetResolvedHostnameOptions { + regionHostname?: string; + partitionHostname?: string; +} +export declare const getResolvedHostname: (resolvedRegion: string, { regionHostname, partitionHostname }: GetResolvedHostnameOptions) => string | undefined; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedPartition.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedPartition.d.ts new file mode 100644 index 0000000000..9fd68d1a48 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedPartition.d.ts @@ -0,0 +1,5 @@ +import { PartitionHash } from "./PartitionHash"; +export interface GetResolvedPartitionOptions { + partitionHash: PartitionHash; +} +export declare const getResolvedPartition: (region: string, { partitionHash }: GetResolvedPartitionOptions) => string; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedSigningRegion.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedSigningRegion.d.ts new file mode 100644 index 0000000000..53e7dd3122 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/getResolvedSigningRegion.d.ts @@ -0,0 +1,6 @@ +export interface GetResolvedSigningRegionOptions { + regionRegex: string; + signingRegion?: string; + useFipsEndpoint: boolean; +} +export declare const getResolvedSigningRegion: (hostname: string, { signingRegion, regionRegex, useFipsEndpoint }: GetResolvedSigningRegionOptions) => string | undefined; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/index.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/index.d.ts new file mode 100644 index 0000000000..e29686a33d --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/regionInfo/index.d.ts @@ -0,0 +1,3 @@ +export * from "./PartitionHash"; +export * from "./RegionHash"; +export * from "./getRegionInfo"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts new file mode 100644 index 0000000000..ca963bcc3c --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts @@ -0,0 +1,5 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +export declare const ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; +export declare const CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; +export declare const DEFAULT_USE_DUALSTACK_ENDPOINT = false; +export declare const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts new file mode 100644 index 0000000000..a94e7ffd46 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts @@ -0,0 +1,5 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +export declare const ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; +export declare const CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; +export declare const DEFAULT_USE_FIPS_ENDPOINT = false; +export declare const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/index.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/index.d.ts new file mode 100644 index 0000000000..1424c22f2a --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/index.d.ts @@ -0,0 +1,4 @@ +export * from "./NodeUseDualstackEndpointConfigOptions"; +export * from "./NodeUseFipsEndpointConfigOptions"; +export * from "./resolveCustomEndpointsConfig"; +export * from "./resolveEndpointsConfig"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/resolveCustomEndpointsConfig.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/resolveCustomEndpointsConfig.d.ts new file mode 100644 index 0000000000..7f7f7c1e00 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/resolveCustomEndpointsConfig.d.ts @@ -0,0 +1,18 @@ +import { Endpoint, Provider, UrlParser } from "@aws-sdk/types"; +import { + EndpointsInputConfig, + EndpointsResolvedConfig, +} from "./resolveEndpointsConfig"; +export interface CustomEndpointsInputConfig extends EndpointsInputConfig { + endpoint: string | Endpoint | Provider; +} +interface PreviouslyResolved { + urlParser: UrlParser; +} +export interface CustomEndpointsResolvedConfig extends EndpointsResolvedConfig { + isCustomEndpoint: true; +} +export declare const resolveCustomEndpointsConfig: ( + input: T & CustomEndpointsInputConfig & PreviouslyResolved +) => T & CustomEndpointsResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/resolveEndpointsConfig.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/resolveEndpointsConfig.d.ts new file mode 100644 index 0000000000..2bd0158e40 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/resolveEndpointsConfig.d.ts @@ -0,0 +1,27 @@ +import { + Endpoint, + Provider, + RegionInfoProvider, + UrlParser, +} from "@aws-sdk/types"; +export interface EndpointsInputConfig { + endpoint?: string | Endpoint | Provider; + tls?: boolean; + useDualstackEndpoint?: boolean | Provider; +} +interface PreviouslyResolved { + regionInfoProvider: RegionInfoProvider; + urlParser: UrlParser; + region: Provider; + useFipsEndpoint: Provider; +} +export interface EndpointsResolvedConfig + extends Required { + endpoint: Provider; + isCustomEndpoint?: boolean; + useDualstackEndpoint: Provider; +} +export declare const resolveEndpointsConfig: ( + input: T & EndpointsInputConfig & PreviouslyResolved +) => T & EndpointsResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/utils/getEndpointFromRegion.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/utils/getEndpointFromRegion.d.ts new file mode 100644 index 0000000000..335581c0c1 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/endpointsConfig/utils/getEndpointFromRegion.d.ts @@ -0,0 +1,13 @@ +import { Provider, RegionInfoProvider, UrlParser } from "@aws-sdk/types"; +interface GetEndpointFromRegionOptions { + region: Provider; + tls?: boolean; + regionInfoProvider: RegionInfoProvider; + urlParser: UrlParser; + useDualstackEndpoint: Provider; + useFipsEndpoint: Provider; +} +export declare const getEndpointFromRegion: ( + input: GetEndpointFromRegionOptions +) => Promise; +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..61456a77c2 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/index.d.ts @@ -0,0 +1,3 @@ +export * from "./endpointsConfig"; +export * from "./regionConfig"; +export * from "./regionInfo"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/config.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/config.d.ts new file mode 100644 index 0000000000..10abfd54d8 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/config.d.ts @@ -0,0 +1,8 @@ +import { + LoadedConfigSelectors, + LocalConfigOptions, +} from "@aws-sdk/node-config-provider"; +export declare const REGION_ENV_NAME = "AWS_REGION"; +export declare const REGION_INI_NAME = "region"; +export declare const NODE_REGION_CONFIG_OPTIONS: LoadedConfigSelectors; +export declare const NODE_REGION_CONFIG_FILE_OPTIONS: LocalConfigOptions; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/getRealRegion.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/getRealRegion.d.ts new file mode 100644 index 0000000000..f06119bd11 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/getRealRegion.d.ts @@ -0,0 +1 @@ +export declare const getRealRegion: (region: string) => string; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/index.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/index.d.ts new file mode 100644 index 0000000000..83675f7738 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/index.d.ts @@ -0,0 +1,2 @@ +export * from "./config"; +export * from "./resolveRegionConfig"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/isFipsRegion.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/isFipsRegion.d.ts new file mode 100644 index 0000000000..13d34f2922 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/isFipsRegion.d.ts @@ -0,0 +1 @@ +export declare const isFipsRegion: (region: string) => boolean; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/resolveRegionConfig.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/resolveRegionConfig.d.ts new file mode 100644 index 0000000000..e36c285b0c --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionConfig/resolveRegionConfig.d.ts @@ -0,0 +1,14 @@ +import { Provider } from "@aws-sdk/types"; +export interface RegionInputConfig { + region?: string | Provider; + useFipsEndpoint?: boolean | Provider; +} +interface PreviouslyResolved {} +export interface RegionResolvedConfig { + region: Provider; + useFipsEndpoint: Provider; +} +export declare const resolveRegionConfig: ( + input: T & RegionInputConfig & PreviouslyResolved +) => T & RegionResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariant.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariant.d.ts new file mode 100644 index 0000000000..5397894fcb --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariant.d.ts @@ -0,0 +1,5 @@ +import { EndpointVariantTag } from "./EndpointVariantTag"; +export declare type EndpointVariant = { + hostname: string; + tags: EndpointVariantTag[]; +}; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariantTag.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariantTag.d.ts new file mode 100644 index 0000000000..3f0bcaa06d --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariantTag.d.ts @@ -0,0 +1 @@ +export declare type EndpointVariantTag = "fips" | "dualstack"; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/PartitionHash.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/PartitionHash.d.ts new file mode 100644 index 0000000000..3b4af42eda --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/PartitionHash.d.ts @@ -0,0 +1,10 @@ +import { EndpointVariant } from "./EndpointVariant"; +export declare type PartitionHash = Record< + string, + { + regions: string[]; + regionRegex: string; + variants: EndpointVariant[]; + endpoint?: string; + } +>; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/RegionHash.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/RegionHash.d.ts new file mode 100644 index 0000000000..45c2bb3a3f --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/RegionHash.d.ts @@ -0,0 +1,9 @@ +import { EndpointVariant } from "./EndpointVariant"; +export declare type RegionHash = Record< + string, + { + variants: EndpointVariant[]; + signingService?: string; + signingRegion?: string; + } +>; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getHostnameFromVariants.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getHostnameFromVariants.d.ts new file mode 100644 index 0000000000..5d93de742c --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getHostnameFromVariants.d.ts @@ -0,0 +1,9 @@ +import { EndpointVariant } from "./EndpointVariant"; +export interface GetHostnameFromVariantsOptions { + useFipsEndpoint: boolean; + useDualstackEndpoint: boolean; +} +export declare const getHostnameFromVariants: ( + variants: EndpointVariant[] | undefined, + { useFipsEndpoint, useDualstackEndpoint }: GetHostnameFromVariantsOptions +) => string | undefined; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getRegionInfo.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getRegionInfo.d.ts new file mode 100644 index 0000000000..de93ce8bb0 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getRegionInfo.d.ts @@ -0,0 +1,20 @@ +import { RegionInfo } from "@aws-sdk/types"; +import { PartitionHash } from "./PartitionHash"; +import { RegionHash } from "./RegionHash"; +export interface GetRegionInfoOptions { + useFipsEndpoint?: boolean; + useDualstackEndpoint?: boolean; + signingService: string; + regionHash: RegionHash; + partitionHash: PartitionHash; +} +export declare const getRegionInfo: ( + region: string, + { + useFipsEndpoint, + useDualstackEndpoint, + signingService, + regionHash, + partitionHash, + }: GetRegionInfoOptions +) => RegionInfo; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedHostname.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedHostname.d.ts new file mode 100644 index 0000000000..a32aa0a607 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedHostname.d.ts @@ -0,0 +1,8 @@ +export interface GetResolvedHostnameOptions { + regionHostname?: string; + partitionHostname?: string; +} +export declare const getResolvedHostname: ( + resolvedRegion: string, + { regionHostname, partitionHostname }: GetResolvedHostnameOptions +) => string | undefined; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedPartition.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedPartition.d.ts new file mode 100644 index 0000000000..487a4706a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedPartition.d.ts @@ -0,0 +1,8 @@ +import { PartitionHash } from "./PartitionHash"; +export interface GetResolvedPartitionOptions { + partitionHash: PartitionHash; +} +export declare const getResolvedPartition: ( + region: string, + { partitionHash }: GetResolvedPartitionOptions +) => string; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedSigningRegion.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedSigningRegion.d.ts new file mode 100644 index 0000000000..4efc55b953 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/getResolvedSigningRegion.d.ts @@ -0,0 +1,13 @@ +export interface GetResolvedSigningRegionOptions { + regionRegex: string; + signingRegion?: string; + useFipsEndpoint: boolean; +} +export declare const getResolvedSigningRegion: ( + hostname: string, + { + signingRegion, + regionRegex, + useFipsEndpoint, + }: GetResolvedSigningRegionOptions +) => string | undefined; diff --git a/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/index.d.ts b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/index.d.ts new file mode 100644 index 0000000000..e29686a33d --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/dist-types/ts3.4/regionInfo/index.d.ts @@ -0,0 +1,3 @@ +export * from "./PartitionHash"; +export * from "./RegionHash"; +export * from "./getRegionInfo"; diff --git a/server/node_modules/@aws-sdk/config-resolver/package.json b/server/node_modules/@aws-sdk/config-resolver/package.json new file mode 100644 index 0000000000..acb77ef875 --- /dev/null +++ b/server/node_modules/@aws-sdk/config-resolver/package.json @@ -0,0 +1,57 @@ +{ + "name": "@aws-sdk/config-resolver", + "version": "3.259.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/signature-v4": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-config-provider": "3.208.0", + "@aws-sdk/util-middleware": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/node-config-provider": "3.259.0", + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/config-resolver", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/config-resolver" + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/LICENSE b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/README.md b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/README.md new file mode 100644 index 0000000000..7ea2c4070e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/README.md @@ -0,0 +1,11 @@ +# @aws-sdk/credential-provider-cognito-identity + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-provider-cognito-identity/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-cognito-identity) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-provider-cognito-identity.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-cognito-identity) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers) +instead. diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/CognitoProviderParameters.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/CognitoProviderParameters.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/CognitoProviderParameters.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/InMemoryStorage.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/InMemoryStorage.js new file mode 100644 index 0000000000..8927eb8eff --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/InMemoryStorage.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InMemoryStorage = void 0; +class InMemoryStorage { + constructor(store = {}) { + this.store = store; + } + getItem(key) { + if (key in this.store) { + return this.store[key]; + } + return null; + } + removeItem(key) { + delete this.store[key]; + } + setItem(key, value) { + this.store[key] = value; + } +} +exports.InMemoryStorage = InMemoryStorage; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/IndexedDbStorage.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/IndexedDbStorage.js new file mode 100644 index 0000000000..cc2481f1c6 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/IndexedDbStorage.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IndexedDbStorage = void 0; +const STORE_NAME = "IdentityIds"; +class IndexedDbStorage { + constructor(dbName = "aws:cognito-identity-ids") { + this.dbName = dbName; + } + getItem(key) { + return this.withObjectStore("readonly", (store) => { + const req = store.get(key); + return new Promise((resolve) => { + req.onerror = () => resolve(null); + req.onsuccess = () => resolve(req.result ? req.result.value : null); + }); + }).catch(() => null); + } + removeItem(key) { + return this.withObjectStore("readwrite", (store) => { + const req = store.delete(key); + return new Promise((resolve, reject) => { + req.onerror = () => reject(req.error); + req.onsuccess = () => resolve(); + }); + }); + } + setItem(id, value) { + return this.withObjectStore("readwrite", (store) => { + const req = store.put({ id, value }); + return new Promise((resolve, reject) => { + req.onerror = () => reject(req.error); + req.onsuccess = () => resolve(); + }); + }); + } + getDb() { + const openDbRequest = self.indexedDB.open(this.dbName, 1); + return new Promise((resolve, reject) => { + openDbRequest.onsuccess = () => { + resolve(openDbRequest.result); + }; + openDbRequest.onerror = () => { + reject(openDbRequest.error); + }; + openDbRequest.onblocked = () => { + reject(new Error("Unable to access DB")); + }; + openDbRequest.onupgradeneeded = () => { + const db = openDbRequest.result; + db.onerror = () => { + reject(new Error("Failed to create object store")); + }; + db.createObjectStore(STORE_NAME, { keyPath: "id" }); + }; + }); + } + withObjectStore(mode, action) { + return this.getDb().then((db) => { + const tx = db.transaction(STORE_NAME, mode); + tx.oncomplete = () => db.close(); + return new Promise((resolve, reject) => { + tx.onerror = () => reject(tx.error); + resolve(action(tx.objectStore(STORE_NAME))); + }).catch((err) => { + db.close(); + throw err; + }); + }); + } +} +exports.IndexedDbStorage = IndexedDbStorage; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Logins.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Logins.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Logins.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Storage.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Storage.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Storage.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentity.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentity.js new file mode 100644 index 0000000000..15d905e75f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentity.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromCognitoIdentity = void 0; +const client_cognito_identity_1 = require("@aws-sdk/client-cognito-identity"); +const property_provider_1 = require("@aws-sdk/property-provider"); +const resolveLogins_1 = require("./resolveLogins"); +function fromCognitoIdentity(parameters) { + return async () => { + const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(), Expiration, SecretKey = throwOnMissingSecretKey(), SessionToken, } = throwOnMissingCredentials(), } = await parameters.client.send(new client_cognito_identity_1.GetCredentialsForIdentityCommand({ + CustomRoleArn: parameters.customRoleArn, + IdentityId: parameters.identityId, + Logins: parameters.logins ? await (0, resolveLogins_1.resolveLogins)(parameters.logins) : undefined, + })); + return { + identityId: parameters.identityId, + accessKeyId: AccessKeyId, + secretAccessKey: SecretKey, + sessionToken: SessionToken, + expiration: Expiration, + }; + }; +} +exports.fromCognitoIdentity = fromCognitoIdentity; +function throwOnMissingAccessKeyId() { + throw new property_provider_1.CredentialsProviderError("Response from Amazon Cognito contained no access key ID"); +} +function throwOnMissingCredentials() { + throw new property_provider_1.CredentialsProviderError("Response from Amazon Cognito contained no credentials"); +} +function throwOnMissingSecretKey() { + throw new property_provider_1.CredentialsProviderError("Response from Amazon Cognito contained no secret key"); +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentityPool.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentityPool.js new file mode 100644 index 0000000000..3827f9cd71 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentityPool.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromCognitoIdentityPool = void 0; +const client_cognito_identity_1 = require("@aws-sdk/client-cognito-identity"); +const property_provider_1 = require("@aws-sdk/property-provider"); +const fromCognitoIdentity_1 = require("./fromCognitoIdentity"); +const localStorage_1 = require("./localStorage"); +const resolveLogins_1 = require("./resolveLogins"); +function fromCognitoIdentityPool({ accountId, cache = (0, localStorage_1.localStorage)(), client, customRoleArn, identityPoolId, logins, userIdentifier = !logins || Object.keys(logins).length === 0 ? "ANONYMOUS" : undefined, }) { + const cacheKey = userIdentifier ? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}` : undefined; + let provider = async () => { + let identityId = cacheKey && (await cache.getItem(cacheKey)); + if (!identityId) { + const { IdentityId = throwOnMissingId() } = await client.send(new client_cognito_identity_1.GetIdCommand({ + AccountId: accountId, + IdentityPoolId: identityPoolId, + Logins: logins ? await (0, resolveLogins_1.resolveLogins)(logins) : undefined, + })); + identityId = IdentityId; + if (cacheKey) { + Promise.resolve(cache.setItem(cacheKey, identityId)).catch(() => { }); + } + } + provider = (0, fromCognitoIdentity_1.fromCognitoIdentity)({ + client, + customRoleArn, + logins, + identityId, + }); + return provider(); + }; + return () => provider().catch(async (err) => { + if (cacheKey) { + Promise.resolve(cache.removeItem(cacheKey)).catch(() => { }); + } + throw err; + }); +} +exports.fromCognitoIdentityPool = fromCognitoIdentityPool; +function throwOnMissingId() { + throw new property_provider_1.CredentialsProviderError("Response from Amazon Cognito contained no identity ID"); +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js new file mode 100644 index 0000000000..880a048bc9 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./CognitoProviderParameters"), exports); +tslib_1.__exportStar(require("./Logins"), exports); +tslib_1.__exportStar(require("./Storage"), exports); +tslib_1.__exportStar(require("./fromCognitoIdentity"), exports); +tslib_1.__exportStar(require("./fromCognitoIdentityPool"), exports); diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/localStorage.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/localStorage.js new file mode 100644 index 0000000000..8eba5d1bcf --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/localStorage.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.localStorage = void 0; +const IndexedDbStorage_1 = require("./IndexedDbStorage"); +const InMemoryStorage_1 = require("./InMemoryStorage"); +const inMemoryStorage = new InMemoryStorage_1.InMemoryStorage(); +function localStorage() { + if (typeof self === "object" && self.indexedDB) { + return new IndexedDbStorage_1.IndexedDbStorage(); + } + if (typeof window === "object" && window.localStorage) { + return window.localStorage; + } + return inMemoryStorage; +} +exports.localStorage = localStorage; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/resolveLogins.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/resolveLogins.js new file mode 100644 index 0000000000..059f43370a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/resolveLogins.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveLogins = void 0; +function resolveLogins(logins) { + return Promise.all(Object.keys(logins).reduce((arr, name) => { + const tokenOrProvider = logins[name]; + if (typeof tokenOrProvider === "string") { + arr.push([name, tokenOrProvider]); + } + else { + arr.push(tokenOrProvider().then((token) => [name, token])); + } + return arr; + }, [])).then((resolvedPairs) => resolvedPairs.reduce((logins, [key, value]) => { + logins[key] = value; + return logins; + }, {})); +} +exports.resolveLogins = resolveLogins; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/CognitoProviderParameters.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/CognitoProviderParameters.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/CognitoProviderParameters.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/InMemoryStorage.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/InMemoryStorage.js new file mode 100644 index 0000000000..40e44dd65b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/InMemoryStorage.js @@ -0,0 +1,17 @@ +export class InMemoryStorage { + constructor(store = {}) { + this.store = store; + } + getItem(key) { + if (key in this.store) { + return this.store[key]; + } + return null; + } + removeItem(key) { + delete this.store[key]; + } + setItem(key, value) { + this.store[key] = value; + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/IndexedDbStorage.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/IndexedDbStorage.js new file mode 100644 index 0000000000..308c3ec58f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/IndexedDbStorage.js @@ -0,0 +1,67 @@ +const STORE_NAME = "IdentityIds"; +export class IndexedDbStorage { + constructor(dbName = "aws:cognito-identity-ids") { + this.dbName = dbName; + } + getItem(key) { + return this.withObjectStore("readonly", (store) => { + const req = store.get(key); + return new Promise((resolve) => { + req.onerror = () => resolve(null); + req.onsuccess = () => resolve(req.result ? req.result.value : null); + }); + }).catch(() => null); + } + removeItem(key) { + return this.withObjectStore("readwrite", (store) => { + const req = store.delete(key); + return new Promise((resolve, reject) => { + req.onerror = () => reject(req.error); + req.onsuccess = () => resolve(); + }); + }); + } + setItem(id, value) { + return this.withObjectStore("readwrite", (store) => { + const req = store.put({ id, value }); + return new Promise((resolve, reject) => { + req.onerror = () => reject(req.error); + req.onsuccess = () => resolve(); + }); + }); + } + getDb() { + const openDbRequest = self.indexedDB.open(this.dbName, 1); + return new Promise((resolve, reject) => { + openDbRequest.onsuccess = () => { + resolve(openDbRequest.result); + }; + openDbRequest.onerror = () => { + reject(openDbRequest.error); + }; + openDbRequest.onblocked = () => { + reject(new Error("Unable to access DB")); + }; + openDbRequest.onupgradeneeded = () => { + const db = openDbRequest.result; + db.onerror = () => { + reject(new Error("Failed to create object store")); + }; + db.createObjectStore(STORE_NAME, { keyPath: "id" }); + }; + }); + } + withObjectStore(mode, action) { + return this.getDb().then((db) => { + const tx = db.transaction(STORE_NAME, mode); + tx.oncomplete = () => db.close(); + return new Promise((resolve, reject) => { + tx.onerror = () => reject(tx.error); + resolve(action(tx.objectStore(STORE_NAME))); + }).catch((err) => { + db.close(); + throw err; + }); + }); + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Logins.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Logins.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Logins.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Storage.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Storage.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Storage.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js new file mode 100644 index 0000000000..f7757f47fb --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js @@ -0,0 +1,28 @@ +import { GetCredentialsForIdentityCommand } from "@aws-sdk/client-cognito-identity"; +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { resolveLogins } from "./resolveLogins"; +export function fromCognitoIdentity(parameters) { + return async () => { + const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(), Expiration, SecretKey = throwOnMissingSecretKey(), SessionToken, } = throwOnMissingCredentials(), } = await parameters.client.send(new GetCredentialsForIdentityCommand({ + CustomRoleArn: parameters.customRoleArn, + IdentityId: parameters.identityId, + Logins: parameters.logins ? await resolveLogins(parameters.logins) : undefined, + })); + return { + identityId: parameters.identityId, + accessKeyId: AccessKeyId, + secretAccessKey: SecretKey, + sessionToken: SessionToken, + expiration: Expiration, + }; + }; +} +function throwOnMissingAccessKeyId() { + throw new CredentialsProviderError("Response from Amazon Cognito contained no access key ID"); +} +function throwOnMissingCredentials() { + throw new CredentialsProviderError("Response from Amazon Cognito contained no credentials"); +} +function throwOnMissingSecretKey() { + throw new CredentialsProviderError("Response from Amazon Cognito contained no secret key"); +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentityPool.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentityPool.js new file mode 100644 index 0000000000..9b6487c2f2 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentityPool.js @@ -0,0 +1,38 @@ +import { GetIdCommand } from "@aws-sdk/client-cognito-identity"; +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { fromCognitoIdentity } from "./fromCognitoIdentity"; +import { localStorage } from "./localStorage"; +import { resolveLogins } from "./resolveLogins"; +export function fromCognitoIdentityPool({ accountId, cache = localStorage(), client, customRoleArn, identityPoolId, logins, userIdentifier = !logins || Object.keys(logins).length === 0 ? "ANONYMOUS" : undefined, }) { + const cacheKey = userIdentifier ? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}` : undefined; + let provider = async () => { + let identityId = cacheKey && (await cache.getItem(cacheKey)); + if (!identityId) { + const { IdentityId = throwOnMissingId() } = await client.send(new GetIdCommand({ + AccountId: accountId, + IdentityPoolId: identityPoolId, + Logins: logins ? await resolveLogins(logins) : undefined, + })); + identityId = IdentityId; + if (cacheKey) { + Promise.resolve(cache.setItem(cacheKey, identityId)).catch(() => { }); + } + } + provider = fromCognitoIdentity({ + client, + customRoleArn, + logins, + identityId, + }); + return provider(); + }; + return () => provider().catch(async (err) => { + if (cacheKey) { + Promise.resolve(cache.removeItem(cacheKey)).catch(() => { }); + } + throw err; + }); +} +function throwOnMissingId() { + throw new CredentialsProviderError("Response from Amazon Cognito contained no identity ID"); +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/index.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/index.js new file mode 100644 index 0000000000..3e03825e1f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/index.js @@ -0,0 +1,5 @@ +export * from "./CognitoProviderParameters"; +export * from "./Logins"; +export * from "./Storage"; +export * from "./fromCognitoIdentity"; +export * from "./fromCognitoIdentityPool"; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/localStorage.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/localStorage.js new file mode 100644 index 0000000000..fc7972f46e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/localStorage.js @@ -0,0 +1,12 @@ +import { IndexedDbStorage } from "./IndexedDbStorage"; +import { InMemoryStorage } from "./InMemoryStorage"; +const inMemoryStorage = new InMemoryStorage(); +export function localStorage() { + if (typeof self === "object" && self.indexedDB) { + return new IndexedDbStorage(); + } + if (typeof window === "object" && window.localStorage) { + return window.localStorage; + } + return inMemoryStorage; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/resolveLogins.js b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/resolveLogins.js new file mode 100644 index 0000000000..aa56280eef --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/resolveLogins.js @@ -0,0 +1,15 @@ +export function resolveLogins(logins) { + return Promise.all(Object.keys(logins).reduce((arr, name) => { + const tokenOrProvider = logins[name]; + if (typeof tokenOrProvider === "string") { + arr.push([name, tokenOrProvider]); + } + else { + arr.push(tokenOrProvider().then((token) => [name, token])); + } + return arr; + }, [])).then((resolvedPairs) => resolvedPairs.reduce((logins, [key, value]) => { + logins[key] = value; + return logins; + }, {})); +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/CognitoProviderParameters.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/CognitoProviderParameters.d.ts new file mode 100644 index 0000000000..de6b6e8788 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/CognitoProviderParameters.d.ts @@ -0,0 +1,25 @@ +import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity"; +import { Logins } from "./Logins"; +export interface CognitoProviderParameters { + /** + * The SDK client with which the credential provider will contact the Amazon + * Cognito service. + */ + client: CognitoIdentityClient; + /** + * The Amazon Resource Name (ARN) of the role to be assumed when multiple + * roles were received in the token from the identity provider. For example, + * a SAML-based identity provider. This parameter is optional for identity + * providers that do not support role customization. + */ + customRoleArn?: string; + /** + * A set of key-value pairs that map external identity provider names to + * login tokens or functions that return promises for login tokens. The + * latter should be used when login tokens must be periodically refreshed. + * + * Logins should not be specified when trying to get credentials for an + * unauthenticated identity. + */ + logins?: Logins; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/InMemoryStorage.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/InMemoryStorage.d.ts new file mode 100644 index 0000000000..e591ff77a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/InMemoryStorage.d.ts @@ -0,0 +1,8 @@ +import { Storage } from "./Storage"; +export declare class InMemoryStorage implements Storage { + private store; + constructor(store?: Record); + getItem(key: string): string | null; + removeItem(key: string): void; + setItem(key: string, value: string): void; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/IndexedDbStorage.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/IndexedDbStorage.d.ts new file mode 100644 index 0000000000..f81afae013 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/IndexedDbStorage.d.ts @@ -0,0 +1,10 @@ +import { Storage } from "./Storage"; +export declare class IndexedDbStorage implements Storage { + private readonly dbName; + constructor(dbName?: string); + getItem(key: string): Promise; + removeItem(key: string): Promise; + setItem(id: string, value: string): Promise; + private getDb; + private withObjectStore; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Logins.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Logins.d.ts new file mode 100644 index 0000000000..ee0dbda155 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Logins.d.ts @@ -0,0 +1,3 @@ +import { Provider } from "@aws-sdk/types"; +export declare type Logins = Record>; +export declare type ResolvedLogins = Record; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Storage.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Storage.d.ts new file mode 100644 index 0000000000..c57cb2c585 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Storage.d.ts @@ -0,0 +1,14 @@ +/** + * A subset of the Storage interface defined in the WHATWG HTML specification. + * Access by index is not supported, as it cannot be replicated without Proxy + * objects. + * + * The interface has been augmented to support asynchronous storage + * + * @see https://html.spec.whatwg.org/multipage/webstorage.html#the-storage-interface + */ +export interface Storage { + getItem(key: string): string | null | Promise; + removeItem(key: string): void | Promise; + setItem(key: string, data: string): void | Promise; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentity.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentity.d.ts new file mode 100644 index 0000000000..1db6071fb9 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentity.d.ts @@ -0,0 +1,23 @@ +import { AwsCredentialIdentity, Provider } from "@aws-sdk/types"; +import { CognitoProviderParameters } from "./CognitoProviderParameters"; +export interface CognitoIdentityCredentials extends AwsCredentialIdentity { + /** + * The Cognito ID returned by the last call to AWS.CognitoIdentity.getOpenIdToken(). + */ + identityId: string; +} +export declare type CognitoIdentityCredentialProvider = Provider; +/** + * Retrieves temporary AWS credentials using Amazon Cognito's + * `GetCredentialsForIdentity` operation. + * + * Results from this function call are not cached internally. + */ +export declare function fromCognitoIdentity(parameters: FromCognitoIdentityParameters): CognitoIdentityCredentialProvider; +export interface FromCognitoIdentityParameters extends CognitoProviderParameters { + /** + * The unique identifier for the identity against which credentials will be + * issued. + */ + identityId: string; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentityPool.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentityPool.d.ts new file mode 100644 index 0000000000..0beac1a1f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentityPool.d.ts @@ -0,0 +1,44 @@ +import { CognitoProviderParameters } from "./CognitoProviderParameters"; +import { CognitoIdentityCredentialProvider } from "./fromCognitoIdentity"; +import { Storage } from "./Storage"; +/** + * Retrieves or generates a unique identifier using Amazon Cognito's `GetId` + * operation, then generates temporary AWS credentials using Amazon Cognito's + * `GetCredentialsForIdentity` operation. + * + * Results from `GetId` are cached internally, but results from + * `GetCredentialsForIdentity` are not. + */ +export declare function fromCognitoIdentityPool({ accountId, cache, client, customRoleArn, identityPoolId, logins, userIdentifier, }: FromCognitoIdentityPoolParameters): CognitoIdentityCredentialProvider; +export interface FromCognitoIdentityPoolParameters extends CognitoProviderParameters { + /** + * A standard AWS account ID (9+ digits). + */ + accountId?: string; + /** + * A cache in which to store resolved Cognito IdentityIds. If not supplied, + * the credential provider will attempt to store IdentityIds in one of the + * following (in order of preference): + * 1. IndexedDB + * 2. LocalStorage + * 3. An in-memory cache object that will not persist between pages. + * + * IndexedDB is preferred to maximize data sharing between top-level + * browsing contexts and web workers. + * + * The provider will not cache IdentityIds of authenticated users unless a + * separate `userIdentitifer` parameter is supplied. + */ + cache?: Storage; + /** + * The unique identifier for the identity pool from which an identity should + * be retrieved or generated. + */ + identityPoolId: string; + /** + * A unique identifier for the user. This is distinct from a Cognito + * IdentityId and should instead be an identifier meaningful to your + * application. Used to cache Cognito IdentityIds on a per-user basis. + */ + userIdentifier?: string; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/index.d.ts new file mode 100644 index 0000000000..3e03825e1f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/index.d.ts @@ -0,0 +1,5 @@ +export * from "./CognitoProviderParameters"; +export * from "./Logins"; +export * from "./Storage"; +export * from "./fromCognitoIdentity"; +export * from "./fromCognitoIdentityPool"; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/localStorage.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/localStorage.d.ts new file mode 100644 index 0000000000..c3c3a326f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/localStorage.d.ts @@ -0,0 +1,2 @@ +import { Storage } from "./Storage"; +export declare function localStorage(): Storage; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/resolveLogins.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/resolveLogins.d.ts new file mode 100644 index 0000000000..edbb17eada --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/resolveLogins.d.ts @@ -0,0 +1,5 @@ +import { Logins, ResolvedLogins } from "./Logins"; +/** + * @internal + */ +export declare function resolveLogins(logins: Logins): Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/CognitoProviderParameters.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/CognitoProviderParameters.d.ts new file mode 100644 index 0000000000..a07b714504 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/CognitoProviderParameters.d.ts @@ -0,0 +1,7 @@ +import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity"; +import { Logins } from "./Logins"; +export interface CognitoProviderParameters { + client: CognitoIdentityClient; + customRoleArn?: string; + logins?: Logins; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/InMemoryStorage.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/InMemoryStorage.d.ts new file mode 100644 index 0000000000..c58e59c29e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/InMemoryStorage.d.ts @@ -0,0 +1,8 @@ +import { Storage } from "./Storage"; +export declare class InMemoryStorage implements Storage { + private store; + constructor(store?: Record); + getItem(key: string): string | null; + removeItem(key: string): void; + setItem(key: string, value: string): void; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/IndexedDbStorage.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/IndexedDbStorage.d.ts new file mode 100644 index 0000000000..0bf554ad42 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/IndexedDbStorage.d.ts @@ -0,0 +1,10 @@ +import { Storage } from "./Storage"; +export declare class IndexedDbStorage implements Storage { + private readonly dbName; + constructor(dbName?: string); + getItem(key: string): Promise; + removeItem(key: string): Promise; + setItem(id: string, value: string): Promise; + private getDb; + private withObjectStore; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Logins.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Logins.d.ts new file mode 100644 index 0000000000..ee0dbda155 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Logins.d.ts @@ -0,0 +1,3 @@ +import { Provider } from "@aws-sdk/types"; +export declare type Logins = Record>; +export declare type ResolvedLogins = Record; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Storage.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Storage.d.ts new file mode 100644 index 0000000000..ac912ad721 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Storage.d.ts @@ -0,0 +1,5 @@ +export interface Storage { + getItem(key: string): string | null | Promise; + removeItem(key: string): void | Promise; + setItem(key: string, data: string): void | Promise; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentity.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentity.d.ts new file mode 100644 index 0000000000..5c00c3572f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentity.d.ts @@ -0,0 +1,14 @@ +import { AwsCredentialIdentity, Provider } from "@aws-sdk/types"; +import { CognitoProviderParameters } from "./CognitoProviderParameters"; +export interface CognitoIdentityCredentials extends AwsCredentialIdentity { + identityId: string; +} +export declare type CognitoIdentityCredentialProvider = + Provider; +export declare function fromCognitoIdentity( + parameters: FromCognitoIdentityParameters +): CognitoIdentityCredentialProvider; +export interface FromCognitoIdentityParameters + extends CognitoProviderParameters { + identityId: string; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentityPool.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentityPool.d.ts new file mode 100644 index 0000000000..e630a02a88 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentityPool.d.ts @@ -0,0 +1,19 @@ +import { CognitoProviderParameters } from "./CognitoProviderParameters"; +import { CognitoIdentityCredentialProvider } from "./fromCognitoIdentity"; +import { Storage } from "./Storage"; +export declare function fromCognitoIdentityPool({ + accountId, + cache, + client, + customRoleArn, + identityPoolId, + logins, + userIdentifier, +}: FromCognitoIdentityPoolParameters): CognitoIdentityCredentialProvider; +export interface FromCognitoIdentityPoolParameters + extends CognitoProviderParameters { + accountId?: string; + cache?: Storage; + identityPoolId: string; + userIdentifier?: string; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..3e03825e1f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/index.d.ts @@ -0,0 +1,5 @@ +export * from "./CognitoProviderParameters"; +export * from "./Logins"; +export * from "./Storage"; +export * from "./fromCognitoIdentity"; +export * from "./fromCognitoIdentityPool"; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/localStorage.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/localStorage.d.ts new file mode 100644 index 0000000000..c3c3a326f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/localStorage.d.ts @@ -0,0 +1,2 @@ +import { Storage } from "./Storage"; +export declare function localStorage(): Storage; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/resolveLogins.d.ts b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/resolveLogins.d.ts new file mode 100644 index 0000000000..4698d3d43e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/resolveLogins.d.ts @@ -0,0 +1,2 @@ +import { Logins, ResolvedLogins } from "./Logins"; +export declare function resolveLogins(logins: Logins): Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-cognito-identity/package.json b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/package.json new file mode 100644 index 0000000000..e175fa1730 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-cognito-identity/package.json @@ -0,0 +1,56 @@ +{ + "name": "@aws-sdk/credential-provider-cognito-identity", + "version": "3.264.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "sideEffects": false, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.264.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/credential-provider-cognito-identity", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/credential-provider-cognito-identity" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-env/LICENSE b/server/node_modules/@aws-sdk/credential-provider-env/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/credential-provider-env/README.md b/server/node_modules/@aws-sdk/credential-provider-env/README.md new file mode 100644 index 0000000000..61a6436141 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/README.md @@ -0,0 +1,11 @@ +# @aws-sdk/credential-provider-env + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-provider-env/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-env) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-provider-env.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-env) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers) +instead. diff --git a/server/node_modules/@aws-sdk/credential-provider-env/dist-cjs/fromEnv.js b/server/node_modules/@aws-sdk/credential-provider-env/dist-cjs/fromEnv.js new file mode 100644 index 0000000000..a68d9b006e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/dist-cjs/fromEnv.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromEnv = exports.ENV_EXPIRATION = exports.ENV_SESSION = exports.ENV_SECRET = exports.ENV_KEY = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +exports.ENV_KEY = "AWS_ACCESS_KEY_ID"; +exports.ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; +exports.ENV_SESSION = "AWS_SESSION_TOKEN"; +exports.ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; +const fromEnv = () => async () => { + const accessKeyId = process.env[exports.ENV_KEY]; + const secretAccessKey = process.env[exports.ENV_SECRET]; + const sessionToken = process.env[exports.ENV_SESSION]; + const expiry = process.env[exports.ENV_EXPIRATION]; + if (accessKeyId && secretAccessKey) { + return { + accessKeyId, + secretAccessKey, + ...(sessionToken && { sessionToken }), + ...(expiry && { expiration: new Date(expiry) }), + }; + } + throw new property_provider_1.CredentialsProviderError("Unable to find environment variable credentials."); +}; +exports.fromEnv = fromEnv; diff --git a/server/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js b/server/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js new file mode 100644 index 0000000000..567b720973 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromEnv"), exports); diff --git a/server/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js b/server/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js new file mode 100644 index 0000000000..bea1f80247 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js @@ -0,0 +1,20 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +export const ENV_KEY = "AWS_ACCESS_KEY_ID"; +export const ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; +export const ENV_SESSION = "AWS_SESSION_TOKEN"; +export const ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; +export const fromEnv = () => async () => { + const accessKeyId = process.env[ENV_KEY]; + const secretAccessKey = process.env[ENV_SECRET]; + const sessionToken = process.env[ENV_SESSION]; + const expiry = process.env[ENV_EXPIRATION]; + if (accessKeyId && secretAccessKey) { + return { + accessKeyId, + secretAccessKey, + ...(sessionToken && { sessionToken }), + ...(expiry && { expiration: new Date(expiry) }), + }; + } + throw new CredentialsProviderError("Unable to find environment variable credentials."); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js b/server/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js new file mode 100644 index 0000000000..17bf6daa67 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js @@ -0,0 +1 @@ +export * from "./fromEnv"; diff --git a/server/node_modules/@aws-sdk/credential-provider-env/dist-types/fromEnv.d.ts b/server/node_modules/@aws-sdk/credential-provider-env/dist-types/fromEnv.d.ts new file mode 100644 index 0000000000..3f07d0f28e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/dist-types/fromEnv.d.ts @@ -0,0 +1,11 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export declare const ENV_KEY = "AWS_ACCESS_KEY_ID"; +export declare const ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; +export declare const ENV_SESSION = "AWS_SESSION_TOKEN"; +export declare const ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; +/** + * Source AWS credentials from known environment variables. If either the + * `AWS_ACCESS_KEY_ID` or `AWS_SECRET_ACCESS_KEY` environment variable is not + * set in this process, the provider will return a rejected promise. + */ +export declare const fromEnv: () => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-env/dist-types/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-env/dist-types/index.d.ts new file mode 100644 index 0000000000..17bf6daa67 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./fromEnv"; diff --git a/server/node_modules/@aws-sdk/credential-provider-env/dist-types/ts3.4/fromEnv.d.ts b/server/node_modules/@aws-sdk/credential-provider-env/dist-types/ts3.4/fromEnv.d.ts new file mode 100644 index 0000000000..9bf578ffe4 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/dist-types/ts3.4/fromEnv.d.ts @@ -0,0 +1,6 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export declare const ENV_KEY = "AWS_ACCESS_KEY_ID"; +export declare const ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; +export declare const ENV_SESSION = "AWS_SESSION_TOKEN"; +export declare const ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; +export declare const fromEnv: () => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-env/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-env/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..17bf6daa67 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./fromEnv"; diff --git a/server/node_modules/@aws-sdk/credential-provider-env/package.json b/server/node_modules/@aws-sdk/credential-provider-env/package.json new file mode 100644 index 0000000000..ca6fe3a970 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-env/package.json @@ -0,0 +1,60 @@ +{ + "name": "@aws-sdk/credential-provider-env", + "version": "3.257.0", + "description": "AWS credential provider that sources credentials from known environment variables", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "credentials" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/credential-provider-env", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/credential-provider-env" + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/LICENSE b/server/node_modules/@aws-sdk/credential-provider-imds/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/README.md b/server/node_modules/@aws-sdk/credential-provider-imds/README.md new file mode 100644 index 0000000000..15039903d4 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/README.md @@ -0,0 +1,11 @@ +# @aws-sdk/credential-provider-imds + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-provider-imds/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-imds) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-provider-imds.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-imds) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers) +instead. diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/Endpoint.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/Endpoint.js new file mode 100644 index 0000000000..65f71ebaf3 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/Endpoint.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Endpoint = void 0; +var Endpoint; +(function (Endpoint) { + Endpoint["IPv4"] = "http://169.254.169.254"; + Endpoint["IPv6"] = "http://[fd00:ec2::254]"; +})(Endpoint = exports.Endpoint || (exports.Endpoint = {})); diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointConfigOptions.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointConfigOptions.js new file mode 100644 index 0000000000..571092d623 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointConfigOptions.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ENDPOINT_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_NAME = exports.ENV_ENDPOINT_NAME = void 0; +exports.ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; +exports.CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; +exports.ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_NAME], + configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_NAME], + default: undefined, +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointMode.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointMode.js new file mode 100644 index 0000000000..933efd9642 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointMode.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EndpointMode = void 0; +var EndpointMode; +(function (EndpointMode) { + EndpointMode["IPv4"] = "IPv4"; + EndpointMode["IPv6"] = "IPv6"; +})(EndpointMode = exports.EndpointMode || (exports.EndpointMode = {})); diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointModeConfigOptions.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointModeConfigOptions.js new file mode 100644 index 0000000000..8d73e9854a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/config/EndpointModeConfigOptions.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ENDPOINT_MODE_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_MODE_NAME = exports.ENV_ENDPOINT_MODE_NAME = void 0; +const EndpointMode_1 = require("./EndpointMode"); +exports.ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; +exports.CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; +exports.ENDPOINT_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_MODE_NAME], + configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_MODE_NAME], + default: EndpointMode_1.EndpointMode.IPv4, +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/fromContainerMetadata.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/fromContainerMetadata.js new file mode 100644 index 0000000000..1ae06aedd9 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/fromContainerMetadata.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromContainerMetadata = exports.ENV_CMDS_AUTH_TOKEN = exports.ENV_CMDS_RELATIVE_URI = exports.ENV_CMDS_FULL_URI = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const url_1 = require("url"); +const httpRequest_1 = require("./remoteProvider/httpRequest"); +const ImdsCredentials_1 = require("./remoteProvider/ImdsCredentials"); +const RemoteProviderInit_1 = require("./remoteProvider/RemoteProviderInit"); +const retry_1 = require("./remoteProvider/retry"); +exports.ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; +exports.ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; +exports.ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; +const fromContainerMetadata = (init = {}) => { + const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); + return () => (0, retry_1.retry)(async () => { + const requestOptions = await getCmdsUri(); + const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); + if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { + throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); + } + return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); + }, maxRetries); +}; +exports.fromContainerMetadata = fromContainerMetadata; +const requestFromEcsImds = async (timeout, options) => { + if (process.env[exports.ENV_CMDS_AUTH_TOKEN]) { + options.headers = { + ...options.headers, + Authorization: process.env[exports.ENV_CMDS_AUTH_TOKEN], + }; + } + const buffer = await (0, httpRequest_1.httpRequest)({ + ...options, + timeout, + }); + return buffer.toString(); +}; +const CMDS_IP = "169.254.170.2"; +const GREENGRASS_HOSTS = { + localhost: true, + "127.0.0.1": true, +}; +const GREENGRASS_PROTOCOLS = { + "http:": true, + "https:": true, +}; +const getCmdsUri = async () => { + if (process.env[exports.ENV_CMDS_RELATIVE_URI]) { + return { + hostname: CMDS_IP, + path: process.env[exports.ENV_CMDS_RELATIVE_URI], + }; + } + if (process.env[exports.ENV_CMDS_FULL_URI]) { + const parsed = (0, url_1.parse)(process.env[exports.ENV_CMDS_FULL_URI]); + if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { + throw new property_provider_1.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, false); + } + if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { + throw new property_provider_1.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, false); + } + return { + ...parsed, + port: parsed.port ? parseInt(parsed.port, 10) : undefined, + }; + } + throw new property_provider_1.CredentialsProviderError("The container metadata credential provider cannot be used unless" + + ` the ${exports.ENV_CMDS_RELATIVE_URI} or ${exports.ENV_CMDS_FULL_URI} environment` + + " variable is set", false); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/fromInstanceMetadata.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/fromInstanceMetadata.js new file mode 100644 index 0000000000..20c37e2322 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/fromInstanceMetadata.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromInstanceMetadata = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const httpRequest_1 = require("./remoteProvider/httpRequest"); +const ImdsCredentials_1 = require("./remoteProvider/ImdsCredentials"); +const RemoteProviderInit_1 = require("./remoteProvider/RemoteProviderInit"); +const retry_1 = require("./remoteProvider/retry"); +const getInstanceMetadataEndpoint_1 = require("./utils/getInstanceMetadataEndpoint"); +const staticStabilityProvider_1 = require("./utils/staticStabilityProvider"); +const IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; +const IMDS_TOKEN_PATH = "/latest/api/token"; +const fromInstanceMetadata = (init = {}) => (0, staticStabilityProvider_1.staticStabilityProvider)(getInstanceImdsProvider(init), { logger: init.logger }); +exports.fromInstanceMetadata = fromInstanceMetadata; +const getInstanceImdsProvider = (init) => { + let disableFetchToken = false; + const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); + const getCredentials = async (maxRetries, options) => { + const profile = (await (0, retry_1.retry)(async () => { + let profile; + try { + profile = await getProfile(options); + } + catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return profile; + }, maxRetries)).trim(); + return (0, retry_1.retry)(async () => { + let creds; + try { + creds = await getCredentialsFromProfile(profile, options); + } + catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return creds; + }, maxRetries); + }; + return async () => { + const endpoint = await (0, getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint)(); + if (disableFetchToken) { + return getCredentials(maxRetries, { ...endpoint, timeout }); + } + else { + let token; + try { + token = (await getMetadataToken({ ...endpoint, timeout })).toString(); + } + catch (error) { + if ((error === null || error === void 0 ? void 0 : error.statusCode) === 400) { + throw Object.assign(error, { + message: "EC2 Metadata token request returned error", + }); + } + else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { + disableFetchToken = true; + } + return getCredentials(maxRetries, { ...endpoint, timeout }); + } + return getCredentials(maxRetries, { + ...endpoint, + headers: { + "x-aws-ec2-metadata-token": token, + }, + timeout, + }); + } + }; +}; +const getMetadataToken = async (options) => (0, httpRequest_1.httpRequest)({ + ...options, + path: IMDS_TOKEN_PATH, + method: "PUT", + headers: { + "x-aws-ec2-metadata-token-ttl-seconds": "21600", + }, +}); +const getProfile = async (options) => (await (0, httpRequest_1.httpRequest)({ ...options, path: IMDS_PATH })).toString(); +const getCredentialsFromProfile = async (profile, options) => { + const credsResponse = JSON.parse((await (0, httpRequest_1.httpRequest)({ + ...options, + path: IMDS_PATH + profile, + })).toString()); + if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { + throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); + } + return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/index.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/index.js new file mode 100644 index 0000000000..e9095c2636 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/index.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getInstanceMetadataEndpoint = exports.httpRequest = void 0; +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromContainerMetadata"), exports); +tslib_1.__exportStar(require("./fromInstanceMetadata"), exports); +tslib_1.__exportStar(require("./remoteProvider/RemoteProviderInit"), exports); +tslib_1.__exportStar(require("./types"), exports); +var httpRequest_1 = require("./remoteProvider/httpRequest"); +Object.defineProperty(exports, "httpRequest", { enumerable: true, get: function () { return httpRequest_1.httpRequest; } }); +var getInstanceMetadataEndpoint_1 = require("./utils/getInstanceMetadataEndpoint"); +Object.defineProperty(exports, "getInstanceMetadataEndpoint", { enumerable: true, get: function () { return getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint; } }); diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/ImdsCredentials.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/ImdsCredentials.js new file mode 100644 index 0000000000..a81746b4e1 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/ImdsCredentials.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromImdsCredentials = exports.isImdsCredentials = void 0; +const isImdsCredentials = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.AccessKeyId === "string" && + typeof arg.SecretAccessKey === "string" && + typeof arg.Token === "string" && + typeof arg.Expiration === "string"; +exports.isImdsCredentials = isImdsCredentials; +const fromImdsCredentials = (creds) => ({ + accessKeyId: creds.AccessKeyId, + secretAccessKey: creds.SecretAccessKey, + sessionToken: creds.Token, + expiration: new Date(creds.Expiration), +}); +exports.fromImdsCredentials = fromImdsCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/RemoteProviderInit.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/RemoteProviderInit.js new file mode 100644 index 0000000000..c92be1e5df --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/RemoteProviderInit.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.providerConfigFromInit = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_TIMEOUT = void 0; +exports.DEFAULT_TIMEOUT = 1000; +exports.DEFAULT_MAX_RETRIES = 0; +const providerConfigFromInit = ({ maxRetries = exports.DEFAULT_MAX_RETRIES, timeout = exports.DEFAULT_TIMEOUT, }) => ({ maxRetries, timeout }); +exports.providerConfigFromInit = providerConfigFromInit; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js new file mode 100644 index 0000000000..c9dfa88278 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.httpRequest = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const buffer_1 = require("buffer"); +const http_1 = require("http"); +function httpRequest(options) { + return new Promise((resolve, reject) => { + var _a; + const req = (0, http_1.request)({ + method: "GET", + ...options, + hostname: (_a = options.hostname) === null || _a === void 0 ? void 0 : _a.replace(/^\[(.+)\]$/, "$1"), + }); + req.on("error", (err) => { + reject(Object.assign(new property_provider_1.ProviderError("Unable to connect to instance metadata service"), err)); + req.destroy(); + }); + req.on("timeout", () => { + reject(new property_provider_1.ProviderError("TimeoutError from instance metadata service")); + req.destroy(); + }); + req.on("response", (res) => { + const { statusCode = 400 } = res; + if (statusCode < 200 || 300 <= statusCode) { + reject(Object.assign(new property_provider_1.ProviderError("Error response received from instance metadata service"), { statusCode })); + req.destroy(); + } + const chunks = []; + res.on("data", (chunk) => { + chunks.push(chunk); + }); + res.on("end", () => { + resolve(buffer_1.Buffer.concat(chunks)); + req.destroy(); + }); + }); + req.end(); + }); +} +exports.httpRequest = httpRequest; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/index.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/index.js new file mode 100644 index 0000000000..62f176e985 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./ImdsCredentials"), exports); +tslib_1.__exportStar(require("./RemoteProviderInit"), exports); diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/retry.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/retry.js new file mode 100644 index 0000000000..18df876038 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/remoteProvider/retry.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.retry = void 0; +const retry = (toRetry, maxRetries) => { + let promise = toRetry(); + for (let i = 0; i < maxRetries; i++) { + promise = promise.catch(toRetry); + } + return promise; +}; +exports.retry = retry; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/types.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/types.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/getExtendedInstanceMetadataCredentials.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/getExtendedInstanceMetadataCredentials.js new file mode 100644 index 0000000000..d5de111253 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/getExtendedInstanceMetadataCredentials.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getExtendedInstanceMetadataCredentials = void 0; +const STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; +const STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; +const STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; +const getExtendedInstanceMetadataCredentials = (credentials, logger) => { + var _a; + const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); + const newExpiration = new Date(Date.now() + refreshInterval * 1000); + logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these " + + "credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: " + + STATIC_STABILITY_DOC_URL); + const originalExpiration = (_a = credentials.originalExpiration) !== null && _a !== void 0 ? _a : credentials.expiration; + return { + ...credentials, + ...(originalExpiration ? { originalExpiration } : {}), + expiration: newExpiration, + }; +}; +exports.getExtendedInstanceMetadataCredentials = getExtendedInstanceMetadataCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/getInstanceMetadataEndpoint.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/getInstanceMetadataEndpoint.js new file mode 100644 index 0000000000..c7fac774e2 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/getInstanceMetadataEndpoint.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getInstanceMetadataEndpoint = void 0; +const node_config_provider_1 = require("@aws-sdk/node-config-provider"); +const url_parser_1 = require("@aws-sdk/url-parser"); +const Endpoint_1 = require("../config/Endpoint"); +const EndpointConfigOptions_1 = require("../config/EndpointConfigOptions"); +const EndpointMode_1 = require("../config/EndpointMode"); +const EndpointModeConfigOptions_1 = require("../config/EndpointModeConfigOptions"); +const getInstanceMetadataEndpoint = async () => (0, url_parser_1.parseUrl)((await getFromEndpointConfig()) || (await getFromEndpointModeConfig())); +exports.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint; +const getFromEndpointConfig = async () => (0, node_config_provider_1.loadConfig)(EndpointConfigOptions_1.ENDPOINT_CONFIG_OPTIONS)(); +const getFromEndpointModeConfig = async () => { + const endpointMode = await (0, node_config_provider_1.loadConfig)(EndpointModeConfigOptions_1.ENDPOINT_MODE_CONFIG_OPTIONS)(); + switch (endpointMode) { + case EndpointMode_1.EndpointMode.IPv4: + return Endpoint_1.Endpoint.IPv4; + case EndpointMode_1.EndpointMode.IPv6: + return Endpoint_1.Endpoint.IPv6; + default: + throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode_1.EndpointMode)}`); + } +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/staticStabilityProvider.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/staticStabilityProvider.js new file mode 100644 index 0000000000..2d272b8918 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-cjs/utils/staticStabilityProvider.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.staticStabilityProvider = void 0; +const getExtendedInstanceMetadataCredentials_1 = require("./getExtendedInstanceMetadataCredentials"); +const staticStabilityProvider = (provider, options = {}) => { + const logger = (options === null || options === void 0 ? void 0 : options.logger) || console; + let pastCredentials; + return async () => { + let credentials; + try { + credentials = await provider(); + if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { + credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(credentials, logger); + } + } + catch (e) { + if (pastCredentials) { + logger.warn("Credential renew failed: ", e); + credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(pastCredentials, logger); + } + else { + throw e; + } + } + pastCredentials = credentials; + return credentials; + }; +}; +exports.staticStabilityProvider = staticStabilityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/Endpoint.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/Endpoint.js new file mode 100644 index 0000000000..b088eb0d86 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/Endpoint.js @@ -0,0 +1,5 @@ +export var Endpoint; +(function (Endpoint) { + Endpoint["IPv4"] = "http://169.254.169.254"; + Endpoint["IPv6"] = "http://[fd00:ec2::254]"; +})(Endpoint || (Endpoint = {})); diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointConfigOptions.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointConfigOptions.js new file mode 100644 index 0000000000..f043de93c8 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointConfigOptions.js @@ -0,0 +1,7 @@ +export const ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; +export const CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; +export const ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME], + configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], + default: undefined, +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointMode.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointMode.js new file mode 100644 index 0000000000..bace819801 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointMode.js @@ -0,0 +1,5 @@ +export var EndpointMode; +(function (EndpointMode) { + EndpointMode["IPv4"] = "IPv4"; + EndpointMode["IPv6"] = "IPv6"; +})(EndpointMode || (EndpointMode = {})); diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js new file mode 100644 index 0000000000..15b19d04d6 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js @@ -0,0 +1,8 @@ +import { EndpointMode } from "./EndpointMode"; +export const ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; +export const CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; +export const ENDPOINT_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME], + configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], + default: EndpointMode.IPv4, +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/fromContainerMetadata.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/fromContainerMetadata.js new file mode 100644 index 0000000000..9708c299d5 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/fromContainerMetadata.js @@ -0,0 +1,66 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { parse } from "url"; +import { httpRequest } from "./remoteProvider/httpRequest"; +import { fromImdsCredentials, isImdsCredentials } from "./remoteProvider/ImdsCredentials"; +import { providerConfigFromInit } from "./remoteProvider/RemoteProviderInit"; +import { retry } from "./remoteProvider/retry"; +export const ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; +export const ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; +export const ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; +export const fromContainerMetadata = (init = {}) => { + const { timeout, maxRetries } = providerConfigFromInit(init); + return () => retry(async () => { + const requestOptions = await getCmdsUri(); + const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); + if (!isImdsCredentials(credsResponse)) { + throw new CredentialsProviderError("Invalid response received from instance metadata service."); + } + return fromImdsCredentials(credsResponse); + }, maxRetries); +}; +const requestFromEcsImds = async (timeout, options) => { + if (process.env[ENV_CMDS_AUTH_TOKEN]) { + options.headers = { + ...options.headers, + Authorization: process.env[ENV_CMDS_AUTH_TOKEN], + }; + } + const buffer = await httpRequest({ + ...options, + timeout, + }); + return buffer.toString(); +}; +const CMDS_IP = "169.254.170.2"; +const GREENGRASS_HOSTS = { + localhost: true, + "127.0.0.1": true, +}; +const GREENGRASS_PROTOCOLS = { + "http:": true, + "https:": true, +}; +const getCmdsUri = async () => { + if (process.env[ENV_CMDS_RELATIVE_URI]) { + return { + hostname: CMDS_IP, + path: process.env[ENV_CMDS_RELATIVE_URI], + }; + } + if (process.env[ENV_CMDS_FULL_URI]) { + const parsed = parse(process.env[ENV_CMDS_FULL_URI]); + if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { + throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, false); + } + if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { + throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, false); + } + return { + ...parsed, + port: parsed.port ? parseInt(parsed.port, 10) : undefined, + }; + } + throw new CredentialsProviderError("The container metadata credential provider cannot be used unless" + + ` the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment` + + " variable is set", false); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/fromInstanceMetadata.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/fromInstanceMetadata.js new file mode 100644 index 0000000000..fbea872a5a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/fromInstanceMetadata.js @@ -0,0 +1,91 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { httpRequest } from "./remoteProvider/httpRequest"; +import { fromImdsCredentials, isImdsCredentials } from "./remoteProvider/ImdsCredentials"; +import { providerConfigFromInit } from "./remoteProvider/RemoteProviderInit"; +import { retry } from "./remoteProvider/retry"; +import { getInstanceMetadataEndpoint } from "./utils/getInstanceMetadataEndpoint"; +import { staticStabilityProvider } from "./utils/staticStabilityProvider"; +const IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; +const IMDS_TOKEN_PATH = "/latest/api/token"; +export const fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceImdsProvider(init), { logger: init.logger }); +const getInstanceImdsProvider = (init) => { + let disableFetchToken = false; + const { timeout, maxRetries } = providerConfigFromInit(init); + const getCredentials = async (maxRetries, options) => { + const profile = (await retry(async () => { + let profile; + try { + profile = await getProfile(options); + } + catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return profile; + }, maxRetries)).trim(); + return retry(async () => { + let creds; + try { + creds = await getCredentialsFromProfile(profile, options); + } + catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return creds; + }, maxRetries); + }; + return async () => { + const endpoint = await getInstanceMetadataEndpoint(); + if (disableFetchToken) { + return getCredentials(maxRetries, { ...endpoint, timeout }); + } + else { + let token; + try { + token = (await getMetadataToken({ ...endpoint, timeout })).toString(); + } + catch (error) { + if (error?.statusCode === 400) { + throw Object.assign(error, { + message: "EC2 Metadata token request returned error", + }); + } + else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { + disableFetchToken = true; + } + return getCredentials(maxRetries, { ...endpoint, timeout }); + } + return getCredentials(maxRetries, { + ...endpoint, + headers: { + "x-aws-ec2-metadata-token": token, + }, + timeout, + }); + } + }; +}; +const getMetadataToken = async (options) => httpRequest({ + ...options, + path: IMDS_TOKEN_PATH, + method: "PUT", + headers: { + "x-aws-ec2-metadata-token-ttl-seconds": "21600", + }, +}); +const getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(); +const getCredentialsFromProfile = async (profile, options) => { + const credsResponse = JSON.parse((await httpRequest({ + ...options, + path: IMDS_PATH + profile, + })).toString()); + if (!isImdsCredentials(credsResponse)) { + throw new CredentialsProviderError("Invalid response received from instance metadata service."); + } + return fromImdsCredentials(credsResponse); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/index.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/index.js new file mode 100644 index 0000000000..59c8dedc15 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/index.js @@ -0,0 +1,6 @@ +export * from "./fromContainerMetadata"; +export * from "./fromInstanceMetadata"; +export * from "./remoteProvider/RemoteProviderInit"; +export * from "./types"; +export { httpRequest } from "./remoteProvider/httpRequest"; +export { getInstanceMetadataEndpoint } from "./utils/getInstanceMetadataEndpoint"; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js new file mode 100644 index 0000000000..bcd65edd9f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js @@ -0,0 +1,12 @@ +export const isImdsCredentials = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.AccessKeyId === "string" && + typeof arg.SecretAccessKey === "string" && + typeof arg.Token === "string" && + typeof arg.Expiration === "string"; +export const fromImdsCredentials = (creds) => ({ + accessKeyId: creds.AccessKeyId, + secretAccessKey: creds.SecretAccessKey, + sessionToken: creds.Token, + expiration: new Date(creds.Expiration), +}); diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js new file mode 100644 index 0000000000..39ace380eb --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js @@ -0,0 +1,3 @@ +export const DEFAULT_TIMEOUT = 1000; +export const DEFAULT_MAX_RETRIES = 0; +export const providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT, }) => ({ maxRetries, timeout }); diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/httpRequest.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/httpRequest.js new file mode 100644 index 0000000000..03a3d7bf9e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/httpRequest.js @@ -0,0 +1,36 @@ +import { ProviderError } from "@aws-sdk/property-provider"; +import { Buffer } from "buffer"; +import { request } from "http"; +export function httpRequest(options) { + return new Promise((resolve, reject) => { + const req = request({ + method: "GET", + ...options, + hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1"), + }); + req.on("error", (err) => { + reject(Object.assign(new ProviderError("Unable to connect to instance metadata service"), err)); + req.destroy(); + }); + req.on("timeout", () => { + reject(new ProviderError("TimeoutError from instance metadata service")); + req.destroy(); + }); + req.on("response", (res) => { + const { statusCode = 400 } = res; + if (statusCode < 200 || 300 <= statusCode) { + reject(Object.assign(new ProviderError("Error response received from instance metadata service"), { statusCode })); + req.destroy(); + } + const chunks = []; + res.on("data", (chunk) => { + chunks.push(chunk); + }); + res.on("end", () => { + resolve(Buffer.concat(chunks)); + req.destroy(); + }); + }); + req.end(); + }); +} diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/index.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/index.js new file mode 100644 index 0000000000..d4ad60104a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/index.js @@ -0,0 +1,2 @@ +export * from "./ImdsCredentials"; +export * from "./RemoteProviderInit"; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/retry.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/retry.js new file mode 100644 index 0000000000..22b79bb280 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/remoteProvider/retry.js @@ -0,0 +1,7 @@ +export const retry = (toRetry, maxRetries) => { + let promise = toRetry(); + for (let i = 0; i < maxRetries; i++) { + promise = promise.catch(toRetry); + } + return promise; +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/types.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/types.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/types.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js new file mode 100644 index 0000000000..40df84b646 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js @@ -0,0 +1,17 @@ +const STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; +const STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; +const STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; +export const getExtendedInstanceMetadataCredentials = (credentials, logger) => { + const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); + const newExpiration = new Date(Date.now() + refreshInterval * 1000); + logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these " + + "credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: " + + STATIC_STABILITY_DOC_URL); + const originalExpiration = credentials.originalExpiration ?? credentials.expiration; + return { + ...credentials, + ...(originalExpiration ? { originalExpiration } : {}), + expiration: newExpiration, + }; +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js new file mode 100644 index 0000000000..c9ed94f948 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js @@ -0,0 +1,19 @@ +import { loadConfig } from "@aws-sdk/node-config-provider"; +import { parseUrl } from "@aws-sdk/url-parser"; +import { Endpoint as InstanceMetadataEndpoint } from "../config/Endpoint"; +import { ENDPOINT_CONFIG_OPTIONS } from "../config/EndpointConfigOptions"; +import { EndpointMode } from "../config/EndpointMode"; +import { ENDPOINT_MODE_CONFIG_OPTIONS, } from "../config/EndpointModeConfigOptions"; +export const getInstanceMetadataEndpoint = async () => parseUrl((await getFromEndpointConfig()) || (await getFromEndpointModeConfig())); +const getFromEndpointConfig = async () => loadConfig(ENDPOINT_CONFIG_OPTIONS)(); +const getFromEndpointModeConfig = async () => { + const endpointMode = await loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)(); + switch (endpointMode) { + case EndpointMode.IPv4: + return InstanceMetadataEndpoint.IPv4; + case EndpointMode.IPv6: + return InstanceMetadataEndpoint.IPv6; + default: + throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode)}`); + } +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/staticStabilityProvider.js b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/staticStabilityProvider.js new file mode 100644 index 0000000000..9a1e742196 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-es/utils/staticStabilityProvider.js @@ -0,0 +1,25 @@ +import { getExtendedInstanceMetadataCredentials } from "./getExtendedInstanceMetadataCredentials"; +export const staticStabilityProvider = (provider, options = {}) => { + const logger = options?.logger || console; + let pastCredentials; + return async () => { + let credentials; + try { + credentials = await provider(); + if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { + credentials = getExtendedInstanceMetadataCredentials(credentials, logger); + } + } + catch (e) { + if (pastCredentials) { + logger.warn("Credential renew failed: ", e); + credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger); + } + else { + throw e; + } + } + pastCredentials = credentials; + return credentials; + }; +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/Endpoint.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/Endpoint.d.ts new file mode 100644 index 0000000000..72a5745d54 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/Endpoint.d.ts @@ -0,0 +1,4 @@ +export declare enum Endpoint { + IPv4 = "http://169.254.169.254", + IPv6 = "http://[fd00:ec2::254]" +} diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointConfigOptions.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointConfigOptions.d.ts new file mode 100644 index 0000000000..50bffbc91c --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointConfigOptions.d.ts @@ -0,0 +1,4 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +export declare const ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; +export declare const CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; +export declare const ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointMode.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointMode.d.ts new file mode 100644 index 0000000000..485a24d690 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointMode.d.ts @@ -0,0 +1,4 @@ +export declare enum EndpointMode { + IPv4 = "IPv4", + IPv6 = "IPv6" +} diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointModeConfigOptions.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointModeConfigOptions.d.ts new file mode 100644 index 0000000000..62ae961b0e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/config/EndpointModeConfigOptions.d.ts @@ -0,0 +1,4 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +export declare const ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; +export declare const CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; +export declare const ENDPOINT_MODE_CONFIG_OPTIONS: LoadedConfigSelectors; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/fromContainerMetadata.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/fromContainerMetadata.d.ts new file mode 100644 index 0000000000..ba6cf73a95 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/fromContainerMetadata.d.ts @@ -0,0 +1,10 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +import { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit"; +export declare const ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; +export declare const ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; +export declare const ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; +/** + * Creates a credential provider that will source credentials from the ECS + * Container Metadata Service + */ +export declare const fromContainerMetadata: (init?: RemoteProviderInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/fromInstanceMetadata.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/fromInstanceMetadata.d.ts new file mode 100644 index 0000000000..0d62788b58 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/fromInstanceMetadata.d.ts @@ -0,0 +1,8 @@ +import { Provider } from "@aws-sdk/types"; +import { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit"; +import { InstanceMetadataCredentials } from "./types"; +/** + * Creates a credential provider that will source credentials from the EC2 + * Instance Metadata Service + */ +export declare const fromInstanceMetadata: (init?: RemoteProviderInit) => Provider; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/index.d.ts new file mode 100644 index 0000000000..59c8dedc15 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/index.d.ts @@ -0,0 +1,6 @@ +export * from "./fromContainerMetadata"; +export * from "./fromInstanceMetadata"; +export * from "./remoteProvider/RemoteProviderInit"; +export * from "./types"; +export { httpRequest } from "./remoteProvider/httpRequest"; +export { getInstanceMetadataEndpoint } from "./utils/getInstanceMetadataEndpoint"; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/ImdsCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/ImdsCredentials.d.ts new file mode 100644 index 0000000000..c2c9fa0311 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/ImdsCredentials.d.ts @@ -0,0 +1,9 @@ +import { AwsCredentialIdentity } from "@aws-sdk/types"; +export interface ImdsCredentials { + AccessKeyId: string; + SecretAccessKey: string; + Token: string; + Expiration: string; +} +export declare const isImdsCredentials: (arg: any) => arg is ImdsCredentials; +export declare const fromImdsCredentials: (creds: ImdsCredentials) => AwsCredentialIdentity; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/RemoteProviderInit.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/RemoteProviderInit.d.ts new file mode 100644 index 0000000000..9202f0e4d3 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/RemoteProviderInit.d.ts @@ -0,0 +1,17 @@ +import { Logger } from "@aws-sdk/types"; +export declare const DEFAULT_TIMEOUT = 1000; +export declare const DEFAULT_MAX_RETRIES = 0; +export interface RemoteProviderConfig { + /** + * The connection timeout (in milliseconds) + */ + timeout: number; + /** + * The maximum number of times the HTTP connection should be retried + */ + maxRetries: number; +} +export interface RemoteProviderInit extends Partial { + logger?: Logger; +} +export declare const providerConfigFromInit: ({ maxRetries, timeout, }: RemoteProviderInit) => RemoteProviderConfig; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/httpRequest.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/httpRequest.d.ts new file mode 100644 index 0000000000..35c06c2cc1 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/httpRequest.d.ts @@ -0,0 +1,6 @@ +/// +import { RequestOptions } from "http"; +/** + * @internal + */ +export declare function httpRequest(options: RequestOptions): Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/index.d.ts new file mode 100644 index 0000000000..d4ad60104a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/index.d.ts @@ -0,0 +1,2 @@ +export * from "./ImdsCredentials"; +export * from "./RemoteProviderInit"; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/retry.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/retry.d.ts new file mode 100644 index 0000000000..3478262d0a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/remoteProvider/retry.d.ts @@ -0,0 +1,7 @@ +export interface RetryableProvider { + (): Promise; +} +/** + * @internal + */ +export declare const retry: (toRetry: RetryableProvider, maxRetries: number) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/Endpoint.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/Endpoint.d.ts new file mode 100644 index 0000000000..c2f8e1bfe0 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/Endpoint.d.ts @@ -0,0 +1,4 @@ +export declare enum Endpoint { + IPv4 = "http://169.254.169.254", + IPv6 = "http://[fd00:ec2::254]", +} diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointConfigOptions.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointConfigOptions.d.ts new file mode 100644 index 0000000000..b78d56f39a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointConfigOptions.d.ts @@ -0,0 +1,6 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +export declare const ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; +export declare const CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; +export declare const ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors< + string | undefined +>; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointMode.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointMode.d.ts new file mode 100644 index 0000000000..b7239f8a13 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointMode.d.ts @@ -0,0 +1,4 @@ +export declare enum EndpointMode { + IPv4 = "IPv4", + IPv6 = "IPv6", +} diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointModeConfigOptions.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointModeConfigOptions.d.ts new file mode 100644 index 0000000000..bdaf3e120e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/config/EndpointModeConfigOptions.d.ts @@ -0,0 +1,8 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +export declare const ENV_ENDPOINT_MODE_NAME = + "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; +export declare const CONFIG_ENDPOINT_MODE_NAME = + "ec2_metadata_service_endpoint_mode"; +export declare const ENDPOINT_MODE_CONFIG_OPTIONS: LoadedConfigSelectors< + string | undefined +>; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/fromContainerMetadata.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/fromContainerMetadata.d.ts new file mode 100644 index 0000000000..7b88bfc80e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/fromContainerMetadata.d.ts @@ -0,0 +1,9 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +import { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit"; +export declare const ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; +export declare const ENV_CMDS_RELATIVE_URI = + "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; +export declare const ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; +export declare const fromContainerMetadata: ( + init?: RemoteProviderInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/fromInstanceMetadata.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/fromInstanceMetadata.d.ts new file mode 100644 index 0000000000..ae334b4133 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/fromInstanceMetadata.d.ts @@ -0,0 +1,6 @@ +import { Provider } from "@aws-sdk/types"; +import { RemoteProviderInit } from "./remoteProvider/RemoteProviderInit"; +import { InstanceMetadataCredentials } from "./types"; +export declare const fromInstanceMetadata: ( + init?: RemoteProviderInit +) => Provider; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..59c8dedc15 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/index.d.ts @@ -0,0 +1,6 @@ +export * from "./fromContainerMetadata"; +export * from "./fromInstanceMetadata"; +export * from "./remoteProvider/RemoteProviderInit"; +export * from "./types"; +export { httpRequest } from "./remoteProvider/httpRequest"; +export { getInstanceMetadataEndpoint } from "./utils/getInstanceMetadataEndpoint"; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/ImdsCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/ImdsCredentials.d.ts new file mode 100644 index 0000000000..11e35fbf1f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/ImdsCredentials.d.ts @@ -0,0 +1,11 @@ +import { AwsCredentialIdentity } from "@aws-sdk/types"; +export interface ImdsCredentials { + AccessKeyId: string; + SecretAccessKey: string; + Token: string; + Expiration: string; +} +export declare const isImdsCredentials: (arg: any) => arg is ImdsCredentials; +export declare const fromImdsCredentials: ( + creds: ImdsCredentials +) => AwsCredentialIdentity; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/RemoteProviderInit.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/RemoteProviderInit.d.ts new file mode 100644 index 0000000000..e85deea89a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/RemoteProviderInit.d.ts @@ -0,0 +1,14 @@ +import { Logger } from "@aws-sdk/types"; +export declare const DEFAULT_TIMEOUT = 1000; +export declare const DEFAULT_MAX_RETRIES = 0; +export interface RemoteProviderConfig { + timeout: number; + maxRetries: number; +} +export interface RemoteProviderInit extends Partial { + logger?: Logger; +} +export declare const providerConfigFromInit: ({ + maxRetries, + timeout, +}: RemoteProviderInit) => RemoteProviderConfig; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/httpRequest.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/httpRequest.d.ts new file mode 100644 index 0000000000..57f8277042 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/httpRequest.d.ts @@ -0,0 +1,2 @@ +import { RequestOptions } from "http"; +export declare function httpRequest(options: RequestOptions): Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/index.d.ts new file mode 100644 index 0000000000..d4ad60104a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/index.d.ts @@ -0,0 +1,2 @@ +export * from "./ImdsCredentials"; +export * from "./RemoteProviderInit"; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/retry.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/retry.d.ts new file mode 100644 index 0000000000..86b89a2248 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/remoteProvider/retry.d.ts @@ -0,0 +1,7 @@ +export interface RetryableProvider { + (): Promise; +} +export declare const retry: ( + toRetry: RetryableProvider, + maxRetries: number +) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/types.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/types.d.ts new file mode 100644 index 0000000000..4488c5719f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/types.d.ts @@ -0,0 +1,4 @@ +import { AwsCredentialIdentity } from "@aws-sdk/types"; +export interface InstanceMetadataCredentials extends AwsCredentialIdentity { + readonly originalExpiration?: Date; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/getExtendedInstanceMetadataCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/getExtendedInstanceMetadataCredentials.d.ts new file mode 100644 index 0000000000..291b8c38ba --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/getExtendedInstanceMetadataCredentials.d.ts @@ -0,0 +1,6 @@ +import { Logger } from "@aws-sdk/types"; +import { InstanceMetadataCredentials } from "../types"; +export declare const getExtendedInstanceMetadataCredentials: ( + credentials: InstanceMetadataCredentials, + logger: Logger +) => InstanceMetadataCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/getInstanceMetadataEndpoint.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/getInstanceMetadataEndpoint.d.ts new file mode 100644 index 0000000000..98b7316bce --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/getInstanceMetadataEndpoint.d.ts @@ -0,0 +1,2 @@ +import { Endpoint } from "@aws-sdk/types"; +export declare const getInstanceMetadataEndpoint: () => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/staticStabilityProvider.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/staticStabilityProvider.d.ts new file mode 100644 index 0000000000..2a4fdb9665 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/ts3.4/utils/staticStabilityProvider.d.ts @@ -0,0 +1,8 @@ +import { Logger, Provider } from "@aws-sdk/types"; +import { InstanceMetadataCredentials } from "../types"; +export declare const staticStabilityProvider: ( + provider: Provider, + options?: { + logger?: Logger | undefined; + } +) => Provider; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/types.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/types.d.ts new file mode 100644 index 0000000000..db384286d2 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/types.d.ts @@ -0,0 +1,4 @@ +import { AwsCredentialIdentity } from "@aws-sdk/types"; +export interface InstanceMetadataCredentials extends AwsCredentialIdentity { + readonly originalExpiration?: Date; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/getExtendedInstanceMetadataCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/getExtendedInstanceMetadataCredentials.d.ts new file mode 100644 index 0000000000..81a36450c3 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/getExtendedInstanceMetadataCredentials.d.ts @@ -0,0 +1,3 @@ +import { Logger } from "@aws-sdk/types"; +import { InstanceMetadataCredentials } from "../types"; +export declare const getExtendedInstanceMetadataCredentials: (credentials: InstanceMetadataCredentials, logger: Logger) => InstanceMetadataCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/getInstanceMetadataEndpoint.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/getInstanceMetadataEndpoint.d.ts new file mode 100644 index 0000000000..f83293708c --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/getInstanceMetadataEndpoint.d.ts @@ -0,0 +1,21 @@ +import { Endpoint } from "@aws-sdk/types"; +/** + * Returns the host to use for instance metadata service call. + * + * The host is read from endpoint which can be set either in + * {@link ENV_ENDPOINT_NAME} environment variable or {@link CONFIG_ENDPOINT_NAME} + * configuration property. + * + * If endpoint is not set, then endpoint mode is read either from + * {@link ENV_ENDPOINT_MODE_NAME} environment variable or {@link CONFIG_ENDPOINT_MODE_NAME} + * configuration property. If endpoint mode is not set, then default endpoint mode + * {@link EndpointMode.IPv4} is used. + * + * If endpoint mode is set to {@link EndpointMode.IPv4}, then the host is {@link Endpoint.IPv4}. + * If endpoint mode is set to {@link EndpointMode.IPv6}, then the host is {@link Endpoint.IPv6}. + * + * @returns Host to use for instance metadata service call. + * + * @internal + */ +export declare const getInstanceMetadataEndpoint: () => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/staticStabilityProvider.d.ts b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/staticStabilityProvider.d.ts new file mode 100644 index 0000000000..a183b465f3 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/dist-types/utils/staticStabilityProvider.d.ts @@ -0,0 +1,14 @@ +import { Logger, Provider } from "@aws-sdk/types"; +import { InstanceMetadataCredentials } from "../types"; +/** + * IMDS credential supports static stability feature. When used, the expiration + * of recently issued credentials is extended. The server side allows using + * the recently expired credentials. This mitigates impact when clients using + * refreshable credentials are unable to retrieve updates. + * + * @param provider Credential provider + * @returns A credential provider that supports static stability + */ +export declare const staticStabilityProvider: (provider: Provider, options?: { + logger?: Logger | undefined; +}) => Provider; diff --git a/server/node_modules/@aws-sdk/credential-provider-imds/package.json b/server/node_modules/@aws-sdk/credential-provider-imds/package.json new file mode 100644 index 0000000000..4835a16ade --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-imds/package.json @@ -0,0 +1,63 @@ +{ + "name": "@aws-sdk/credential-provider-imds", + "version": "3.259.0", + "description": "AWS credential provider that sources credentials from the EC2 instance metadata service and ECS container metadata service", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "credentials" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "nock": "^13.0.2", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/credential-provider-imds", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/credential-provider-imds" + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/LICENSE b/server/node_modules/@aws-sdk/credential-provider-ini/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/README.md b/server/node_modules/@aws-sdk/credential-provider-ini/README.md new file mode 100644 index 0000000000..b4f3af1b9a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/README.md @@ -0,0 +1,11 @@ +# @aws-sdk/credential-provider-ini + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-provider-ini/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-ini) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-provider-ini.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-ini) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers) +instead. diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/fromIni.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/fromIni.js new file mode 100644 index 0000000000..4a94677865 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/fromIni.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromIni = void 0; +const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader"); +const resolveProfileData_1 = require("./resolveProfileData"); +const fromIni = (init = {}) => async () => { + const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); + return (0, resolveProfileData_1.resolveProfileData)((0, shared_ini_file_loader_1.getProfileName)(init), profiles, init); +}; +exports.fromIni = fromIni; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js new file mode 100644 index 0000000000..07290210e5 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromIni"), exports); diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveAssumeRoleCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveAssumeRoleCredentials.js new file mode 100644 index 0000000000..f7d372ce09 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveAssumeRoleCredentials.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveAssumeRoleCredentials = exports.isAssumeRoleProfile = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader"); +const resolveCredentialSource_1 = require("./resolveCredentialSource"); +const resolveProfileData_1 = require("./resolveProfileData"); +const isAssumeRoleProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.role_arn === "string" && + ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && + ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && + ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && + (isAssumeRoleWithSourceProfile(arg) || isAssumeRoleWithProviderProfile(arg)); +exports.isAssumeRoleProfile = isAssumeRoleProfile; +const isAssumeRoleWithSourceProfile = (arg) => typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined"; +const isAssumeRoleWithProviderProfile = (arg) => typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined"; +const resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}) => { + const data = profiles[profileName]; + if (!options.roleAssumer) { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} requires a role to be assumed, but no role assumption callback was provided.`, false); + } + const { source_profile } = data; + if (source_profile && source_profile in visitedProfiles) { + throw new property_provider_1.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` + + ` ${(0, shared_ini_file_loader_1.getProfileName)(options)}. Profiles visited: ` + + Object.keys(visitedProfiles).join(", "), false); + } + const sourceCredsProvider = source_profile + ? (0, resolveProfileData_1.resolveProfileData)(source_profile, profiles, options, { + ...visitedProfiles, + [source_profile]: true, + }) + : (0, resolveCredentialSource_1.resolveCredentialSource)(data.credential_source, profileName)(); + const params = { + RoleArn: data.role_arn, + RoleSessionName: data.role_session_name || `aws-sdk-js-${Date.now()}`, + ExternalId: data.external_id, + }; + const { mfa_serial } = data; + if (mfa_serial) { + if (!options.mfaCodeProvider) { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, false); + } + params.SerialNumber = mfa_serial; + params.TokenCode = await options.mfaCodeProvider(mfa_serial); + } + const sourceCreds = await sourceCredsProvider; + return options.roleAssumer(sourceCreds, params); +}; +exports.resolveAssumeRoleCredentials = resolveAssumeRoleCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveCredentialSource.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveCredentialSource.js new file mode 100644 index 0000000000..b8b28d2df9 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveCredentialSource.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveCredentialSource = void 0; +const credential_provider_env_1 = require("@aws-sdk/credential-provider-env"); +const credential_provider_imds_1 = require("@aws-sdk/credential-provider-imds"); +const property_provider_1 = require("@aws-sdk/property-provider"); +const resolveCredentialSource = (credentialSource, profileName) => { + const sourceProvidersMap = { + EcsContainer: credential_provider_imds_1.fromContainerMetadata, + Ec2InstanceMetadata: credential_provider_imds_1.fromInstanceMetadata, + Environment: credential_provider_env_1.fromEnv, + }; + if (credentialSource in sourceProvidersMap) { + return sourceProvidersMap[credentialSource](); + } + else { + throw new property_provider_1.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` + + `expected EcsContainer or Ec2InstanceMetadata or Environment.`); + } +}; +exports.resolveCredentialSource = resolveCredentialSource; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProcessCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProcessCredentials.js new file mode 100644 index 0000000000..cbd098ea10 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProcessCredentials.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveProcessCredentials = exports.isProcessProfile = void 0; +const credential_provider_process_1 = require("@aws-sdk/credential-provider-process"); +const isProcessProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.credential_process === "string"; +exports.isProcessProfile = isProcessProfile; +const resolveProcessCredentials = async (options, profile) => (0, credential_provider_process_1.fromProcess)({ + ...options, + profile, +})(); +exports.resolveProcessCredentials = resolveProcessCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProfileData.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProfileData.js new file mode 100644 index 0000000000..2d0c71832d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProfileData.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveProfileData = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const resolveAssumeRoleCredentials_1 = require("./resolveAssumeRoleCredentials"); +const resolveProcessCredentials_1 = require("./resolveProcessCredentials"); +const resolveSsoCredentials_1 = require("./resolveSsoCredentials"); +const resolveStaticCredentials_1 = require("./resolveStaticCredentials"); +const resolveWebIdentityCredentials_1 = require("./resolveWebIdentityCredentials"); +const resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}) => { + const data = profiles[profileName]; + if (Object.keys(visitedProfiles).length > 0 && (0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) { + return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data); + } + if ((0, resolveAssumeRoleCredentials_1.isAssumeRoleProfile)(data)) { + return (0, resolveAssumeRoleCredentials_1.resolveAssumeRoleCredentials)(profileName, profiles, options, visitedProfiles); + } + if ((0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) { + return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data); + } + if ((0, resolveWebIdentityCredentials_1.isWebIdentityProfile)(data)) { + return (0, resolveWebIdentityCredentials_1.resolveWebIdentityCredentials)(data, options); + } + if ((0, resolveProcessCredentials_1.isProcessProfile)(data)) { + return (0, resolveProcessCredentials_1.resolveProcessCredentials)(options, profileName); + } + if ((0, resolveSsoCredentials_1.isSsoProfile)(data)) { + return (0, resolveSsoCredentials_1.resolveSsoCredentials)(data); + } + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} could not be found or parsed in shared credentials file.`); +}; +exports.resolveProfileData = resolveProfileData; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveSsoCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveSsoCredentials.js new file mode 100644 index 0000000000..27b55c320a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveSsoCredentials.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveSsoCredentials = exports.isSsoProfile = void 0; +const credential_provider_sso_1 = require("@aws-sdk/credential-provider-sso"); +var credential_provider_sso_2 = require("@aws-sdk/credential-provider-sso"); +Object.defineProperty(exports, "isSsoProfile", { enumerable: true, get: function () { return credential_provider_sso_2.isSsoProfile; } }); +const resolveSsoCredentials = (data) => { + const { sso_start_url, sso_account_id, sso_session, sso_region, sso_role_name } = (0, credential_provider_sso_1.validateSsoProfile)(data); + return (0, credential_provider_sso_1.fromSSO)({ + ssoStartUrl: sso_start_url, + ssoAccountId: sso_account_id, + ssoSession: sso_session, + ssoRegion: sso_region, + ssoRoleName: sso_role_name, + })(); +}; +exports.resolveSsoCredentials = resolveSsoCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveStaticCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveStaticCredentials.js new file mode 100644 index 0000000000..43d4df7372 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveStaticCredentials.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveStaticCredentials = exports.isStaticCredsProfile = void 0; +const isStaticCredsProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.aws_access_key_id === "string" && + typeof arg.aws_secret_access_key === "string" && + ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1; +exports.isStaticCredsProfile = isStaticCredsProfile; +const resolveStaticCredentials = (profile) => Promise.resolve({ + accessKeyId: profile.aws_access_key_id, + secretAccessKey: profile.aws_secret_access_key, + sessionToken: profile.aws_session_token, +}); +exports.resolveStaticCredentials = resolveStaticCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveWebIdentityCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveWebIdentityCredentials.js new file mode 100644 index 0000000000..4b5d0bd462 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveWebIdentityCredentials.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveWebIdentityCredentials = exports.isWebIdentityProfile = void 0; +const credential_provider_web_identity_1 = require("@aws-sdk/credential-provider-web-identity"); +const isWebIdentityProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.web_identity_token_file === "string" && + typeof arg.role_arn === "string" && + ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1; +exports.isWebIdentityProfile = isWebIdentityProfile; +const resolveWebIdentityCredentials = async (profile, options) => (0, credential_provider_web_identity_1.fromTokenFile)({ + webIdentityTokenFile: profile.web_identity_token_file, + roleArn: profile.role_arn, + roleSessionName: profile.role_session_name, + roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity, +})(); +exports.resolveWebIdentityCredentials = resolveWebIdentityCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js new file mode 100644 index 0000000000..59fdc99044 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js @@ -0,0 +1,6 @@ +import { getProfileName, parseKnownFiles } from "@aws-sdk/shared-ini-file-loader"; +import { resolveProfileData } from "./resolveProfileData"; +export const fromIni = (init = {}) => async () => { + const profiles = await parseKnownFiles(init); + return resolveProfileData(getProfileName(init), profiles, init); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js new file mode 100644 index 0000000000..b01913159b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js @@ -0,0 +1 @@ +export * from "./fromIni"; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js new file mode 100644 index 0000000000..05bc840584 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js @@ -0,0 +1,46 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { getProfileName } from "@aws-sdk/shared-ini-file-loader"; +import { resolveCredentialSource } from "./resolveCredentialSource"; +import { resolveProfileData } from "./resolveProfileData"; +export const isAssumeRoleProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.role_arn === "string" && + ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && + ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && + ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && + (isAssumeRoleWithSourceProfile(arg) || isAssumeRoleWithProviderProfile(arg)); +const isAssumeRoleWithSourceProfile = (arg) => typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined"; +const isAssumeRoleWithProviderProfile = (arg) => typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined"; +export const resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}) => { + const data = profiles[profileName]; + if (!options.roleAssumer) { + throw new CredentialsProviderError(`Profile ${profileName} requires a role to be assumed, but no role assumption callback was provided.`, false); + } + const { source_profile } = data; + if (source_profile && source_profile in visitedProfiles) { + throw new CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` + + ` ${getProfileName(options)}. Profiles visited: ` + + Object.keys(visitedProfiles).join(", "), false); + } + const sourceCredsProvider = source_profile + ? resolveProfileData(source_profile, profiles, options, { + ...visitedProfiles, + [source_profile]: true, + }) + : resolveCredentialSource(data.credential_source, profileName)(); + const params = { + RoleArn: data.role_arn, + RoleSessionName: data.role_session_name || `aws-sdk-js-${Date.now()}`, + ExternalId: data.external_id, + }; + const { mfa_serial } = data; + if (mfa_serial) { + if (!options.mfaCodeProvider) { + throw new CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, false); + } + params.SerialNumber = mfa_serial; + params.TokenCode = await options.mfaCodeProvider(mfa_serial); + } + const sourceCreds = await sourceCredsProvider; + return options.roleAssumer(sourceCreds, params); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js new file mode 100644 index 0000000000..1c540cf691 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js @@ -0,0 +1,17 @@ +import { fromEnv } from "@aws-sdk/credential-provider-env"; +import { fromContainerMetadata, fromInstanceMetadata } from "@aws-sdk/credential-provider-imds"; +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +export const resolveCredentialSource = (credentialSource, profileName) => { + const sourceProvidersMap = { + EcsContainer: fromContainerMetadata, + Ec2InstanceMetadata: fromInstanceMetadata, + Environment: fromEnv, + }; + if (credentialSource in sourceProvidersMap) { + return sourceProvidersMap[credentialSource](); + } + else { + throw new CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` + + `expected EcsContainer or Ec2InstanceMetadata or Environment.`); + } +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js new file mode 100644 index 0000000000..4a9b0c0ec9 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js @@ -0,0 +1,8 @@ +import { fromProcess } from "@aws-sdk/credential-provider-process"; +export const isProcessProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.credential_process === "string"; +export const resolveProcessCredentials = async (options, profile) => fromProcess({ + ...options, + profile, +})(); diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js new file mode 100644 index 0000000000..c8b3118a5d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js @@ -0,0 +1,28 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { isAssumeRoleProfile, resolveAssumeRoleCredentials } from "./resolveAssumeRoleCredentials"; +import { isProcessProfile, resolveProcessCredentials } from "./resolveProcessCredentials"; +import { isSsoProfile, resolveSsoCredentials } from "./resolveSsoCredentials"; +import { isStaticCredsProfile, resolveStaticCredentials } from "./resolveStaticCredentials"; +import { isWebIdentityProfile, resolveWebIdentityCredentials } from "./resolveWebIdentityCredentials"; +export const resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}) => { + const data = profiles[profileName]; + if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) { + return resolveStaticCredentials(data); + } + if (isAssumeRoleProfile(data)) { + return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles); + } + if (isStaticCredsProfile(data)) { + return resolveStaticCredentials(data); + } + if (isWebIdentityProfile(data)) { + return resolveWebIdentityCredentials(data, options); + } + if (isProcessProfile(data)) { + return resolveProcessCredentials(options, profileName); + } + if (isSsoProfile(data)) { + return resolveSsoCredentials(data); + } + throw new CredentialsProviderError(`Profile ${profileName} could not be found or parsed in shared credentials file.`); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js new file mode 100644 index 0000000000..d25395b957 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js @@ -0,0 +1,12 @@ +import { fromSSO, validateSsoProfile } from "@aws-sdk/credential-provider-sso"; +export { isSsoProfile } from "@aws-sdk/credential-provider-sso"; +export const resolveSsoCredentials = (data) => { + const { sso_start_url, sso_account_id, sso_session, sso_region, sso_role_name } = validateSsoProfile(data); + return fromSSO({ + ssoStartUrl: sso_start_url, + ssoAccountId: sso_account_id, + ssoSession: sso_session, + ssoRegion: sso_region, + ssoRoleName: sso_role_name, + })(); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js new file mode 100644 index 0000000000..717f2d6449 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js @@ -0,0 +1,10 @@ +export const isStaticCredsProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.aws_access_key_id === "string" && + typeof arg.aws_secret_access_key === "string" && + ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1; +export const resolveStaticCredentials = (profile) => Promise.resolve({ + accessKeyId: profile.aws_access_key_id, + secretAccessKey: profile.aws_secret_access_key, + sessionToken: profile.aws_session_token, +}); diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js new file mode 100644 index 0000000000..6cce9f465d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js @@ -0,0 +1,12 @@ +import { fromTokenFile } from "@aws-sdk/credential-provider-web-identity"; +export const isWebIdentityProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.web_identity_token_file === "string" && + typeof arg.role_arn === "string" && + ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1; +export const resolveWebIdentityCredentials = async (profile, options) => fromTokenFile({ + webIdentityTokenFile: profile.web_identity_token_file, + roleArn: profile.role_arn, + roleSessionName: profile.role_session_name, + roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity, +})(); diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/fromIni.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/fromIni.d.ts new file mode 100644 index 0000000000..cbb7dc499f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/fromIni.d.ts @@ -0,0 +1,36 @@ +import { AssumeRoleWithWebIdentityParams } from "@aws-sdk/credential-provider-web-identity"; +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { AwsCredentialIdentity, AwsCredentialIdentityProvider } from "@aws-sdk/types"; +import { AssumeRoleParams } from "./resolveAssumeRoleCredentials"; +export interface FromIniInit extends SourceProfileInit { + /** + * A function that returns a promise fulfilled with an MFA token code for + * the provided MFA Serial code. If a profile requires an MFA code and + * `mfaCodeProvider` is not a valid function, the credential provider + * promise will be rejected. + * + * @param mfaSerial The serial code of the MFA device specified. + */ + mfaCodeProvider?: (mfaSerial: string) => Promise; + /** + * A function that assumes a role and returns a promise fulfilled with + * credentials for the assumed role. + * + * @param sourceCreds The credentials with which to assume a role. + * @param params + */ + roleAssumer?: (sourceCreds: AwsCredentialIdentity, params: AssumeRoleParams) => Promise; + /** + * A function that assumes a role with web identity and returns a promise fulfilled with + * credentials for the assumed role. + * + * @param sourceCreds The credentials with which to assume a role. + * @param params + */ + roleAssumerWithWebIdentity?: (params: AssumeRoleWithWebIdentityParams) => Promise; +} +/** + * Creates a credential provider that will read from ini files and supports + * role assumption and multi-factor authentication. + */ +export declare const fromIni: (init?: FromIniInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/index.d.ts new file mode 100644 index 0000000000..b01913159b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./fromIni"; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveAssumeRoleCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveAssumeRoleCredentials.d.ts new file mode 100644 index 0000000000..967b053be2 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveAssumeRoleCredentials.d.ts @@ -0,0 +1,32 @@ +import { ParsedIniData } from "@aws-sdk/types"; +import { FromIniInit } from "./fromIni"; +/** + * @see http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#assumeRole-property + * TODO update the above to link to V3 docs + */ +export interface AssumeRoleParams { + /** + * The identifier of the role to be assumed. + */ + RoleArn: string; + /** + * A name for the assumed role session. + */ + RoleSessionName: string; + /** + * A unique identifier that is used by third parties when assuming roles in + * their customers' accounts. + */ + ExternalId?: string; + /** + * The identification number of the MFA device that is associated with the + * user who is making the `AssumeRole` call. + */ + SerialNumber?: string; + /** + * The value provided by the MFA device. + */ + TokenCode?: string; +} +export declare const isAssumeRoleProfile: (arg: any) => boolean; +export declare const resolveAssumeRoleCredentials: (profileName: string, profiles: ParsedIniData, options: FromIniInit, visitedProfiles?: Record) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveCredentialSource.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveCredentialSource.d.ts new file mode 100644 index 0000000000..b96c23321e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveCredentialSource.d.ts @@ -0,0 +1,9 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +/** + * Resolve the `credential_source` entry from the profile, and return the + * credential providers respectively. No memoization is needed for the + * credential source providers because memoization should be added outside the + * fromIni() provider. The source credential needs to be refreshed every time + * fromIni() is called. + */ +export declare const resolveCredentialSource: (credentialSource: string, profileName: string) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveProcessCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveProcessCredentials.d.ts new file mode 100644 index 0000000000..8b95f067dd --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveProcessCredentials.d.ts @@ -0,0 +1,7 @@ +import { Credentials, Profile } from "@aws-sdk/types"; +import { FromIniInit } from "./fromIni"; +export interface ProcessProfile extends Profile { + credential_process: string; +} +export declare const isProcessProfile: (arg: any) => arg is ProcessProfile; +export declare const resolveProcessCredentials: (options: FromIniInit, profile: string) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveProfileData.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveProfileData.d.ts new file mode 100644 index 0000000000..7a9413087d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveProfileData.d.ts @@ -0,0 +1,3 @@ +import { AwsCredentialIdentity, ParsedIniData } from "@aws-sdk/types"; +import { FromIniInit } from "./fromIni"; +export declare const resolveProfileData: (profileName: string, profiles: ParsedIniData, options: FromIniInit, visitedProfiles?: Record) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveSsoCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveSsoCredentials.d.ts new file mode 100644 index 0000000000..7e91ff81cb --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveSsoCredentials.d.ts @@ -0,0 +1,3 @@ +import { SsoProfile } from "@aws-sdk/credential-provider-sso"; +export { isSsoProfile } from "@aws-sdk/credential-provider-sso"; +export declare const resolveSsoCredentials: (data: Partial) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveStaticCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveStaticCredentials.d.ts new file mode 100644 index 0000000000..a98d686c87 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveStaticCredentials.d.ts @@ -0,0 +1,8 @@ +import { AwsCredentialIdentity, Profile } from "@aws-sdk/types"; +export interface StaticCredsProfile extends Profile { + aws_access_key_id: string; + aws_secret_access_key: string; + aws_session_token?: string; +} +export declare const isStaticCredsProfile: (arg: any) => arg is StaticCredsProfile; +export declare const resolveStaticCredentials: (profile: StaticCredsProfile) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveWebIdentityCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveWebIdentityCredentials.d.ts new file mode 100644 index 0000000000..4d45630c10 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/resolveWebIdentityCredentials.d.ts @@ -0,0 +1,9 @@ +import { AwsCredentialIdentity, Profile } from "@aws-sdk/types"; +import { FromIniInit } from "./fromIni"; +export interface WebIdentityProfile extends Profile { + web_identity_token_file: string; + role_arn: string; + role_session_name?: string; +} +export declare const isWebIdentityProfile: (arg: any) => arg is WebIdentityProfile; +export declare const resolveWebIdentityCredentials: (profile: WebIdentityProfile, options: FromIniInit) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/fromIni.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/fromIni.d.ts new file mode 100644 index 0000000000..bdcc190ed0 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/fromIni.d.ts @@ -0,0 +1,20 @@ +import { AssumeRoleWithWebIdentityParams } from "@aws-sdk/credential-provider-web-identity"; +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { + AwsCredentialIdentity, + AwsCredentialIdentityProvider, +} from "@aws-sdk/types"; +import { AssumeRoleParams } from "./resolveAssumeRoleCredentials"; +export interface FromIniInit extends SourceProfileInit { + mfaCodeProvider?: (mfaSerial: string) => Promise; + roleAssumer?: ( + sourceCreds: AwsCredentialIdentity, + params: AssumeRoleParams + ) => Promise; + roleAssumerWithWebIdentity?: ( + params: AssumeRoleWithWebIdentityParams + ) => Promise; +} +export declare const fromIni: ( + init?: FromIniInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..b01913159b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./fromIni"; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveAssumeRoleCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveAssumeRoleCredentials.d.ts new file mode 100644 index 0000000000..77790cd56d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveAssumeRoleCredentials.d.ts @@ -0,0 +1,16 @@ +import { ParsedIniData } from "@aws-sdk/types"; +import { FromIniInit } from "./fromIni"; +export interface AssumeRoleParams { + RoleArn: string; + RoleSessionName: string; + ExternalId?: string; + SerialNumber?: string; + TokenCode?: string; +} +export declare const isAssumeRoleProfile: (arg: any) => boolean; +export declare const resolveAssumeRoleCredentials: ( + profileName: string, + profiles: ParsedIniData, + options: FromIniInit, + visitedProfiles?: Record +) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveCredentialSource.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveCredentialSource.d.ts new file mode 100644 index 0000000000..b833eb9ac3 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveCredentialSource.d.ts @@ -0,0 +1,5 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export declare const resolveCredentialSource: ( + credentialSource: string, + profileName: string +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveProcessCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveProcessCredentials.d.ts new file mode 100644 index 0000000000..dbd5583595 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveProcessCredentials.d.ts @@ -0,0 +1,10 @@ +import { Credentials, Profile } from "@aws-sdk/types"; +import { FromIniInit } from "./fromIni"; +export interface ProcessProfile extends Profile { + credential_process: string; +} +export declare const isProcessProfile: (arg: any) => arg is ProcessProfile; +export declare const resolveProcessCredentials: ( + options: FromIniInit, + profile: string +) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveProfileData.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveProfileData.d.ts new file mode 100644 index 0000000000..af0dc19356 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveProfileData.d.ts @@ -0,0 +1,8 @@ +import { AwsCredentialIdentity, ParsedIniData } from "@aws-sdk/types"; +import { FromIniInit } from "./fromIni"; +export declare const resolveProfileData: ( + profileName: string, + profiles: ParsedIniData, + options: FromIniInit, + visitedProfiles?: Record +) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveSsoCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveSsoCredentials.d.ts new file mode 100644 index 0000000000..6e97c3d33f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveSsoCredentials.d.ts @@ -0,0 +1,5 @@ +import { SsoProfile } from "@aws-sdk/credential-provider-sso"; +export { isSsoProfile } from "@aws-sdk/credential-provider-sso"; +export declare const resolveSsoCredentials: ( + data: Partial +) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveStaticCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveStaticCredentials.d.ts new file mode 100644 index 0000000000..a4b8f82b7f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveStaticCredentials.d.ts @@ -0,0 +1,12 @@ +import { AwsCredentialIdentity, Profile } from "@aws-sdk/types"; +export interface StaticCredsProfile extends Profile { + aws_access_key_id: string; + aws_secret_access_key: string; + aws_session_token?: string; +} +export declare const isStaticCredsProfile: ( + arg: any +) => arg is StaticCredsProfile; +export declare const resolveStaticCredentials: ( + profile: StaticCredsProfile +) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveWebIdentityCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveWebIdentityCredentials.d.ts new file mode 100644 index 0000000000..bab521eff7 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/dist-types/ts3.4/resolveWebIdentityCredentials.d.ts @@ -0,0 +1,14 @@ +import { AwsCredentialIdentity, Profile } from "@aws-sdk/types"; +import { FromIniInit } from "./fromIni"; +export interface WebIdentityProfile extends Profile { + web_identity_token_file: string; + role_arn: string; + role_session_name?: string; +} +export declare const isWebIdentityProfile: ( + arg: any +) => arg is WebIdentityProfile; +export declare const resolveWebIdentityCredentials: ( + profile: WebIdentityProfile, + options: FromIniInit +) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-ini/package.json b/server/node_modules/@aws-sdk/credential-provider-ini/package.json new file mode 100644 index 0000000000..4a60c71876 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-ini/package.json @@ -0,0 +1,66 @@ +{ + "name": "@aws-sdk/credential-provider-ini", + "version": "3.264.0", + "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "credentials" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.257.0", + "@aws-sdk/credential-provider-imds": "3.259.0", + "@aws-sdk/credential-provider-process": "3.257.0", + "@aws-sdk/credential-provider-sso": "3.264.0", + "@aws-sdk/credential-provider-web-identity": "3.257.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/credential-provider-ini", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/credential-provider-ini" + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-node/LICENSE b/server/node_modules/@aws-sdk/credential-provider-node/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/credential-provider-node/README.md b/server/node_modules/@aws-sdk/credential-provider-node/README.md new file mode 100644 index 0000000000..5aeb129486 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/README.md @@ -0,0 +1,101 @@ +# @aws-sdk/credential-provider-node + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-provider-node/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-node) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-provider-node.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-node) + +## AWS Credential Provider for Node.JS + +This module provides a factory function, `fromEnv`, that will attempt to source +AWS credentials from a Node.JS environment. It will attempt to find credentials +from the following sources (listed in order of precedence): + +- Environment variables exposed via `process.env` +- SSO credentials from token cache +- Web identity token credentials +- Shared credentials and config ini files +- The EC2/ECS Instance Metadata Service + +The default credential provider will invoke one provider at a time and only +continue to the next if no credentials have been located. For example, if the +process finds values defined via the `AWS_ACCESS_KEY_ID` and +`AWS_SECRET_ACCESS_KEY` environment variables, the files at `~/.aws/credentials` +and `~/.aws/config` will not be read, nor will any messages be sent to the +Instance Metadata Service. + +If invalid configuration is encountered (such as a profile in +`~/.aws/credentials` specifying as its `source_profile` the name of a profile +that does not exist), then the chained provider will be rejected with an error +and will not invoke the next provider in the list. + +_IMPORTANT_: if you intend to acquire credentials using EKS +[IAM Roles for Service Accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) +then you must explicitly specify a value for `roleAssumerWithWebIdentity`. There is a +default function available in `@aws-sdk/client-sts` package. An example of using +this: + +```js +const { getDefaultRoleAssumerWithWebIdentity } = require("@aws-sdk/client-sts"); +const { defaultProvider } = require("@aws-sdk/credential-provider-node"); +const { S3Client, GetObjectCommand } = require("@aws-sdk/client-s3"); + +const provider = defaultProvider({ + roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(), +}); + +const client = new S3Client({ credentialDefaultProvider: provider }); +``` + +_IMPORTANT_: We provide a wrapper of this provider in `@aws-sdk/credential-providers` +package to save you from importing `getDefaultRoleAssumerWithWebIdentity()` or +`getDefaultRoleAssume()` from STS package. Similarly, you can do: + +```js +const { fromNodeProviderChain } = require("@aws-sdk/credential-providers"); + +const credentials = fromNodeProviderChain(); + +const client = new S3Client({ credentials }); +``` + +## Supported configuration + +You may customize how credentials are resolved by providing an options hash to +the `defaultProvider` factory function. The following options are +supported: + +- `profile` - The configuration profile to use. If not specified, the provider + will use the value in the `AWS_PROFILE` environment variable or a default of + `default`. +- `filepath` - The path to the shared credentials file. If not specified, the + provider will use the value in the `AWS_SHARED_CREDENTIALS_FILE` environment + variable or a default of `~/.aws/credentials`. +- `configFilepath` - The path to the shared config file. If not specified, the + provider will use the value in the `AWS_CONFIG_FILE` environment variable or a + default of `~/.aws/config`. +- `mfaCodeProvider` - A function that returns a a promise fulfilled with an + MFA token code for the provided MFA Serial code. If a profile requires an MFA + code and `mfaCodeProvider` is not a valid function, the credential provider + promise will be rejected. +- `roleAssumer` - A function that assumes a role and returns a promise + fulfilled with credentials for the assumed role. If not specified, the SDK + will create an STS client and call its `assumeRole` method. +- `roleArn` - ARN to assume. If not specified, the provider will use the value + in the `AWS_ROLE_ARN` environment variable. +- `webIdentityTokenFile` - File location of where the `OIDC` token is stored. + If not specified, the provider will use the value in the `AWS_WEB_IDENTITY_TOKEN_FILE` + environment variable. +- `roleAssumerWithWebIdentity` - A function that assumes a role with web identity and + returns a promise fulfilled with credentials for the assumed role. +- `timeout` - The connection timeout (in milliseconds) to apply to any remote + requests. If not specified, a default value of `1000` (one second) is used. +- `maxRetries` - The maximum number of times any HTTP connections should be + retried. If not specified, a default value of `0` will be used. + +## Related packages: + +- [AWS Credential Provider for Node.JS - Environment Variables](../credential-provider-env) +- [AWS Credential Provider for Node.JS - SSO](../credential-provider-sso) +- [AWS Credential Provider for Node.JS - Web Identity](../credential-provider-web-identity) +- [AWS Credential Provider for Node.JS - Shared Configuration Files](../credential-provider-ini) +- [AWS Credential Provider for Node.JS - Instance and Container Metadata](../credential-provider-imds) +- [AWS Shared Configuration File Loader](../shared-ini-file-loader) diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/defaultProvider.js b/server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/defaultProvider.js new file mode 100644 index 0000000000..f0fadca154 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/defaultProvider.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultProvider = void 0; +const credential_provider_env_1 = require("@aws-sdk/credential-provider-env"); +const credential_provider_ini_1 = require("@aws-sdk/credential-provider-ini"); +const credential_provider_process_1 = require("@aws-sdk/credential-provider-process"); +const credential_provider_sso_1 = require("@aws-sdk/credential-provider-sso"); +const credential_provider_web_identity_1 = require("@aws-sdk/credential-provider-web-identity"); +const property_provider_1 = require("@aws-sdk/property-provider"); +const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader"); +const remoteProvider_1 = require("./remoteProvider"); +const defaultProvider = (init = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)(...(init.profile || process.env[shared_ini_file_loader_1.ENV_PROFILE] ? [] : [(0, credential_provider_env_1.fromEnv)()]), (0, credential_provider_sso_1.fromSSO)(init), (0, credential_provider_ini_1.fromIni)(init), (0, credential_provider_process_1.fromProcess)(init), (0, credential_provider_web_identity_1.fromTokenFile)(init), (0, remoteProvider_1.remoteProvider)(init), async () => { + throw new property_provider_1.CredentialsProviderError("Could not load credentials from any providers", false); +}), (credentials) => credentials.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000, (credentials) => credentials.expiration !== undefined); +exports.defaultProvider = defaultProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js b/server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js new file mode 100644 index 0000000000..ea45c38459 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./defaultProvider"), exports); diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/remoteProvider.js b/server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/remoteProvider.js new file mode 100644 index 0000000000..f579875759 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-cjs/remoteProvider.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.remoteProvider = exports.ENV_IMDS_DISABLED = void 0; +const credential_provider_imds_1 = require("@aws-sdk/credential-provider-imds"); +const property_provider_1 = require("@aws-sdk/property-provider"); +exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +const remoteProvider = (init) => { + if (process.env[credential_provider_imds_1.ENV_CMDS_RELATIVE_URI] || process.env[credential_provider_imds_1.ENV_CMDS_FULL_URI]) { + return (0, credential_provider_imds_1.fromContainerMetadata)(init); + } + if (process.env[exports.ENV_IMDS_DISABLED]) { + return async () => { + throw new property_provider_1.CredentialsProviderError("EC2 Instance Metadata Service access disabled"); + }; + } + return (0, credential_provider_imds_1.fromInstanceMetadata)(init); +}; +exports.remoteProvider = remoteProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js b/server/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js new file mode 100644 index 0000000000..e7d598ec60 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js @@ -0,0 +1,11 @@ +import { fromEnv } from "@aws-sdk/credential-provider-env"; +import { fromIni } from "@aws-sdk/credential-provider-ini"; +import { fromProcess } from "@aws-sdk/credential-provider-process"; +import { fromSSO } from "@aws-sdk/credential-provider-sso"; +import { fromTokenFile } from "@aws-sdk/credential-provider-web-identity"; +import { chain, CredentialsProviderError, memoize } from "@aws-sdk/property-provider"; +import { ENV_PROFILE } from "@aws-sdk/shared-ini-file-loader"; +import { remoteProvider } from "./remoteProvider"; +export const defaultProvider = (init = {}) => memoize(chain(...(init.profile || process.env[ENV_PROFILE] ? [] : [fromEnv()]), fromSSO(init), fromIni(init), fromProcess(init), fromTokenFile(init), remoteProvider(init), async () => { + throw new CredentialsProviderError("Could not load credentials from any providers", false); +}), (credentials) => credentials.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000, (credentials) => credentials.expiration !== undefined); diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-es/index.js b/server/node_modules/@aws-sdk/credential-provider-node/dist-es/index.js new file mode 100644 index 0000000000..c82818e534 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-es/index.js @@ -0,0 +1 @@ +export * from "./defaultProvider"; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js b/server/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js new file mode 100644 index 0000000000..608257319a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js @@ -0,0 +1,14 @@ +import { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata, } from "@aws-sdk/credential-provider-imds"; +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +export const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +export const remoteProvider = (init) => { + if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) { + return fromContainerMetadata(init); + } + if (process.env[ENV_IMDS_DISABLED]) { + return async () => { + throw new CredentialsProviderError("EC2 Instance Metadata Service access disabled"); + }; + } + return fromInstanceMetadata(init); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-types/defaultProvider.d.ts b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/defaultProvider.d.ts new file mode 100644 index 0000000000..dd84388e76 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/defaultProvider.d.ts @@ -0,0 +1,42 @@ +import { RemoteProviderInit } from "@aws-sdk/credential-provider-imds"; +import { FromIniInit } from "@aws-sdk/credential-provider-ini"; +import { FromProcessInit } from "@aws-sdk/credential-provider-process"; +import { FromSSOInit } from "@aws-sdk/credential-provider-sso"; +import { FromTokenFileInit } from "@aws-sdk/credential-provider-web-identity"; +import { AwsCredentialIdentity, MemoizedProvider } from "@aws-sdk/types"; +export declare type DefaultProviderInit = FromIniInit & RemoteProviderInit & FromProcessInit & FromSSOInit & FromTokenFileInit; +/** + * Creates a credential provider that will attempt to find credentials from the + * following sources (listed in order of precedence): + * * Environment variables exposed via `process.env` + * * SSO credentials from token cache + * * Web identity token credentials + * * Shared credentials and config ini files + * * The EC2/ECS Instance Metadata Service + * + * The default credential provider will invoke one provider at a time and only + * continue to the next if no credentials have been located. For example, if + * the process finds values defined via the `AWS_ACCESS_KEY_ID` and + * `AWS_SECRET_ACCESS_KEY` environment variables, the files at + * `~/.aws/credentials` and `~/.aws/config` will not be read, nor will any + * messages be sent to the Instance Metadata Service. + * + * @param init Configuration that is passed to each individual + * provider + * + * @see {@link fromEnv} The function used to source credentials from + * environment variables + * @see {@link fromSSO} The function used to source credentials from + * resolved SSO token cache + * @see {@link fromTokenFile} The function used to source credentials from + * token file + * @see {@link fromIni} The function used to source credentials from INI + * files + * @see {@link fromProcess} The function used to sources credentials from + * credential_process in INI files + * @see {@link fromInstanceMetadata} The function used to source credentials from the + * EC2 Instance Metadata Service + * @see {@link fromContainerMetadata} The function used to source credentials from the + * ECS Container Metadata Service + */ +export declare const defaultProvider: (init?: DefaultProviderInit) => MemoizedProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-types/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/index.d.ts new file mode 100644 index 0000000000..c82818e534 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./defaultProvider"; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-types/remoteProvider.d.ts b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/remoteProvider.d.ts new file mode 100644 index 0000000000..f0777cf881 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/remoteProvider.d.ts @@ -0,0 +1,4 @@ +import { RemoteProviderInit } from "@aws-sdk/credential-provider-imds"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export declare const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +export declare const remoteProvider: (init: RemoteProviderInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/defaultProvider.d.ts b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/defaultProvider.d.ts new file mode 100644 index 0000000000..cbdc99c06d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/defaultProvider.d.ts @@ -0,0 +1,14 @@ +import { RemoteProviderInit } from "@aws-sdk/credential-provider-imds"; +import { FromIniInit } from "@aws-sdk/credential-provider-ini"; +import { FromProcessInit } from "@aws-sdk/credential-provider-process"; +import { FromSSOInit } from "@aws-sdk/credential-provider-sso"; +import { FromTokenFileInit } from "@aws-sdk/credential-provider-web-identity"; +import { AwsCredentialIdentity, MemoizedProvider } from "@aws-sdk/types"; +export declare type DefaultProviderInit = FromIniInit & + RemoteProviderInit & + FromProcessInit & + FromSSOInit & + FromTokenFileInit; +export declare const defaultProvider: ( + init?: DefaultProviderInit +) => MemoizedProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..c82818e534 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./defaultProvider"; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/remoteProvider.d.ts b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/remoteProvider.d.ts new file mode 100644 index 0000000000..c484b2fa30 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/dist-types/ts3.4/remoteProvider.d.ts @@ -0,0 +1,6 @@ +import { RemoteProviderInit } from "@aws-sdk/credential-provider-imds"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export declare const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +export declare const remoteProvider: ( + init: RemoteProviderInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-node/package.json b/server/node_modules/@aws-sdk/credential-provider-node/package.json new file mode 100644 index 0000000000..9559b999a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-node/package.json @@ -0,0 +1,67 @@ +{ + "name": "@aws-sdk/credential-provider-node", + "version": "3.264.0", + "description": "AWS credential provider that sources credentials from a Node.JS environment. ", + "engines": { + "node": ">=14.0.0" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "credentials" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.257.0", + "@aws-sdk/credential-provider-imds": "3.259.0", + "@aws-sdk/credential-provider-ini": "3.264.0", + "@aws-sdk/credential-provider-process": "3.257.0", + "@aws-sdk/credential-provider-sso": "3.264.0", + "@aws-sdk/credential-provider-web-identity": "3.257.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/credential-provider-node", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/credential-provider-node" + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-process/LICENSE b/server/node_modules/@aws-sdk/credential-provider-process/LICENSE new file mode 100644 index 0000000000..f9a667398b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/credential-provider-process/README.md b/server/node_modules/@aws-sdk/credential-provider-process/README.md new file mode 100644 index 0000000000..4e9d9bd480 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/README.md @@ -0,0 +1,11 @@ +# @aws-sdk/credential-provider-process + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-provider-process/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-process) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-provider-process.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-process) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers) +instead. diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/ProcessCredentials.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/ProcessCredentials.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/ProcessCredentials.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/fromProcess.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/fromProcess.js new file mode 100644 index 0000000000..8491254476 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/fromProcess.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromProcess = void 0; +const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader"); +const resolveProcessCredentials_1 = require("./resolveProcessCredentials"); +const fromProcess = (init = {}) => async () => { + const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); + return (0, resolveProcessCredentials_1.resolveProcessCredentials)((0, shared_ini_file_loader_1.getProfileName)(init), profiles); +}; +exports.fromProcess = fromProcess; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/getValidatedProcessCredentials.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/getValidatedProcessCredentials.js new file mode 100644 index 0000000000..a60569b17a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/getValidatedProcessCredentials.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getValidatedProcessCredentials = void 0; +const getValidatedProcessCredentials = (profileName, data) => { + if (data.Version !== 1) { + throw Error(`Profile ${profileName} credential_process did not return Version 1.`); + } + if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) { + throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); + } + if (data.Expiration) { + const currentTime = new Date(); + const expireTime = new Date(data.Expiration); + if (expireTime < currentTime) { + throw Error(`Profile ${profileName} credential_process returned expired credentials.`); + } + } + return { + accessKeyId: data.AccessKeyId, + secretAccessKey: data.SecretAccessKey, + ...(data.SessionToken && { sessionToken: data.SessionToken }), + ...(data.Expiration && { expiration: new Date(data.Expiration) }), + }; +}; +exports.getValidatedProcessCredentials = getValidatedProcessCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js new file mode 100644 index 0000000000..85d88197a3 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromProcess"), exports); diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/resolveProcessCredentials.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/resolveProcessCredentials.js new file mode 100644 index 0000000000..4f27c16555 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-cjs/resolveProcessCredentials.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveProcessCredentials = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const child_process_1 = require("child_process"); +const util_1 = require("util"); +const getValidatedProcessCredentials_1 = require("./getValidatedProcessCredentials"); +const resolveProcessCredentials = async (profileName, profiles) => { + const profile = profiles[profileName]; + if (profiles[profileName]) { + const credentialProcess = profile["credential_process"]; + if (credentialProcess !== undefined) { + const execPromise = (0, util_1.promisify)(child_process_1.exec); + try { + const { stdout } = await execPromise(credentialProcess); + let data; + try { + data = JSON.parse(stdout.trim()); + } + catch (_a) { + throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); + } + return (0, getValidatedProcessCredentials_1.getValidatedProcessCredentials)(profileName, data); + } + catch (error) { + throw new property_provider_1.CredentialsProviderError(error.message); + } + } + else { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`); + } + } + else { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`); + } +}; +exports.resolveProcessCredentials = resolveProcessCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-es/ProcessCredentials.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/ProcessCredentials.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/ProcessCredentials.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js new file mode 100644 index 0000000000..de3c69309d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js @@ -0,0 +1,6 @@ +import { getProfileName, parseKnownFiles } from "@aws-sdk/shared-ini-file-loader"; +import { resolveProcessCredentials } from "./resolveProcessCredentials"; +export const fromProcess = (init = {}) => async () => { + const profiles = await parseKnownFiles(init); + return resolveProcessCredentials(getProfileName(init), profiles); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js new file mode 100644 index 0000000000..9d851028aa --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js @@ -0,0 +1,21 @@ +export const getValidatedProcessCredentials = (profileName, data) => { + if (data.Version !== 1) { + throw Error(`Profile ${profileName} credential_process did not return Version 1.`); + } + if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) { + throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); + } + if (data.Expiration) { + const currentTime = new Date(); + const expireTime = new Date(data.Expiration); + if (expireTime < currentTime) { + throw Error(`Profile ${profileName} credential_process returned expired credentials.`); + } + } + return { + accessKeyId: data.AccessKeyId, + secretAccessKey: data.SecretAccessKey, + ...(data.SessionToken && { sessionToken: data.SessionToken }), + ...(data.Expiration && { expiration: new Date(data.Expiration) }), + }; +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js new file mode 100644 index 0000000000..b921d3536d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js @@ -0,0 +1 @@ +export * from "./fromProcess"; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js new file mode 100644 index 0000000000..880ebaa47e --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js @@ -0,0 +1,33 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { exec } from "child_process"; +import { promisify } from "util"; +import { getValidatedProcessCredentials } from "./getValidatedProcessCredentials"; +export const resolveProcessCredentials = async (profileName, profiles) => { + const profile = profiles[profileName]; + if (profiles[profileName]) { + const credentialProcess = profile["credential_process"]; + if (credentialProcess !== undefined) { + const execPromise = promisify(exec); + try { + const { stdout } = await execPromise(credentialProcess); + let data; + try { + data = JSON.parse(stdout.trim()); + } + catch { + throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); + } + return getValidatedProcessCredentials(profileName, data); + } + catch (error) { + throw new CredentialsProviderError(error.message); + } + } + else { + throw new CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`); + } + } + else { + throw new CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`); + } +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ProcessCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ProcessCredentials.d.ts new file mode 100644 index 0000000000..f8939242e8 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ProcessCredentials.d.ts @@ -0,0 +1,7 @@ +export declare type ProcessCredentials = { + Version: number; + AccessKeyId: string; + SecretAccessKey: string; + SessionToken?: string; + Expiration?: number; +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/fromProcess.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/fromProcess.d.ts new file mode 100644 index 0000000000..0207cff2f4 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/fromProcess.d.ts @@ -0,0 +1,9 @@ +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface FromProcessInit extends SourceProfileInit { +} +/** + * Creates a credential provider that will read from a credential_process specified + * in ini files. + */ +export declare const fromProcess: (init?: FromProcessInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/getValidatedProcessCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/getValidatedProcessCredentials.d.ts new file mode 100644 index 0000000000..f5b7eb6357 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/getValidatedProcessCredentials.d.ts @@ -0,0 +1,3 @@ +import { AwsCredentialIdentity } from "@aws-sdk/types"; +import { ProcessCredentials } from "./ProcessCredentials"; +export declare const getValidatedProcessCredentials: (profileName: string, data: ProcessCredentials) => AwsCredentialIdentity; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/index.d.ts new file mode 100644 index 0000000000..b921d3536d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./fromProcess"; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/resolveProcessCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/resolveProcessCredentials.d.ts new file mode 100644 index 0000000000..9f6b740939 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/resolveProcessCredentials.d.ts @@ -0,0 +1,2 @@ +import { AwsCredentialIdentity, ParsedIniData } from "@aws-sdk/types"; +export declare const resolveProcessCredentials: (profileName: string, profiles: ParsedIniData) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/ProcessCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/ProcessCredentials.d.ts new file mode 100644 index 0000000000..e17d69c421 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/ProcessCredentials.d.ts @@ -0,0 +1,7 @@ +export declare type ProcessCredentials = { + Version: number; + AccessKeyId: string; + SecretAccessKey: string; + SessionToken?: string; + Expiration?: number; +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/fromProcess.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/fromProcess.d.ts new file mode 100644 index 0000000000..fea42c6c63 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/fromProcess.d.ts @@ -0,0 +1,6 @@ +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface FromProcessInit extends SourceProfileInit {} +export declare const fromProcess: ( + init?: FromProcessInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/getValidatedProcessCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/getValidatedProcessCredentials.d.ts new file mode 100644 index 0000000000..d3c3b4dd62 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/getValidatedProcessCredentials.d.ts @@ -0,0 +1,6 @@ +import { AwsCredentialIdentity } from "@aws-sdk/types"; +import { ProcessCredentials } from "./ProcessCredentials"; +export declare const getValidatedProcessCredentials: ( + profileName: string, + data: ProcessCredentials +) => AwsCredentialIdentity; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..b921d3536d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./fromProcess"; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/resolveProcessCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/resolveProcessCredentials.d.ts new file mode 100644 index 0000000000..57dcc10298 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/dist-types/ts3.4/resolveProcessCredentials.d.ts @@ -0,0 +1,5 @@ +import { AwsCredentialIdentity, ParsedIniData } from "@aws-sdk/types"; +export declare const resolveProcessCredentials: ( + profileName: string, + profiles: ParsedIniData +) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-process/package.json b/server/node_modules/@aws-sdk/credential-provider-process/package.json new file mode 100644 index 0000000000..da68343ce2 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-process/package.json @@ -0,0 +1,61 @@ +{ + "name": "@aws-sdk/credential-provider-process", + "version": "3.257.0", + "description": "AWS credential provider that sources credential_process from ~/.aws/credentials and ~/.aws/config", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "credentials" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/credential-provider-process", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/credential-provider-process" + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/LICENSE b/server/node_modules/@aws-sdk/credential-provider-sso/LICENSE new file mode 100644 index 0000000000..f9a667398b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/README.md b/server/node_modules/@aws-sdk/credential-provider-sso/README.md new file mode 100644 index 0000000000..aba3fa8063 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/README.md @@ -0,0 +1,11 @@ +# @aws-sdk/credential-provider-sso + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-provider-sso/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-sso) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-provider-sso.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-sso) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers) +instead. diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/fromSSO.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/fromSSO.js new file mode 100644 index 0000000000..f5bd0ceb77 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/fromSSO.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromSSO = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader"); +const isSsoProfile_1 = require("./isSsoProfile"); +const resolveSSOCredentials_1 = require("./resolveSSOCredentials"); +const validateSsoProfile_1 = require("./validateSsoProfile"); +const fromSSO = (init = {}) => async () => { + const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, ssoSession } = init; + const profileName = (0, shared_ini_file_loader_1.getProfileName)(init); + if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { + const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); + const profile = profiles[profileName]; + if (!profile) { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} was not found.`); + } + if (!(0, isSsoProfile_1.isSsoProfile)(profile)) { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`); + } + if (profile === null || profile === void 0 ? void 0 : profile.sso_session) { + const ssoSessions = await (0, shared_ini_file_loader_1.loadSsoSessionData)(init); + const session = ssoSessions[profile.sso_session]; + const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`; + if (ssoRegion && ssoRegion !== session.sso_region) { + throw new property_provider_1.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, false); + } + if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { + throw new property_provider_1.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, false); + } + profile.sso_region = session.sso_region; + profile.sso_start_url = session.sso_start_url; + } + const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = (0, validateSsoProfile_1.validateSsoProfile)(profile); + return (0, resolveSSOCredentials_1.resolveSSOCredentials)({ + ssoStartUrl: sso_start_url, + ssoSession: sso_session, + ssoAccountId: sso_account_id, + ssoRegion: sso_region, + ssoRoleName: sso_role_name, + ssoClient: ssoClient, + profile: profileName, + }); + } + else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { + throw new property_provider_1.CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + + '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"'); + } + else { + return (0, resolveSSOCredentials_1.resolveSSOCredentials)({ + ssoStartUrl, + ssoSession, + ssoAccountId, + ssoRegion, + ssoRoleName, + ssoClient, + profile: profileName, + }); + } +}; +exports.fromSSO = fromSSO; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js new file mode 100644 index 0000000000..b692007da3 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromSSO"), exports); +tslib_1.__exportStar(require("./isSsoProfile"), exports); +tslib_1.__exportStar(require("./types"), exports); +tslib_1.__exportStar(require("./validateSsoProfile"), exports); diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/isSsoProfile.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/isSsoProfile.js new file mode 100644 index 0000000000..e477d8e377 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/isSsoProfile.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSsoProfile = void 0; +const isSsoProfile = (arg) => arg && + (typeof arg.sso_start_url === "string" || + typeof arg.sso_account_id === "string" || + typeof arg.sso_session === "string" || + typeof arg.sso_region === "string" || + typeof arg.sso_role_name === "string"); +exports.isSsoProfile = isSsoProfile; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/resolveSSOCredentials.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/resolveSSOCredentials.js new file mode 100644 index 0000000000..6ff23df8f2 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/resolveSSOCredentials.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveSSOCredentials = void 0; +const client_sso_1 = require("@aws-sdk/client-sso"); +const property_provider_1 = require("@aws-sdk/property-provider"); +const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader"); +const token_providers_1 = require("@aws-sdk/token-providers"); +const EXPIRE_WINDOW_MS = 15 * 60 * 1000; +const SHOULD_FAIL_CREDENTIAL_CHAIN = false; +const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }) => { + let token; + const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; + if (ssoSession) { + try { + const _token = await (0, token_providers_1.fromSso)({ profile })(); + token = { + accessToken: _token.token, + expiresAt: new Date(_token.expiration).toISOString(), + }; + } + catch (e) { + throw new property_provider_1.CredentialsProviderError(e.message, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + } + else { + try { + token = await (0, shared_ini_file_loader_1.getSSOTokenFromFile)(ssoStartUrl); + } + catch (e) { + throw new property_provider_1.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + } + if (new Date(token.expiresAt).getTime() - Date.now() <= EXPIRE_WINDOW_MS) { + throw new property_provider_1.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + const { accessToken } = token; + const sso = ssoClient || new client_sso_1.SSOClient({ region: ssoRegion }); + let ssoResp; + try { + ssoResp = await sso.send(new client_sso_1.GetRoleCredentialsCommand({ + accountId: ssoAccountId, + roleName: ssoRoleName, + accessToken, + })); + } + catch (e) { + throw property_provider_1.CredentialsProviderError.from(e, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration } = {} } = ssoResp; + if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { + throw new property_provider_1.CredentialsProviderError("SSO returns an invalid temporary credential.", SHOULD_FAIL_CREDENTIAL_CHAIN); + } + return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration) }; +}; +exports.resolveSSOCredentials = resolveSSOCredentials; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/types.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/types.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/validateSsoProfile.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/validateSsoProfile.js new file mode 100644 index 0000000000..ba50677c68 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/validateSsoProfile.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateSsoProfile = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const validateSsoProfile = (profile) => { + const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile; + if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) { + throw new property_provider_1.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ` + + `"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, false); + } + return profile; +}; +exports.validateSsoProfile = validateSsoProfile; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js new file mode 100644 index 0000000000..da1f12e51c --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js @@ -0,0 +1,57 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { getProfileName, loadSsoSessionData, parseKnownFiles, } from "@aws-sdk/shared-ini-file-loader"; +import { isSsoProfile } from "./isSsoProfile"; +import { resolveSSOCredentials } from "./resolveSSOCredentials"; +import { validateSsoProfile } from "./validateSsoProfile"; +export const fromSSO = (init = {}) => async () => { + const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, ssoSession } = init; + const profileName = getProfileName(init); + if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { + const profiles = await parseKnownFiles(init); + const profile = profiles[profileName]; + if (!profile) { + throw new CredentialsProviderError(`Profile ${profileName} was not found.`); + } + if (!isSsoProfile(profile)) { + throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`); + } + if (profile?.sso_session) { + const ssoSessions = await loadSsoSessionData(init); + const session = ssoSessions[profile.sso_session]; + const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`; + if (ssoRegion && ssoRegion !== session.sso_region) { + throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, false); + } + if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { + throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, false); + } + profile.sso_region = session.sso_region; + profile.sso_start_url = session.sso_start_url; + } + const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile); + return resolveSSOCredentials({ + ssoStartUrl: sso_start_url, + ssoSession: sso_session, + ssoAccountId: sso_account_id, + ssoRegion: sso_region, + ssoRoleName: sso_role_name, + ssoClient: ssoClient, + profile: profileName, + }); + } + else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { + throw new CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + + '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"'); + } + else { + return resolveSSOCredentials({ + ssoStartUrl, + ssoSession, + ssoAccountId, + ssoRegion, + ssoRoleName, + ssoClient, + profile: profileName, + }); + } +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js new file mode 100644 index 0000000000..7215fb6870 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js @@ -0,0 +1,4 @@ +export * from "./fromSSO"; +export * from "./isSsoProfile"; +export * from "./types"; +export * from "./validateSsoProfile"; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js new file mode 100644 index 0000000000..e6554380e8 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js @@ -0,0 +1,6 @@ +export const isSsoProfile = (arg) => arg && + (typeof arg.sso_start_url === "string" || + typeof arg.sso_account_id === "string" || + typeof arg.sso_session === "string" || + typeof arg.sso_region === "string" || + typeof arg.sso_role_name === "string"); diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js new file mode 100644 index 0000000000..a574274e5c --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js @@ -0,0 +1,51 @@ +import { GetRoleCredentialsCommand, SSOClient } from "@aws-sdk/client-sso"; +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { getSSOTokenFromFile } from "@aws-sdk/shared-ini-file-loader"; +import { fromSso as getSsoTokenProvider } from "@aws-sdk/token-providers"; +const EXPIRE_WINDOW_MS = 15 * 60 * 1000; +const SHOULD_FAIL_CREDENTIAL_CHAIN = false; +export const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }) => { + let token; + const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; + if (ssoSession) { + try { + const _token = await getSsoTokenProvider({ profile })(); + token = { + accessToken: _token.token, + expiresAt: new Date(_token.expiration).toISOString(), + }; + } + catch (e) { + throw new CredentialsProviderError(e.message, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + } + else { + try { + token = await getSSOTokenFromFile(ssoStartUrl); + } + catch (e) { + throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + } + if (new Date(token.expiresAt).getTime() - Date.now() <= EXPIRE_WINDOW_MS) { + throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + const { accessToken } = token; + const sso = ssoClient || new SSOClient({ region: ssoRegion }); + let ssoResp; + try { + ssoResp = await sso.send(new GetRoleCredentialsCommand({ + accountId: ssoAccountId, + roleName: ssoRoleName, + accessToken, + })); + } + catch (e) { + throw CredentialsProviderError.from(e, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration } = {} } = ssoResp; + if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { + throw new CredentialsProviderError("SSO returns an invalid temporary credential.", SHOULD_FAIL_CREDENTIAL_CHAIN); + } + return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration) }; +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js new file mode 100644 index 0000000000..72ef24c80f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js @@ -0,0 +1,9 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +export const validateSsoProfile = (profile) => { + const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile; + if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) { + throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ` + + `"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, false); + } + return profile; +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/fromSSO.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/fromSSO.d.ts new file mode 100644 index 0000000000..3fd1e4ae33 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/fromSSO.d.ts @@ -0,0 +1,59 @@ +import { SSOClient } from "@aws-sdk/client-sso"; +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface SsoCredentialsParameters { + /** + * The URL to the AWS SSO service. + */ + ssoStartUrl: string; + /** + * SSO session identifier. + * Presence implies usage of the SSOTokenProvider. + */ + ssoSession?: string; + /** + * The ID of the AWS account to use for temporary credentials. + */ + ssoAccountId: string; + /** + * The AWS region to use for temporary credentials. + */ + ssoRegion: string; + /** + * The name of the AWS role to assume. + */ + ssoRoleName: string; +} +export interface FromSSOInit extends SourceProfileInit { + ssoClient?: SSOClient; +} +/** + * Creates a credential provider that will read from a credential_process specified + * in ini files. + * + * The SSO credential provider must support both + * + * 1. the legacy profile format, + * @example + * ``` + * [profile sample-profile] + * sso_account_id = 012345678901 + * sso_region = us-east-1 + * sso_role_name = SampleRole + * sso_start_url = https://www.....com/start + * ``` + * + * 2. and the profile format for SSO Token Providers. + * @example + * ``` + * [profile sso-profile] + * sso_session = dev + * sso_account_id = 012345678901 + * sso_role_name = SampleRole + * + * [sso-session dev] + * sso_region = us-east-1 + * sso_start_url = https://www.....com/start + * ``` + */ +export declare const fromSSO: (init?: FromSSOInit & Partial) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/index.d.ts new file mode 100644 index 0000000000..7215fb6870 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/index.d.ts @@ -0,0 +1,4 @@ +export * from "./fromSSO"; +export * from "./isSsoProfile"; +export * from "./types"; +export * from "./validateSsoProfile"; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/isSsoProfile.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/isSsoProfile.d.ts new file mode 100644 index 0000000000..b7cf35cb0d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/isSsoProfile.d.ts @@ -0,0 +1,6 @@ +import { Profile } from "@aws-sdk/types"; +import { SsoProfile } from "./types"; +/** + * @internal + */ +export declare const isSsoProfile: (arg: Profile) => arg is Partial; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/resolveSSOCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/resolveSSOCredentials.d.ts new file mode 100644 index 0000000000..38d75d1b7a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/resolveSSOCredentials.d.ts @@ -0,0 +1,6 @@ +import { AwsCredentialIdentity } from "@aws-sdk/types"; +import { FromSSOInit, SsoCredentialsParameters } from "./fromSSO"; +/** + * @private + */ +export declare const resolveSSOCredentials: ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }: FromSSOInit & SsoCredentialsParameters) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/fromSSO.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/fromSSO.d.ts new file mode 100644 index 0000000000..84c81d536a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/fromSSO.d.ts @@ -0,0 +1,16 @@ +import { SSOClient } from "@aws-sdk/client-sso"; +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface SsoCredentialsParameters { + ssoStartUrl: string; + ssoSession?: string; + ssoAccountId: string; + ssoRegion: string; + ssoRoleName: string; +} +export interface FromSSOInit extends SourceProfileInit { + ssoClient?: SSOClient; +} +export declare const fromSSO: ( + init?: FromSSOInit & Partial +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..7215fb6870 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/index.d.ts @@ -0,0 +1,4 @@ +export * from "./fromSSO"; +export * from "./isSsoProfile"; +export * from "./types"; +export * from "./validateSsoProfile"; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/isSsoProfile.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/isSsoProfile.d.ts new file mode 100644 index 0000000000..36846dd879 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/isSsoProfile.d.ts @@ -0,0 +1,3 @@ +import { Profile } from "@aws-sdk/types"; +import { SsoProfile } from "./types"; +export declare const isSsoProfile: (arg: Profile) => arg is Partial; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/resolveSSOCredentials.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/resolveSSOCredentials.d.ts new file mode 100644 index 0000000000..6be8ae5876 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/resolveSSOCredentials.d.ts @@ -0,0 +1,11 @@ +import { AwsCredentialIdentity } from "@aws-sdk/types"; +import { FromSSOInit, SsoCredentialsParameters } from "./fromSSO"; +export declare const resolveSSOCredentials: ({ + ssoStartUrl, + ssoSession, + ssoAccountId, + ssoRegion, + ssoRoleName, + ssoClient, + profile, +}: FromSSOInit & SsoCredentialsParameters) => Promise; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/types.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/types.d.ts new file mode 100644 index 0000000000..c49761d4a1 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/types.d.ts @@ -0,0 +1,14 @@ +import { Profile } from "@aws-sdk/types"; +export interface SSOToken { + accessToken: string; + expiresAt: string; + region?: string; + startUrl?: string; +} +export interface SsoProfile extends Profile { + sso_start_url: string; + sso_session?: string; + sso_account_id: string; + sso_region: string; + sso_role_name: string; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/validateSsoProfile.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/validateSsoProfile.d.ts new file mode 100644 index 0000000000..67fa8639dc --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/ts3.4/validateSsoProfile.d.ts @@ -0,0 +1,4 @@ +import { SsoProfile } from "./types"; +export declare const validateSsoProfile: ( + profile: Partial +) => SsoProfile; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/types.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/types.d.ts new file mode 100644 index 0000000000..1440ac4c4d --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/types.d.ts @@ -0,0 +1,20 @@ +import { Profile } from "@aws-sdk/types"; +/** + * Cached SSO token retrieved from SSO login flow. + */ +export interface SSOToken { + accessToken: string; + expiresAt: string; + region?: string; + startUrl?: string; +} +/** + * @internal + */ +export interface SsoProfile extends Profile { + sso_start_url: string; + sso_session?: string; + sso_account_id: string; + sso_region: string; + sso_role_name: string; +} diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/validateSsoProfile.d.ts b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/validateSsoProfile.d.ts new file mode 100644 index 0000000000..eddea0cb30 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/dist-types/validateSsoProfile.d.ts @@ -0,0 +1,5 @@ +import { SsoProfile } from "./types"; +/** + * @internal + */ +export declare const validateSsoProfile: (profile: Partial) => SsoProfile; diff --git a/server/node_modules/@aws-sdk/credential-provider-sso/package.json b/server/node_modules/@aws-sdk/credential-provider-sso/package.json new file mode 100644 index 0000000000..4d319e3a62 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-sso/package.json @@ -0,0 +1,63 @@ +{ + "name": "@aws-sdk/credential-provider-sso", + "version": "3.264.0", + "description": "AWS credential provider that exchanges a resolved SSO login token file for temporary AWS credentials", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "credentials" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.264.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/token-providers": "3.264.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/master/packages/credential-provider-sso", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/credential-provider-sso" + } +} diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/LICENSE b/server/node_modules/@aws-sdk/credential-provider-web-identity/LICENSE new file mode 100644 index 0000000000..f9a667398b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/README.md b/server/node_modules/@aws-sdk/credential-provider-web-identity/README.md new file mode 100644 index 0000000000..e4858a41b1 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/README.md @@ -0,0 +1,11 @@ +# @aws-sdk/credential-provider-web-identity + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-provider-web-identity/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-web-identity) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-provider-web-identity.svg)](https://www.npmjs.com/package/@aws-sdk/credential-provider-web-identity) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers) +instead. diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js new file mode 100644 index 0000000000..6fe0d5fb45 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromTokenFile = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const fs_1 = require("fs"); +const fromWebToken_1 = require("./fromWebToken"); +const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; +const ENV_ROLE_ARN = "AWS_ROLE_ARN"; +const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; +const fromTokenFile = (init = {}) => async () => { + return resolveTokenFile(init); +}; +exports.fromTokenFile = fromTokenFile; +const resolveTokenFile = (init) => { + var _a, _b, _c; + const webIdentityTokenFile = (_a = init === null || init === void 0 ? void 0 : init.webIdentityTokenFile) !== null && _a !== void 0 ? _a : process.env[ENV_TOKEN_FILE]; + const roleArn = (_b = init === null || init === void 0 ? void 0 : init.roleArn) !== null && _b !== void 0 ? _b : process.env[ENV_ROLE_ARN]; + const roleSessionName = (_c = init === null || init === void 0 ? void 0 : init.roleSessionName) !== null && _c !== void 0 ? _c : process.env[ENV_ROLE_SESSION_NAME]; + if (!webIdentityTokenFile || !roleArn) { + throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified"); + } + return (0, fromWebToken_1.fromWebToken)({ + ...init, + webIdentityToken: (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), + roleArn, + roleSessionName, + })(); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js new file mode 100644 index 0000000000..75675c709c --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromWebToken = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const fromWebToken = (init) => () => { + const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds, roleAssumerWithWebIdentity, } = init; + if (!roleAssumerWithWebIdentity) { + throw new property_provider_1.CredentialsProviderError(`Role Arn '${roleArn}' needs to be assumed with web identity,` + + ` but no role assumption callback was provided.`, false); + } + return roleAssumerWithWebIdentity({ + RoleArn: roleArn, + RoleSessionName: roleSessionName !== null && roleSessionName !== void 0 ? roleSessionName : `aws-sdk-js-session-${Date.now()}`, + WebIdentityToken: webIdentityToken, + ProviderId: providerId, + PolicyArns: policyArns, + Policy: policy, + DurationSeconds: durationSeconds, + }); +}; +exports.fromWebToken = fromWebToken; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js new file mode 100644 index 0000000000..2470bd90c4 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromTokenFile"), exports); +tslib_1.__exportStar(require("./fromWebToken"), exports); diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js new file mode 100644 index 0000000000..4e7a0605bc --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js @@ -0,0 +1,23 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { readFileSync } from "fs"; +import { fromWebToken } from "./fromWebToken"; +const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; +const ENV_ROLE_ARN = "AWS_ROLE_ARN"; +const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; +export const fromTokenFile = (init = {}) => async () => { + return resolveTokenFile(init); +}; +const resolveTokenFile = (init) => { + const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE]; + const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN]; + const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME]; + if (!webIdentityTokenFile || !roleArn) { + throw new CredentialsProviderError("Web identity configuration not specified"); + } + return fromWebToken({ + ...init, + webIdentityToken: readFileSync(webIdentityTokenFile, { encoding: "ascii" }), + roleArn, + roleSessionName, + })(); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js new file mode 100644 index 0000000000..2a9eaf5556 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js @@ -0,0 +1,17 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +export const fromWebToken = (init) => () => { + const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds, roleAssumerWithWebIdentity, } = init; + if (!roleAssumerWithWebIdentity) { + throw new CredentialsProviderError(`Role Arn '${roleArn}' needs to be assumed with web identity,` + + ` but no role assumption callback was provided.`, false); + } + return roleAssumerWithWebIdentity({ + RoleArn: roleArn, + RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`, + WebIdentityToken: webIdentityToken, + ProviderId: providerId, + PolicyArns: policyArns, + Policy: policy, + DurationSeconds: durationSeconds, + }); +}; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js new file mode 100644 index 0000000000..0e900c0a13 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js @@ -0,0 +1,2 @@ +export * from "./fromTokenFile"; +export * from "./fromWebToken"; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromTokenFile.d.ts b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromTokenFile.d.ts new file mode 100644 index 0000000000..e636a0d334 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromTokenFile.d.ts @@ -0,0 +1,12 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +import { FromWebTokenInit } from "./fromWebToken"; +export interface FromTokenFileInit extends Partial> { + /** + * File location of where the `OIDC` token is stored. + */ + webIdentityTokenFile?: string; +} +/** + * Represents OIDC credentials from a file on disk. + */ +export declare const fromTokenFile: (init?: FromTokenFileInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts new file mode 100644 index 0000000000..43b35b7397 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/fromWebToken.d.ts @@ -0,0 +1,126 @@ +import { AwsCredentialIdentity, AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface AssumeRoleWithWebIdentityParams { + /** + *

The Amazon Resource Name (ARN) of the role that the caller is assuming.

+ */ + RoleArn: string; + /** + *

An identifier for the assumed role session. Typically, you pass the name or identifier + * that is associated with the user who is using your application. That way, the temporary + * security credentials that your application will use are associated with that user. This + * session name is included as part of the ARN and assumed role ID in the + * AssumedRoleUser response element.

+ *

The regex used to validate this parameter is a string of characters + * consisting of upper- and lower-case alphanumeric characters with no spaces. You can + * also include underscores or any of the following characters: =,.@-

+ */ + RoleSessionName: string; + /** + *

The OAuth 2.0 access token or OpenID Connect ID token that is provided by the identity + * provider. Your application must get this token by authenticating the user who is using your + * application with a web identity provider before the application makes an + * AssumeRoleWithWebIdentity call.

+ */ + WebIdentityToken: string; + /** + *

The fully qualified host component of the domain name of the identity provider.

+ *

Specify this value only for OAuth 2.0 access tokens. Currently + * www.amazon.com and graph.facebook.com are the only supported + * identity providers for OAuth 2.0 access tokens. Do not include URL schemes and port + * numbers.

+ *

Do not specify this value for OpenID Connect ID tokens.

+ */ + ProviderId?: string; + /** + *

The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as + * managed session policies. The policies must exist in the same account as the role.

+ *

This parameter is optional. You can provide up to 10 managed policy ARNs. However, the + * plain text that you use for both inline and managed session policies can't exceed 2,048 + * characters. For more information about ARNs, see Amazon Resource Names (ARNs) and AWS + * Service Namespaces in the AWS General Reference.

+ * + *

An AWS conversion compresses the passed session policies and session tags into a + * packed binary format that has a separate limit. Your request can fail for this limit + * even if your plain text meets the other requirements. The PackedPolicySize + * response element indicates by percentage how close the policies and tags for your + * request are to the upper size limit. + *

+ *
+ * + *

Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent AWS API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ */ + PolicyArns?: { + arn?: string; + }[]; + /** + *

An IAM policy in JSON format that you want to use as an inline session policy.

+ *

This parameter is optional. Passing policies to this operation returns new + * temporary credentials. The resulting session's permissions are the intersection of the + * role's identity-based policy and the session policies. You can use the role's temporary + * credentials in subsequent AWS API calls to access resources in the account that owns + * the role. You cannot use session policies to grant more permissions than those allowed + * by the identity-based policy of the role that is being assumed. For more information, see + * Session + * Policies in the IAM User Guide.

+ *

The plain text that you use for both inline and managed session policies can't exceed + * 2,048 characters. The JSON policy characters can be any ASCII character from the space + * character to the end of the valid character list (\u0020 through \u00FF). It can also + * include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) + * characters.

+ * + *

An AWS conversion compresses the passed session policies and session tags into a + * packed binary format that has a separate limit. Your request can fail for this limit + * even if your plain text meets the other requirements. The PackedPolicySize + * response element indicates by percentage how close the policies and tags for your + * request are to the upper size limit. + *

+ *
+ */ + Policy?: string; + /** + *

The duration, in seconds, of the role session. The value can range from 900 seconds (15 + * minutes) up to the maximum session duration setting for the role. This setting can have a + * value from 1 hour to 12 hours. If you specify a value higher than this setting, the + * operation fails. For example, if you specify a session duration of 12 hours, but your + * administrator set the maximum session duration to 6 hours, your operation fails. To learn + * how to view the maximum value for your role, see View the + * Maximum Session Duration Setting for a Role in the + * IAM User Guide.

+ *

By default, the value is set to 3600 seconds.

+ * + *

The DurationSeconds parameter is separate from the duration of a console + * session that you might request using the returned credentials. The request to the + * federation endpoint for a console sign-in token takes a SessionDuration + * parameter that specifies the maximum length of the console session. For more + * information, see Creating a URL + * that Enables Federated Users to Access the AWS Management Console in the + * IAM User Guide.

+ *
+ */ + DurationSeconds?: number; +} +declare type LowerCaseKey = { + [K in keyof T as `${Uncapitalize}`]: T[K]; +}; +export interface FromWebTokenInit extends Omit, "roleSessionName"> { + /** + * The IAM session name used to distinguish sessions. + */ + roleSessionName?: string; + /** + * A function that assumes a role with web identity and returns a promise fulfilled with + * credentials for the assumed role. + * + * @param params input parameter of sts:AssumeRoleWithWebIdentity API. + */ + roleAssumerWithWebIdentity?: (params: AssumeRoleWithWebIdentityParams) => Promise; +} +export declare const fromWebToken: (init: FromWebTokenInit) => AwsCredentialIdentityProvider; +export {}; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/index.d.ts new file mode 100644 index 0000000000..0e900c0a13 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/index.d.ts @@ -0,0 +1,2 @@ +export * from "./fromTokenFile"; +export * from "./fromWebToken"; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromTokenFile.d.ts b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromTokenFile.d.ts new file mode 100644 index 0000000000..f7a7d40a87 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromTokenFile.d.ts @@ -0,0 +1,11 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +import { FromWebTokenInit } from "./fromWebToken"; +export interface FromTokenFileInit + extends Partial< + Pick> + > { + webIdentityTokenFile?: string; +} +export declare const fromTokenFile: ( + init?: FromTokenFileInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromWebToken.d.ts b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromWebToken.d.ts new file mode 100644 index 0000000000..82bce0a755 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/fromWebToken.d.ts @@ -0,0 +1,35 @@ +import { + AwsCredentialIdentity, + AwsCredentialIdentityProvider, +} from "@aws-sdk/types"; +export interface AssumeRoleWithWebIdentityParams { + RoleArn: string; + RoleSessionName: string; + WebIdentityToken: string; + ProviderId?: string; + PolicyArns?: { + arn?: string; + }[]; + Policy?: string; + DurationSeconds?: number; +} +declare type LowerCaseKey = { + [K in keyof T as `${Uncapitalize}`]: T[K]; +}; +export interface FromWebTokenInit + extends Pick< + LowerCaseKey, + Exclude< + keyof LowerCaseKey, + "roleSessionName" + > + > { + roleSessionName?: string; + roleAssumerWithWebIdentity?: ( + params: AssumeRoleWithWebIdentityParams + ) => Promise; +} +export declare const fromWebToken: ( + init: FromWebTokenInit +) => AwsCredentialIdentityProvider; +export {}; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..0e900c0a13 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export * from "./fromTokenFile"; +export * from "./fromWebToken"; diff --git a/server/node_modules/@aws-sdk/credential-provider-web-identity/package.json b/server/node_modules/@aws-sdk/credential-provider-web-identity/package.json new file mode 100644 index 0000000000..080b1a33fa --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-provider-web-identity/package.json @@ -0,0 +1,68 @@ +{ + "name": "@aws-sdk/credential-provider-web-identity", + "version": "3.257.0", + "description": "AWS credential provider that calls STS assumeRole for temporary AWS credentials", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "browser": { + "./dist-cjs/fromTokenFile": false, + "./dist-es/fromTokenFile": false + }, + "react-native": { + "./dist-es/fromTokenFile": false, + "./dist-cjs/fromTokenFile": false + }, + "keywords": [ + "aws", + "credentials" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/master/packages/credential-provider-web-identity", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/credential-provider-web-identity" + } +} diff --git a/server/node_modules/@aws-sdk/credential-providers/LICENSE b/server/node_modules/@aws-sdk/credential-providers/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/credential-providers/README.md b/server/node_modules/@aws-sdk/credential-providers/README.md new file mode 100644 index 0000000000..bfd469318c --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/README.md @@ -0,0 +1,692 @@ +# @aws-sdk/credential-providers + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-providers/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-providers) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-providers.svg)](https://www.npmjs.com/package/@aws-sdk/credential-providers) + +A collection of all credential providers, with default clients. + +# Table of Contents + +1. [From Cognito Identity](#fromcognitoidentity) +1. [From Cognito Identity Pool](#fromcognitoidentitypool) +1. [From Temporary Credentials](#fromtemporarycredentials) +1. [From Web Token](#fromwebtoken) + 1. [Examples](#examples) +1. [From Token File](#fromtokenfile) +1. [From Instance and Container Metadata Service](#fromcontainermetadata-and-frominstancemetadata) +1. [From Shared INI files](#fromini) + 1. [Sample Files](#sample-files) +1. [From Environmental Variables](#fromenv) +1. [From Credential Process](#fromprocess) + 1. [Sample files](#sample-files-1) +1. [From Single Sign-On Service](#fromsso) + 1. [Supported Configuration](#supported-configuration) + 1. [SSO login with AWS CLI](#sso-login-with-the-aws-cli) + 1. [Sample Files](#sample-files-2) +1. [From Node.js default credentials provider chain](#fromNodeProviderChain) + +## `fromCognitoIdentity()` + +The function `fromCognitoIdentity()` returns `CredentialsProvider` that retrieves credentials for +the provided identity ID. See [GetCredentialsForIdentity API][getcredentialsforidentity_api] +for more information. + +```javascript +import { fromCognitoIdentity } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromCognitoIdentity } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + region, + credentials: fromCognitoIdentity({ + // Required. The unique identifier for the identity against which credentials + // will be issued. + identityId: "us-east-1:128d0a74-c82f-4553-916d-90053example", + // Optional. The ARN of the role to be assumed when multiple roles were received in the token + // from the identity provider. + customRoleArn: "arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity", + // Optional. A set of name-value pairs that map provider names to provider tokens. + // Required when using identities associated with external identity providers such as Facebook. + logins: { + "graph.facebook.com": "FBTOKEN", + "www.amazon.com": "AMAZONTOKEN", + "accounts.google.com": "GOOGLETOKEN", + "api.twitter.com": "TWITTERTOKEN'", + "www.digits.com": "DIGITSTOKEN", + }, + // Optional. Custom client config if you need overwrite default Cognito Identity client + // configuration. + clientConfig: { region }, + }), +}); +``` + +## `fromCognitoIdentityPool()` + +The function `fromCognitoIdentityPool()` returns `AwsCredentialIdentityProvider` that calls [GetId API][getid_api] +to obtain an `identityId`, then generates temporary AWS credentials with +[GetCredentialsForIdentity API][getcredentialsforidentity_api], see +[`fromCognitoIdentity()`](#fromcognitoidentity). + +Results from `GetId` are cached internally, but results from `GetCredentialsForIdentity` are not. + +```javascript +import { fromCognitoIdentityPool } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromCognitoIdentityPool } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + region, + credentials: fromCognitoIdentityPool({ + // Required. The unique identifier for the identity pool from which an identity should be + // retrieved or generated. + identityPoolId: "us-east-1:1699ebc0-7900-4099-b910-2df94f52a030", + // Optional. A standard AWS account ID (9+ digits) + accountId: "123456789", + // Optional. A cache in which to store resolved Cognito IdentityIds. + cache: custom_storage, + // Optional. A unique identifier for the user used to cache Cognito IdentityIds on a per-user + // basis. + userIdentifier: "user_0", + // Optional. The ARN of the role to be assumed when multiple roles were received in the token + // from the identity provider. + customRoleArn: "arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity", + // Optional. A set of name-value pairs that map provider names to provider tokens. + // Required when using identities associated with external identity providers such as Facebook. + logins: { + "graph.facebook.com": "FBTOKEN", + "www.amazon.com": "AMAZONTOKEN", + "accounts.google.com": "GOOGLETOKEN", + "api.twitter.com": "TWITTERTOKEN", + "www.digits.com": "DIGITSTOKEN", + }, + // Optional. Custom client config if you need overwrite default Cognito Identity client + // configuration. + clientConfig: { region }, + }), +}); +``` + +## `fromTemporaryCredentials()` + +The function `fromTemporaryCredentials` returns `AwsCredentialIdentityProvider` that retrieves temporary +credentials from [STS AssumeRole API][assumerole_api]. + +```javascript +import { fromTemporaryCredentials } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromTemporaryCredentials } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + region, + credentials: fromTemporaryCredentials({ + // Optional. The master credentials used to get and refresh temporary credentials from AWS STS. + // If skipped, it uses the default credential resolved by internal STS client. + masterCredentials: fromTemporaryCredentials({ + params: { RoleArn: "arn:aws:iam::1234567890:role/RoleA" }, + }), + // Required. Options passed to STS AssumeRole operation. + params: { + // Required. ARN of role to assume. + RoleArn: "arn:aws:iam::1234567890:role/RoleB", + // Optional. An identifier for the assumed role session. If skipped, it generates a random + // session name with prefix of 'aws-sdk-js-'. + RoleSessionName: "aws-sdk-js-123", + // Optional. The duration, in seconds, of the role session. + DurationSeconds: 3600, + // ... For more options see https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html + }, + // Optional. Custom STS client configurations overriding the default ones. + clientConfig: { region }, + // Optional. A function that returns a promise fulfilled with an MFA token code for the provided + // MFA Serial code. Required if `params` has `SerialNumber` config. + mfaCodeProvider: async (mfaSerial) => { + return "token"; + }, + }), +}); +``` + +## `fromWebToken()` + +The function `fromWebToken` returns `AwsCredentialIdentityProvider` that gets credentials calling +[STS AssumeRoleWithWebIdentity API][assumerolewithwebidentity_api] + +```javascript +import { fromWebToken } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromWebToken } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + region, + credentials: fromWebToken({ + // Required. ARN of the role that the caller is assuming. + roleArn: "arn:aws:iam::1234567890:role/RoleA", + // Required. The OAuth 2.0 access token or OpenID Connect ID token that is provided by the + // identity provider. + webIdentityToken: await openIdProvider(), + // Optional. Custom STS client configurations overriding the default ones. + clientConfig: { region }, + // Optional. A function that assumes a role with web identity and returns a promise fulfilled + // with credentials for the assumed role. + roleAssumerWithWebIdentity, + // Optional. An identifier for the assumed role session. + roleSessionName: "session_123", + // Optional. The fully qualified host component of the domain name of the identity provider. + providerId: "graph.facebook.com", + // Optional. ARNs of the IAM managed policies that you want to use as managed session. + policyArns: [{ arn: "arn:aws:iam::1234567890:policy/SomePolicy" }], + // Optional. An IAM policy in JSON format that you want to use as an inline session policy. + policy: "JSON_STRING", + // Optional. The duration, in seconds, of the role session. Default to 3600. + durationSeconds: 7200, + }), +}); +``` + +### Examples + +You can directly configure individual identity providers to access AWS resources using web identity +federation. AWS currently supports authenticating users using web identity federation through +several identity providers: + +- [Login with Amazon](https://login.amazon.com/) + +- [Facebook Login](https://developers.facebook.com/docs/facebook-login/web/) + +- [Google Sign-in](https://developers.google.com/identity/) + +You must first register your application with the providers that your application supports. Next, +create an IAM role and set up permissions for it. The IAM role you create is then used to grant the +permissions you configured for it through the respective identity provider. For example, you can set +up a role that allows users who logged in through Facebook to have read access to a specific Amazon +S3 bucket you control. + +After you have both an IAM role with configured privileges and an application registered with your +chosen identity providers, you can set up the SDK to get credentials for the IAM role using helper +code, as follows: + +The value in the ProviderId parameter depends on the specified identity provider. The value in the +WebIdentityToken parameter is the access token retrieved from a successful login with the identity +provider. For more information on how to configure and retrieve access tokens for each identity +provider, see the documentation for the identity provider. + +## `fromContainerMetadata()` and `fromInstanceMetadata()` + +`fromContainerMetadata` and `fromInstanceMetadata` will create `AwsCredentialIdentityProvider` functions that +read from the ECS container metadata service and the EC2 instance metadata service, respectively. + +```javascript +import { fromInstanceMetadata } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromInstanceMetadata } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + credentials: fromInstanceMetadata({ + // Optional. The connection timeout (in milliseconds) to apply to any remote requests. + // If not specified, a default value of `1000` (one second) is used. + timeout: 1000, + // Optional. The maximum number of times any HTTP connections should be retried. If not + // specified, a default value of `0` will be used. + maxRetries: 0, + }), +}); +``` + +```javascript +import { fromContainerMetadata } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromContainerMetadata } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + credentials: fromContainerMetadata({ + // Optional. The connection timeout (in milliseconds) to apply to any remote requests. + // If not specified, a default value of `1000` (one second) is used. + timeout: 1000, + // Optional. The maximum number of times any HTTP connections should be retried. If not + // specified, a default value of `0` will be used. + maxRetries: 0, + }), +}); +``` + +A `AwsCredentialIdentityProvider` function created with `fromContainerMetadata` will return a promise that will +resolve with credentials for the IAM role associated with containers in an Amazon ECS task. Please +see [IAM Roles for Tasks][iam_roles_for_tasks] for more information on using IAM roles with Amazon +ECS. + +A `AwsCredentialIdentityProvider` function created with `fromInstanceMetadata` will return a promise that will +resolve with credentials for the IAM role associated with an EC2 instance. +Please see [IAM Roles for Amazon EC2][iam_roles_for_ec2] for more information on using IAM roles +with Amazon EC2. Both IMDSv1 (a request/response method) and IMDSv2 (a session-oriented method) are +supported. + +Please see [Configure the instance metadata service][config_instance_metadata] for more information. + +## `fromIni()` + +`fromIni` creates `AwsCredentialIdentityProvider` functions that read from a shared credentials file at +`~/.aws/credentials` and a shared configuration file at `~/.aws/config`. Both files are expected to +be INI formatted with section names corresponding to profiles. Sections in the credentials file are +treated as profile names, whereas profile sections in the config file must have the format of +`[profile profile-name]`, except for the default profile. Please see the +[sample files](#sample-files) below for examples of well-formed configuration and credentials files. + +Profiles that appear in both files will not be merged, and the version that appears in the +credentials file will be given precedence over the profile found in the config file. + +```javascript +import { fromIni } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromIni } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + credentials: fromIni({ + // Optional. The configuration profile to use. If not specified, the provider will use the value + // in the `AWS_PROFILE` environment variable or a default of `default`. + profile: "profile", + // Optional. The path to the shared credentials file. If not specified, the provider will use + // the value in the `AWS_SHARED_CREDENTIALS_FILE` environment variable or a default of + // `~/.aws/credentials`. + filepath: "~/.aws/credentials", + // Optional. The path to the shared config file. If not specified, the provider will use the + // value in the `AWS_CONFIG_FILE` environment variable or a default of `~/.aws/config`. + configFilepath: "~/.aws/config", + // Optional. A function that returns a a promise fulfilled with an MFA token code for the + // provided MFA Serial code. If a profile requires an MFA code and `mfaCodeProvider` is not a + // valid function, the credential provider promise will be rejected. + mfaCodeProvider: async (mfaSerial) => { + return "token"; + }, + // Optional. Custom STS client configurations overriding the default ones. + clientConfig: { region }, + }), +}); +``` + +### Sample files + +#### `~/.aws/credentials` + +```ini +[default] +aws_access_key_id=foo +aws_secret_access_key=bar + +[dev] +aws_access_key_id=foo2 +aws_secret_access_key=bar2 +``` + +#### `~/.aws/config` + +```ini +[default] +aws_access_key_id=foo +aws_secret_access_key=bar + +[profile dev] +aws_access_key_id=foo2 +aws_secret_access_key=bar2 +``` + +#### profile with source profile + +```ini +[second] +aws_access_key_id=foo +aws_secret_access_key=bar + +[first] +source_profile=second +role_arn=arn:aws:iam::123456789012:role/example-role-arn +``` + +#### profile with source provider + +You can supply `credential_source` options to tell the SDK where to source credentials for the call +to `AssumeRole`. The supported credential providers are listed below: + +```ini +[default] +role_arn=arn:aws:iam::123456789012:role/example-role-arn +credential_source = Ec2InstanceMetadata +``` + +```ini +[default] +role_arn=arn:aws:iam::123456789012:role/example-role-arn +credential_source = Environment +``` + +```ini +[default] +role_arn=arn:aws:iam::123456789012:role/example-role-arn +credential_source = EcsContainer +``` + +#### profile with web_identity_token_file + +```ini +[default] +web_identity_token_file=/temp/token +role_arn=arn:aws:iam::123456789012:role/example-role-arn +``` + +You can specify another profile(`second`) whose credentials are used to assume the role by the +`role_arn` setting in this profile(`first`). + +```ini +[second] +web_identity_token_file=/temp/token +role_arn=arn:aws:iam::123456789012:role/example-role-2 + +[first] +source_profile=second +role_arn=arn:aws:iam::123456789012:role/example-role +``` + +#### profile with sso credentials + +See [`fromSSO()`](#fromsso) fro more information + +## `fromEnv()` + +```javascript +import { fromEnv } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromEnv } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + credentials: fromEnv(), +}); +``` + +`fromEnv` returns a `AwsCredentialIdentityProvider` function, that reads credentials from the following +environment variables: + +- `AWS_ACCESS_KEY_ID` - The access key for your AWS account. +- `AWS_SECRET_ACCESS_KEY` - The secret key for your AWS account. +- `AWS_SESSION_TOKEN` - The session key for your AWS account. This is only needed when you are using + temporarycredentials. +- `AWS_CREDENTIAL_EXPIRATION` - The expiration time of the credentials contained in the environment + variables described above. This value must be in a format compatible with the + [ISO-8601 standard][iso8601_standard] and is only needed when you are using temporary credentials. + +If either the `AWS_ACCESS_KEY_ID` or `AWS_SECRET_ACCESS_KEY` environment variable is not set or +contains a falsy value, the promise returned by the `fromEnv` function will be rejected. + +## `fromProcess()` + +```javascript +import { fromProcess } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromProcess } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + credentials: fromProcess({ + // Optional. The configuration profile to use. If not specified, the provider will use the value + // in the `AWS_PROFILE` environment variable or a default of `default`. + profile: "profile", + // Optional. The path to the shared credentials file. If not specified, the provider will use + // the value in the `AWS_SHARED_CREDENTIALS_FILE` environment variable or a default of + // `~/.aws/credentials`. + filepath: "~/.aws/credentials", + // Optional. The path to the shared config file. If not specified, the provider will use the + // value in the `AWS_CONFIG_FILE` environment variable or a default of `~/.aws/config`. + configFilepath: "~/.aws/config", + }), +}); +``` + +`fromSharedConfigFiles` creates a `AwsCredentialIdentityProvider` functions that executes a given process and +attempt to read its standard output to receive a JSON payload containing the credentials. The +process command is read from a shared credentials file at `~/.aws/credentials` and a shared +configuration file at `~/.aws/config`. Both files are expected to be INI formatted with section +names corresponding to profiles. Sections in the credentials file are treated as profile names, +whereas profile sections in the config file must have the format of`[profile profile-name]`, except +for the default profile. Please see the [sample files](#sample-files-1) below for examples of +well-formed configuration and credentials files. + +Profiles that appear in both files will not be merged, and the version that appears in the +credentials file will be given precedence over the profile found in the config file. + +### Sample files + +#### `~/.aws/credentials` + +```ini +[default] +credential_process = /usr/local/bin/awscreds + +[dev] +credential_process = /usr/local/bin/awscreds dev +``` + +#### `~/.aws/config` + +```ini +[default] +credential_process = /usr/local/bin/awscreds + +[profile dev] +credential_process = /usr/local/bin/awscreds dev +``` + +## `fromTokenFile()` + +The function `fromTokenFile` returns `AwsCredentialIdentityProvider` that reads credentials as follows: + +- Reads file location of where the OIDC token is stored from either provided option + `webIdentityTokenFile` or environment variable `AWS_WEB_IDENTITY_TOKEN_FILE`. +- Reads IAM role wanting to be assumed from either provided option `roleArn` or environment + variable `AWS_ROLE_ARN`. +- Reads optional role session name to be used to distinguish sessions from provided option + `roleSessionName` or environment variable `AWS_ROLE_SESSION_NAME`. If session name is not defined, + it comes up with a role session name. +- Reads OIDC token from file on disk. +- Calls sts:AssumeRoleWithWebIdentity via `roleAssumerWithWebIdentity` option to get credentials. + +| **Configuration Key** | **Environment Variable** | **Required** | **Description** | +| --------------------- | --------------------------- | ------------ | ------------------------------------------------- | +| webIdentityTokenFile | AWS_WEB_IDENTITY_TOKEN_FILE | true | File location of where the `OIDC` token is stored | +| roleArn | AWS_IAM_ROLE_ARN | true | The IAM role wanting to be assumed | +| roleSessionName | AWS_IAM_ROLE_SESSION_NAME | false | The IAM session name used to distinguish sessions | + +```javascript +import { fromTokenFile } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromTokenFile } = require("@aws-sdk/credential-providers"); // CommonJS import + +const client = new FooClient({ + credentials: fromTokenFile({ + // Optional. STS client config to make the assume role request. + clientConfig: { region } + }); +}); +``` + +## `fromSSO()` + +> This credential provider **ONLY** supports profiles using the SSO credential. If you have a +> profile that assumes a role which derived from the SSO credential, you should use the +> [`fromIni()`](#fromini), or `@aws-sdk/credential-provider-node` package. + +`fromSSO`, that creates `AwsCredentialIdentityProvider` functions that read from the _resolved_ access token +from local disk then requests temporary AWS credentials. For guidance on the AWS Single Sign-On +service, please refer to [AWS's Single Sign-On documentation][sso_api]. + +You can create the `AwsCredentialIdentityProvider` functions using the inline SSO parameters(`ssoStartUrl`, +`ssoAccountId`, `ssoRegion`, `ssoRoleName`) or load them from +[AWS SDKs and Tools shared configuration and credentials files][shared_config_files]. +Profiles in the `credentials` file are given precedence over profiles in the `config` file. + +This credential provider is intended for use with the AWS SDK for Node.js. + +### Supported configuration + +You may customize how credentials are resolved by providing an options hash to the `fromSSO` factory +function. You can either load the SSO config from shared INI credential files, or specify the +`ssoStartUrl`, `ssoAccountId`, `ssoRegion`, and `ssoRoleName` directly from the code. + +```javascript +import { fromSSO } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromSSO } = require(@aws-sdk/credential-providers") // CommonJS import + +const client = new FooClient({ + credentials: fromSSO({ + // Optional. The configuration profile to use. If not specified, the provider will use the value + // in the `AWS_PROFILE` environment variable or `default` by default. + profile: "my-sso-profile", + // Optional. The path to the shared credentials file. If not specified, the provider will use + // the value in the `AWS_SHARED_CREDENTIALS_FILE` environment variable or a default of + // `~/.aws/credentials`. + filepath: "~/.aws/credentials", + // Optional. The path to the shared config file. If not specified, the provider will use the + // value in the `AWS_CONFIG_FILE` environment variable or a default of `~/.aws/config`. + configFilepath: "~/.aws/config", + // Optional. The URL to the AWS SSO service. Required if any of the `sso*` options(except for + // `ssoClient`) is provided. + ssoStartUrl: "https://d-abc123.awsapps.com/start", + // Optional. The ID of the AWS account to use for temporary credentials. Required if any of the + // `sso*` options(except for `ssoClient`) is provided. + ssoAccountId: "1234567890", + // Optional. The AWS region to use for temporary credentials. Required if any of the `sso*` + // options(except for `ssoClient`) is provided. + ssoRegion: "us-east-1", + // Optional. The name of the AWS role to assume. Required if any of the `sso*` options(except + // for `ssoClient`) is provided. + ssoRoleName: "SampleRole", + // Optional. Overwrite the configuration used construct the SSO service client. If not + // specified, a default SSO client will be created with the region specified in the profile + // `sso_region` entry. + clientConfig: { region }, + }), +}); +``` + +### SSO Login with the AWS CLI + +This credential provider relies on the [AWS CLI][cli_sso] to log into an AWS SSO session. Here's a +brief walk-through: + +1. Create a new AWS SSO enabled profile using the AWS CLI. It will ask you to login to your AWS SSO + account and prompt for the name of the profile: + +```console +$ aws configure sso +... +... +CLI profile name [123456789011_ReadOnly]: my-sso-profile +``` + +2. Configure your SDK client with the SSO credential provider: + +```javascript +//... +const client = new FooClient({ credentials: fromSSO({ profile: "my-sso-profile" }); +``` + +Alternatively, the SSO credential provider is supported in shared INI credentials provider + +```javascript +//... +const client = new FooClient({ credentials: fromIni({ profile: "my-sso-profile" }); +``` + +3. To log out from the current SSO session, use the AWS CLI: + +```console +$ aws sso logout +Successfully signed out of all SSO profiles. +``` + +### Sample files + +This credential provider is only applicable if the profile specified in shared configuration and +credentials files contain ALL of the following entries. + +#### `~/.aws/credentials` + +```ini +[sample-profile] +sso_account_id = 012345678901 +sso_region = us-east-1 +sso_role_name = SampleRole +sso_start_url = https://d-abc123.awsapps.com/start +``` + +#### `~/.aws/config` + +```ini +[profile sample-profile] +sso_account_id = 012345678901 +sso_region = us-east-1 +sso_role_name = SampleRole +sso_start_url = https://d-abc123.awsapps.com/start +``` + +## `fromNodeProviderChain()` + +The credential provider used as default in the Node.js clients, but with default role assumers so +you don't need to import them from STS client and supply them manually. You normally don't need +to use this explicitly in the client constructor. It is useful for utility functions requiring +credentials like S3 presigner, or RDS signer. + +This credential provider will attempt to find credentials from the following sources (listed in +order of precedence): + +- [Environment variables exposed via `process.env`](#fromenv) +- [SSO credentials from token cache](#fromsso) +- [Web identity token credentials](#fromtokenfile) +- [Shared credentials and config ini files](#fromini) +- [The EC2/ECS Instance Metadata Service](#fromcontainermetadata-and-frominstancemetadata) + +This credential provider will invoke one provider at a time and only +continue to the next if no credentials have been located. For example, if +the process finds values defined via the `AWS_ACCESS_KEY_ID` and +`AWS_SECRET_ACCESS_KEY` environment variables, the files at +`~/.aws/credentials` and `~/.aws/config` will not be read, nor will any +messages be sent to the Instance Metadata Service + +```js +import { fromNodeProviderChain } from "@aws-sdk/credential-providers"; // ES6 import +// const { fromNodeProviderChain } = require("@aws-sdk/credential-providers") // CommonJS import +const credentialProvider = fromNodeProviderChain({ + //...any input of fromEnv(), fromSSO(), fromTokenFile(), fromIni(), + // fromProcess(), fromInstanceMetadata(), fromContainerMetadata() + // Optional. Custom STS client configurations overriding the default ones. + clientConfig: { region }, +}); +``` + +## Add Custom Headers to STS assume-role calls + +You can specify the plugins--groups of middleware, to inject to the STS client. +For example, you can inject custom headers to each STS assume-role calls. It's +available in [`fromTemporaryCredentials()`](#fromtemporarycredentials), +[`fromWebToken()`](#fromwebtoken), [`fromTokenFile()`](#fromtokenfile), [`fromIni()`](#fromini). + +Code example: + +```javascript +const addConfusedDeputyMiddleware = (next) => (args) => { + args.request.headers["x-amz-source-account"] = account; + args.request.headers["x-amz-source-arn"] = sourceArn; + return next(args); +}; +const confusedDeputyPlugin = { + applyToStack: (stack) => { + stack.add(addConfusedDeputyMiddleware, { step: "finalizeRequest" }); + }, +}; +const provider = fromTemporaryCredentials({ + // Required. Options passed to STS AssumeRole operation. + params: { + RoleArn: "arn:aws:iam::1234567890:role/Role", + }, + clientPlugins: [confusedDeputyPlugin], +}); +``` + +[getcredentialsforidentity_api]: https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html +[getid_api]: https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetId.html +[assumerole_api]: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html +[assumerolewithwebidentity_api]: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html +[iam_roles_for_tasks]: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html +[iam_roles_for_ec2]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html +[config_instance_metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html +[iso8601_standard]: https://en.wikipedia.org/wiki/ISO_8601 +[sso_api]: https://aws.amazon.com/single-sign-on/ +[shared_config_files]: https://docs.aws.amazon.com/credref/latest/refdocs/creds-config-files.html +[cli_sso]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html#sso-configure-profile diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentity.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentity.js new file mode 100644 index 0000000000..e1ff0e0858 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentity.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromCognitoIdentity = void 0; +const client_cognito_identity_1 = require("@aws-sdk/client-cognito-identity"); +const credential_provider_cognito_identity_1 = require("@aws-sdk/credential-provider-cognito-identity"); +const fromCognitoIdentity = (options) => { + var _a; + return (0, credential_provider_cognito_identity_1.fromCognitoIdentity)({ + ...options, + client: new client_cognito_identity_1.CognitoIdentityClient((_a = options.clientConfig) !== null && _a !== void 0 ? _a : {}), + }); +}; +exports.fromCognitoIdentity = fromCognitoIdentity; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentityPool.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentityPool.js new file mode 100644 index 0000000000..e8d12c96b8 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentityPool.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromCognitoIdentityPool = void 0; +const client_cognito_identity_1 = require("@aws-sdk/client-cognito-identity"); +const credential_provider_cognito_identity_1 = require("@aws-sdk/credential-provider-cognito-identity"); +const fromCognitoIdentityPool = (options) => { + var _a; + return (0, credential_provider_cognito_identity_1.fromCognitoIdentityPool)({ + ...options, + client: new client_cognito_identity_1.CognitoIdentityClient((_a = options.clientConfig) !== null && _a !== void 0 ? _a : {}), + }); +}; +exports.fromCognitoIdentityPool = fromCognitoIdentityPool; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromContainerMetadata.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromContainerMetadata.js new file mode 100644 index 0000000000..fdf0422321 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromContainerMetadata.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromContainerMetadata = void 0; +const credential_provider_imds_1 = require("@aws-sdk/credential-provider-imds"); +const fromContainerMetadata = (init) => (0, credential_provider_imds_1.fromContainerMetadata)(init); +exports.fromContainerMetadata = fromContainerMetadata; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromEnv.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromEnv.js new file mode 100644 index 0000000000..c1bb3ba75b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromEnv.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromEnv = void 0; +const credential_provider_env_1 = require("@aws-sdk/credential-provider-env"); +const fromEnv = () => (0, credential_provider_env_1.fromEnv)(); +exports.fromEnv = fromEnv; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromIni.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromIni.js new file mode 100644 index 0000000000..a52c438f98 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromIni.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromIni = void 0; +const client_sts_1 = require("@aws-sdk/client-sts"); +const credential_provider_ini_1 = require("@aws-sdk/credential-provider-ini"); +const fromIni = (init = {}) => { + var _a, _b; + return (0, credential_provider_ini_1.fromIni)({ + ...init, + roleAssumer: (_a = init.roleAssumer) !== null && _a !== void 0 ? _a : (0, client_sts_1.getDefaultRoleAssumer)(init.clientConfig, init.clientPlugins), + roleAssumerWithWebIdentity: (_b = init.roleAssumerWithWebIdentity) !== null && _b !== void 0 ? _b : (0, client_sts_1.getDefaultRoleAssumerWithWebIdentity)(init.clientConfig, init.clientPlugins), + }); +}; +exports.fromIni = fromIni; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromInstanceMetadata.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromInstanceMetadata.js new file mode 100644 index 0000000000..1481c7e1e1 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromInstanceMetadata.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromInstanceMetadata = void 0; +const credential_provider_imds_1 = require("@aws-sdk/credential-provider-imds"); +const fromInstanceMetadata = (init) => (0, credential_provider_imds_1.fromInstanceMetadata)(init); +exports.fromInstanceMetadata = fromInstanceMetadata; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromNodeProviderChain.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromNodeProviderChain.js new file mode 100644 index 0000000000..e04e1949ea --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromNodeProviderChain.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromNodeProviderChain = void 0; +const client_sts_1 = require("@aws-sdk/client-sts"); +const credential_provider_node_1 = require("@aws-sdk/credential-provider-node"); +const fromNodeProviderChain = (init = {}) => { + var _a, _b; + return (0, credential_provider_node_1.defaultProvider)({ + ...init, + roleAssumer: (_a = init.roleAssumer) !== null && _a !== void 0 ? _a : (0, client_sts_1.getDefaultRoleAssumer)(init.clientConfig, init.clientPlugins), + roleAssumerWithWebIdentity: (_b = init.roleAssumerWithWebIdentity) !== null && _b !== void 0 ? _b : (0, client_sts_1.getDefaultRoleAssumerWithWebIdentity)(init.clientConfig, init.clientPlugins), + }); +}; +exports.fromNodeProviderChain = fromNodeProviderChain; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromProcess.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromProcess.js new file mode 100644 index 0000000000..58a65abda4 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromProcess.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromProcess = void 0; +const credential_provider_process_1 = require("@aws-sdk/credential-provider-process"); +const fromProcess = (init) => (0, credential_provider_process_1.fromProcess)(init); +exports.fromProcess = fromProcess; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromSSO.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromSSO.js new file mode 100644 index 0000000000..980e8915d4 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromSSO.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromSSO = void 0; +const client_sso_1 = require("@aws-sdk/client-sso"); +const credential_provider_sso_1 = require("@aws-sdk/credential-provider-sso"); +const fromSSO = (init = {}) => (0, credential_provider_sso_1.fromSSO)({ ...{ ssoClient: init.clientConfig ? new client_sso_1.SSOClient(init.clientConfig) : undefined }, ...init }); +exports.fromSSO = fromSSO; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.js new file mode 100644 index 0000000000..50e89b67c7 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromTemporaryCredentials = void 0; +const client_sts_1 = require("@aws-sdk/client-sts"); +const property_provider_1 = require("@aws-sdk/property-provider"); +const fromTemporaryCredentials = (options) => { + let stsClient; + return async () => { + var _a; + const params = { ...options.params, RoleSessionName: (_a = options.params.RoleSessionName) !== null && _a !== void 0 ? _a : "aws-sdk-js-" + Date.now() }; + if (params === null || params === void 0 ? void 0 : params.SerialNumber) { + if (!options.mfaCodeProvider) { + throw new property_provider_1.CredentialsProviderError(`Temporary credential requires multi-factor authentication,` + ` but no MFA code callback was provided.`, false); + } + params.TokenCode = await options.mfaCodeProvider(params === null || params === void 0 ? void 0 : params.SerialNumber); + } + if (!stsClient) + stsClient = new client_sts_1.STSClient({ ...options.clientConfig, credentials: options.masterCredentials }); + if (options.clientPlugins) { + for (const plugin of options.clientPlugins) { + stsClient.middlewareStack.use(plugin); + } + } + const { Credentials } = await stsClient.send(new client_sts_1.AssumeRoleCommand(params)); + if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { + throw new property_provider_1.CredentialsProviderError(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); + } + return { + accessKeyId: Credentials.AccessKeyId, + secretAccessKey: Credentials.SecretAccessKey, + sessionToken: Credentials.SessionToken, + expiration: Credentials.Expiration, + }; + }; +}; +exports.fromTemporaryCredentials = fromTemporaryCredentials; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js new file mode 100644 index 0000000000..9718585a00 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromTokenFile = void 0; +const client_sts_1 = require("@aws-sdk/client-sts"); +const credential_provider_web_identity_1 = require("@aws-sdk/credential-provider-web-identity"); +const fromTokenFile = (init = {}) => { + var _a; + return (0, credential_provider_web_identity_1.fromTokenFile)({ + ...init, + roleAssumerWithWebIdentity: (_a = init.roleAssumerWithWebIdentity) !== null && _a !== void 0 ? _a : (0, client_sts_1.getDefaultRoleAssumerWithWebIdentity)(init.clientConfig, init.clientPlugins), + }); +}; +exports.fromTokenFile = fromTokenFile; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js new file mode 100644 index 0000000000..50a6206b44 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromWebToken = void 0; +const client_sts_1 = require("@aws-sdk/client-sts"); +const credential_provider_web_identity_1 = require("@aws-sdk/credential-provider-web-identity"); +const fromWebToken = (init) => { + var _a; + return (0, credential_provider_web_identity_1.fromWebToken)({ + ...init, + roleAssumerWithWebIdentity: (_a = init.roleAssumerWithWebIdentity) !== null && _a !== void 0 ? _a : (0, client_sts_1.getDefaultRoleAssumerWithWebIdentity)(init.clientConfig, init.clientPlugins), + }); +}; +exports.fromWebToken = fromWebToken; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/index.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/index.js new file mode 100644 index 0000000000..6c61b845f8 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/index.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromCognitoIdentity"), exports); +tslib_1.__exportStar(require("./fromCognitoIdentityPool"), exports); +tslib_1.__exportStar(require("./fromContainerMetadata"), exports); +tslib_1.__exportStar(require("./fromEnv"), exports); +tslib_1.__exportStar(require("./fromIni"), exports); +tslib_1.__exportStar(require("./fromInstanceMetadata"), exports); +tslib_1.__exportStar(require("./fromNodeProviderChain"), exports); +tslib_1.__exportStar(require("./fromProcess"), exports); +tslib_1.__exportStar(require("./fromSSO"), exports); +tslib_1.__exportStar(require("./fromTemporaryCredentials"), exports); +tslib_1.__exportStar(require("./fromTokenFile"), exports); +tslib_1.__exportStar(require("./fromWebToken"), exports); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-cjs/index.web.js b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/index.web.js new file mode 100644 index 0000000000..1a1966558a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-cjs/index.web.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromCognitoIdentity"), exports); +tslib_1.__exportStar(require("./fromCognitoIdentityPool"), exports); +tslib_1.__exportStar(require("./fromTemporaryCredentials"), exports); +tslib_1.__exportStar(require("./fromWebToken"), exports); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentity.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentity.js new file mode 100644 index 0000000000..afb2da2a65 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentity.js @@ -0,0 +1,6 @@ +import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity"; +import { fromCognitoIdentity as _fromCognitoIdentity, } from "@aws-sdk/credential-provider-cognito-identity"; +export const fromCognitoIdentity = (options) => _fromCognitoIdentity({ + ...options, + client: new CognitoIdentityClient(options.clientConfig ?? {}), +}); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentityPool.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentityPool.js new file mode 100644 index 0000000000..9377bf3b4b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentityPool.js @@ -0,0 +1,6 @@ +import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity"; +import { fromCognitoIdentityPool as _fromCognitoIdentityPool, } from "@aws-sdk/credential-provider-cognito-identity"; +export const fromCognitoIdentityPool = (options) => _fromCognitoIdentityPool({ + ...options, + client: new CognitoIdentityClient(options.clientConfig ?? {}), +}); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromContainerMetadata.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromContainerMetadata.js new file mode 100644 index 0000000000..3824944fd1 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromContainerMetadata.js @@ -0,0 +1,2 @@ +import { fromContainerMetadata as _fromContainerMetadata, } from "@aws-sdk/credential-provider-imds"; +export const fromContainerMetadata = (init) => _fromContainerMetadata(init); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromEnv.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromEnv.js new file mode 100644 index 0000000000..6e0265cd17 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromEnv.js @@ -0,0 +1,2 @@ +import { fromEnv as _fromEnv } from "@aws-sdk/credential-provider-env"; +export const fromEnv = () => _fromEnv(); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromIni.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromIni.js new file mode 100644 index 0000000000..2dbf4d3d03 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromIni.js @@ -0,0 +1,7 @@ +import { getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity } from "@aws-sdk/client-sts"; +import { fromIni as _fromIni } from "@aws-sdk/credential-provider-ini"; +export const fromIni = (init = {}) => _fromIni({ + ...init, + roleAssumer: init.roleAssumer ?? getDefaultRoleAssumer(init.clientConfig, init.clientPlugins), + roleAssumerWithWebIdentity: init.roleAssumerWithWebIdentity ?? getDefaultRoleAssumerWithWebIdentity(init.clientConfig, init.clientPlugins), +}); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromInstanceMetadata.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromInstanceMetadata.js new file mode 100644 index 0000000000..46562694e9 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromInstanceMetadata.js @@ -0,0 +1,2 @@ +import { fromInstanceMetadata as _fromInstanceMetadata, } from "@aws-sdk/credential-provider-imds"; +export const fromInstanceMetadata = (init) => _fromInstanceMetadata(init); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromNodeProviderChain.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromNodeProviderChain.js new file mode 100644 index 0000000000..6d02336a27 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromNodeProviderChain.js @@ -0,0 +1,7 @@ +import { getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity } from "@aws-sdk/client-sts"; +import { defaultProvider } from "@aws-sdk/credential-provider-node"; +export const fromNodeProviderChain = (init = {}) => defaultProvider({ + ...init, + roleAssumer: init.roleAssumer ?? getDefaultRoleAssumer(init.clientConfig, init.clientPlugins), + roleAssumerWithWebIdentity: init.roleAssumerWithWebIdentity ?? getDefaultRoleAssumerWithWebIdentity(init.clientConfig, init.clientPlugins), +}); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromProcess.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromProcess.js new file mode 100644 index 0000000000..d3611a5f01 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromProcess.js @@ -0,0 +1,2 @@ +import { fromProcess as _fromProcess } from "@aws-sdk/credential-provider-process"; +export const fromProcess = (init) => _fromProcess(init); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromSSO.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromSSO.js new file mode 100644 index 0000000000..f410c784d9 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromSSO.js @@ -0,0 +1,3 @@ +import { SSOClient } from "@aws-sdk/client-sso"; +import { fromSSO as _fromSSO } from "@aws-sdk/credential-provider-sso"; +export const fromSSO = (init = {}) => _fromSSO({ ...{ ssoClient: init.clientConfig ? new SSOClient(init.clientConfig) : undefined }, ...init }); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromTemporaryCredentials.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromTemporaryCredentials.js new file mode 100644 index 0000000000..9446eaeefa --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromTemporaryCredentials.js @@ -0,0 +1,31 @@ +import { AssumeRoleCommand, STSClient } from "@aws-sdk/client-sts"; +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +export const fromTemporaryCredentials = (options) => { + let stsClient; + return async () => { + const params = { ...options.params, RoleSessionName: options.params.RoleSessionName ?? "aws-sdk-js-" + Date.now() }; + if (params?.SerialNumber) { + if (!options.mfaCodeProvider) { + throw new CredentialsProviderError(`Temporary credential requires multi-factor authentication,` + ` but no MFA code callback was provided.`, false); + } + params.TokenCode = await options.mfaCodeProvider(params?.SerialNumber); + } + if (!stsClient) + stsClient = new STSClient({ ...options.clientConfig, credentials: options.masterCredentials }); + if (options.clientPlugins) { + for (const plugin of options.clientPlugins) { + stsClient.middlewareStack.use(plugin); + } + } + const { Credentials } = await stsClient.send(new AssumeRoleCommand(params)); + if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { + throw new CredentialsProviderError(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); + } + return { + accessKeyId: Credentials.AccessKeyId, + secretAccessKey: Credentials.SecretAccessKey, + sessionToken: Credentials.SessionToken, + expiration: Credentials.Expiration, + }; + }; +}; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromTokenFile.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromTokenFile.js new file mode 100644 index 0000000000..b557ba0289 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromTokenFile.js @@ -0,0 +1,6 @@ +import { getDefaultRoleAssumerWithWebIdentity } from "@aws-sdk/client-sts"; +import { fromTokenFile as _fromTokenFile, } from "@aws-sdk/credential-provider-web-identity"; +export const fromTokenFile = (init = {}) => _fromTokenFile({ + ...init, + roleAssumerWithWebIdentity: init.roleAssumerWithWebIdentity ?? getDefaultRoleAssumerWithWebIdentity(init.clientConfig, init.clientPlugins), +}); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/fromWebToken.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromWebToken.js new file mode 100644 index 0000000000..448f361266 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/fromWebToken.js @@ -0,0 +1,6 @@ +import { getDefaultRoleAssumerWithWebIdentity } from "@aws-sdk/client-sts"; +import { fromWebToken as _fromWebToken, } from "@aws-sdk/credential-provider-web-identity"; +export const fromWebToken = (init) => _fromWebToken({ + ...init, + roleAssumerWithWebIdentity: init.roleAssumerWithWebIdentity ?? getDefaultRoleAssumerWithWebIdentity(init.clientConfig, init.clientPlugins), +}); diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/index.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/index.js new file mode 100644 index 0000000000..4881d80813 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/index.js @@ -0,0 +1,12 @@ +export * from "./fromCognitoIdentity"; +export * from "./fromCognitoIdentityPool"; +export * from "./fromContainerMetadata"; +export * from "./fromEnv"; +export * from "./fromIni"; +export * from "./fromInstanceMetadata"; +export * from "./fromNodeProviderChain"; +export * from "./fromProcess"; +export * from "./fromSSO"; +export * from "./fromTemporaryCredentials"; +export * from "./fromTokenFile"; +export * from "./fromWebToken"; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-es/index.web.js b/server/node_modules/@aws-sdk/credential-providers/dist-es/index.web.js new file mode 100644 index 0000000000..963a737b13 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-es/index.web.js @@ -0,0 +1,4 @@ +export * from "./fromCognitoIdentity"; +export * from "./fromCognitoIdentityPool"; +export * from "./fromTemporaryCredentials"; +export * from "./fromWebToken"; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentity.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentity.d.ts new file mode 100644 index 0000000000..246297790c --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentity.d.ts @@ -0,0 +1,45 @@ +import { CognitoIdentityClientConfig } from "@aws-sdk/client-cognito-identity"; +import { CognitoIdentityCredentialProvider as _CognitoIdentityCredentialProvider, FromCognitoIdentityParameters as _FromCognitoIdentityParameters } from "@aws-sdk/credential-provider-cognito-identity"; +export interface FromCognitoIdentityParameters extends Omit<_FromCognitoIdentityParameters, "client"> { + /** + * Custom client configuration if you need overwrite default Cognito Identity client configuration. + */ + clientConfig?: CognitoIdentityClientConfig; +} +export declare type CognitoIdentityCredentialProvider = _CognitoIdentityCredentialProvider; +/** + * Creates a credential provider function that reetrieves temporary AWS credentials using Amazon Cognito's + * `GetCredentialsForIdentity` operation. + * + * Results from this function call are not cached internally. + * + * ```javascript + * import { fromCognitoIdentity } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromCognitoIdentity } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const client = new FooClient({ + * region, + * credentials: fromCognitoIdentity({ + * // Required. The unique identifier for the identity against which credentials + * // will be issued. + * identityId: "us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f" + * // optional. The ARN of the role to be assumed when multiple roles were + * // received in the token from the identity provider. + * customRoleArn: "arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity" + * // Optional. A set of name-value pairs that map provider names to provider + * // tokens. Required when using identities associated with external identity + * // providers such as Facebook. + * logins: { + * "graph.facebook.com": "FBTOKEN", + * "www.amazon.com": "AMAZONTOKEN", + * "accounts.google.com": "GOOGLETOKEN", + * "api.twitter.com": "TWITTERTOKEN'", + * "www.digits.com": "DIGITSTOKEN" + * }, + * // Optional. Custom client configuration if you need overwrite default Cognito Identity client configuration. + * clientConfig: { region } + * }), + * }); + * ``` + */ +export declare const fromCognitoIdentity: (options: FromCognitoIdentityParameters) => _CognitoIdentityCredentialProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentityPool.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentityPool.d.ts new file mode 100644 index 0000000000..71a1b779bb --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentityPool.d.ts @@ -0,0 +1,46 @@ +import { CognitoIdentityClientConfig } from "@aws-sdk/client-cognito-identity"; +import { CognitoIdentityCredentialProvider, FromCognitoIdentityPoolParameters as _FromCognitoIdentityPoolParameters } from "@aws-sdk/credential-provider-cognito-identity"; +export interface FromCognitoIdentityPoolParameters extends Omit<_FromCognitoIdentityPoolParameters, "client"> { + clientConfig?: CognitoIdentityClientConfig; +} +/** + * Creates a credential provider function that retrieves or generates a unique identifier using Amazon Cognito's `GetId` + * operation, then generates temporary AWS credentials using Amazon Cognito's `GetCredentialsForIdentity` operation. + * + * Results from `GetId` are cached internally, but results from `GetCredentialsForIdentity` are not. + * + * ```javascript + * import { fromCognitoIdentityPool } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromCognitoIdentityPool } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const client = new FooClient({ + * region, + * credentials: fromCognitoIdentityPool({ + * // Required. The unique identifier for the identity pool from which an identity should be retrieved or generated. + * identityPoolId: "us-east-1:1699ebc0-7900-4099-b910-2df94f52a030"; + * // Optional. A standard AWS account ID (9+ digits) + * accountId: "123456789", + * // Optional. A cache in which to store resolved Cognito IdentityIds. + * cache: custom_storage, + * // Optional. A unique identifier for the user used to cache Cognito IdentityIds on a per-user basis. + * userIdentifier: "user_0", + * // optional. The ARN of the role to be assumed when multiple roles were + * // received in the token from the identity provider. + * customRoleArn: "arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity" + * // Optional. A set of name-value pairs that map provider names to provider + * // tokens. Required when using identities associated with external identity + * // providers such as Facebook. + * logins: { + * 'graph.facebook.com': 'FBTOKEN', + * 'www.amazon.com': 'AMAZONTOKEN', + * 'accounts.google.com': 'GOOGLETOKEN', + * 'api.twitter.com': 'TWITTERTOKEN', + * 'www.digits.com': 'DIGITSTOKEN' + * }, + * // Optional. Custom client configuration if you need overwrite default Cognito Identity client configuration. + * client: new CognitoIdentityClient({ region }) + * }), + * }); + * ``` + */ +export declare const fromCognitoIdentityPool: (options: FromCognitoIdentityPoolParameters) => CognitoIdentityCredentialProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromContainerMetadata.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromContainerMetadata.d.ts new file mode 100644 index 0000000000..8cba774746 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromContainerMetadata.d.ts @@ -0,0 +1,24 @@ +import { RemoteProviderInit as _RemoteProviderInit } from "@aws-sdk/credential-provider-imds"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface RemoteProviderInit extends _RemoteProviderInit { +} +/** + * Create a credential provider function that reads from ECS container metadata service. + * + * ```javascript + * import { fromContainerMetadata } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromContainerMetadata } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const foo = new FooClient({ + * credentials: fromInstanceMetadata({ + * // Optional. The connection timeout (in milliseconds) to apply to any remote requests. If not specified, a default value + * // of`1000` (one second) is used. + * timeout: 1000, + * // Optional. The maximum number of times any HTTP connections should be retried. If not specified, a default value of `0` + * // will be used. + * maxRetries: 0, + * }), + * }); + * ``` + */ +export declare const fromContainerMetadata: (init?: RemoteProviderInit | undefined) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromEnv.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromEnv.d.ts new file mode 100644 index 0000000000..019de33a32 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromEnv.d.ts @@ -0,0 +1,26 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +/** + * Create a credential provider that reads credentials from the following environment variables: + * + * - `AWS_ACCESS_KEY_ID` - The access key for your AWS account. + * - `AWS_SECRET_ACCESS_KEY` - The secret key for your AWS account. + * - `AWS_SESSION_TOKEN` - The session key for your AWS account. This is only + * needed when you are using temporary credentials. + * - `AWS_CREDENTIAL_EXPIRATION` - The expiration time of the credentials contained + * in the environment variables described above. This value must be in a format + * compatible with the [ISO-8601 standard](https://en.wikipedia.org/wiki/ISO_8601) + * and is only needed when you are using temporary credentials. + * + * If either the `AWS_ACCESS_KEY_ID` or `AWS_SECRET_ACCESS_KEY` environment variable is not set or contains a falsy + * value, the promise returned by the `fromEnv` function will be rejected. + * + * ```javascript + * import { fromEnv } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromEnv } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const client = new DynamoDBClient({ + * credentials: fromEnv(), + * }); + * ``` + */ +export declare const fromEnv: () => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromIni.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromIni.d.ts new file mode 100644 index 0000000000..fa65924c56 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromIni.d.ts @@ -0,0 +1,47 @@ +import { STSClientConfig } from "@aws-sdk/client-sts"; +import { FromIniInit as _FromIniInit } from "@aws-sdk/credential-provider-ini"; +import { AwsCredentialIdentityProvider, Pluggable } from "@aws-sdk/types"; +export interface FromIniInit extends _FromIniInit { + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; +} +/** + * Creates a credential provider function that reads from a shared credentials file at `~/.aws/credentials` and a + * shared configuration file at `~/.aws/config`. Both files are expected to be INI formatted with section names + * corresponding to profiles. Sections in the credentials file are treated as profile names, whereas profile sections in + * the config file must have the format of`[profile profile-name]`, except for the default profile. + * + * Profiles that appear in both files will not be merged, and the version that appears in the credentials file will be + * given precedence over the profile found in the config file. + * + * ```javascript + * import { fromIni } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromIni } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const client = new FooClient({ + * credentials: fromIni({ + * // Optional. The configuration profile to use. If not specified, the provider will use the value in the + * // `AWS_PROFILE` environment variable or a default of `default`. + * profile: "profile", + * // Optional. The path to the shared credentials file. If not specified, the provider will use the value in the + * // `AWS_SHARED_CREDENTIALS_FILE` environment variable or a default of `~/.aws/credentials`. + * filepath: "~/.aws/credentials", + * // Optional. The path to the shared config file. If not specified, the provider will use the value in the + * // `AWS_CONFIG_FILE` environment variable or a default of `~/.aws/config`. + * configFilepath: "~/.aws/config", + * // Optional. A function that returns a a promise fulfilled with an MFA token code for the provided MFA Serial + * // code. If a profile requires an MFA code and `mfaCodeProvider` is not a valid function, the credential provider + * // promise will be rejected. + * mfaCodeProvider: async (mfaSerial) => { + * return "token"; + * }, + * // Optional. Custom STS client configurations overriding the default ones. + * clientConfig: { region }, + * // Optional. Custom STS client middleware plugin to modify the client default behavior. + * // e.g. adding custom headers. + * clientPlugins: [addFooHeadersPlugin], + * }), + * }); + * ``` + */ +export declare const fromIni: (init?: FromIniInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromInstanceMetadata.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromInstanceMetadata.d.ts new file mode 100644 index 0000000000..42fffeba80 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromInstanceMetadata.d.ts @@ -0,0 +1,22 @@ +import { RemoteProviderConfig as _RemoteProviderInit } from "@aws-sdk/credential-provider-imds"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +/** + * Creates a credential provider function that reads from the EC2 instance metadata service. + * + * ```javascript + * import { fromInstanceMetadata } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromInstanceMetadata } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const client = new DynamoDBClient({ + * credentials: fromInstanceMetadata({ + * // Optional. The connection timeout (in milliseconds) to apply to any remote requests. If not specified, a + * // default value of`1000` (one second) is used. + * timeout: 1000, + * // Optional. The maximum number of times any HTTP connections should be retried. If not specified, a default + * // value of `0` will be used. + * maxRetries: 0, + * }), + * }); + * ``` + */ +export declare const fromInstanceMetadata: (init?: _RemoteProviderInit | undefined) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromNodeProviderChain.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromNodeProviderChain.d.ts new file mode 100644 index 0000000000..5049dacf9b --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromNodeProviderChain.d.ts @@ -0,0 +1,33 @@ +import { STSClientConfig } from "@aws-sdk/client-sts"; +import { DefaultProviderInit } from "@aws-sdk/credential-provider-node"; +import { AwsCredentialIdentityProvider, Pluggable } from "@aws-sdk/types"; +export interface fromNodeProviderChainInit extends DefaultProviderInit { + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; +} +/** + * This is the same credential provider as {@link defaultProvider|the default provider for Node.js SDK}, + * but with default role assumers so you don't need to import them from + * STS client and supply them manually. + * + * You normally don't need to use this explicitly in the client constructor. + * It is useful for utility functions requiring credentials like S3 presigner, + * or RDS signer. + * + * ```js + * import { fromNodeProviderChain } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromNodeProviderChain } = require("@aws-sdk/credential-providers") // CommonJS import + * + * const credentialProvider = fromNodeProviderChain({ + * //...any input of fromEnv(), fromSSO(), fromTokenFile(), fromIni(), + * // fromProcess(), fromInstanceMetadata(), fromContainerMetadata() + * + * // Optional. Custom STS client configurations overriding the default ones. + * clientConfig: { region }, + * // Optional. Custom STS client middleware plugin to modify the client default behavior. + * // e.g. adding custom headers. + * clientPlugins: [addFooHeadersPlugin], + * }) + * ``` + */ +export declare const fromNodeProviderChain: (init?: fromNodeProviderChainInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromProcess.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromProcess.d.ts new file mode 100644 index 0000000000..dbbf55edeb --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromProcess.d.ts @@ -0,0 +1,28 @@ +import { FromProcessInit as _FromProcessInit } from "@aws-sdk/credential-provider-process"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface FromProcessInit extends _FromProcessInit { +} +/** + * Creates a credential provider function that executes a given process and attempt to read its standard output to + * receive a JSON payload containing the credentials. + * + * ```javascript + * import { fromProcess } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromProcess } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const client = new FooClient({ + * credentials: fromProcess({ + * // Optional. The configuration profile to use. If not specified, the provider will use the value in the + * // `AWS_PROFILE` environment variable or a default of `default`. + * profile: "profile", + * // Optional. The path to the shared credentials file. If not specified, the provider will use the value in the + * // `AWS_SHARED_CREDENTIALS_FILE` environment variable or a default of `~/.aws/credentials`. + * filepath: "~/.aws/credentials", + * // Optional. The path to the shared config file. If not specified, the provider will use the value in the + * // `AWS_CONFIG_FILE` environment variable or a default of `~/.aws/config`. + * configFilepath: "~/.aws/config", + * }), + * }); + * ``` + */ +export declare const fromProcess: (init?: FromProcessInit | undefined) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromSSO.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromSSO.d.ts new file mode 100644 index 0000000000..ef8ca2c400 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromSSO.d.ts @@ -0,0 +1,48 @@ +import { SSOClientConfig } from "@aws-sdk/client-sso"; +import { FromSSOInit as _FromSSOInit } from "@aws-sdk/credential-provider-sso"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface FromSSOInit extends Omit<_FromSSOInit, "client"> { + clientConfig?: SSOClientConfig; +} +/** + * Creates a credential provider function that reads from the _resolved_ access token from local disk then requests + * temporary AWS credentials. + * + * You can create the `AwsCredentialIdentityProvider` functions using the inline SSO parameters(`ssoStartUrl`, `ssoAccountId`, + * `ssoRegion`, `ssoRoleName`) or load them from [AWS SDKs and Tools shared configuration and credentials files](https://docs.aws.amazon.com/credref/latest/refdocs/creds-config-files.html). + * Profiles in the `credentials` file are given precedence over profiles in the `config` file. + * + * ```javascript + * import { fromSSO } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromSSO } = require(@aws-sdk/credential-providers") // CommonJS import + * + * const client = new FooClient({ + * credentials: fromSSO({ + * // Optional. The configuration profile to use. If not specified, the provider will use the value in the + * // `AWS_PROFILE` environment variable or `default` by default. + * profile: "my-sso-profile", + * // Optional. The path to the shared credentials file. If not specified, the provider will use the value in the + * // `AWS_SHARED_CREDENTIALS_FILE` environment variable or a default of `~/.aws/credentials`. + * filepath: "~/.aws/credentials", + * // Optional. The path to the shared config file. If not specified, the provider will use the value in the + * // `AWS_CONFIG_FILE` environment variable or a default of `~/.aws/config`. + * configFilepath: "~/.aws/config", + * // Optional. The URL to the AWS SSO service. Required if any of the `sso*` options(except for `ssoClient`) is + * // provided. + * ssoStartUrl: "https://d-abc123.awsapps.com/start", + * // Optional. The ID of the AWS account to use for temporary credentials. Required if any of the `sso*` + * // options(except for `ssoClient`) is provided. + * ssoAccountId: "1234567890", + * // Optional. The AWS region to use for temporary credentials. Required if any of the `sso*` options(except for + * // `ssoClient`) is provided. + * ssoRegion: "us-east-1", + * // Optional. The name of the AWS role to assume. Required if any of the `sso*` options(except for `ssoClient`) is + * // provided. + * ssoRoleName: "SampleRole", + * // Optional. Overwrite the configuration used construct the SSO service client. + * clientConfig: { region }, + * }), + * }); + * ``` + */ +export declare const fromSSO: (init?: FromSSOInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromTemporaryCredentials.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromTemporaryCredentials.d.ts new file mode 100644 index 0000000000..8da3c9522a --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromTemporaryCredentials.d.ts @@ -0,0 +1,52 @@ +import { AssumeRoleCommandInput, STSClientConfig } from "@aws-sdk/client-sts"; +import { AwsCredentialIdentity, AwsCredentialIdentityProvider, Pluggable } from "@aws-sdk/types"; +export interface FromTemporaryCredentialsOptions { + params: Omit & { + RoleSessionName?: string; + }; + masterCredentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider; + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; + mfaCodeProvider?: (mfaSerial: string) => Promise; +} +/** + * Creates a credential provider function that retrieves temporary credentials from STS AssumeRole API. + * + * ```javascript + * import { fromTemporaryCredentials } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromTemporaryCredentials } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const client = new FooClient({ + * region, + * credentials: fromTemporaryCredentials( + * // Optional. The master credentials used to get and refresh temporary credentials from AWS STS. If skipped, it uses + * // the default credential resolved by internal STS client. + * masterCredentials: fromTemporaryCredentials({ + * params: { RoleArn: "arn:aws:iam::1234567890:role/RoleA" } + * }), + * // Required. Options passed to STS AssumeRole operation. + * params: { + * // Required. ARN of role to assume. + * RoleArn: "arn:aws:iam::1234567890:role/RoleB", + * // Optional. An identifier for the assumed role session. If skipped, it generates a random session name with + * // prefix of 'aws-sdk-js-'. + * RoleSessionName: "aws-sdk-js-123", + * // Optional. The duration, in seconds, of the role session. + * DurationSeconds: 3600 + * //... For more options see https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html + * }, + * // Optional. Custom STS client configurations overriding the default ones. + * clientConfig: { region }, + * // Optional. Custom STS client middleware plugin to modify the client default behavior. + * // e.g. adding custom headers. + * clientPlugins: [addFooHeadersPlugin], + * // Optional. A function that returns a promise fulfilled with an MFA token code for the provided MFA Serial code. + * // Required if `params` has `SerialNumber` config. + * mfaCodeProvider: async mfaSerial => { + * return "token" + * } + * ), + * }); + * ``` + */ +export declare const fromTemporaryCredentials: (options: FromTemporaryCredentialsOptions) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromTokenFile.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromTokenFile.d.ts new file mode 100644 index 0000000000..5276894561 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromTokenFile.d.ts @@ -0,0 +1,36 @@ +import { STSClientConfig } from "@aws-sdk/client-sts"; +import { FromTokenFileInit as _FromTokenFileInit } from "@aws-sdk/credential-provider-web-identity"; +import { AwsCredentialIdentityProvider, Pluggable } from "@aws-sdk/types"; +export interface FromTokenFileInit extends _FromTokenFileInit { + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; +} +/** + * Creates a credential provider function that reads OIDC token from given file, then call STS.AssumeRoleWithWebIdentity + * API. The configurations must be specified in environmental variables: + * + * - Reads file location of where the OIDC token is stored from either provided option `webIdentityTokenFile` or + * environment variable `AWS_WEB_IDENTITY_TOKEN_FILE`. + * - Reads IAM role wanting to be assumed from either provided option `roleArn` or environment variable `AWS_ROLE_ARN`. + * - Reads optional role session name to be used to distinguish sessions from provided option `roleSessionName` or + * environment variable `AWS_ROLE_SESSION_NAME`. + * If session name is not defined, it comes up with a role session name. + * - Reads OIDC token from file on disk. + * - Calls sts:AssumeRoleWithWebIdentity via `roleAssumerWithWebIdentity` option to get credentials. + * + * ```javascript + * import { fromTokenFile } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromTokenFile } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const client = new FooClient({ + * credentials: fromTokenFile({ + * // Optional. STS client config to make the assume role request. + * clientConfig: { region } + * // Optional. Custom STS client middleware plugin to modify the client default behavior. + * // e.g. adding custom headers. + * clientPlugins: [addFooHeadersPlugin], + * }); + * }); + * ``` + */ +export declare const fromTokenFile: (init?: FromTokenFileInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/fromWebToken.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromWebToken.d.ts new file mode 100644 index 0000000000..01aec6f130 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/fromWebToken.d.ts @@ -0,0 +1,45 @@ +import { STSClientConfig } from "@aws-sdk/client-sts"; +import { FromWebTokenInit as _FromWebTokenInit } from "@aws-sdk/credential-provider-web-identity"; +import { AwsCredentialIdentityProvider, Pluggable } from "@aws-sdk/types"; +export interface FromWebTokenInit extends _FromWebTokenInit { + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; +} +/** + * Creates a credential provider function that gets credentials calling STS + * AssumeRoleWithWebIdentity API. + * + * ```javascript + * import { fromWebToken } from "@aws-sdk/credential-providers"; // ES6 import + * // const { fromWebToken } = require("@aws-sdk/credential-providers"); // CommonJS import + * + * const dynamodb = new DynamoDBClient({ + * region, + * credentials: fromWebToken({ + * // Required. ARN of the role that the caller is assuming. + * roleArn: "arn:aws:iam::1234567890:role/RoleA", + * // Required. The OAuth 2.0 access token or OpenID Connect ID token that is provided by the identity provider. + * webIdentityToken: await openIdProvider() + * // Optional. Custom STS client configurations overriding the default ones. + * clientConfig: { region } + * // Optional. Custom STS client middleware plugin to modify the client default behavior. + * // e.g. adding custom headers. + * clientPlugins: [addFooHeadersPlugin], + * // Optional. A function that assumes a role with web identity and returns a promise fulfilled with credentials for + * // the assumed role. + * roleAssumerWithWebIdentity, + * // Optional. An identifier for the assumed role session. + * roleSessionName: "session_123", + * // Optional. The fully qualified host component of the domain name of the identity provider. + * providerId: "graph.facebook.com", + * // Optional. ARNs of the IAM managed policies that you want to use as managed session. + * policyArns: [{arn: "arn:aws:iam::1234567890:policy/SomePolicy"}], + * // Optional. An IAM policy in JSON format that you want to use as an inline session policy. + * policy: "JSON_STRING", + * // Optional. The duration, in seconds, of the role session. Default to 3600. + * durationSeconds: 7200 + * }), + * }); + * ``` + */ +export declare const fromWebToken: (init: FromWebTokenInit) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/index.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/index.d.ts new file mode 100644 index 0000000000..4881d80813 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/index.d.ts @@ -0,0 +1,12 @@ +export * from "./fromCognitoIdentity"; +export * from "./fromCognitoIdentityPool"; +export * from "./fromContainerMetadata"; +export * from "./fromEnv"; +export * from "./fromIni"; +export * from "./fromInstanceMetadata"; +export * from "./fromNodeProviderChain"; +export * from "./fromProcess"; +export * from "./fromSSO"; +export * from "./fromTemporaryCredentials"; +export * from "./fromTokenFile"; +export * from "./fromWebToken"; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/index.web.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/index.web.d.ts new file mode 100644 index 0000000000..963a737b13 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/index.web.d.ts @@ -0,0 +1,4 @@ +export * from "./fromCognitoIdentity"; +export * from "./fromCognitoIdentityPool"; +export * from "./fromTemporaryCredentials"; +export * from "./fromWebToken"; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentity.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentity.d.ts new file mode 100644 index 0000000000..30738718e0 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentity.d.ts @@ -0,0 +1,17 @@ +import { CognitoIdentityClientConfig } from "@aws-sdk/client-cognito-identity"; +import { + CognitoIdentityCredentialProvider as _CognitoIdentityCredentialProvider, + FromCognitoIdentityParameters as _FromCognitoIdentityParameters, +} from "@aws-sdk/credential-provider-cognito-identity"; +export interface FromCognitoIdentityParameters + extends Pick< + _FromCognitoIdentityParameters, + Exclude + > { + clientConfig?: CognitoIdentityClientConfig; +} +export declare type CognitoIdentityCredentialProvider = + _CognitoIdentityCredentialProvider; +export declare const fromCognitoIdentity: ( + options: FromCognitoIdentityParameters +) => _CognitoIdentityCredentialProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentityPool.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentityPool.d.ts new file mode 100644 index 0000000000..dcead797f2 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentityPool.d.ts @@ -0,0 +1,15 @@ +import { CognitoIdentityClientConfig } from "@aws-sdk/client-cognito-identity"; +import { + CognitoIdentityCredentialProvider, + FromCognitoIdentityPoolParameters as _FromCognitoIdentityPoolParameters, +} from "@aws-sdk/credential-provider-cognito-identity"; +export interface FromCognitoIdentityPoolParameters + extends Pick< + _FromCognitoIdentityPoolParameters, + Exclude + > { + clientConfig?: CognitoIdentityClientConfig; +} +export declare const fromCognitoIdentityPool: ( + options: FromCognitoIdentityPoolParameters +) => CognitoIdentityCredentialProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromContainerMetadata.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromContainerMetadata.d.ts new file mode 100644 index 0000000000..bee2237760 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromContainerMetadata.d.ts @@ -0,0 +1,6 @@ +import { RemoteProviderInit as _RemoteProviderInit } from "@aws-sdk/credential-provider-imds"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface RemoteProviderInit extends _RemoteProviderInit {} +export declare const fromContainerMetadata: ( + init?: RemoteProviderInit | undefined +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromEnv.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromEnv.d.ts new file mode 100644 index 0000000000..59c0d071a0 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromEnv.d.ts @@ -0,0 +1,2 @@ +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export declare const fromEnv: () => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromIni.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromIni.d.ts new file mode 100644 index 0000000000..906a9f42a9 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromIni.d.ts @@ -0,0 +1,10 @@ +import { STSClientConfig } from "@aws-sdk/client-sts"; +import { FromIniInit as _FromIniInit } from "@aws-sdk/credential-provider-ini"; +import { AwsCredentialIdentityProvider, Pluggable } from "@aws-sdk/types"; +export interface FromIniInit extends _FromIniInit { + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; +} +export declare const fromIni: ( + init?: FromIniInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromInstanceMetadata.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromInstanceMetadata.d.ts new file mode 100644 index 0000000000..bd9169b533 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromInstanceMetadata.d.ts @@ -0,0 +1,5 @@ +import { RemoteProviderConfig as _RemoteProviderInit } from "@aws-sdk/credential-provider-imds"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export declare const fromInstanceMetadata: ( + init?: _RemoteProviderInit | undefined +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromNodeProviderChain.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromNodeProviderChain.d.ts new file mode 100644 index 0000000000..9dc7f71d93 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromNodeProviderChain.d.ts @@ -0,0 +1,10 @@ +import { STSClientConfig } from "@aws-sdk/client-sts"; +import { DefaultProviderInit } from "@aws-sdk/credential-provider-node"; +import { AwsCredentialIdentityProvider, Pluggable } from "@aws-sdk/types"; +export interface fromNodeProviderChainInit extends DefaultProviderInit { + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; +} +export declare const fromNodeProviderChain: ( + init?: fromNodeProviderChainInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromProcess.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromProcess.d.ts new file mode 100644 index 0000000000..331dec694f --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromProcess.d.ts @@ -0,0 +1,6 @@ +import { FromProcessInit as _FromProcessInit } from "@aws-sdk/credential-provider-process"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface FromProcessInit extends _FromProcessInit {} +export declare const fromProcess: ( + init?: FromProcessInit | undefined +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromSSO.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromSSO.d.ts new file mode 100644 index 0000000000..381b8d2cd0 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromSSO.d.ts @@ -0,0 +1,10 @@ +import { SSOClientConfig } from "@aws-sdk/client-sso"; +import { FromSSOInit as _FromSSOInit } from "@aws-sdk/credential-provider-sso"; +import { AwsCredentialIdentityProvider } from "@aws-sdk/types"; +export interface FromSSOInit + extends Pick<_FromSSOInit, Exclude> { + clientConfig?: SSOClientConfig; +} +export declare const fromSSO: ( + init?: FromSSOInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTemporaryCredentials.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTemporaryCredentials.d.ts new file mode 100644 index 0000000000..ed841514ef --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTemporaryCredentials.d.ts @@ -0,0 +1,21 @@ +import { AssumeRoleCommandInput, STSClientConfig } from "@aws-sdk/client-sts"; +import { + AwsCredentialIdentity, + AwsCredentialIdentityProvider, + Pluggable, +} from "@aws-sdk/types"; +export interface FromTemporaryCredentialsOptions { + params: Pick< + AssumeRoleCommandInput, + Exclude + > & { + RoleSessionName?: string; + }; + masterCredentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider; + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; + mfaCodeProvider?: (mfaSerial: string) => Promise; +} +export declare const fromTemporaryCredentials: ( + options: FromTemporaryCredentialsOptions +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTokenFile.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTokenFile.d.ts new file mode 100644 index 0000000000..fb5314d980 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTokenFile.d.ts @@ -0,0 +1,10 @@ +import { STSClientConfig } from "@aws-sdk/client-sts"; +import { FromTokenFileInit as _FromTokenFileInit } from "@aws-sdk/credential-provider-web-identity"; +import { AwsCredentialIdentityProvider, Pluggable } from "@aws-sdk/types"; +export interface FromTokenFileInit extends _FromTokenFileInit { + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; +} +export declare const fromTokenFile: ( + init?: FromTokenFileInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromWebToken.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromWebToken.d.ts new file mode 100644 index 0000000000..a0e70073e8 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromWebToken.d.ts @@ -0,0 +1,10 @@ +import { STSClientConfig } from "@aws-sdk/client-sts"; +import { FromWebTokenInit as _FromWebTokenInit } from "@aws-sdk/credential-provider-web-identity"; +import { AwsCredentialIdentityProvider, Pluggable } from "@aws-sdk/types"; +export interface FromWebTokenInit extends _FromWebTokenInit { + clientConfig?: STSClientConfig; + clientPlugins?: Pluggable[]; +} +export declare const fromWebToken: ( + init: FromWebTokenInit +) => AwsCredentialIdentityProvider; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..4881d80813 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.d.ts @@ -0,0 +1,12 @@ +export * from "./fromCognitoIdentity"; +export * from "./fromCognitoIdentityPool"; +export * from "./fromContainerMetadata"; +export * from "./fromEnv"; +export * from "./fromIni"; +export * from "./fromInstanceMetadata"; +export * from "./fromNodeProviderChain"; +export * from "./fromProcess"; +export * from "./fromSSO"; +export * from "./fromTemporaryCredentials"; +export * from "./fromTokenFile"; +export * from "./fromWebToken"; diff --git a/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.web.d.ts b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.web.d.ts new file mode 100644 index 0000000000..963a737b13 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.web.d.ts @@ -0,0 +1,4 @@ +export * from "./fromCognitoIdentity"; +export * from "./fromCognitoIdentityPool"; +export * from "./fromTemporaryCredentials"; +export * from "./fromWebToken"; diff --git a/server/node_modules/@aws-sdk/credential-providers/package.json b/server/node_modules/@aws-sdk/credential-providers/package.json new file mode 100644 index 0000000000..0525dfb9f3 --- /dev/null +++ b/server/node_modules/@aws-sdk/credential-providers/package.json @@ -0,0 +1,75 @@ +{ + "name": "@aws-sdk/credential-providers", + "version": "3.264.0", + "description": "A collection of credential providers, without requiring service clients like STS, Cognito", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "browser": "./dist-es/index.web.js", + "react-native": "./dist-es/index.web.js", + "sideEffects": false, + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "credentials" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.264.0", + "@aws-sdk/client-sso": "3.264.0", + "@aws-sdk/client-sts": "3.264.0", + "@aws-sdk/credential-provider-cognito-identity": "3.264.0", + "@aws-sdk/credential-provider-env": "3.257.0", + "@aws-sdk/credential-provider-imds": "3.259.0", + "@aws-sdk/credential-provider-ini": "3.264.0", + "@aws-sdk/credential-provider-node": "3.264.0", + "@aws-sdk/credential-provider-process": "3.257.0", + "@aws-sdk/credential-provider-sso": "3.264.0", + "@aws-sdk/credential-provider-web-identity": "3.257.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/credential-providers", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/credential-providers" + } +} diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/LICENSE b/server/node_modules/@aws-sdk/fetch-http-handler/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/README.md b/server/node_modules/@aws-sdk/fetch-http-handler/README.md new file mode 100644 index 0000000000..e7447ae39e --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/fetch-http-handler + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/fetch-http-handler/latest.svg)](https://www.npmjs.com/package/@aws-sdk/fetch-http-handler) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/fetch-http-handler.svg)](https://www.npmjs.com/package/@aws-sdk/fetch-http-handler) diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/fetch-http-handler.js b/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/fetch-http-handler.js new file mode 100644 index 0000000000..979b432e6f --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/fetch-http-handler.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FetchHttpHandler = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const querystring_builder_1 = require("@aws-sdk/querystring-builder"); +const request_timeout_1 = require("./request-timeout"); +class FetchHttpHandler { + constructor(options) { + if (typeof options === "function") { + this.configProvider = options().then((opts) => opts || {}); + } + else { + this.config = options !== null && options !== void 0 ? options : {}; + this.configProvider = Promise.resolve(this.config); + } + } + destroy() { + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + const requestTimeoutInMs = this.config.requestTimeout; + if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + return Promise.reject(abortError); + } + let path = request.path; + if (request.query) { + const queryString = (0, querystring_builder_1.buildQueryString)(request.query); + if (queryString) { + path += `?${queryString}`; + } + } + const { port, method } = request; + const url = `${request.protocol}//${request.hostname}${port ? `:${port}` : ""}${path}`; + const body = method === "GET" || method === "HEAD" ? undefined : request.body; + const requestOptions = { + body, + headers: new Headers(request.headers), + method: method, + }; + if (typeof AbortController !== "undefined") { + requestOptions["signal"] = abortSignal; + } + const fetchRequest = new Request(url, requestOptions); + const raceOfPromises = [ + fetch(fetchRequest).then((response) => { + const fetchHeaders = response.headers; + const transformedHeaders = {}; + for (const pair of fetchHeaders.entries()) { + transformedHeaders[pair[0]] = pair[1]; + } + const hasReadableStream = response.body !== undefined; + if (!hasReadableStream) { + return response.blob().then((body) => ({ + response: new protocol_http_1.HttpResponse({ + headers: transformedHeaders, + statusCode: response.status, + body, + }), + })); + } + return { + response: new protocol_http_1.HttpResponse({ + headers: transformedHeaders, + statusCode: response.status, + body: response.body, + }), + }; + }), + (0, request_timeout_1.requestTimeout)(requestTimeoutInMs), + ]; + if (abortSignal) { + raceOfPromises.push(new Promise((resolve, reject) => { + abortSignal.onabort = () => { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + })); + } + return Promise.race(raceOfPromises); + } +} +exports.FetchHttpHandler = FetchHttpHandler; diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/index.js b/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/index.js new file mode 100644 index 0000000000..df8ffde600 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fetch-http-handler"), exports); +tslib_1.__exportStar(require("./stream-collector"), exports); diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/request-timeout.js b/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/request-timeout.js new file mode 100644 index 0000000000..4e535c2cfb --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/request-timeout.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.requestTimeout = void 0; +function requestTimeout(timeoutInMs = 0) { + return new Promise((resolve, reject) => { + if (timeoutInMs) { + setTimeout(() => { + const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); + timeoutError.name = "TimeoutError"; + reject(timeoutError); + }, timeoutInMs); + } + }); +} +exports.requestTimeout = requestTimeout; diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/stream-collector.js b/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/stream-collector.js new file mode 100644 index 0000000000..ffe06cc352 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/stream-collector.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.streamCollector = void 0; +const util_base64_1 = require("@aws-sdk/util-base64"); +const streamCollector = (stream) => { + if (typeof Blob === "function" && stream instanceof Blob) { + return collectBlob(stream); + } + return collectStream(stream); +}; +exports.streamCollector = streamCollector; +async function collectBlob(blob) { + const base64 = await readToBase64(blob); + const arrayBuffer = (0, util_base64_1.fromBase64)(base64); + return new Uint8Array(arrayBuffer); +} +async function collectStream(stream) { + let res = new Uint8Array(0); + const reader = stream.getReader(); + let isDone = false; + while (!isDone) { + const { done, value } = await reader.read(); + if (value) { + const prior = res; + res = new Uint8Array(prior.length + value.length); + res.set(prior); + res.set(value, prior.length); + } + isDone = done; + } + return res; +} +function readToBase64(blob) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onloadend = () => { + var _a; + if (reader.readyState !== 2) { + return reject(new Error("Reader aborted too early")); + } + const result = ((_a = reader.result) !== null && _a !== void 0 ? _a : ""); + const commaIndex = result.indexOf(","); + const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length; + resolve(result.substring(dataOffset)); + }; + reader.onabort = () => reject(new Error("Read aborted")); + reader.onerror = () => reject(reader.error); + reader.readAsDataURL(blob); + }); +} diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/fetch-http-handler.js b/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/fetch-http-handler.js new file mode 100644 index 0000000000..f5bf8e243b --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/fetch-http-handler.js @@ -0,0 +1,83 @@ +import { HttpResponse } from "@aws-sdk/protocol-http"; +import { buildQueryString } from "@aws-sdk/querystring-builder"; +import { requestTimeout } from "./request-timeout"; +export class FetchHttpHandler { + constructor(options) { + if (typeof options === "function") { + this.configProvider = options().then((opts) => opts || {}); + } + else { + this.config = options ?? {}; + this.configProvider = Promise.resolve(this.config); + } + } + destroy() { + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + const requestTimeoutInMs = this.config.requestTimeout; + if (abortSignal?.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + return Promise.reject(abortError); + } + let path = request.path; + if (request.query) { + const queryString = buildQueryString(request.query); + if (queryString) { + path += `?${queryString}`; + } + } + const { port, method } = request; + const url = `${request.protocol}//${request.hostname}${port ? `:${port}` : ""}${path}`; + const body = method === "GET" || method === "HEAD" ? undefined : request.body; + const requestOptions = { + body, + headers: new Headers(request.headers), + method: method, + }; + if (typeof AbortController !== "undefined") { + requestOptions["signal"] = abortSignal; + } + const fetchRequest = new Request(url, requestOptions); + const raceOfPromises = [ + fetch(fetchRequest).then((response) => { + const fetchHeaders = response.headers; + const transformedHeaders = {}; + for (const pair of fetchHeaders.entries()) { + transformedHeaders[pair[0]] = pair[1]; + } + const hasReadableStream = response.body !== undefined; + if (!hasReadableStream) { + return response.blob().then((body) => ({ + response: new HttpResponse({ + headers: transformedHeaders, + statusCode: response.status, + body, + }), + })); + } + return { + response: new HttpResponse({ + headers: transformedHeaders, + statusCode: response.status, + body: response.body, + }), + }; + }), + requestTimeout(requestTimeoutInMs), + ]; + if (abortSignal) { + raceOfPromises.push(new Promise((resolve, reject) => { + abortSignal.onabort = () => { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + })); + } + return Promise.race(raceOfPromises); + } +} diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/index.js b/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/index.js new file mode 100644 index 0000000000..a0c61f1b08 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/index.js @@ -0,0 +1,2 @@ +export * from "./fetch-http-handler"; +export * from "./stream-collector"; diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/request-timeout.js b/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/request-timeout.js new file mode 100644 index 0000000000..66b09b260b --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/request-timeout.js @@ -0,0 +1,11 @@ +export function requestTimeout(timeoutInMs = 0) { + return new Promise((resolve, reject) => { + if (timeoutInMs) { + setTimeout(() => { + const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); + timeoutError.name = "TimeoutError"; + reject(timeoutError); + }, timeoutInMs); + } + }); +} diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/stream-collector.js b/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/stream-collector.js new file mode 100644 index 0000000000..2d7dd638dc --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-es/stream-collector.js @@ -0,0 +1,45 @@ +import { fromBase64 } from "@aws-sdk/util-base64"; +export const streamCollector = (stream) => { + if (typeof Blob === "function" && stream instanceof Blob) { + return collectBlob(stream); + } + return collectStream(stream); +}; +async function collectBlob(blob) { + const base64 = await readToBase64(blob); + const arrayBuffer = fromBase64(base64); + return new Uint8Array(arrayBuffer); +} +async function collectStream(stream) { + let res = new Uint8Array(0); + const reader = stream.getReader(); + let isDone = false; + while (!isDone) { + const { done, value } = await reader.read(); + if (value) { + const prior = res; + res = new Uint8Array(prior.length + value.length); + res.set(prior); + res.set(value, prior.length); + } + isDone = done; + } + return res; +} +function readToBase64(blob) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onloadend = () => { + if (reader.readyState !== 2) { + return reject(new Error("Reader aborted too early")); + } + const result = (reader.result ?? ""); + const commaIndex = result.indexOf(","); + const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length; + resolve(result.substring(dataOffset)); + }; + reader.onabort = () => reject(new Error("Read aborted")); + reader.onerror = () => reject(reader.error); + reader.readAsDataURL(blob); + }); +} diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/fetch-http-handler.d.ts b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/fetch-http-handler.d.ts new file mode 100644 index 0000000000..b5c25ee84b --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/fetch-http-handler.d.ts @@ -0,0 +1,21 @@ +import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; +import { HttpHandlerOptions, Provider } from "@aws-sdk/types"; +/** + * Represents the http options that can be passed to a browser http client. + */ +export interface FetchHttpHandlerOptions { + /** + * The number of milliseconds a request can take before being automatically + * terminated. + */ + requestTimeout?: number; +} +export declare class FetchHttpHandler implements HttpHandler { + private config?; + private readonly configProvider; + constructor(options?: FetchHttpHandlerOptions | Provider); + destroy(): void; + handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{ + response: HttpResponse; + }>; +} diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/index.d.ts b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/index.d.ts new file mode 100644 index 0000000000..a0c61f1b08 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/index.d.ts @@ -0,0 +1,2 @@ +export * from "./fetch-http-handler"; +export * from "./stream-collector"; diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/request-timeout.d.ts b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/request-timeout.d.ts new file mode 100644 index 0000000000..28d784b296 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/request-timeout.d.ts @@ -0,0 +1 @@ +export declare function requestTimeout(timeoutInMs?: number): Promise; diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/stream-collector.d.ts b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/stream-collector.d.ts new file mode 100644 index 0000000000..be9a6c6f4d --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/stream-collector.d.ts @@ -0,0 +1,2 @@ +import { StreamCollector } from "@aws-sdk/types"; +export declare const streamCollector: StreamCollector; diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/fetch-http-handler.d.ts b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/fetch-http-handler.d.ts new file mode 100644 index 0000000000..a65b431bf9 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/fetch-http-handler.d.ts @@ -0,0 +1,21 @@ +import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; +import { HttpHandlerOptions, Provider } from "@aws-sdk/types"; +export interface FetchHttpHandlerOptions { + requestTimeout?: number; +} +export declare class FetchHttpHandler implements HttpHandler { + private config?; + private readonly configProvider; + constructor( + options?: + | FetchHttpHandlerOptions + | Provider + ); + destroy(): void; + handle( + request: HttpRequest, + { abortSignal }?: HttpHandlerOptions + ): Promise<{ + response: HttpResponse; + }>; +} diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..a0c61f1b08 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export * from "./fetch-http-handler"; +export * from "./stream-collector"; diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/request-timeout.d.ts b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/request-timeout.d.ts new file mode 100644 index 0000000000..28d784b296 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/request-timeout.d.ts @@ -0,0 +1 @@ +export declare function requestTimeout(timeoutInMs?: number): Promise; diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/stream-collector.d.ts b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/stream-collector.d.ts new file mode 100644 index 0000000000..be9a6c6f4d --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/dist-types/ts3.4/stream-collector.d.ts @@ -0,0 +1,2 @@ +import { StreamCollector } from "@aws-sdk/types"; +export declare const streamCollector: StreamCollector; diff --git a/server/node_modules/@aws-sdk/fetch-http-handler/package.json b/server/node_modules/@aws-sdk/fetch-http-handler/package.json new file mode 100644 index 0000000000..edffe2dbf7 --- /dev/null +++ b/server/node_modules/@aws-sdk/fetch-http-handler/package.json @@ -0,0 +1,55 @@ +{ + "name": "@aws-sdk/fetch-http-handler", + "version": "3.257.0", + "description": "Provides a way to make requests", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --coverage && karma start karma.conf.js" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/querystring-builder": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-base64": "3.208.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/abort-controller": "3.257.0", + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/fetch-http-handler", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/fetch-http-handler" + } +} diff --git a/server/node_modules/@aws-sdk/hash-node/LICENSE b/server/node_modules/@aws-sdk/hash-node/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/hash-node/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/hash-node/README.md b/server/node_modules/@aws-sdk/hash-node/README.md new file mode 100644 index 0000000000..917c664a58 --- /dev/null +++ b/server/node_modules/@aws-sdk/hash-node/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/md5-node + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/hash-node/latest.svg)](https://www.npmjs.com/package/@aws-sdk/hash-node) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/hash-node.svg)](https://www.npmjs.com/package/@aws-sdk/hash-node) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/hash-node/dist-cjs/index.js b/server/node_modules/@aws-sdk/hash-node/dist-cjs/index.js new file mode 100644 index 0000000000..acfbede547 --- /dev/null +++ b/server/node_modules/@aws-sdk/hash-node/dist-cjs/index.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Hash = void 0; +const util_buffer_from_1 = require("@aws-sdk/util-buffer-from"); +const util_utf8_1 = require("@aws-sdk/util-utf8"); +const buffer_1 = require("buffer"); +const crypto_1 = require("crypto"); +class Hash { + constructor(algorithmIdentifier, secret) { + this.algorithmIdentifier = algorithmIdentifier; + this.secret = secret; + this.reset(); + } + update(toHash, encoding) { + this.hash.update((0, util_utf8_1.toUint8Array)(castSourceData(toHash, encoding))); + } + digest() { + return Promise.resolve(this.hash.digest()); + } + reset() { + this.hash = this.secret + ? (0, crypto_1.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) + : (0, crypto_1.createHash)(this.algorithmIdentifier); + } +} +exports.Hash = Hash; +function castSourceData(toCast, encoding) { + if (buffer_1.Buffer.isBuffer(toCast)) { + return toCast; + } + if (typeof toCast === "string") { + return (0, util_buffer_from_1.fromString)(toCast, encoding); + } + if (ArrayBuffer.isView(toCast)) { + return (0, util_buffer_from_1.fromArrayBuffer)(toCast.buffer, toCast.byteOffset, toCast.byteLength); + } + return (0, util_buffer_from_1.fromArrayBuffer)(toCast); +} diff --git a/server/node_modules/@aws-sdk/hash-node/dist-es/index.js b/server/node_modules/@aws-sdk/hash-node/dist-es/index.js new file mode 100644 index 0000000000..412afb6a13 --- /dev/null +++ b/server/node_modules/@aws-sdk/hash-node/dist-es/index.js @@ -0,0 +1,34 @@ +import { fromArrayBuffer, fromString } from "@aws-sdk/util-buffer-from"; +import { toUint8Array } from "@aws-sdk/util-utf8"; +import { Buffer } from "buffer"; +import { createHash, createHmac } from "crypto"; +export class Hash { + constructor(algorithmIdentifier, secret) { + this.algorithmIdentifier = algorithmIdentifier; + this.secret = secret; + this.reset(); + } + update(toHash, encoding) { + this.hash.update(toUint8Array(castSourceData(toHash, encoding))); + } + digest() { + return Promise.resolve(this.hash.digest()); + } + reset() { + this.hash = this.secret + ? createHmac(this.algorithmIdentifier, castSourceData(this.secret)) + : createHash(this.algorithmIdentifier); + } +} +function castSourceData(toCast, encoding) { + if (Buffer.isBuffer(toCast)) { + return toCast; + } + if (typeof toCast === "string") { + return fromString(toCast, encoding); + } + if (ArrayBuffer.isView(toCast)) { + return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); + } + return fromArrayBuffer(toCast); +} diff --git a/server/node_modules/@aws-sdk/hash-node/dist-types/index.d.ts b/server/node_modules/@aws-sdk/hash-node/dist-types/index.d.ts new file mode 100644 index 0000000000..2525c6a7c0 --- /dev/null +++ b/server/node_modules/@aws-sdk/hash-node/dist-types/index.d.ts @@ -0,0 +1,10 @@ +import { Checksum, SourceData } from "@aws-sdk/types"; +export declare class Hash implements Checksum { + private readonly algorithmIdentifier; + private readonly secret?; + private hash; + constructor(algorithmIdentifier: string, secret?: SourceData); + update(toHash: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void; + digest(): Promise; + reset(): void; +} diff --git a/server/node_modules/@aws-sdk/hash-node/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/hash-node/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..d46e97a4e3 --- /dev/null +++ b/server/node_modules/@aws-sdk/hash-node/dist-types/ts3.4/index.d.ts @@ -0,0 +1,10 @@ +import { Checksum, SourceData } from "@aws-sdk/types"; +export declare class Hash implements Checksum { + private readonly algorithmIdentifier; + private readonly secret?; + private hash; + constructor(algorithmIdentifier: string, secret?: SourceData); + update(toHash: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void; + digest(): Promise; + reset(): void; +} diff --git a/server/node_modules/@aws-sdk/hash-node/package.json b/server/node_modules/@aws-sdk/hash-node/package.json new file mode 100644 index 0000000000..46f2d778ea --- /dev/null +++ b/server/node_modules/@aws-sdk/hash-node/package.json @@ -0,0 +1,57 @@ +{ + "name": "@aws-sdk/hash-node", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "hash-test-vectors": "^1.3.2", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "dependencies": { + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-buffer-from": "3.208.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/hash-node", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/hash-node" + } +} diff --git a/server/node_modules/@aws-sdk/invalid-dependency/LICENSE b/server/node_modules/@aws-sdk/invalid-dependency/LICENSE new file mode 100644 index 0000000000..e907b58668 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/invalid-dependency/README.md b/server/node_modules/@aws-sdk/invalid-dependency/README.md new file mode 100644 index 0000000000..552390b4b3 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/invalid-dependency + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/invalid-dependency/latest.svg)](https://www.npmjs.com/package/@aws-sdk/invalid-dependency) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/invalid-dependency.svg)](https://www.npmjs.com/package/@aws-sdk/invalid-dependency) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/index.js b/server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/index.js new file mode 100644 index 0000000000..c760073ddd --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./invalidFunction"), exports); +tslib_1.__exportStar(require("./invalidProvider"), exports); diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/invalidFunction.js b/server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/invalidFunction.js new file mode 100644 index 0000000000..ccff268c0f --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/invalidFunction.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.invalidFunction = void 0; +const invalidFunction = (message) => () => { + throw new Error(message); +}; +exports.invalidFunction = invalidFunction; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/invalidProvider.js b/server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/invalidProvider.js new file mode 100644 index 0000000000..bae05e6e04 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-cjs/invalidProvider.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.invalidProvider = void 0; +const invalidProvider = (message) => () => Promise.reject(message); +exports.invalidProvider = invalidProvider; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-es/index.js b/server/node_modules/@aws-sdk/invalid-dependency/dist-es/index.js new file mode 100644 index 0000000000..fa0f1a6060 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-es/index.js @@ -0,0 +1,2 @@ +export * from "./invalidFunction"; +export * from "./invalidProvider"; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-es/invalidFunction.js b/server/node_modules/@aws-sdk/invalid-dependency/dist-es/invalidFunction.js new file mode 100644 index 0000000000..676f9cb03d --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-es/invalidFunction.js @@ -0,0 +1,3 @@ +export const invalidFunction = (message) => () => { + throw new Error(message); +}; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-es/invalidProvider.js b/server/node_modules/@aws-sdk/invalid-dependency/dist-es/invalidProvider.js new file mode 100644 index 0000000000..5305a0bc5e --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-es/invalidProvider.js @@ -0,0 +1 @@ +export const invalidProvider = (message) => () => Promise.reject(message); diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-types/index.d.ts b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/index.d.ts new file mode 100644 index 0000000000..fa0f1a6060 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/index.d.ts @@ -0,0 +1,2 @@ +export * from "./invalidFunction"; +export * from "./invalidProvider"; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-types/invalidFunction.d.ts b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/invalidFunction.d.ts new file mode 100644 index 0000000000..568c4c5959 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/invalidFunction.d.ts @@ -0,0 +1 @@ +export declare const invalidFunction: (message: string) => () => never; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-types/invalidProvider.d.ts b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/invalidProvider.d.ts new file mode 100644 index 0000000000..a331845b59 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/invalidProvider.d.ts @@ -0,0 +1,2 @@ +import { Provider } from "@aws-sdk/types"; +export declare const invalidProvider: (message: string) => Provider; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..fa0f1a6060 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export * from "./invalidFunction"; +export * from "./invalidProvider"; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/invalidFunction.d.ts b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/invalidFunction.d.ts new file mode 100644 index 0000000000..568c4c5959 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/invalidFunction.d.ts @@ -0,0 +1 @@ +export declare const invalidFunction: (message: string) => () => never; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/invalidProvider.d.ts b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/invalidProvider.d.ts new file mode 100644 index 0000000000..a331845b59 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/dist-types/ts3.4/invalidProvider.d.ts @@ -0,0 +1,2 @@ +import { Provider } from "@aws-sdk/types"; +export declare const invalidProvider: (message: string) => Provider; diff --git a/server/node_modules/@aws-sdk/invalid-dependency/package.json b/server/node_modules/@aws-sdk/invalid-dependency/package.json new file mode 100644 index 0000000000..6df2c6f1a4 --- /dev/null +++ b/server/node_modules/@aws-sdk/invalid-dependency/package.json @@ -0,0 +1,50 @@ +{ + "name": "@aws-sdk/invalid-dependency", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/invalid-dependency", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/invalid-dependency" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/is-array-buffer/CHANGELOG.md b/server/node_modules/@aws-sdk/is-array-buffer/CHANGELOG.md new file mode 100644 index 0000000000..bff6371fad --- /dev/null +++ b/server/node_modules/@aws-sdk/is-array-buffer/CHANGELOG.md @@ -0,0 +1,663 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.201.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.200.0...v3.201.0) (2022-11-01) + + +### Features + +* end support for Node.js 12.x ([#4123](https://github.com/aws/aws-sdk-js-v3/issues/4123)) ([83f913e](https://github.com/aws/aws-sdk-js-v3/commit/83f913ec2ac3878d8726c6964f585550dc5caf3e)) + + + + + +# [3.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.170.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.169.0...v3.170.0) (2022-09-13) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.168.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.167.0...v3.168.0) (2022-09-09) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.52.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.51.0...v3.52.0) (2022-02-18) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.49.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.48.0...v3.49.0) (2022-01-29) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +## [3.47.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.47.0-release-test-1...v3.47.1) (2022-01-20) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.47.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.46.0...v3.47.0) (2022-01-15) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.46.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.45.0...v3.46.0) (2022-01-07) + + +### Features + +* **packages:** end support for Node.js 10.x ([#3141](https://github.com/aws/aws-sdk-js-v3/issues/3141)) ([1a62865](https://github.com/aws/aws-sdk-js-v3/commit/1a6286513f7cdb556708845c512861c5f92eb883)) + + + + + +# [3.37.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.36.1...v3.37.0) (2021-10-15) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.36.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.35.0...v3.36.0) (2021-10-08) + + +### Features + +* publish files in dist-* only ([#2873](https://github.com/aws/aws-sdk-js-v3/issues/2873)) ([53b4243](https://github.com/aws/aws-sdk-js-v3/commit/53b4243b066f25ff2412d5f0dea1036054b2df32)) + + + + + +# [3.35.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.34.0...v3.35.0) (2021-10-04) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.34.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.33.0...v3.34.0) (2021-09-24) + + +### Features + +* **non-clients:** remove comments from transpiled JS files ([#2813](https://github.com/aws/aws-sdk-js-v3/issues/2813)) ([e6fc7f3](https://github.com/aws/aws-sdk-js-v3/commit/e6fc7f3e0fa74785590ac19e7ed143c916bb9b6e)) + + + + + +# [3.32.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.31.0...v3.32.0) (2021-09-17) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.29.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.28.0...v3.29.0) (2021-09-02) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.23.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.22.0...v3.23.0) (2021-07-23) + + +### Bug Fixes + +* bump up tslib to 2.3.0 ([#2601](https://github.com/aws/aws-sdk-js-v3/issues/2601)) ([7040faa](https://github.com/aws/aws-sdk-js-v3/commit/7040faac07976c1dcfd5240675b82a2f275b2a55)) + + + + + +# [3.22.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.21.0...v3.22.0) (2021-07-16) + + +### Bug Fixes + +* **clients:** prefix `dist/` for typesVersions TS<4 ([#2580](https://github.com/aws/aws-sdk-js-v3/issues/2580)) ([dff5cd4](https://github.com/aws/aws-sdk-js-v3/commit/dff5cd4b6fa00453e938ce8f238c1542ee7ba3d6)) + + + + + +# [3.20.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.19.0...v3.20.0) (2021-07-02) + + +### Bug Fixes + +* replace prepublishOnly script with downlevel-dts ([#2537](https://github.com/aws/aws-sdk-js-v3/issues/2537)) ([63818a1](https://github.com/aws/aws-sdk-js-v3/commit/63818a1e47b08af56f092031a01bbbff0a9af590)) + + + + + +# [3.18.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.17.0...v3.18.0) (2021-06-04) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +## [3.13.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.13.0...v3.13.1) (2021-04-22) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.12.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.11.0...v3.12.0) (2021-04-09) + + +### Bug Fixes + +* run downlevel-dts in prepublishOnly ([#2218](https://github.com/aws/aws-sdk-js-v3/issues/2218)) ([0745502](https://github.com/aws/aws-sdk-js-v3/commit/0745502dcf819460ee1d81362470859674c757a7)) + + + + + +# [3.10.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.9.0...v3.10.0) (2021-03-26) + + +### Features + +* use ts-jest for running jest tests ([#2088](https://github.com/aws/aws-sdk-js-v3/issues/2088)) ([456002c](https://github.com/aws/aws-sdk-js-v3/commit/456002cf7fa16864b72c3c279b094886a42abddb)) + + + + + +## [3.6.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.6.0...v3.6.1) (2021-02-22) + + +### Bug Fixes + +* update references of default branch from master to main ([#2057](https://github.com/aws/aws-sdk-js-v3/issues/2057)) ([59b8b58](https://github.com/aws/aws-sdk-js-v3/commit/59b8b58c3a8c057b36abfaa59bae3a6ffb068cf1)) + + + + + +## [3.4.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.4.0...v3.4.1) (2021-01-29) + + +### Bug Fixes + +* **clients:** use TS 3.4 compatible types for TS 3.9 ([#1978](https://github.com/aws/aws-sdk-js-v3/issues/1978)) ([8bced5c](https://github.com/aws/aws-sdk-js-v3/commit/8bced5c32b9dbc68f1065054d796cb0b8b87bcc4)) + + + + + +# [3.4.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.3.0...v3.4.0) (2021-01-28) + + +### Features + +* use downlevel-dts to generate TS 3.4 compatible types ([#1943](https://github.com/aws/aws-sdk-js-v3/issues/1943)) ([63ad215](https://github.com/aws/aws-sdk-js-v3/commit/63ad2151c8bb7be32ea8838a9b0974806ed3906b)) + + + + + +# [3.1.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.0.0...v3.1.0) (2020-12-23) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [3.0.0](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.10...v3.0.0) (2020-12-15) + + +### Features + +* bump version to 3.0.0 ([#1793](https://github.com/aws/aws-sdk-js-v3/issues/1793)) ([d8475f8](https://github.com/aws/aws-sdk-js-v3/commit/d8475f8d972d28fbc15cd7e23abfe18f9eab0644)) + + + + + +# [1.0.0-rc.8](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.7...v1.0.0-rc.8) (2020-12-05) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [1.0.0-rc.3](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2020-10-27) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [1.0.0-rc.2](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.1...v1.0.0-rc.2) (2020-10-22) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [1.0.0-rc.1](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-gamma.11...v1.0.0-rc.1) (2020-10-19) + + +### Features + +* ready for release candidate ([#1578](https://github.com/aws/aws-sdk-js-v3/issues/1578)) ([519f66c](https://github.com/aws/aws-sdk-js-v3/commit/519f66c6388b91d0bd750a511e6d1af56196835e)) + + + + + +# [1.0.0-gamma.7](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@1.0.0-gamma.6...@aws-sdk/is-array-buffer@1.0.0-gamma.7) (2020-10-07) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [1.0.0-gamma.6](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@1.0.0-gamma.5...@aws-sdk/is-array-buffer@1.0.0-gamma.6) (2020-08-25) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [1.0.0-gamma.5](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@1.0.0-gamma.4...@aws-sdk/is-array-buffer@1.0.0-gamma.5) (2020-08-04) + + +### Features + +* build command ([#1407](https://github.com/aws/aws-sdk-js-v3/issues/1407)) ([81b2e87](https://github.com/aws/aws-sdk-js-v3/commit/81b2e87067642a8cea8649cbdb2c342ca9fb6ac6)) + + + + + +# [1.0.0-gamma.4](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@1.0.0-gamma.3...@aws-sdk/is-array-buffer@1.0.0-gamma.4) (2020-07-21) + +**Note:** Version bump only for package @aws-sdk/is-array-buffer + + + + + +# [1.0.0-gamma.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@1.0.0-gamma.2...@aws-sdk/is-array-buffer@1.0.0-gamma.3) (2020-07-13) + + +### Features + +* add code linting and prettify ([#1350](https://github.com/aws/aws-sdk-js-v3/issues/1350)) ([47770fa](https://github.com/aws/aws-sdk-js-v3/commit/47770fa493c3405f193069cd18319882529ff484)) + + + + + +# [1.0.0-gamma.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@0.1.0-preview.1...@aws-sdk/is-array-buffer@1.0.0-gamma.2) (2020-07-08) + + +### Features + +* use a common tsconfig for the monorepo ([#1297](https://github.com/aws/aws-sdk-js-v3/issues/1297)) ([16aea66](https://github.com/aws/aws-sdk-js-v3/commit/16aea66d1fc5386680d3e6da9b7dcde78e178bd3)) + + + +# 1.0.0-gamma.1 (2020-05-21) + + +### Features + +* bump up to gamma version ([#1192](https://github.com/aws/aws-sdk-js-v3/issues/1192)) ([a609075](https://github.com/aws/aws-sdk-js-v3/commit/a6090754f2a6c21e5b70bf0c8782cc0fbe59ee12)) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-gamma.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@0.1.0-preview.1...@aws-sdk/is-array-buffer@1.0.0-gamma.1) (2020-05-21) + + +### Features + +* bump up to gamma version ([#1192](https://github.com/aws/aws-sdk-js-v3/issues/1192)) ([a609075](https://github.com/aws/aws-sdk-js-v3/commit/a6090754f2a6c21e5b70bf0c8782cc0fbe59ee12)) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@0.1.0-preview.1...@aws-sdk/is-array-buffer@1.0.0-beta.2) (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@0.1.0-preview.1...@aws-sdk/is-array-buffer@1.0.0-beta.1) (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-alpha.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@0.1.0-preview.1...@aws-sdk/is-array-buffer@1.0.0-alpha.3) (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-alpha.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@0.1.0-preview.1...@aws-sdk/is-array-buffer@1.0.0-alpha.2) (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [1.0.0-alpha.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@0.1.0-preview.1...@aws-sdk/is-array-buffer@1.0.0-alpha.1) (2020-01-08) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [0.1.0-preview.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@0.1.0-preview.1...@aws-sdk/is-array-buffer@0.1.0-preview.3) (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [0.1.0-preview.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/is-array-buffer@0.1.0-preview.1...@aws-sdk/is-array-buffer@0.1.0-preview.2) (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) diff --git a/server/node_modules/@aws-sdk/is-array-buffer/LICENSE b/server/node_modules/@aws-sdk/is-array-buffer/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/is-array-buffer/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/is-array-buffer/README.md b/server/node_modules/@aws-sdk/is-array-buffer/README.md new file mode 100644 index 0000000000..30c0c7ee7a --- /dev/null +++ b/server/node_modules/@aws-sdk/is-array-buffer/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/is-array-buffer + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/is-array-buffer/latest.svg)](https://www.npmjs.com/package/@aws-sdk/is-array-buffer) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/is-array-buffer.svg)](https://www.npmjs.com/package/@aws-sdk/is-array-buffer) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/is-array-buffer/dist-cjs/index.js b/server/node_modules/@aws-sdk/is-array-buffer/dist-cjs/index.js new file mode 100644 index 0000000000..4c449a84e2 --- /dev/null +++ b/server/node_modules/@aws-sdk/is-array-buffer/dist-cjs/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isArrayBuffer = void 0; +const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) || + Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; +exports.isArrayBuffer = isArrayBuffer; diff --git a/server/node_modules/@aws-sdk/is-array-buffer/dist-es/index.js b/server/node_modules/@aws-sdk/is-array-buffer/dist-es/index.js new file mode 100644 index 0000000000..8096cca365 --- /dev/null +++ b/server/node_modules/@aws-sdk/is-array-buffer/dist-es/index.js @@ -0,0 +1,2 @@ +export const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) || + Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; diff --git a/server/node_modules/@aws-sdk/is-array-buffer/dist-types/index.d.ts b/server/node_modules/@aws-sdk/is-array-buffer/dist-types/index.d.ts new file mode 100644 index 0000000000..72d263d00d --- /dev/null +++ b/server/node_modules/@aws-sdk/is-array-buffer/dist-types/index.d.ts @@ -0,0 +1 @@ +export declare const isArrayBuffer: (arg: any) => arg is ArrayBuffer; diff --git a/server/node_modules/@aws-sdk/is-array-buffer/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/is-array-buffer/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..72d263d00d --- /dev/null +++ b/server/node_modules/@aws-sdk/is-array-buffer/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export declare const isArrayBuffer: (arg: any) => arg is ArrayBuffer; diff --git a/server/node_modules/@aws-sdk/is-array-buffer/package.json b/server/node_modules/@aws-sdk/is-array-buffer/package.json new file mode 100644 index 0000000000..97e05bcc2a --- /dev/null +++ b/server/node_modules/@aws-sdk/is-array-buffer/package.json @@ -0,0 +1,53 @@ +{ + "name": "@aws-sdk/is-array-buffer", + "version": "3.201.0", + "description": "Provides a function for detecting if an argument is an ArrayBuffer", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/is-array-buffer", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/is-array-buffer" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-content-length/LICENSE b/server/node_modules/@aws-sdk/middleware-content-length/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-content-length/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/middleware-content-length/README.md b/server/node_modules/@aws-sdk/middleware-content-length/README.md new file mode 100644 index 0000000000..468d273ef4 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-content-length/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/middleware-content-length + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-content-length/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-content-length) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-content-length.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-content-length) diff --git a/server/node_modules/@aws-sdk/middleware-content-length/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-content-length/dist-cjs/index.js new file mode 100644 index 0000000000..17865ca6f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-content-length/dist-cjs/index.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getContentLengthPlugin = exports.contentLengthMiddlewareOptions = exports.contentLengthMiddleware = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const CONTENT_LENGTH_HEADER = "content-length"; +function contentLengthMiddleware(bodyLengthChecker) { + return (next) => async (args) => { + const request = args.request; + if (protocol_http_1.HttpRequest.isInstance(request)) { + const { body, headers } = request; + if (body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf(CONTENT_LENGTH_HEADER) === -1) { + try { + const length = bodyLengthChecker(body); + request.headers = { + ...request.headers, + [CONTENT_LENGTH_HEADER]: String(length), + }; + } + catch (error) { + } + } + } + return next({ + ...args, + request, + }); + }; +} +exports.contentLengthMiddleware = contentLengthMiddleware; +exports.contentLengthMiddlewareOptions = { + step: "build", + tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], + name: "contentLengthMiddleware", + override: true, +}; +const getContentLengthPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), exports.contentLengthMiddlewareOptions); + }, +}); +exports.getContentLengthPlugin = getContentLengthPlugin; diff --git a/server/node_modules/@aws-sdk/middleware-content-length/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-content-length/dist-es/index.js new file mode 100644 index 0000000000..54fb403f71 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-content-length/dist-es/index.js @@ -0,0 +1,39 @@ +import { HttpRequest } from "@aws-sdk/protocol-http"; +const CONTENT_LENGTH_HEADER = "content-length"; +export function contentLengthMiddleware(bodyLengthChecker) { + return (next) => async (args) => { + const request = args.request; + if (HttpRequest.isInstance(request)) { + const { body, headers } = request; + if (body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf(CONTENT_LENGTH_HEADER) === -1) { + try { + const length = bodyLengthChecker(body); + request.headers = { + ...request.headers, + [CONTENT_LENGTH_HEADER]: String(length), + }; + } + catch (error) { + } + } + } + return next({ + ...args, + request, + }); + }; +} +export const contentLengthMiddlewareOptions = { + step: "build", + tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], + name: "contentLengthMiddleware", + override: true, +}; +export const getContentLengthPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); + }, +}); diff --git a/server/node_modules/@aws-sdk/middleware-content-length/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-content-length/dist-types/index.d.ts new file mode 100644 index 0000000000..c7f15cfeb9 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-content-length/dist-types/index.d.ts @@ -0,0 +1,6 @@ +import { BodyLengthCalculator, BuildHandlerOptions, BuildMiddleware, Pluggable } from "@aws-sdk/types"; +export declare function contentLengthMiddleware(bodyLengthChecker: BodyLengthCalculator): BuildMiddleware; +export declare const contentLengthMiddlewareOptions: BuildHandlerOptions; +export declare const getContentLengthPlugin: (options: { + bodyLengthChecker: BodyLengthCalculator; +}) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-content-length/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-content-length/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..016b25cfe2 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-content-length/dist-types/ts3.4/index.d.ts @@ -0,0 +1,13 @@ +import { + BodyLengthCalculator, + BuildHandlerOptions, + BuildMiddleware, + Pluggable, +} from "@aws-sdk/types"; +export declare function contentLengthMiddleware( + bodyLengthChecker: BodyLengthCalculator +): BuildMiddleware; +export declare const contentLengthMiddlewareOptions: BuildHandlerOptions; +export declare const getContentLengthPlugin: (options: { + bodyLengthChecker: BodyLengthCalculator; +}) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-content-length/package.json b/server/node_modules/@aws-sdk/middleware-content-length/package.json new file mode 100644 index 0000000000..0f538c0e62 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-content-length/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/middleware-content-length", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "exit 0" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-content-length", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-content-length" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/LICENSE b/server/node_modules/@aws-sdk/middleware-endpoint/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/README.md b/server/node_modules/@aws-sdk/middleware-endpoint/README.md new file mode 100644 index 0000000000..ca5cb22218 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/middleware-endpoint + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-endpoint/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-endpoint) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-endpoint.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-endpoint) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/createConfigValueProvider.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/createConfigValueProvider.js new file mode 100644 index 0000000000..6f0f137d34 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/createConfigValueProvider.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createConfigValueProvider = void 0; +const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config) => { + const configProvider = async () => { + var _a; + const configValue = (_a = config[configKey]) !== null && _a !== void 0 ? _a : config[canonicalEndpointParamKey]; + if (typeof configValue === "function") { + return configValue(); + } + return configValue; + }; + if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { + return async () => { + const endpoint = await configProvider(); + if (endpoint && typeof endpoint === "object") { + if ("url" in endpoint) { + return endpoint.url.href; + } + if ("hostname" in endpoint) { + const { protocol, hostname, port, path } = endpoint; + return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; + } + } + return endpoint; + }; + } + return configProvider; +}; +exports.createConfigValueProvider = createConfigValueProvider; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/getEndpointFromInstructions.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/getEndpointFromInstructions.js new file mode 100644 index 0000000000..31283fa7bb --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/getEndpointFromInstructions.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveParams = exports.getEndpointFromInstructions = void 0; +const service_customizations_1 = require("../service-customizations"); +const createConfigValueProvider_1 = require("./createConfigValueProvider"); +const getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { + const endpointParams = await (0, exports.resolveParams)(commandInput, instructionsSupplier, clientConfig); + if (typeof clientConfig.endpointProvider !== "function") { + throw new Error("config.endpointProvider is not set."); + } + const endpoint = clientConfig.endpointProvider(endpointParams, context); + return endpoint; +}; +exports.getEndpointFromInstructions = getEndpointFromInstructions; +const resolveParams = async (commandInput, instructionsSupplier, clientConfig) => { + var _a; + const endpointParams = {}; + const instructions = ((_a = instructionsSupplier === null || instructionsSupplier === void 0 ? void 0 : instructionsSupplier.getEndpointParameterInstructions) === null || _a === void 0 ? void 0 : _a.call(instructionsSupplier)) || {}; + for (const [name, instruction] of Object.entries(instructions)) { + switch (instruction.type) { + case "staticContextParams": + endpointParams[name] = instruction.value; + break; + case "contextParams": + endpointParams[name] = commandInput[instruction.name]; + break; + case "clientContextParams": + case "builtInParams": + endpointParams[name] = await (0, createConfigValueProvider_1.createConfigValueProvider)(instruction.name, name, clientConfig)(); + break; + default: + throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); + } + } + if (Object.keys(instructions).length === 0) { + Object.assign(endpointParams, clientConfig); + } + if (String(clientConfig.serviceId).toLowerCase() === "s3") { + await (0, service_customizations_1.resolveParamsForS3)(endpointParams); + } + return endpointParams; +}; +exports.resolveParams = resolveParams; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/index.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/index.js new file mode 100644 index 0000000000..59729092bd --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./getEndpointFromInstructions"), exports); +tslib_1.__exportStar(require("./toEndpointV1"), exports); diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/toEndpointV1.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/toEndpointV1.js new file mode 100644 index 0000000000..1cbe6f1391 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/toEndpointV1.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toEndpointV1 = void 0; +const url_parser_1 = require("@aws-sdk/url-parser"); +const toEndpointV1 = (endpoint) => { + if (typeof endpoint === "object") { + if ("url" in endpoint) { + return (0, url_parser_1.parseUrl)(endpoint.url); + } + return endpoint; + } + return (0, url_parser_1.parseUrl)(endpoint); +}; +exports.toEndpointV1 = toEndpointV1; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/endpointMiddleware.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/endpointMiddleware.js new file mode 100644 index 0000000000..46d0140f1f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/endpointMiddleware.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.endpointMiddleware = void 0; +const getEndpointFromInstructions_1 = require("./adaptors/getEndpointFromInstructions"); +const endpointMiddleware = ({ config, instructions, }) => { + return (next, context) => async (args) => { + var _a, _b; + const endpoint = await (0, getEndpointFromInstructions_1.getEndpointFromInstructions)(args.input, { + getEndpointParameterInstructions() { + return instructions; + }, + }, { ...config }, context); + context.endpointV2 = endpoint; + context.authSchemes = (_a = endpoint.properties) === null || _a === void 0 ? void 0 : _a.authSchemes; + const authScheme = (_b = context.authSchemes) === null || _b === void 0 ? void 0 : _b[0]; + if (authScheme) { + context["signing_region"] = authScheme.signingRegion; + context["signing_service"] = authScheme.signingName; + } + return next({ + ...args, + }); + }; +}; +exports.endpointMiddleware = endpointMiddleware; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/getEndpointPlugin.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/getEndpointPlugin.js new file mode 100644 index 0000000000..ab192816ef --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/getEndpointPlugin.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEndpointPlugin = exports.endpointMiddlewareOptions = void 0; +const middleware_serde_1 = require("@aws-sdk/middleware-serde"); +const endpointMiddleware_1 = require("./endpointMiddleware"); +exports.endpointMiddlewareOptions = { + step: "serialize", + tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], + name: "endpointV2Middleware", + override: true, + relation: "before", + toMiddleware: middleware_serde_1.serializerMiddlewareOption.name, +}; +const getEndpointPlugin = (config, instructions) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, endpointMiddleware_1.endpointMiddleware)({ + config, + instructions, + }), exports.endpointMiddlewareOptions); + }, +}); +exports.getEndpointPlugin = getEndpointPlugin; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/index.js new file mode 100644 index 0000000000..3ef2a87705 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./adaptors"), exports); +tslib_1.__exportStar(require("./endpointMiddleware"), exports); +tslib_1.__exportStar(require("./getEndpointPlugin"), exports); +tslib_1.__exportStar(require("./resolveEndpointConfig"), exports); +tslib_1.__exportStar(require("./types"), exports); diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/resolveEndpointConfig.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/resolveEndpointConfig.js new file mode 100644 index 0000000000..a215d7348c --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/resolveEndpointConfig.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveEndpointConfig = void 0; +const util_middleware_1 = require("@aws-sdk/util-middleware"); +const toEndpointV1_1 = require("./adaptors/toEndpointV1"); +const resolveEndpointConfig = (input) => { + var _a, _b, _c; + const tls = (_a = input.tls) !== null && _a !== void 0 ? _a : true; + const { endpoint } = input; + const customEndpointProvider = endpoint != null ? async () => (0, toEndpointV1_1.toEndpointV1)(await (0, util_middleware_1.normalizeProvider)(endpoint)()) : undefined; + const isCustomEndpoint = !!endpoint; + return { + ...input, + endpoint: customEndpointProvider, + tls, + isCustomEndpoint, + useDualstackEndpoint: (0, util_middleware_1.normalizeProvider)((_b = input.useDualstackEndpoint) !== null && _b !== void 0 ? _b : false), + useFipsEndpoint: (0, util_middleware_1.normalizeProvider)((_c = input.useFipsEndpoint) !== null && _c !== void 0 ? _c : false), + }; +}; +exports.resolveEndpointConfig = resolveEndpointConfig; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/service-customizations/index.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/service-customizations/index.js new file mode 100644 index 0000000000..3bb76407f4 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/service-customizations/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./s3"), exports); diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/service-customizations/s3.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/service-customizations/s3.js new file mode 100644 index 0000000000..9ec0a1848f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/service-customizations/s3.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isArnBucketName = exports.isDnsCompatibleBucketName = exports.S3_HOSTNAME_PATTERN = exports.DOT_PATTERN = exports.resolveParamsForS3 = void 0; +const resolveParamsForS3 = async (endpointParams) => { + const bucket = (endpointParams === null || endpointParams === void 0 ? void 0 : endpointParams.Bucket) || ""; + if (typeof endpointParams.Bucket === "string") { + endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); + } + if ((0, exports.isArnBucketName)(bucket)) { + if (endpointParams.ForcePathStyle === true) { + throw new Error("Path-style addressing cannot be used with ARN buckets"); + } + } + else if (!(0, exports.isDnsCompatibleBucketName)(bucket) || + (bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:")) || + bucket.toLowerCase() !== bucket || + bucket.length < 3) { + endpointParams.ForcePathStyle = true; + } + if (endpointParams.DisableMultiRegionAccessPoints) { + endpointParams.disableMultiRegionAccessPoints = true; + endpointParams.DisableMRAP = true; + } + return endpointParams; +}; +exports.resolveParamsForS3 = resolveParamsForS3; +const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; +const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; +const DOTS_PATTERN = /\.\./; +exports.DOT_PATTERN = /\./; +exports.S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./; +const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); +exports.isDnsCompatibleBucketName = isDnsCompatibleBucketName; +const isArnBucketName = (bucketName) => { + const [arn, partition, service, region, account, typeOrId] = bucketName.split(":"); + const isArn = arn === "arn" && bucketName.split(":").length >= 6; + const isValidArn = [arn, partition, service, account, typeOrId].filter(Boolean).length === 5; + if (isArn && !isValidArn) { + throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); + } + return arn === "arn" && !!partition && !!service && !!account && !!typeOrId; +}; +exports.isArnBucketName = isArnBucketName; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/types.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/types.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js new file mode 100644 index 0000000000..3761ccd978 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js @@ -0,0 +1,25 @@ +export const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config) => { + const configProvider = async () => { + const configValue = config[configKey] ?? config[canonicalEndpointParamKey]; + if (typeof configValue === "function") { + return configValue(); + } + return configValue; + }; + if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { + return async () => { + const endpoint = await configProvider(); + if (endpoint && typeof endpoint === "object") { + if ("url" in endpoint) { + return endpoint.url.href; + } + if ("hostname" in endpoint) { + const { protocol, hostname, port, path } = endpoint; + return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; + } + } + return endpoint; + }; + } + return configProvider; +}; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js new file mode 100644 index 0000000000..4e75d42d1b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js @@ -0,0 +1,37 @@ +import { resolveParamsForS3 } from "../service-customizations"; +import { createConfigValueProvider } from "./createConfigValueProvider"; +export const getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { + const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); + if (typeof clientConfig.endpointProvider !== "function") { + throw new Error("config.endpointProvider is not set."); + } + const endpoint = clientConfig.endpointProvider(endpointParams, context); + return endpoint; +}; +export const resolveParams = async (commandInput, instructionsSupplier, clientConfig) => { + const endpointParams = {}; + const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {}; + for (const [name, instruction] of Object.entries(instructions)) { + switch (instruction.type) { + case "staticContextParams": + endpointParams[name] = instruction.value; + break; + case "contextParams": + endpointParams[name] = commandInput[instruction.name]; + break; + case "clientContextParams": + case "builtInParams": + endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)(); + break; + default: + throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); + } + } + if (Object.keys(instructions).length === 0) { + Object.assign(endpointParams, clientConfig); + } + if (String(clientConfig.serviceId).toLowerCase() === "s3") { + await resolveParamsForS3(endpointParams); + } + return endpointParams; +}; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/index.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/index.js new file mode 100644 index 0000000000..17752da201 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/index.js @@ -0,0 +1,2 @@ +export * from "./getEndpointFromInstructions"; +export * from "./toEndpointV1"; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/toEndpointV1.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/toEndpointV1.js new file mode 100644 index 0000000000..b739628b97 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/adaptors/toEndpointV1.js @@ -0,0 +1,10 @@ +import { parseUrl } from "@aws-sdk/url-parser"; +export const toEndpointV1 = (endpoint) => { + if (typeof endpoint === "object") { + if ("url" in endpoint) { + return parseUrl(endpoint.url); + } + return endpoint; + } + return parseUrl(endpoint); +}; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/endpointMiddleware.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/endpointMiddleware.js new file mode 100644 index 0000000000..73cc945041 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/endpointMiddleware.js @@ -0,0 +1,20 @@ +import { getEndpointFromInstructions } from "./adaptors/getEndpointFromInstructions"; +export const endpointMiddleware = ({ config, instructions, }) => { + return (next, context) => async (args) => { + const endpoint = await getEndpointFromInstructions(args.input, { + getEndpointParameterInstructions() { + return instructions; + }, + }, { ...config }, context); + context.endpointV2 = endpoint; + context.authSchemes = endpoint.properties?.authSchemes; + const authScheme = context.authSchemes?.[0]; + if (authScheme) { + context["signing_region"] = authScheme.signingRegion; + context["signing_service"] = authScheme.signingName; + } + return next({ + ...args, + }); + }; +}; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/getEndpointPlugin.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/getEndpointPlugin.js new file mode 100644 index 0000000000..28c3033ba9 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/getEndpointPlugin.js @@ -0,0 +1,18 @@ +import { serializerMiddlewareOption } from "@aws-sdk/middleware-serde"; +import { endpointMiddleware } from "./endpointMiddleware"; +export const endpointMiddlewareOptions = { + step: "serialize", + tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], + name: "endpointV2Middleware", + override: true, + relation: "before", + toMiddleware: serializerMiddlewareOption.name, +}; +export const getEndpointPlugin = (config, instructions) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(endpointMiddleware({ + config, + instructions, + }), endpointMiddlewareOptions); + }, +}); diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/index.js new file mode 100644 index 0000000000..f89653edeb --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/index.js @@ -0,0 +1,5 @@ +export * from "./adaptors"; +export * from "./endpointMiddleware"; +export * from "./getEndpointPlugin"; +export * from "./resolveEndpointConfig"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/resolveEndpointConfig.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/resolveEndpointConfig.js new file mode 100644 index 0000000000..e692d722c4 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/resolveEndpointConfig.js @@ -0,0 +1,16 @@ +import { normalizeProvider } from "@aws-sdk/util-middleware"; +import { toEndpointV1 } from "./adaptors/toEndpointV1"; +export const resolveEndpointConfig = (input) => { + const tls = input.tls ?? true; + const { endpoint } = input; + const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider(endpoint)()) : undefined; + const isCustomEndpoint = !!endpoint; + return { + ...input, + endpoint: customEndpointProvider, + tls, + isCustomEndpoint, + useDualstackEndpoint: normalizeProvider(input.useDualstackEndpoint ?? false), + useFipsEndpoint: normalizeProvider(input.useFipsEndpoint ?? false), + }; +}; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/service-customizations/index.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/service-customizations/index.js new file mode 100644 index 0000000000..e50e10799f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/service-customizations/index.js @@ -0,0 +1 @@ +export * from "./s3"; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/service-customizations/s3.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/service-customizations/s3.js new file mode 100644 index 0000000000..b199305ae9 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/service-customizations/s3.js @@ -0,0 +1,37 @@ +export const resolveParamsForS3 = async (endpointParams) => { + const bucket = endpointParams?.Bucket || ""; + if (typeof endpointParams.Bucket === "string") { + endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); + } + if (isArnBucketName(bucket)) { + if (endpointParams.ForcePathStyle === true) { + throw new Error("Path-style addressing cannot be used with ARN buckets"); + } + } + else if (!isDnsCompatibleBucketName(bucket) || + (bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:")) || + bucket.toLowerCase() !== bucket || + bucket.length < 3) { + endpointParams.ForcePathStyle = true; + } + if (endpointParams.DisableMultiRegionAccessPoints) { + endpointParams.disableMultiRegionAccessPoints = true; + endpointParams.DisableMRAP = true; + } + return endpointParams; +}; +const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; +const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; +const DOTS_PATTERN = /\.\./; +export const DOT_PATTERN = /\./; +export const S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./; +export const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); +export const isArnBucketName = (bucketName) => { + const [arn, partition, service, region, account, typeOrId] = bucketName.split(":"); + const isArn = arn === "arn" && bucketName.split(":").length >= 6; + const isValidArn = [arn, partition, service, account, typeOrId].filter(Boolean).length === 5; + if (isArn && !isValidArn) { + throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); + } + return arn === "arn" && !!partition && !!service && !!account && !!typeOrId; +}; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/types.js b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/types.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-es/types.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/createConfigValueProvider.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/createConfigValueProvider.d.ts new file mode 100644 index 0000000000..1ba7748905 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/createConfigValueProvider.d.ts @@ -0,0 +1,13 @@ +/** + * Normalize some key of the client config to an async provider. + * @private + * + * @param configKey - the key to look up in config. + * @param canonicalEndpointParamKey - this is the name the EndpointRuleSet uses. + * it will most likely not contain the config + * value, but we use it as a fallback. + * @param config - container of the config values. + * + * @returns async function that will resolve with the value. + */ +export declare const createConfigValueProvider: >(configKey: string, canonicalEndpointParamKey: string, config: Config) => () => Promise; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/getEndpointFromInstructions.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/getEndpointFromInstructions.d.ts new file mode 100644 index 0000000000..746d665ee2 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/getEndpointFromInstructions.d.ts @@ -0,0 +1,22 @@ +import { EndpointParameters, EndpointV2, HandlerExecutionContext } from "@aws-sdk/types"; +import { EndpointResolvedConfig } from "../resolveEndpointConfig"; +import { EndpointParameterInstructions } from "../types"; +export declare type EndpointParameterInstructionsSupplier = Partial<{ + getEndpointParameterInstructions(): EndpointParameterInstructions; +}>; +/** + * This step in the endpoint resolution process is exposed as a function + * to allow packages such as signers, lib-upload, etc. to get + * the V2 Endpoint associated to an instance of some api operation command + * without needing to send it or resolve its middleware stack. + * + * @private + * @param commandInput - the input of the Command in question. + * @param instructionsSupplier - this is typically a Command constructor. A static function supplying the + * endpoint parameter instructions will exist for commands in services + * having an endpoints ruleset trait. + * @param clientConfig - config of the service client. + * @param context - optional context. + */ +export declare const getEndpointFromInstructions: , Config extends Record>(commandInput: CommandInput, instructionsSupplier: EndpointParameterInstructionsSupplier, clientConfig: Partial> & Config, context?: HandlerExecutionContext | undefined) => Promise; +export declare const resolveParams: , Config extends Record>(commandInput: CommandInput, instructionsSupplier: EndpointParameterInstructionsSupplier, clientConfig: Partial> & Config) => Promise; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/index.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/index.d.ts new file mode 100644 index 0000000000..17752da201 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/index.d.ts @@ -0,0 +1,2 @@ +export * from "./getEndpointFromInstructions"; +export * from "./toEndpointV1"; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/toEndpointV1.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/toEndpointV1.d.ts new file mode 100644 index 0000000000..51fc9ef7d3 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/adaptors/toEndpointV1.d.ts @@ -0,0 +1,2 @@ +import { Endpoint, EndpointV2 } from "@aws-sdk/types"; +export declare const toEndpointV1: (endpoint: string | Endpoint | EndpointV2) => Endpoint; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/endpointMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/endpointMiddleware.d.ts new file mode 100644 index 0000000000..916b4c371e --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/endpointMiddleware.d.ts @@ -0,0 +1,10 @@ +import { EndpointParameters, SerializeMiddleware } from "@aws-sdk/types"; +import { EndpointResolvedConfig } from "./resolveEndpointConfig"; +import { EndpointParameterInstructions } from "./types"; +/** + * @private + */ +export declare const endpointMiddleware: ({ config, instructions, }: { + config: EndpointResolvedConfig; + instructions: EndpointParameterInstructions; +}) => SerializeMiddleware; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/getEndpointPlugin.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/getEndpointPlugin.d.ts new file mode 100644 index 0000000000..d5085e612b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/getEndpointPlugin.d.ts @@ -0,0 +1,5 @@ +import { EndpointParameters, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@aws-sdk/types"; +import { EndpointResolvedConfig } from "./resolveEndpointConfig"; +import { EndpointParameterInstructions } from "./types"; +export declare const endpointMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions; +export declare const getEndpointPlugin: (config: EndpointResolvedConfig, instructions: EndpointParameterInstructions) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/index.d.ts new file mode 100644 index 0000000000..f89653edeb --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/index.d.ts @@ -0,0 +1,5 @@ +export * from "./adaptors"; +export * from "./endpointMiddleware"; +export * from "./getEndpointPlugin"; +export * from "./resolveEndpointConfig"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts new file mode 100644 index 0000000000..b2306f4ee0 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts @@ -0,0 +1,81 @@ +import { Endpoint, EndpointParameters, EndpointV2, Logger, Provider, UrlParser } from "@aws-sdk/types"; +/** + * Endpoint config interfaces and resolver for Endpoint v2. They live in separate package to allow per-service onboarding. + * When all services onboard Endpoint v2, the resolver in config-resolver package can be removed. + * This interface includes all the endpoint parameters with built-in bindings of "AWS::*" and "SDK::*" + */ +export interface EndpointInputConfig { + /** + * The fully qualified endpoint of the webservice. This is only for using + * a custom endpoint (for example, when using a local version of S3). + * + * Endpoint transformations such as S3 applying a bucket to the hostname are + * still applicable to this custom endpoint. + */ + endpoint?: string | Endpoint | Provider | EndpointV2 | Provider; + /** + * Providing a custom endpointProvider will override + * built-in transformations of the endpoint such as S3 adding the bucket + * name to the hostname, since they are part of the default endpointProvider. + */ + endpointProvider?: (params: T, context?: { + logger?: Logger; + }) => EndpointV2; + /** + * Whether TLS is enabled for requests. + * @deprecated + */ + tls?: boolean; + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | Provider; + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | Provider; +} +interface PreviouslyResolved { + urlParser: UrlParser; + region: Provider; + endpointProvider: (params: T, context?: { + logger?: Logger; + }) => EndpointV2; + logger?: Logger; +} +/** + * This supercedes the similarly named EndpointsResolvedConfig (no parametric types) + * from resolveEndpointsConfig.ts in @aws-sdk/config-resolver. + */ +export interface EndpointResolvedConfig { + /** + * Custom endpoint provided by the user. + * This is normalized to a single interface from the various acceptable types. + * This field will be undefined if a custom endpoint is not provided. + */ + endpoint?: Provider; + endpointProvider: (params: T, context?: { + logger?: Logger; + }) => EndpointV2; + /** + * Whether TLS is enabled for requests. + * @deprecated + */ + tls: boolean; + /** + * Whether the endpoint is specified by caller. + * @internal + * @deprecated + */ + isCustomEndpoint?: boolean; + /** + * Resolved value for input {@link EndpointsInputConfig.useDualstackEndpoint} + */ + useDualstackEndpoint: Provider; + /** + * Resolved value for input {@link EndpointsInputConfig.useFipsEndpoint} + */ + useFipsEndpoint: Provider; +} +export declare const resolveEndpointConfig: (input: T & EndpointInputConfig

& PreviouslyResolved

) => T & EndpointResolvedConfig

; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/service-customizations/index.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/service-customizations/index.d.ts new file mode 100644 index 0000000000..e50e10799f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/service-customizations/index.d.ts @@ -0,0 +1 @@ +export * from "./s3"; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/service-customizations/s3.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/service-customizations/s3.d.ts new file mode 100644 index 0000000000..edf87ea4d2 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/service-customizations/s3.d.ts @@ -0,0 +1,14 @@ +import { EndpointParameters } from "@aws-sdk/types"; +export declare const resolveParamsForS3: (endpointParams: EndpointParameters) => Promise; +export declare const DOT_PATTERN: RegExp; +export declare const S3_HOSTNAME_PATTERN: RegExp; +/** + * Determines whether a given string is DNS compliant per the rules outlined by + * S3. Length, capitaization, and leading dot restrictions are enforced by the + * DOMAIN_PATTERN regular expression. + * @internal + * + * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html + */ +export declare const isDnsCompatibleBucketName: (bucketName: string) => boolean; +export declare const isArnBucketName: (bucketName: string) => boolean; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/createConfigValueProvider.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/createConfigValueProvider.d.ts new file mode 100644 index 0000000000..294b681881 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/createConfigValueProvider.d.ts @@ -0,0 +1,7 @@ +export declare const createConfigValueProvider: < + Config extends Record +>( + configKey: string, + canonicalEndpointParamKey: string, + config: Config +) => () => Promise; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/getEndpointFromInstructions.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/getEndpointFromInstructions.d.ts new file mode 100644 index 0000000000..938974250f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/getEndpointFromInstructions.d.ts @@ -0,0 +1,29 @@ +import { + EndpointParameters, + EndpointV2, + HandlerExecutionContext, +} from "@aws-sdk/types"; +import { EndpointResolvedConfig } from "../resolveEndpointConfig"; +import { EndpointParameterInstructions } from "../types"; +export declare type EndpointParameterInstructionsSupplier = Partial<{ + getEndpointParameterInstructions(): EndpointParameterInstructions; +}>; +export declare const getEndpointFromInstructions: < + T extends EndpointParameters, + CommandInput extends Record, + Config extends Record +>( + commandInput: CommandInput, + instructionsSupplier: EndpointParameterInstructionsSupplier, + clientConfig: Partial> & Config, + context?: HandlerExecutionContext | undefined +) => Promise; +export declare const resolveParams: < + T extends EndpointParameters, + CommandInput extends Record, + Config extends Record +>( + commandInput: CommandInput, + instructionsSupplier: EndpointParameterInstructionsSupplier, + clientConfig: Partial> & Config +) => Promise; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/index.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/index.d.ts new file mode 100644 index 0000000000..17752da201 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/index.d.ts @@ -0,0 +1,2 @@ +export * from "./getEndpointFromInstructions"; +export * from "./toEndpointV1"; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/toEndpointV1.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/toEndpointV1.d.ts new file mode 100644 index 0000000000..9d3ec7b36e --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/adaptors/toEndpointV1.d.ts @@ -0,0 +1,4 @@ +import { Endpoint, EndpointV2 } from "@aws-sdk/types"; +export declare const toEndpointV1: ( + endpoint: string | Endpoint | EndpointV2 +) => Endpoint; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/endpointMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/endpointMiddleware.d.ts new file mode 100644 index 0000000000..40d8675ee8 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/endpointMiddleware.d.ts @@ -0,0 +1,10 @@ +import { EndpointParameters, SerializeMiddleware } from "@aws-sdk/types"; +import { EndpointResolvedConfig } from "./resolveEndpointConfig"; +import { EndpointParameterInstructions } from "./types"; +export declare const endpointMiddleware: ({ + config, + instructions, +}: { + config: EndpointResolvedConfig; + instructions: EndpointParameterInstructions; +}) => SerializeMiddleware; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/getEndpointPlugin.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/getEndpointPlugin.d.ts new file mode 100644 index 0000000000..30c9304d43 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/getEndpointPlugin.d.ts @@ -0,0 +1,14 @@ +import { + EndpointParameters, + Pluggable, + RelativeMiddlewareOptions, + SerializeHandlerOptions, +} from "@aws-sdk/types"; +import { EndpointResolvedConfig } from "./resolveEndpointConfig"; +import { EndpointParameterInstructions } from "./types"; +export declare const endpointMiddlewareOptions: SerializeHandlerOptions & + RelativeMiddlewareOptions; +export declare const getEndpointPlugin: ( + config: EndpointResolvedConfig, + instructions: EndpointParameterInstructions +) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..f89653edeb --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/index.d.ts @@ -0,0 +1,5 @@ +export * from "./adaptors"; +export * from "./endpointMiddleware"; +export * from "./getEndpointPlugin"; +export * from "./resolveEndpointConfig"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts new file mode 100644 index 0000000000..dba6165b00 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts @@ -0,0 +1,62 @@ +import { + Endpoint, + EndpointParameters, + EndpointV2, + Logger, + Provider, + UrlParser, +} from "@aws-sdk/types"; +export interface EndpointInputConfig< + T extends EndpointParameters = EndpointParameters +> { + endpoint?: + | string + | Endpoint + | Provider + | EndpointV2 + | Provider; + endpointProvider?: ( + params: T, + context?: { + logger?: Logger; + } + ) => EndpointV2; + tls?: boolean; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; +} +interface PreviouslyResolved< + T extends EndpointParameters = EndpointParameters +> { + urlParser: UrlParser; + region: Provider; + endpointProvider: ( + params: T, + context?: { + logger?: Logger; + } + ) => EndpointV2; + logger?: Logger; +} +export interface EndpointResolvedConfig< + T extends EndpointParameters = EndpointParameters +> { + endpoint?: Provider; + endpointProvider: ( + params: T, + context?: { + logger?: Logger; + } + ) => EndpointV2; + tls: boolean; + isCustomEndpoint?: boolean; + useDualstackEndpoint: Provider; + useFipsEndpoint: Provider; +} +export declare const resolveEndpointConfig: < + T, + P extends EndpointParameters = EndpointParameters +>( + input: T & EndpointInputConfig

& PreviouslyResolved

+) => T & EndpointResolvedConfig

; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/service-customizations/index.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/service-customizations/index.d.ts new file mode 100644 index 0000000000..e50e10799f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/service-customizations/index.d.ts @@ -0,0 +1 @@ +export * from "./s3"; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/service-customizations/s3.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/service-customizations/s3.d.ts new file mode 100644 index 0000000000..1bb3cb2b34 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/service-customizations/s3.d.ts @@ -0,0 +1,8 @@ +import { EndpointParameters } from "@aws-sdk/types"; +export declare const resolveParamsForS3: ( + endpointParams: EndpointParameters +) => Promise; +export declare const DOT_PATTERN: RegExp; +export declare const S3_HOSTNAME_PATTERN: RegExp; +export declare const isDnsCompatibleBucketName: (bucketName: string) => boolean; +export declare const isArnBucketName: (bucketName: string) => boolean; diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/types.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/types.d.ts new file mode 100644 index 0000000000..5d8b3aa538 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/ts3.4/types.d.ts @@ -0,0 +1,23 @@ +export interface EndpointParameterInstructions { + [name: string]: + | BuiltInParamInstruction + | ClientContextParamInstruction + | StaticContextParamInstruction + | ContextParamInstruction; +} +export interface BuiltInParamInstruction { + type: "builtInParams"; + name: string; +} +export interface ClientContextParamInstruction { + type: "clientContextParams"; + name: string; +} +export interface StaticContextParamInstruction { + type: "staticContextParams"; + value: string | boolean; +} +export interface ContextParamInstruction { + type: "contextParams"; + name: string; +} diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/types.d.ts b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/types.d.ts new file mode 100644 index 0000000000..9116fe6736 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/dist-types/types.d.ts @@ -0,0 +1,19 @@ +export interface EndpointParameterInstructions { + [name: string]: BuiltInParamInstruction | ClientContextParamInstruction | StaticContextParamInstruction | ContextParamInstruction; +} +export interface BuiltInParamInstruction { + type: "builtInParams"; + name: string; +} +export interface ClientContextParamInstruction { + type: "clientContextParams"; + name: string; +} +export interface StaticContextParamInstruction { + type: "staticContextParams"; + value: string | boolean; +} +export interface ContextParamInstruction { + type: "contextParams"; + name: string; +} diff --git a/server/node_modules/@aws-sdk/middleware-endpoint/package.json b/server/node_modules/@aws-sdk/middleware-endpoint/package.json new file mode 100644 index 0000000000..798d2b3fad --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-endpoint/package.json @@ -0,0 +1,59 @@ +{ + "name": "@aws-sdk/middleware-endpoint", + "version": "3.264.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --passWithNoTests" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-serde": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/signature-v4": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/url-parser": "3.257.0", + "@aws-sdk/util-config-provider": "3.208.0", + "@aws-sdk/util-middleware": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-endpoint", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-endpoint" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-host-header/LICENSE b/server/node_modules/@aws-sdk/middleware-host-header/LICENSE new file mode 100644 index 0000000000..e907b58668 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-host-header/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/middleware-host-header/README.md b/server/node_modules/@aws-sdk/middleware-host-header/README.md new file mode 100644 index 0000000000..123940e6d6 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-host-header/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/middleware-host-header + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-host-header/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-host-header) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-host-header.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-host-header) diff --git a/server/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js new file mode 100644 index 0000000000..228ce388af --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getHostHeaderPlugin = exports.hostHeaderMiddlewareOptions = exports.hostHeaderMiddleware = exports.resolveHostHeaderConfig = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +function resolveHostHeaderConfig(input) { + return input; +} +exports.resolveHostHeaderConfig = resolveHostHeaderConfig; +const hostHeaderMiddleware = (options) => (next) => async (args) => { + if (!protocol_http_1.HttpRequest.isInstance(args.request)) + return next(args); + const { request } = args; + const { handlerProtocol = "" } = options.requestHandler.metadata || {}; + if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { + delete request.headers["host"]; + request.headers[":authority"] = ""; + } + else if (!request.headers["host"]) { + request.headers["host"] = request.hostname; + } + return next(args); +}; +exports.hostHeaderMiddleware = hostHeaderMiddleware; +exports.hostHeaderMiddlewareOptions = { + name: "hostHeaderMiddleware", + step: "build", + priority: "low", + tags: ["HOST"], + override: true, +}; +const getHostHeaderPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.hostHeaderMiddleware)(options), exports.hostHeaderMiddlewareOptions); + }, +}); +exports.getHostHeaderPlugin = getHostHeaderPlugin; diff --git a/server/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js new file mode 100644 index 0000000000..1df8929dc9 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js @@ -0,0 +1,30 @@ +import { HttpRequest } from "@aws-sdk/protocol-http"; +export function resolveHostHeaderConfig(input) { + return input; +} +export const hostHeaderMiddleware = (options) => (next) => async (args) => { + if (!HttpRequest.isInstance(args.request)) + return next(args); + const { request } = args; + const { handlerProtocol = "" } = options.requestHandler.metadata || {}; + if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { + delete request.headers["host"]; + request.headers[":authority"] = ""; + } + else if (!request.headers["host"]) { + request.headers["host"] = request.hostname; + } + return next(args); +}; +export const hostHeaderMiddlewareOptions = { + name: "hostHeaderMiddleware", + step: "build", + priority: "low", + tags: ["HOST"], + override: true, +}; +export const getHostHeaderPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); + }, +}); diff --git a/server/node_modules/@aws-sdk/middleware-host-header/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-host-header/dist-types/index.d.ts new file mode 100644 index 0000000000..f269524087 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-host-header/dist-types/index.d.ts @@ -0,0 +1,17 @@ +import { AbsoluteLocation, BuildHandlerOptions, BuildMiddleware, Pluggable, RequestHandler } from "@aws-sdk/types"; +export interface HostHeaderInputConfig { +} +interface PreviouslyResolved { + requestHandler: RequestHandler; +} +export interface HostHeaderResolvedConfig { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler: RequestHandler; +} +export declare function resolveHostHeaderConfig(input: T & PreviouslyResolved & HostHeaderInputConfig): T & HostHeaderResolvedConfig; +export declare const hostHeaderMiddleware: (options: HostHeaderResolvedConfig) => BuildMiddleware; +export declare const hostHeaderMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation; +export declare const getHostHeaderPlugin: (options: HostHeaderResolvedConfig) => Pluggable; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-host-header/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-host-header/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..46a1bda0ac --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-host-header/dist-types/ts3.4/index.d.ts @@ -0,0 +1,29 @@ +import { + AbsoluteLocation, + BuildHandlerOptions, + BuildMiddleware, + Pluggable, + RequestHandler, +} from "@aws-sdk/types"; +export interface HostHeaderInputConfig {} +interface PreviouslyResolved { + requestHandler: RequestHandler; +} +export interface HostHeaderResolvedConfig { + requestHandler: RequestHandler; +} +export declare function resolveHostHeaderConfig( + input: T & PreviouslyResolved & HostHeaderInputConfig +): T & HostHeaderResolvedConfig; +export declare const hostHeaderMiddleware: < + Input extends object, + Output extends object +>( + options: HostHeaderResolvedConfig +) => BuildMiddleware; +export declare const hostHeaderMiddlewareOptions: BuildHandlerOptions & + AbsoluteLocation; +export declare const getHostHeaderPlugin: ( + options: HostHeaderResolvedConfig +) => Pluggable; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-host-header/package.json b/server/node_modules/@aws-sdk/middleware-host-header/package.json new file mode 100644 index 0000000000..d184c27967 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-host-header/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/middleware-host-header", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-host-header", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-host-header" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-logger/LICENSE b/server/node_modules/@aws-sdk/middleware-logger/LICENSE new file mode 100644 index 0000000000..74d4e5c31f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/middleware-logger/README.md b/server/node_modules/@aws-sdk/middleware-logger/README.md new file mode 100644 index 0000000000..861fa43fea --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/middleware-logger + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-logger/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-logger) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-logger.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-logger) diff --git a/server/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js new file mode 100644 index 0000000000..747113b084 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./loggerMiddleware"), exports); diff --git a/server/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js b/server/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js new file mode 100644 index 0000000000..3d65748643 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getLoggerPlugin = exports.loggerMiddlewareOptions = exports.loggerMiddleware = void 0; +const loggerMiddleware = () => (next, context) => async (args) => { + const response = await next(args); + const { clientName, commandName, logger, inputFilterSensitiveLog, outputFilterSensitiveLog, dynamoDbDocumentClientOptions = {}, } = context; + const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + if (!logger) { + return response; + } + if (typeof logger.info === "function") { + const { $metadata, ...outputWithoutMetadata } = response.output; + logger.info({ + clientName, + commandName, + input: (overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : inputFilterSensitiveLog)(args.input), + output: (overrideOutputFilterSensitiveLog !== null && overrideOutputFilterSensitiveLog !== void 0 ? overrideOutputFilterSensitiveLog : outputFilterSensitiveLog)(outputWithoutMetadata), + metadata: $metadata, + }); + } + return response; +}; +exports.loggerMiddleware = loggerMiddleware; +exports.loggerMiddlewareOptions = { + name: "loggerMiddleware", + tags: ["LOGGER"], + step: "initialize", + override: true, +}; +const getLoggerPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.loggerMiddleware)(), exports.loggerMiddlewareOptions); + }, +}); +exports.getLoggerPlugin = getLoggerPlugin; diff --git a/server/node_modules/@aws-sdk/middleware-logger/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-logger/dist-es/index.js new file mode 100644 index 0000000000..171e3bc54d --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/dist-es/index.js @@ -0,0 +1 @@ +export * from "./loggerMiddleware"; diff --git a/server/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js b/server/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js new file mode 100644 index 0000000000..bb26fb8a9f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js @@ -0,0 +1,30 @@ +export const loggerMiddleware = () => (next, context) => async (args) => { + const response = await next(args); + const { clientName, commandName, logger, inputFilterSensitiveLog, outputFilterSensitiveLog, dynamoDbDocumentClientOptions = {}, } = context; + const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + if (!logger) { + return response; + } + if (typeof logger.info === "function") { + const { $metadata, ...outputWithoutMetadata } = response.output; + logger.info({ + clientName, + commandName, + input: (overrideInputFilterSensitiveLog ?? inputFilterSensitiveLog)(args.input), + output: (overrideOutputFilterSensitiveLog ?? outputFilterSensitiveLog)(outputWithoutMetadata), + metadata: $metadata, + }); + } + return response; +}; +export const loggerMiddlewareOptions = { + name: "loggerMiddleware", + tags: ["LOGGER"], + step: "initialize", + override: true, +}; +export const getLoggerPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); + }, +}); diff --git a/server/node_modules/@aws-sdk/middleware-logger/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-logger/dist-types/index.d.ts new file mode 100644 index 0000000000..171e3bc54d --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./loggerMiddleware"; diff --git a/server/node_modules/@aws-sdk/middleware-logger/dist-types/loggerMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-logger/dist-types/loggerMiddleware.d.ts new file mode 100644 index 0000000000..efe867fad8 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/dist-types/loggerMiddleware.d.ts @@ -0,0 +1,4 @@ +import { AbsoluteLocation, HandlerExecutionContext, InitializeHandler, InitializeHandlerOptions, MetadataBearer, Pluggable } from "@aws-sdk/types"; +export declare const loggerMiddleware: () => (next: InitializeHandler, context: HandlerExecutionContext) => InitializeHandler; +export declare const loggerMiddlewareOptions: InitializeHandlerOptions & AbsoluteLocation; +export declare const getLoggerPlugin: (options: any) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..171e3bc54d --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./loggerMiddleware"; diff --git a/server/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/loggerMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/loggerMiddleware.d.ts new file mode 100644 index 0000000000..d8f511c0d2 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/loggerMiddleware.d.ts @@ -0,0 +1,17 @@ +import { + AbsoluteLocation, + HandlerExecutionContext, + InitializeHandler, + InitializeHandlerOptions, + MetadataBearer, + Pluggable, +} from "@aws-sdk/types"; +export declare const loggerMiddleware: () => < + Output extends MetadataBearer = MetadataBearer +>( + next: InitializeHandler, + context: HandlerExecutionContext +) => InitializeHandler; +export declare const loggerMiddlewareOptions: InitializeHandlerOptions & + AbsoluteLocation; +export declare const getLoggerPlugin: (options: any) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-logger/package.json b/server/node_modules/@aws-sdk/middleware-logger/package.json new file mode 100644 index 0000000000..2c4687ded3 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-logger/package.json @@ -0,0 +1,55 @@ +{ + "name": "@aws-sdk/middleware-logger", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --passWithNoTests" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "email": "", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-logger", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-logger" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-recursion-detection/LICENSE b/server/node_modules/@aws-sdk/middleware-recursion-detection/LICENSE new file mode 100644 index 0000000000..e907b58668 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-recursion-detection/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/middleware-recursion-detection/README.md b/server/node_modules/@aws-sdk/middleware-recursion-detection/README.md new file mode 100644 index 0000000000..2d5437e0af --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-recursion-detection/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/middleware-recursion-detection + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-recursion-detection/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-recursion-detection) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-recursion-detection.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-recursion-detection) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js new file mode 100644 index 0000000000..181d2d04a5 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRecursionDetectionPlugin = exports.addRecursionDetectionMiddlewareOptions = exports.recursionDetectionMiddleware = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; +const ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; +const ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; +const recursionDetectionMiddleware = (options) => (next) => async (args) => { + const { request } = args; + if (!protocol_http_1.HttpRequest.isInstance(request) || + options.runtime !== "node" || + request.headers.hasOwnProperty(TRACE_ID_HEADER_NAME)) { + return next(args); + } + const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; + const traceId = process.env[ENV_TRACE_ID]; + const nonEmptyString = (str) => typeof str === "string" && str.length > 0; + if (nonEmptyString(functionName) && nonEmptyString(traceId)) { + request.headers[TRACE_ID_HEADER_NAME] = traceId; + } + return next({ + ...args, + request, + }); +}; +exports.recursionDetectionMiddleware = recursionDetectionMiddleware; +exports.addRecursionDetectionMiddlewareOptions = { + step: "build", + tags: ["RECURSION_DETECTION"], + name: "recursionDetectionMiddleware", + override: true, + priority: "low", +}; +const getRecursionDetectionPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.recursionDetectionMiddleware)(options), exports.addRecursionDetectionMiddlewareOptions); + }, +}); +exports.getRecursionDetectionPlugin = getRecursionDetectionPlugin; diff --git a/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js new file mode 100644 index 0000000000..01ef54bdf7 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js @@ -0,0 +1,34 @@ +import { HttpRequest } from "@aws-sdk/protocol-http"; +const TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; +const ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; +const ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; +export const recursionDetectionMiddleware = (options) => (next) => async (args) => { + const { request } = args; + if (!HttpRequest.isInstance(request) || + options.runtime !== "node" || + request.headers.hasOwnProperty(TRACE_ID_HEADER_NAME)) { + return next(args); + } + const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; + const traceId = process.env[ENV_TRACE_ID]; + const nonEmptyString = (str) => typeof str === "string" && str.length > 0; + if (nonEmptyString(functionName) && nonEmptyString(traceId)) { + request.headers[TRACE_ID_HEADER_NAME] = traceId; + } + return next({ + ...args, + request, + }); +}; +export const addRecursionDetectionMiddlewareOptions = { + step: "build", + tags: ["RECURSION_DETECTION"], + name: "recursionDetectionMiddleware", + override: true, + priority: "low", +}; +export const getRecursionDetectionPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions); + }, +}); diff --git a/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/index.d.ts new file mode 100644 index 0000000000..1cdecb48a4 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/index.d.ts @@ -0,0 +1,12 @@ +import { AbsoluteLocation, BuildHandlerOptions, BuildMiddleware, Pluggable } from "@aws-sdk/types"; +interface PreviouslyResolved { + runtime: string; +} +/** + * Inject to trace ID to request header to detect recursion invocation in Lambda. + * @internal + */ +export declare const recursionDetectionMiddleware: (options: PreviouslyResolved) => BuildMiddleware; +export declare const addRecursionDetectionMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation; +export declare const getRecursionDetectionPlugin: (options: PreviouslyResolved) => Pluggable; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..74dfe537e7 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/ts3.4/index.d.ts @@ -0,0 +1,18 @@ +import { + AbsoluteLocation, + BuildHandlerOptions, + BuildMiddleware, + Pluggable, +} from "@aws-sdk/types"; +interface PreviouslyResolved { + runtime: string; +} +export declare const recursionDetectionMiddleware: ( + options: PreviouslyResolved +) => BuildMiddleware; +export declare const addRecursionDetectionMiddlewareOptions: BuildHandlerOptions & + AbsoluteLocation; +export declare const getRecursionDetectionPlugin: ( + options: PreviouslyResolved +) => Pluggable; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-recursion-detection/package.json b/server/node_modules/@aws-sdk/middleware-recursion-detection/package.json new file mode 100644 index 0000000000..2a41f60dee --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-recursion-detection/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/middleware-recursion-detection", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-recursion-detection", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-recursion-detection" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-retry/LICENSE b/server/node_modules/@aws-sdk/middleware-retry/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/middleware-retry/README.md b/server/node_modules/@aws-sdk/middleware-retry/README.md new file mode 100644 index 0000000000..ba7d0826ea --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/middleware-retry + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-retry/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-retry) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-retry.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-retry) diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/AdaptiveRetryStrategy.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/AdaptiveRetryStrategy.js new file mode 100644 index 0000000000..9a4806cae7 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/AdaptiveRetryStrategy.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AdaptiveRetryStrategy = void 0; +const util_retry_1 = require("@aws-sdk/util-retry"); +const StandardRetryStrategy_1 = require("./StandardRetryStrategy"); +class AdaptiveRetryStrategy extends StandardRetryStrategy_1.StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + const { rateLimiter, ...superOptions } = options !== null && options !== void 0 ? options : {}; + super(maxAttemptsProvider, superOptions); + this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new util_retry_1.DefaultRateLimiter(); + this.mode = util_retry_1.RETRY_MODES.ADAPTIVE; + } + async retry(next, args) { + return super.retry(next, args, { + beforeRequest: async () => { + return this.rateLimiter.getSendToken(); + }, + afterRequest: (response) => { + this.rateLimiter.updateClientSendingRate(response); + }, + }); + } +} +exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/StandardRetryStrategy.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/StandardRetryStrategy.js new file mode 100644 index 0000000000..65b7511913 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/StandardRetryStrategy.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StandardRetryStrategy = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const service_error_classification_1 = require("@aws-sdk/service-error-classification"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const uuid_1 = require("uuid"); +const defaultRetryQuota_1 = require("./defaultRetryQuota"); +const delayDecider_1 = require("./delayDecider"); +const retryDecider_1 = require("./retryDecider"); +const util_1 = require("./util"); +class StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + var _a, _b, _c; + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = util_retry_1.RETRY_MODES.STANDARD; + this.retryDecider = (_a = options === null || options === void 0 ? void 0 : options.retryDecider) !== null && _a !== void 0 ? _a : retryDecider_1.defaultRetryDecider; + this.delayDecider = (_b = options === null || options === void 0 ? void 0 : options.delayDecider) !== null && _b !== void 0 ? _b : delayDecider_1.defaultDelayDecider; + this.retryQuota = (_c = options === null || options === void 0 ? void 0 : options.retryQuota) !== null && _c !== void 0 ? _c : (0, defaultRetryQuota_1.getDefaultRetryQuota)(util_retry_1.INITIAL_RETRY_TOKENS); + } + shouldRetry(error, attempts, maxAttempts) { + return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error); + } + async getMaxAttempts() { + let maxAttempts; + try { + maxAttempts = await this.maxAttemptsProvider(); + } + catch (error) { + maxAttempts = util_retry_1.DEFAULT_MAX_ATTEMPTS; + } + return maxAttempts; + } + async retry(next, args, options) { + let retryTokenAmount; + let attempts = 0; + let totalDelay = 0; + const maxAttempts = await this.getMaxAttempts(); + const { request } = args; + if (protocol_http_1.HttpRequest.isInstance(request)) { + request.headers[util_retry_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)(); + } + while (true) { + try { + if (protocol_http_1.HttpRequest.isInstance(request)) { + request.headers[util_retry_1.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + if (options === null || options === void 0 ? void 0 : options.beforeRequest) { + await options.beforeRequest(); + } + const { response, output } = await next(args); + if (options === null || options === void 0 ? void 0 : options.afterRequest) { + options.afterRequest(response); + } + this.retryQuota.releaseRetryTokens(retryTokenAmount); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalDelay; + return { response, output }; + } + catch (e) { + const err = (0, util_1.asSdkError)(e); + attempts++; + if (this.shouldRetry(err, attempts, maxAttempts)) { + retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); + const delayFromDecider = this.delayDecider((0, service_error_classification_1.isThrottlingError)(err) ? util_retry_1.THROTTLING_RETRY_DELAY_BASE : util_retry_1.DEFAULT_RETRY_DELAY_BASE, attempts); + const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); + const delay = Math.max(delayFromResponse || 0, delayFromDecider); + totalDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + continue; + } + if (!err.$metadata) { + err.$metadata = {}; + } + err.$metadata.attempts = attempts; + err.$metadata.totalRetryDelay = totalDelay; + throw err; + } + } + } +} +exports.StandardRetryStrategy = StandardRetryStrategy; +const getDelayFromRetryAfterHeader = (response) => { + if (!protocol_http_1.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return retryAfterSeconds * 1000; + const retryAfterDate = new Date(retryAfter); + return retryAfterDate.getTime() - Date.now(); +}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/configurations.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/configurations.js new file mode 100644 index 0000000000..3c9ec26574 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/configurations.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NODE_RETRY_MODE_CONFIG_OPTIONS = exports.CONFIG_RETRY_MODE = exports.ENV_RETRY_MODE = exports.resolveRetryConfig = exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = exports.CONFIG_MAX_ATTEMPTS = exports.ENV_MAX_ATTEMPTS = void 0; +const util_middleware_1 = require("@aws-sdk/util-middleware"); +const util_retry_1 = require("@aws-sdk/util-retry"); +exports.ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; +exports.CONFIG_MAX_ATTEMPTS = "max_attempts"; +exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + const value = env[exports.ENV_MAX_ATTEMPTS]; + if (!value) + return undefined; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Environment variable ${exports.ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + configFileSelector: (profile) => { + const value = profile[exports.CONFIG_MAX_ATTEMPTS]; + if (!value) + return undefined; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Shared config file entry ${exports.CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + default: util_retry_1.DEFAULT_MAX_ATTEMPTS, +}; +const resolveRetryConfig = (input) => { + var _a; + const { retryStrategy } = input; + const maxAttempts = (0, util_middleware_1.normalizeProvider)((_a = input.maxAttempts) !== null && _a !== void 0 ? _a : util_retry_1.DEFAULT_MAX_ATTEMPTS); + return { + ...input, + maxAttempts, + retryStrategy: async () => { + if (retryStrategy) { + return retryStrategy; + } + const retryMode = await (0, util_middleware_1.normalizeProvider)(input.retryMode)(); + if (retryMode === util_retry_1.RETRY_MODES.ADAPTIVE) { + return new util_retry_1.AdaptiveRetryStrategy(maxAttempts); + } + return new util_retry_1.StandardRetryStrategy(maxAttempts); + }, + }; +}; +exports.resolveRetryConfig = resolveRetryConfig; +exports.ENV_RETRY_MODE = "AWS_RETRY_MODE"; +exports.CONFIG_RETRY_MODE = "retry_mode"; +exports.NODE_RETRY_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[exports.ENV_RETRY_MODE], + configFileSelector: (profile) => profile[exports.CONFIG_RETRY_MODE], + default: util_retry_1.DEFAULT_RETRY_MODE, +}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/defaultRetryQuota.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/defaultRetryQuota.js new file mode 100644 index 0000000000..0c05c2a5f0 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/defaultRetryQuota.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDefaultRetryQuota = void 0; +const util_retry_1 = require("@aws-sdk/util-retry"); +const getDefaultRetryQuota = (initialRetryTokens, options) => { + var _a, _b, _c; + const MAX_CAPACITY = initialRetryTokens; + const noRetryIncrement = (_a = options === null || options === void 0 ? void 0 : options.noRetryIncrement) !== null && _a !== void 0 ? _a : util_retry_1.NO_RETRY_INCREMENT; + const retryCost = (_b = options === null || options === void 0 ? void 0 : options.retryCost) !== null && _b !== void 0 ? _b : util_retry_1.RETRY_COST; + const timeoutRetryCost = (_c = options === null || options === void 0 ? void 0 : options.timeoutRetryCost) !== null && _c !== void 0 ? _c : util_retry_1.TIMEOUT_RETRY_COST; + let availableCapacity = initialRetryTokens; + const getCapacityAmount = (error) => (error.name === "TimeoutError" ? timeoutRetryCost : retryCost); + const hasRetryTokens = (error) => getCapacityAmount(error) <= availableCapacity; + const retrieveRetryTokens = (error) => { + if (!hasRetryTokens(error)) { + throw new Error("No retry token available"); + } + const capacityAmount = getCapacityAmount(error); + availableCapacity -= capacityAmount; + return capacityAmount; + }; + const releaseRetryTokens = (capacityReleaseAmount) => { + availableCapacity += capacityReleaseAmount !== null && capacityReleaseAmount !== void 0 ? capacityReleaseAmount : noRetryIncrement; + availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); + }; + return Object.freeze({ + hasRetryTokens, + retrieveRetryTokens, + releaseRetryTokens, + }); +}; +exports.getDefaultRetryQuota = getDefaultRetryQuota; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/delayDecider.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/delayDecider.js new file mode 100644 index 0000000000..1d2a95eb4e --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/delayDecider.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultDelayDecider = void 0; +const util_retry_1 = require("@aws-sdk/util-retry"); +const defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(util_retry_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); +exports.defaultDelayDecider = defaultDelayDecider; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/index.js new file mode 100644 index 0000000000..c98ff2793f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/index.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./AdaptiveRetryStrategy"), exports); +tslib_1.__exportStar(require("./StandardRetryStrategy"), exports); +tslib_1.__exportStar(require("./configurations"), exports); +tslib_1.__exportStar(require("./delayDecider"), exports); +tslib_1.__exportStar(require("./omitRetryHeadersMiddleware"), exports); +tslib_1.__exportStar(require("./retryDecider"), exports); +tslib_1.__exportStar(require("./retryMiddleware"), exports); diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/omitRetryHeadersMiddleware.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/omitRetryHeadersMiddleware.js new file mode 100644 index 0000000000..18725baaf6 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/omitRetryHeadersMiddleware.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getOmitRetryHeadersPlugin = exports.omitRetryHeadersMiddlewareOptions = exports.omitRetryHeadersMiddleware = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const omitRetryHeadersMiddleware = () => (next) => async (args) => { + const { request } = args; + if (protocol_http_1.HttpRequest.isInstance(request)) { + delete request.headers[util_retry_1.INVOCATION_ID_HEADER]; + delete request.headers[util_retry_1.REQUEST_HEADER]; + } + return next(args); +}; +exports.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; +exports.omitRetryHeadersMiddlewareOptions = { + name: "omitRetryHeadersMiddleware", + tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], + relation: "before", + toMiddleware: "awsAuthMiddleware", + override: true, +}; +const getOmitRetryHeadersPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, exports.omitRetryHeadersMiddleware)(), exports.omitRetryHeadersMiddlewareOptions); + }, +}); +exports.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/retryDecider.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/retryDecider.js new file mode 100644 index 0000000000..cb67971f91 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/retryDecider.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultRetryDecider = void 0; +const service_error_classification_1 = require("@aws-sdk/service-error-classification"); +const defaultRetryDecider = (error) => { + if (!error) { + return false; + } + return (0, service_error_classification_1.isRetryableByTrait)(error) || (0, service_error_classification_1.isClockSkewError)(error) || (0, service_error_classification_1.isThrottlingError)(error) || (0, service_error_classification_1.isTransientError)(error); +}; +exports.defaultRetryDecider = defaultRetryDecider; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/retryMiddleware.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/retryMiddleware.js new file mode 100644 index 0000000000..7bb467e626 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/retryMiddleware.js @@ -0,0 +1,110 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRetryAfterHint = exports.getRetryPlugin = exports.retryMiddlewareOptions = exports.retryMiddleware = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const service_error_classification_1 = require("@aws-sdk/service-error-classification"); +const util_retry_1 = require("@aws-sdk/util-retry"); +const uuid_1 = require("uuid"); +const util_1 = require("./util"); +const retryMiddleware = (options) => (next, context) => async (args) => { + let retryStrategy = await options.retryStrategy(); + const maxAttempts = await options.maxAttempts(); + if (isRetryStrategyV2(retryStrategy)) { + retryStrategy = retryStrategy; + let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]); + let lastError = new Error(); + let attempts = 0; + let totalRetryDelay = 0; + const { request } = args; + if (protocol_http_1.HttpRequest.isInstance(request)) { + request.headers[util_retry_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)(); + } + while (true) { + try { + if (protocol_http_1.HttpRequest.isInstance(request)) { + request.headers[util_retry_1.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + const { response, output } = await next(args); + retryStrategy.recordSuccess(retryToken); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalRetryDelay; + return { response, output }; + } + catch (e) { + const retryErrorInfo = getRetyErrorInto(e); + lastError = (0, util_1.asSdkError)(e); + try { + retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); + } + catch (refreshError) { + if (!lastError.$metadata) { + lastError.$metadata = {}; + } + lastError.$metadata.attempts = attempts + 1; + lastError.$metadata.totalRetryDelay = totalRetryDelay; + throw lastError; + } + attempts = retryToken.getRetryCount(); + const delay = retryToken.getRetryDelay(); + totalRetryDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + } + } + else { + retryStrategy = retryStrategy; + if (retryStrategy === null || retryStrategy === void 0 ? void 0 : retryStrategy.mode) + context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]]; + return retryStrategy.retry(next, args); + } +}; +exports.retryMiddleware = retryMiddleware; +const isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && + typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && + typeof retryStrategy.recordSuccess !== "undefined"; +const getRetyErrorInto = (error) => { + const errorInfo = { + errorType: getRetryErrorType(error), + }; + const retryAfterHint = (0, exports.getRetryAfterHint)(error.$response); + if (retryAfterHint) { + errorInfo.retryAfterHint = retryAfterHint; + } + return errorInfo; +}; +const getRetryErrorType = (error) => { + if ((0, service_error_classification_1.isThrottlingError)(error)) + return "THROTTLING"; + if ((0, service_error_classification_1.isTransientError)(error)) + return "TRANSIENT"; + if ((0, service_error_classification_1.isServerError)(error)) + return "SERVER_ERROR"; + return "CLIENT_ERROR"; +}; +exports.retryMiddlewareOptions = { + name: "retryMiddleware", + tags: ["RETRY"], + step: "finalizeRequest", + priority: "high", + override: true, +}; +const getRetryPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.retryMiddleware)(options), exports.retryMiddlewareOptions); + }, +}); +exports.getRetryPlugin = getRetryPlugin; +const getRetryAfterHint = (response) => { + if (!protocol_http_1.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return new Date(retryAfterSeconds * 1000); + const retryAfterDate = new Date(retryAfter); + return retryAfterDate; +}; +exports.getRetryAfterHint = getRetryAfterHint; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/types.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/types.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/util.js b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/util.js new file mode 100644 index 0000000000..28721d3c2b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-cjs/util.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.asSdkError = void 0; +const asSdkError = (error) => { + if (error instanceof Error) + return error; + if (error instanceof Object) + return Object.assign(new Error(), error); + if (typeof error === "string") + return new Error(error); + return new Error(`AWS SDK error wrapper for ${error}`); +}; +exports.asSdkError = asSdkError; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/AdaptiveRetryStrategy.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/AdaptiveRetryStrategy.js new file mode 100644 index 0000000000..12a5743756 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/AdaptiveRetryStrategy.js @@ -0,0 +1,20 @@ +import { DefaultRateLimiter, RETRY_MODES } from "@aws-sdk/util-retry"; +import { StandardRetryStrategy } from "./StandardRetryStrategy"; +export class AdaptiveRetryStrategy extends StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + const { rateLimiter, ...superOptions } = options ?? {}; + super(maxAttemptsProvider, superOptions); + this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); + this.mode = RETRY_MODES.ADAPTIVE; + } + async retry(next, args) { + return super.retry(next, args, { + beforeRequest: async () => { + return this.rateLimiter.getSendToken(); + }, + afterRequest: (response) => { + this.rateLimiter.updateClientSendingRate(response); + }, + }); + } +} diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/StandardRetryStrategy.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/StandardRetryStrategy.js new file mode 100644 index 0000000000..d156c7663b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/StandardRetryStrategy.js @@ -0,0 +1,90 @@ +import { HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; +import { isThrottlingError } from "@aws-sdk/service-error-classification"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, INVOCATION_ID_HEADER, REQUEST_HEADER, RETRY_MODES, THROTTLING_RETRY_DELAY_BASE, } from "@aws-sdk/util-retry"; +import { v4 } from "uuid"; +import { getDefaultRetryQuota } from "./defaultRetryQuota"; +import { defaultDelayDecider } from "./delayDecider"; +import { defaultRetryDecider } from "./retryDecider"; +import { asSdkError } from "./util"; +export class StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = RETRY_MODES.STANDARD; + this.retryDecider = options?.retryDecider ?? defaultRetryDecider; + this.delayDecider = options?.delayDecider ?? defaultDelayDecider; + this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(INITIAL_RETRY_TOKENS); + } + shouldRetry(error, attempts, maxAttempts) { + return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error); + } + async getMaxAttempts() { + let maxAttempts; + try { + maxAttempts = await this.maxAttemptsProvider(); + } + catch (error) { + maxAttempts = DEFAULT_MAX_ATTEMPTS; + } + return maxAttempts; + } + async retry(next, args, options) { + let retryTokenAmount; + let attempts = 0; + let totalDelay = 0; + const maxAttempts = await this.getMaxAttempts(); + const { request } = args; + if (HttpRequest.isInstance(request)) { + request.headers[INVOCATION_ID_HEADER] = v4(); + } + while (true) { + try { + if (HttpRequest.isInstance(request)) { + request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + if (options?.beforeRequest) { + await options.beforeRequest(); + } + const { response, output } = await next(args); + if (options?.afterRequest) { + options.afterRequest(response); + } + this.retryQuota.releaseRetryTokens(retryTokenAmount); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalDelay; + return { response, output }; + } + catch (e) { + const err = asSdkError(e); + attempts++; + if (this.shouldRetry(err, attempts, maxAttempts)) { + retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); + const delayFromDecider = this.delayDecider(isThrottlingError(err) ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE, attempts); + const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); + const delay = Math.max(delayFromResponse || 0, delayFromDecider); + totalDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + continue; + } + if (!err.$metadata) { + err.$metadata = {}; + } + err.$metadata.attempts = attempts; + err.$metadata.totalRetryDelay = totalDelay; + throw err; + } + } + } +} +const getDelayFromRetryAfterHeader = (response) => { + if (!HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return retryAfterSeconds * 1000; + const retryAfterDate = new Date(retryAfter); + return retryAfterDate.getTime() - Date.now(); +}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/configurations.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/configurations.js new file mode 100644 index 0000000000..5d210e1993 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/configurations.js @@ -0,0 +1,52 @@ +import { normalizeProvider } from "@aws-sdk/util-middleware"; +import { AdaptiveRetryStrategy, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE, RETRY_MODES, StandardRetryStrategy, } from "@aws-sdk/util-retry"; +export const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; +export const CONFIG_MAX_ATTEMPTS = "max_attempts"; +export const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + const value = env[ENV_MAX_ATTEMPTS]; + if (!value) + return undefined; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + configFileSelector: (profile) => { + const value = profile[CONFIG_MAX_ATTEMPTS]; + if (!value) + return undefined; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + default: DEFAULT_MAX_ATTEMPTS, +}; +export const resolveRetryConfig = (input) => { + const { retryStrategy } = input; + const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS); + return { + ...input, + maxAttempts, + retryStrategy: async () => { + if (retryStrategy) { + return retryStrategy; + } + const retryMode = await normalizeProvider(input.retryMode)(); + if (retryMode === RETRY_MODES.ADAPTIVE) { + return new AdaptiveRetryStrategy(maxAttempts); + } + return new StandardRetryStrategy(maxAttempts); + }, + }; +}; +export const ENV_RETRY_MODE = "AWS_RETRY_MODE"; +export const CONFIG_RETRY_MODE = "retry_mode"; +export const NODE_RETRY_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_RETRY_MODE], + configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], + default: DEFAULT_RETRY_MODE, +}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/defaultRetryQuota.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/defaultRetryQuota.js new file mode 100644 index 0000000000..6915e490e5 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/defaultRetryQuota.js @@ -0,0 +1,27 @@ +import { NO_RETRY_INCREMENT, RETRY_COST, TIMEOUT_RETRY_COST } from "@aws-sdk/util-retry"; +export const getDefaultRetryQuota = (initialRetryTokens, options) => { + const MAX_CAPACITY = initialRetryTokens; + const noRetryIncrement = options?.noRetryIncrement ?? NO_RETRY_INCREMENT; + const retryCost = options?.retryCost ?? RETRY_COST; + const timeoutRetryCost = options?.timeoutRetryCost ?? TIMEOUT_RETRY_COST; + let availableCapacity = initialRetryTokens; + const getCapacityAmount = (error) => (error.name === "TimeoutError" ? timeoutRetryCost : retryCost); + const hasRetryTokens = (error) => getCapacityAmount(error) <= availableCapacity; + const retrieveRetryTokens = (error) => { + if (!hasRetryTokens(error)) { + throw new Error("No retry token available"); + } + const capacityAmount = getCapacityAmount(error); + availableCapacity -= capacityAmount; + return capacityAmount; + }; + const releaseRetryTokens = (capacityReleaseAmount) => { + availableCapacity += capacityReleaseAmount ?? noRetryIncrement; + availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); + }; + return Object.freeze({ + hasRetryTokens, + retrieveRetryTokens, + releaseRetryTokens, + }); +}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/delayDecider.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/delayDecider.js new file mode 100644 index 0000000000..3ef96dd17b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/delayDecider.js @@ -0,0 +1,2 @@ +import { MAXIMUM_RETRY_DELAY } from "@aws-sdk/util-retry"; +export const defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/index.js new file mode 100644 index 0000000000..9ebe326af6 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/index.js @@ -0,0 +1,7 @@ +export * from "./AdaptiveRetryStrategy"; +export * from "./StandardRetryStrategy"; +export * from "./configurations"; +export * from "./delayDecider"; +export * from "./omitRetryHeadersMiddleware"; +export * from "./retryDecider"; +export * from "./retryMiddleware"; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/omitRetryHeadersMiddleware.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/omitRetryHeadersMiddleware.js new file mode 100644 index 0000000000..ef349df693 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/omitRetryHeadersMiddleware.js @@ -0,0 +1,22 @@ +import { HttpRequest } from "@aws-sdk/protocol-http"; +import { INVOCATION_ID_HEADER, REQUEST_HEADER } from "@aws-sdk/util-retry"; +export const omitRetryHeadersMiddleware = () => (next) => async (args) => { + const { request } = args; + if (HttpRequest.isInstance(request)) { + delete request.headers[INVOCATION_ID_HEADER]; + delete request.headers[REQUEST_HEADER]; + } + return next(args); +}; +export const omitRetryHeadersMiddlewareOptions = { + name: "omitRetryHeadersMiddleware", + tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], + relation: "before", + toMiddleware: "awsAuthMiddleware", + override: true, +}; +export const getOmitRetryHeadersPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); + }, +}); diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/retryDecider.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/retryDecider.js new file mode 100644 index 0000000000..58f10bb615 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/retryDecider.js @@ -0,0 +1,7 @@ +import { isClockSkewError, isRetryableByTrait, isThrottlingError, isTransientError, } from "@aws-sdk/service-error-classification"; +export const defaultRetryDecider = (error) => { + if (!error) { + return false; + } + return isRetryableByTrait(error) || isClockSkewError(error) || isThrottlingError(error) || isTransientError(error); +}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/retryMiddleware.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/retryMiddleware.js new file mode 100644 index 0000000000..28e54b6a5e --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/retryMiddleware.js @@ -0,0 +1,104 @@ +import { HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; +import { isServerError, isThrottlingError, isTransientError } from "@aws-sdk/service-error-classification"; +import { INVOCATION_ID_HEADER, REQUEST_HEADER } from "@aws-sdk/util-retry"; +import { v4 } from "uuid"; +import { asSdkError } from "./util"; +export const retryMiddleware = (options) => (next, context) => async (args) => { + let retryStrategy = await options.retryStrategy(); + const maxAttempts = await options.maxAttempts(); + if (isRetryStrategyV2(retryStrategy)) { + retryStrategy = retryStrategy; + let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]); + let lastError = new Error(); + let attempts = 0; + let totalRetryDelay = 0; + const { request } = args; + if (HttpRequest.isInstance(request)) { + request.headers[INVOCATION_ID_HEADER] = v4(); + } + while (true) { + try { + if (HttpRequest.isInstance(request)) { + request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + const { response, output } = await next(args); + retryStrategy.recordSuccess(retryToken); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalRetryDelay; + return { response, output }; + } + catch (e) { + const retryErrorInfo = getRetyErrorInto(e); + lastError = asSdkError(e); + try { + retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); + } + catch (refreshError) { + if (!lastError.$metadata) { + lastError.$metadata = {}; + } + lastError.$metadata.attempts = attempts + 1; + lastError.$metadata.totalRetryDelay = totalRetryDelay; + throw lastError; + } + attempts = retryToken.getRetryCount(); + const delay = retryToken.getRetryDelay(); + totalRetryDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + } + } + else { + retryStrategy = retryStrategy; + if (retryStrategy?.mode) + context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]]; + return retryStrategy.retry(next, args); + } +}; +const isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && + typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && + typeof retryStrategy.recordSuccess !== "undefined"; +const getRetyErrorInto = (error) => { + const errorInfo = { + errorType: getRetryErrorType(error), + }; + const retryAfterHint = getRetryAfterHint(error.$response); + if (retryAfterHint) { + errorInfo.retryAfterHint = retryAfterHint; + } + return errorInfo; +}; +const getRetryErrorType = (error) => { + if (isThrottlingError(error)) + return "THROTTLING"; + if (isTransientError(error)) + return "TRANSIENT"; + if (isServerError(error)) + return "SERVER_ERROR"; + return "CLIENT_ERROR"; +}; +export const retryMiddlewareOptions = { + name: "retryMiddleware", + tags: ["RETRY"], + step: "finalizeRequest", + priority: "high", + override: true, +}; +export const getRetryPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(retryMiddleware(options), retryMiddlewareOptions); + }, +}); +export const getRetryAfterHint = (response) => { + if (!HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return new Date(retryAfterSeconds * 1000); + const retryAfterDate = new Date(retryAfter); + return retryAfterDate; +}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/types.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/types.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/types.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-es/util.js b/server/node_modules/@aws-sdk/middleware-retry/dist-es/util.js new file mode 100644 index 0000000000..f45e6b4d31 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-es/util.js @@ -0,0 +1,9 @@ +export const asSdkError = (error) => { + if (error instanceof Error) + return error; + if (error instanceof Object) + return Object.assign(new Error(), error); + if (typeof error === "string") + return new Error(error); + return new Error(`AWS SDK error wrapper for ${error}`); +}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/AdaptiveRetryStrategy.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/AdaptiveRetryStrategy.d.ts new file mode 100644 index 0000000000..dd419af5f9 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/AdaptiveRetryStrategy.d.ts @@ -0,0 +1,20 @@ +import { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider } from "@aws-sdk/types"; +import { RateLimiter } from "@aws-sdk/util-retry"; +import { StandardRetryStrategy, StandardRetryStrategyOptions } from "./StandardRetryStrategy"; +/** + * Strategy options to be passed to AdaptiveRetryStrategy + */ +export interface AdaptiveRetryStrategyOptions extends StandardRetryStrategyOptions { + rateLimiter?: RateLimiter; +} +/** + * @deprected use AdaptiveRetryStrategy from @aws-sdk/util-retry + */ +export declare class AdaptiveRetryStrategy extends StandardRetryStrategy { + private rateLimiter; + constructor(maxAttemptsProvider: Provider, options?: AdaptiveRetryStrategyOptions); + retry(next: FinalizeHandler, args: FinalizeHandlerArguments): Promise<{ + response: unknown; + output: Ouput; + }>; +} diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/StandardRetryStrategy.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/StandardRetryStrategy.d.ts new file mode 100644 index 0000000000..469301e6b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/StandardRetryStrategy.d.ts @@ -0,0 +1,30 @@ +import { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider, RetryStrategy } from "@aws-sdk/types"; +import { DelayDecider, RetryDecider, RetryQuota } from "./types"; +/** + * Strategy options to be passed to StandardRetryStrategy + */ +export interface StandardRetryStrategyOptions { + retryDecider?: RetryDecider; + delayDecider?: DelayDecider; + retryQuota?: RetryQuota; +} +/** + * @deprected use StandardRetryStrategy from @aws-sdk/util-retry + */ +export declare class StandardRetryStrategy implements RetryStrategy { + private readonly maxAttemptsProvider; + private retryDecider; + private delayDecider; + private retryQuota; + mode: string; + constructor(maxAttemptsProvider: Provider, options?: StandardRetryStrategyOptions); + private shouldRetry; + private getMaxAttempts; + retry(next: FinalizeHandler, args: FinalizeHandlerArguments, options?: { + beforeRequest: Function; + afterRequest: Function; + }): Promise<{ + response: unknown; + output: Ouput; + }>; +} diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/configurations.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/configurations.d.ts new file mode 100644 index 0000000000..f048f0f088 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/configurations.d.ts @@ -0,0 +1,37 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +import { Provider, RetryStrategy, RetryStrategyV2 } from "@aws-sdk/types"; +export declare const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; +export declare const CONFIG_MAX_ATTEMPTS = "max_attempts"; +export declare const NODE_MAX_ATTEMPT_CONFIG_OPTIONS: LoadedConfigSelectors; +export interface RetryInputConfig { + /** + * The maximum number of times requests that encounter retryable failures should be attempted. + */ + maxAttempts?: number | Provider; + /** + * The strategy to retry the request. Using built-in exponential backoff strategy by default. + */ + retryStrategy?: RetryStrategy | RetryStrategyV2; +} +interface PreviouslyResolved { + /** + * Specifies provider for retry algorithm to use. + * @internal + */ + retryMode: string | Provider; +} +export interface RetryResolvedConfig { + /** + * Resolved value for input config {@link RetryInputConfig.maxAttempts} + */ + maxAttempts: Provider; + /** + * Resolved value for input config {@link RetryInputConfig.retryStrategy} + */ + retryStrategy: Provider; +} +export declare const resolveRetryConfig: (input: T & PreviouslyResolved & RetryInputConfig) => T & RetryResolvedConfig; +export declare const ENV_RETRY_MODE = "AWS_RETRY_MODE"; +export declare const CONFIG_RETRY_MODE = "retry_mode"; +export declare const NODE_RETRY_MODE_CONFIG_OPTIONS: LoadedConfigSelectors; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/defaultRetryQuota.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/defaultRetryQuota.d.ts new file mode 100644 index 0000000000..52aac852f0 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/defaultRetryQuota.d.ts @@ -0,0 +1,18 @@ +import { RetryQuota } from "./types"; +export interface DefaultRetryQuotaOptions { + /** + * The total amount of retry token to be incremented from retry token balance + * if an SDK operation invocation succeeds without requiring a retry request. + */ + noRetryIncrement?: number; + /** + * The total amount of retry tokens to be decremented from retry token balance. + */ + retryCost?: number; + /** + * The total amount of retry tokens to be decremented from retry token balance + * when a throttling error is encountered. + */ + timeoutRetryCost?: number; +} +export declare const getDefaultRetryQuota: (initialRetryTokens: number, options?: DefaultRetryQuotaOptions | undefined) => RetryQuota; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/delayDecider.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/delayDecider.d.ts new file mode 100644 index 0000000000..a7251fce17 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/delayDecider.d.ts @@ -0,0 +1,4 @@ +/** + * Calculate a capped, fully-jittered exponential backoff time. + */ +export declare const defaultDelayDecider: (delayBase: number, attempts: number) => number; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/index.d.ts new file mode 100644 index 0000000000..9ebe326af6 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/index.d.ts @@ -0,0 +1,7 @@ +export * from "./AdaptiveRetryStrategy"; +export * from "./StandardRetryStrategy"; +export * from "./configurations"; +export * from "./delayDecider"; +export * from "./omitRetryHeadersMiddleware"; +export * from "./retryDecider"; +export * from "./retryMiddleware"; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/omitRetryHeadersMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/omitRetryHeadersMiddleware.d.ts new file mode 100644 index 0000000000..cfb3277756 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/omitRetryHeadersMiddleware.d.ts @@ -0,0 +1,4 @@ +import { FinalizeHandler, MetadataBearer, Pluggable, RelativeMiddlewareOptions } from "@aws-sdk/types"; +export declare const omitRetryHeadersMiddleware: () => (next: FinalizeHandler) => FinalizeHandler; +export declare const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions; +export declare const getOmitRetryHeadersPlugin: (options: unknown) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/retryDecider.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/retryDecider.d.ts new file mode 100644 index 0000000000..b6dced0561 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/retryDecider.d.ts @@ -0,0 +1,2 @@ +import { SdkError } from "@aws-sdk/types"; +export declare const defaultRetryDecider: (error: SdkError) => boolean; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/retryMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/retryMiddleware.d.ts new file mode 100644 index 0000000000..f2c5c705a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/retryMiddleware.d.ts @@ -0,0 +1,6 @@ +import { AbsoluteLocation, FinalizeHandler, FinalizeRequestHandlerOptions, HandlerExecutionContext, MetadataBearer, Pluggable } from "@aws-sdk/types"; +import { RetryResolvedConfig } from "./configurations"; +export declare const retryMiddleware: (options: RetryResolvedConfig) => (next: FinalizeHandler, context: HandlerExecutionContext) => FinalizeHandler; +export declare const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLocation; +export declare const getRetryPlugin: (options: RetryResolvedConfig) => Pluggable; +export declare const getRetryAfterHint: (response: unknown) => Date | undefined; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/AdaptiveRetryStrategy.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/AdaptiveRetryStrategy.d.ts new file mode 100644 index 0000000000..058309084f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/AdaptiveRetryStrategy.d.ts @@ -0,0 +1,29 @@ +import { + FinalizeHandler, + FinalizeHandlerArguments, + MetadataBearer, + Provider, +} from "@aws-sdk/types"; +import { RateLimiter } from "@aws-sdk/util-retry"; +import { + StandardRetryStrategy, + StandardRetryStrategyOptions, +} from "./StandardRetryStrategy"; +export interface AdaptiveRetryStrategyOptions + extends StandardRetryStrategyOptions { + rateLimiter?: RateLimiter; +} +export declare class AdaptiveRetryStrategy extends StandardRetryStrategy { + private rateLimiter; + constructor( + maxAttemptsProvider: Provider, + options?: AdaptiveRetryStrategyOptions + ); + retry( + next: FinalizeHandler, + args: FinalizeHandlerArguments + ): Promise<{ + response: unknown; + output: Ouput; + }>; +} diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts new file mode 100644 index 0000000000..fb8373afd3 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts @@ -0,0 +1,37 @@ +import { + FinalizeHandler, + FinalizeHandlerArguments, + MetadataBearer, + Provider, + RetryStrategy, +} from "@aws-sdk/types"; +import { DelayDecider, RetryDecider, RetryQuota } from "./types"; +export interface StandardRetryStrategyOptions { + retryDecider?: RetryDecider; + delayDecider?: DelayDecider; + retryQuota?: RetryQuota; +} +export declare class StandardRetryStrategy implements RetryStrategy { + private readonly maxAttemptsProvider; + private retryDecider; + private delayDecider; + private retryQuota; + mode: string; + constructor( + maxAttemptsProvider: Provider, + options?: StandardRetryStrategyOptions + ); + private shouldRetry; + private getMaxAttempts; + retry( + next: FinalizeHandler, + args: FinalizeHandlerArguments, + options?: { + beforeRequest: Function; + afterRequest: Function; + } + ): Promise<{ + response: unknown; + output: Ouput; + }>; +} diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/configurations.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/configurations.d.ts new file mode 100644 index 0000000000..8cf453ea7b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/configurations.d.ts @@ -0,0 +1,23 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +import { Provider, RetryStrategy, RetryStrategyV2 } from "@aws-sdk/types"; +export declare const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; +export declare const CONFIG_MAX_ATTEMPTS = "max_attempts"; +export declare const NODE_MAX_ATTEMPT_CONFIG_OPTIONS: LoadedConfigSelectors; +export interface RetryInputConfig { + maxAttempts?: number | Provider; + retryStrategy?: RetryStrategy | RetryStrategyV2; +} +interface PreviouslyResolved { + retryMode: string | Provider; +} +export interface RetryResolvedConfig { + maxAttempts: Provider; + retryStrategy: Provider; +} +export declare const resolveRetryConfig: ( + input: T & PreviouslyResolved & RetryInputConfig +) => T & RetryResolvedConfig; +export declare const ENV_RETRY_MODE = "AWS_RETRY_MODE"; +export declare const CONFIG_RETRY_MODE = "retry_mode"; +export declare const NODE_RETRY_MODE_CONFIG_OPTIONS: LoadedConfigSelectors; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/defaultRetryQuota.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/defaultRetryQuota.d.ts new file mode 100644 index 0000000000..ebec172b35 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/defaultRetryQuota.d.ts @@ -0,0 +1,10 @@ +import { RetryQuota } from "./types"; +export interface DefaultRetryQuotaOptions { + noRetryIncrement?: number; + retryCost?: number; + timeoutRetryCost?: number; +} +export declare const getDefaultRetryQuota: ( + initialRetryTokens: number, + options?: DefaultRetryQuotaOptions | undefined +) => RetryQuota; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/delayDecider.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/delayDecider.d.ts new file mode 100644 index 0000000000..79f9cc4f06 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/delayDecider.d.ts @@ -0,0 +1,4 @@ +export declare const defaultDelayDecider: ( + delayBase: number, + attempts: number +) => number; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..9ebe326af6 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/index.d.ts @@ -0,0 +1,7 @@ +export * from "./AdaptiveRetryStrategy"; +export * from "./StandardRetryStrategy"; +export * from "./configurations"; +export * from "./delayDecider"; +export * from "./omitRetryHeadersMiddleware"; +export * from "./retryDecider"; +export * from "./retryMiddleware"; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/omitRetryHeadersMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/omitRetryHeadersMiddleware.d.ts new file mode 100644 index 0000000000..fb0ce73d1c --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/omitRetryHeadersMiddleware.d.ts @@ -0,0 +1,15 @@ +import { + FinalizeHandler, + MetadataBearer, + Pluggable, + RelativeMiddlewareOptions, +} from "@aws-sdk/types"; +export declare const omitRetryHeadersMiddleware: () => < + Output extends MetadataBearer = MetadataBearer +>( + next: FinalizeHandler +) => FinalizeHandler; +export declare const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions; +export declare const getOmitRetryHeadersPlugin: ( + options: unknown +) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/retryDecider.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/retryDecider.d.ts new file mode 100644 index 0000000000..b6dced0561 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/retryDecider.d.ts @@ -0,0 +1,2 @@ +import { SdkError } from "@aws-sdk/types"; +export declare const defaultRetryDecider: (error: SdkError) => boolean; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/retryMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/retryMiddleware.d.ts new file mode 100644 index 0000000000..35de5fd0cb --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/retryMiddleware.d.ts @@ -0,0 +1,21 @@ +import { + AbsoluteLocation, + FinalizeHandler, + FinalizeRequestHandlerOptions, + HandlerExecutionContext, + MetadataBearer, + Pluggable, +} from "@aws-sdk/types"; +import { RetryResolvedConfig } from "./configurations"; +export declare const retryMiddleware: ( + options: RetryResolvedConfig +) => ( + next: FinalizeHandler, + context: HandlerExecutionContext +) => FinalizeHandler; +export declare const retryMiddlewareOptions: FinalizeRequestHandlerOptions & + AbsoluteLocation; +export declare const getRetryPlugin: ( + options: RetryResolvedConfig +) => Pluggable; +export declare const getRetryAfterHint: (response: unknown) => Date | undefined; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/types.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/types.d.ts new file mode 100644 index 0000000000..e26d816dc5 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/types.d.ts @@ -0,0 +1,16 @@ +import { SdkError } from "@aws-sdk/types"; +export interface RetryDecider { + (error: SdkError): boolean; +} +export interface DelayDecider { + (delayBase: number, attempts: number): number; +} +export interface RetryQuota { + hasRetryTokens: (error: SdkError) => boolean; + retrieveRetryTokens: (error: SdkError) => number; + releaseRetryTokens: (releaseCapacityAmount?: number) => void; +} +export interface RateLimiter { + getSendToken: () => Promise; + updateClientSendingRate: (response: any) => void; +} diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/util.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/util.d.ts new file mode 100644 index 0000000000..002ee24d39 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/ts3.4/util.d.ts @@ -0,0 +1,2 @@ +import { SdkError } from "@aws-sdk/types"; +export declare const asSdkError: (error: unknown) => SdkError; diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/types.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/types.d.ts new file mode 100644 index 0000000000..430f50a7b7 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/types.d.ts @@ -0,0 +1,53 @@ +import { SdkError } from "@aws-sdk/types"; +/** + * Determines whether an error is retryable based on the number of retries + * already attempted, the HTTP status code, and the error received (if any). + * + * @param error The error encountered. + */ +export interface RetryDecider { + (error: SdkError): boolean; +} +/** + * Determines the number of milliseconds to wait before retrying an action. + * + * @param delayBase The base delay (in milliseconds). + * @param attempts The number of times the action has already been tried. + */ +export interface DelayDecider { + (delayBase: number, attempts: number): number; +} +/** + * Interface that specifies the retry quota behavior. + */ +export interface RetryQuota { + /** + * returns true if retry tokens are available from the retry quota bucket. + */ + hasRetryTokens: (error: SdkError) => boolean; + /** + * returns token amount from the retry quota bucket. + * throws error is retry tokens are not available. + */ + retrieveRetryTokens: (error: SdkError) => number; + /** + * releases tokens back to the retry quota. + */ + releaseRetryTokens: (releaseCapacityAmount?: number) => void; +} +export interface RateLimiter { + /** + * If there is sufficient capacity (tokens) available, it immediately returns. + * If there is not sufficient capacity, it will either sleep a certain amount + * of time until the rate limiter can retrieve a token from its token bucket + * or raise an exception indicating there is insufficient capacity. + */ + getSendToken: () => Promise; + /** + * Updates the client sending rate based on response. + * If the response was successful, the capacity and fill rate are increased. + * If the response was a throttling response, the capacity and fill rate are + * decreased. Transient errors do not affect the rate limiter. + */ + updateClientSendingRate: (response: any) => void; +} diff --git a/server/node_modules/@aws-sdk/middleware-retry/dist-types/util.d.ts b/server/node_modules/@aws-sdk/middleware-retry/dist-types/util.d.ts new file mode 100644 index 0000000000..002ee24d39 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/dist-types/util.d.ts @@ -0,0 +1,2 @@ +import { SdkError } from "@aws-sdk/types"; +export declare const asSdkError: (error: unknown) => SdkError; diff --git a/server/node_modules/@aws-sdk/middleware-retry/package.json b/server/node_modules/@aws-sdk/middleware-retry/package.json new file mode 100644 index 0000000000..4ae7082c98 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-retry/package.json @@ -0,0 +1,60 @@ +{ + "name": "@aws-sdk/middleware-retry", + "version": "3.259.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/service-error-classification": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-middleware": "3.257.0", + "@aws-sdk/util-retry": "3.257.0", + "tslib": "^2.3.1", + "uuid": "^8.3.2" + }, + "devDependencies": { + "@aws-sdk/node-config-provider": "3.259.0", + "@tsconfig/recommended": "1.0.1", + "@types/uuid": "^8.3.0", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-retry", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-retry" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-sdk-sts/LICENSE b/server/node_modules/@aws-sdk/middleware-sdk-sts/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-sdk-sts/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/middleware-sdk-sts/README.md b/server/node_modules/@aws-sdk/middleware-sdk-sts/README.md new file mode 100644 index 0000000000..db18b93b3d --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-sdk-sts/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/middleware-sdk-sts + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-sdk-sts/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-sdk-sts) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-sdk-sts.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-sdk-sts) diff --git a/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-cjs/index.js new file mode 100644 index 0000000000..c556762ac5 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-cjs/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveStsAuthConfig = void 0; +const middleware_signing_1 = require("@aws-sdk/middleware-signing"); +const resolveStsAuthConfig = (input, { stsClientCtor }) => (0, middleware_signing_1.resolveAwsAuthConfig)({ + ...input, + stsClientCtor, +}); +exports.resolveStsAuthConfig = resolveStsAuthConfig; diff --git a/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-es/index.js new file mode 100644 index 0000000000..6659df6452 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-es/index.js @@ -0,0 +1,5 @@ +import { resolveAwsAuthConfig } from "@aws-sdk/middleware-signing"; +export const resolveStsAuthConfig = (input, { stsClientCtor }) => resolveAwsAuthConfig({ + ...input, + stsClientCtor, +}); diff --git a/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/index.d.ts new file mode 100644 index 0000000000..4fb65e5b5f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/index.d.ts @@ -0,0 +1,34 @@ +import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing"; +import { AwsCredentialIdentity, ChecksumConstructor, Client, HashConstructor, Provider, RegionInfoProvider } from "@aws-sdk/types"; +export interface StsAuthInputConfig extends AwsAuthInputConfig { +} +interface PreviouslyResolved { + credentialDefaultProvider: (input: any) => Provider; + region: string | Provider; + regionInfoProvider?: RegionInfoProvider; + signingName?: string; + serviceId: string; + sha256: ChecksumConstructor | HashConstructor; + useFipsEndpoint: Provider; + useDualstackEndpoint: Provider; +} +export interface StsAuthResolvedConfig extends AwsAuthResolvedConfig { + /** + * Reference to STSClient class constructor. + * @internal + */ + stsClientCtor: new (clientConfig: any) => Client; +} +export interface StsAuthConfigOptions { + /** + * Reference to STSClient class constructor. + */ + stsClientCtor: new (clientConfig: any) => Client; +} +/** + * Set STS client constructor to `stsClientCtor` config parameter. It is used + * for role assumers for STS client internally. See `clients/client-sts/defaultStsRoleAssumers.ts` + * and `clients/client-sts/STSClient.ts`. + */ +export declare const resolveStsAuthConfig: (input: T & PreviouslyResolved & StsAuthInputConfig, { stsClientCtor }: StsAuthConfigOptions) => T & StsAuthResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..32e8f9ff39 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-sdk-sts/dist-types/ts3.4/index.d.ts @@ -0,0 +1,34 @@ +import { + AwsAuthInputConfig, + AwsAuthResolvedConfig, +} from "@aws-sdk/middleware-signing"; +import { + AwsCredentialIdentity, + ChecksumConstructor, + Client, + HashConstructor, + Provider, + RegionInfoProvider, +} from "@aws-sdk/types"; +export interface StsAuthInputConfig extends AwsAuthInputConfig {} +interface PreviouslyResolved { + credentialDefaultProvider: (input: any) => Provider; + region: string | Provider; + regionInfoProvider?: RegionInfoProvider; + signingName?: string; + serviceId: string; + sha256: ChecksumConstructor | HashConstructor; + useFipsEndpoint: Provider; + useDualstackEndpoint: Provider; +} +export interface StsAuthResolvedConfig extends AwsAuthResolvedConfig { + stsClientCtor: new (clientConfig: any) => Client; +} +export interface StsAuthConfigOptions { + stsClientCtor: new (clientConfig: any) => Client; +} +export declare const resolveStsAuthConfig: ( + input: T & PreviouslyResolved & StsAuthInputConfig, + { stsClientCtor }: StsAuthConfigOptions +) => T & StsAuthResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-sdk-sts/package.json b/server/node_modules/@aws-sdk/middleware-sdk-sts/package.json new file mode 100644 index 0000000000..6507cc06dd --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-sdk-sts/package.json @@ -0,0 +1,57 @@ +{ + "name": "@aws-sdk/middleware-sdk-sts", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "exit 0" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-signing": "3.257.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/signature-v4": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-sdk-sts", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-sdk-sts" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-serde/LICENSE b/server/node_modules/@aws-sdk/middleware-serde/LICENSE new file mode 100644 index 0000000000..e907b58668 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/middleware-serde/README.md b/server/node_modules/@aws-sdk/middleware-serde/README.md new file mode 100644 index 0000000000..95b162bae4 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/middleware-serde + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-serde/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-serde) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-serde.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-serde) diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/deserializerMiddleware.js b/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/deserializerMiddleware.js new file mode 100644 index 0000000000..3b8e9cb741 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/deserializerMiddleware.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deserializerMiddleware = void 0; +const deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => { + const { response } = await next(args); + try { + const parsed = await deserializer(response, options); + return { + response, + output: parsed, + }; + } + catch (error) { + Object.defineProperty(error, "$response", { + value: response, + }); + throw error; + } +}; +exports.deserializerMiddleware = deserializerMiddleware; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/index.js new file mode 100644 index 0000000000..529a0945fa --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./deserializerMiddleware"), exports); +tslib_1.__exportStar(require("./serdePlugin"), exports); +tslib_1.__exportStar(require("./serializerMiddleware"), exports); diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/serdePlugin.js b/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/serdePlugin.js new file mode 100644 index 0000000000..c2f66db843 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/serdePlugin.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSerdePlugin = exports.serializerMiddlewareOption = exports.deserializerMiddlewareOption = void 0; +const deserializerMiddleware_1 = require("./deserializerMiddleware"); +const serializerMiddleware_1 = require("./serializerMiddleware"); +exports.deserializerMiddlewareOption = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true, +}; +exports.serializerMiddlewareOption = { + name: "serializerMiddleware", + step: "serialize", + tags: ["SERIALIZER"], + override: true, +}; +function getSerdePlugin(config, serializer, deserializer) { + return { + applyToStack: (commandStack) => { + commandStack.add((0, deserializerMiddleware_1.deserializerMiddleware)(config, deserializer), exports.deserializerMiddlewareOption); + commandStack.add((0, serializerMiddleware_1.serializerMiddleware)(config, serializer), exports.serializerMiddlewareOption); + }, + }; +} +exports.getSerdePlugin = getSerdePlugin; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/serializerMiddleware.js b/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/serializerMiddleware.js new file mode 100644 index 0000000000..20f32ca3ba --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-cjs/serializerMiddleware.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.serializerMiddleware = void 0; +const serializerMiddleware = (options, serializer) => (next, context) => async (args) => { + var _a; + const endpoint = ((_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.url) && options.urlParser + ? async () => options.urlParser(context.endpointV2.url) + : options.endpoint; + if (!endpoint) { + throw new Error("No valid endpoint provider available."); + } + const request = await serializer(args.input, { ...options, endpoint }); + return next({ + ...args, + request, + }); +}; +exports.serializerMiddleware = serializerMiddleware; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-es/deserializerMiddleware.js b/server/node_modules/@aws-sdk/middleware-serde/dist-es/deserializerMiddleware.js new file mode 100644 index 0000000000..82db43015c --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-es/deserializerMiddleware.js @@ -0,0 +1,16 @@ +export const deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => { + const { response } = await next(args); + try { + const parsed = await deserializer(response, options); + return { + response, + output: parsed, + }; + } + catch (error) { + Object.defineProperty(error, "$response", { + value: response, + }); + throw error; + } +}; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-serde/dist-es/index.js new file mode 100644 index 0000000000..166a2be21f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-es/index.js @@ -0,0 +1,3 @@ +export * from "./deserializerMiddleware"; +export * from "./serdePlugin"; +export * from "./serializerMiddleware"; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-es/serdePlugin.js b/server/node_modules/@aws-sdk/middleware-serde/dist-es/serdePlugin.js new file mode 100644 index 0000000000..be2a06ef86 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-es/serdePlugin.js @@ -0,0 +1,22 @@ +import { deserializerMiddleware } from "./deserializerMiddleware"; +import { serializerMiddleware } from "./serializerMiddleware"; +export const deserializerMiddlewareOption = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true, +}; +export const serializerMiddlewareOption = { + name: "serializerMiddleware", + step: "serialize", + tags: ["SERIALIZER"], + override: true, +}; +export function getSerdePlugin(config, serializer, deserializer) { + return { + applyToStack: (commandStack) => { + commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption); + commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption); + }, + }; +} diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-es/serializerMiddleware.js b/server/node_modules/@aws-sdk/middleware-serde/dist-es/serializerMiddleware.js new file mode 100644 index 0000000000..b02b93d738 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-es/serializerMiddleware.js @@ -0,0 +1,13 @@ +export const serializerMiddleware = (options, serializer) => (next, context) => async (args) => { + const endpoint = context.endpointV2?.url && options.urlParser + ? async () => options.urlParser(context.endpointV2.url) + : options.endpoint; + if (!endpoint) { + throw new Error("No valid endpoint provider available."); + } + const request = await serializer(args.input, { ...options, endpoint }); + return next({ + ...args, + request, + }); +}; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-types/deserializerMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-serde/dist-types/deserializerMiddleware.d.ts new file mode 100644 index 0000000000..70ca0c25d1 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-types/deserializerMiddleware.d.ts @@ -0,0 +1,2 @@ +import { DeserializeMiddleware, ResponseDeserializer } from "@aws-sdk/types"; +export declare const deserializerMiddleware: (options: RuntimeUtils, deserializer: ResponseDeserializer) => DeserializeMiddleware; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-serde/dist-types/index.d.ts new file mode 100644 index 0000000000..166a2be21f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-types/index.d.ts @@ -0,0 +1,3 @@ +export * from "./deserializerMiddleware"; +export * from "./serdePlugin"; +export * from "./serializerMiddleware"; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-types/serdePlugin.d.ts b/server/node_modules/@aws-sdk/middleware-serde/dist-types/serdePlugin.d.ts new file mode 100644 index 0000000000..53b88d28df --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-types/serdePlugin.d.ts @@ -0,0 +1,8 @@ +import { DeserializeHandlerOptions, Endpoint, EndpointBearer, MetadataBearer, Pluggable, Provider, RequestSerializer, ResponseDeserializer, SerializeHandlerOptions, UrlParser } from "@aws-sdk/types"; +export declare const deserializerMiddlewareOption: DeserializeHandlerOptions; +export declare const serializerMiddlewareOption: SerializeHandlerOptions; +export declare type V1OrV2Endpoint = { + urlParser?: UrlParser; + endpoint?: Provider; +}; +export declare function getSerdePlugin(config: V1OrV2Endpoint, serializer: RequestSerializer, deserializer: ResponseDeserializer): Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-types/serializerMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-serde/dist-types/serializerMiddleware.d.ts new file mode 100644 index 0000000000..719de5e80d --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-types/serializerMiddleware.d.ts @@ -0,0 +1,3 @@ +import { EndpointBearer, RequestSerializer, SerializeMiddleware } from "@aws-sdk/types"; +import type { V1OrV2Endpoint } from "./serdePlugin"; +export declare const serializerMiddleware: (options: V1OrV2Endpoint, serializer: RequestSerializer) => SerializeMiddleware; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/deserializerMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/deserializerMiddleware.d.ts new file mode 100644 index 0000000000..8247263099 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/deserializerMiddleware.d.ts @@ -0,0 +1,9 @@ +import { DeserializeMiddleware, ResponseDeserializer } from "@aws-sdk/types"; +export declare const deserializerMiddleware: < + Input extends object, + Output extends object, + RuntimeUtils = any +>( + options: RuntimeUtils, + deserializer: ResponseDeserializer +) => DeserializeMiddleware; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..166a2be21f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/index.d.ts @@ -0,0 +1,3 @@ +export * from "./deserializerMiddleware"; +export * from "./serdePlugin"; +export * from "./serializerMiddleware"; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/serdePlugin.d.ts b/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/serdePlugin.d.ts new file mode 100644 index 0000000000..b7d5db5c50 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/serdePlugin.d.ts @@ -0,0 +1,27 @@ +import { + DeserializeHandlerOptions, + Endpoint, + EndpointBearer, + MetadataBearer, + Pluggable, + Provider, + RequestSerializer, + ResponseDeserializer, + SerializeHandlerOptions, + UrlParser, +} from "@aws-sdk/types"; +export declare const deserializerMiddlewareOption: DeserializeHandlerOptions; +export declare const serializerMiddlewareOption: SerializeHandlerOptions; +export declare type V1OrV2Endpoint = { + urlParser?: UrlParser; + endpoint?: Provider; +}; +export declare function getSerdePlugin< + InputType extends object, + SerDeContext, + OutputType extends MetadataBearer +>( + config: V1OrV2Endpoint, + serializer: RequestSerializer, + deserializer: ResponseDeserializer +): Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/serializerMiddleware.d.ts b/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/serializerMiddleware.d.ts new file mode 100644 index 0000000000..e7bedca384 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/dist-types/ts3.4/serializerMiddleware.d.ts @@ -0,0 +1,14 @@ +import { + EndpointBearer, + RequestSerializer, + SerializeMiddleware, +} from "@aws-sdk/types"; +import { V1OrV2Endpoint } from "./serdePlugin"; +export declare const serializerMiddleware: < + Input extends object, + Output extends object, + RuntimeUtils extends EndpointBearer +>( + options: V1OrV2Endpoint, + serializer: RequestSerializer +) => SerializeMiddleware; diff --git a/server/node_modules/@aws-sdk/middleware-serde/package.json b/server/node_modules/@aws-sdk/middleware-serde/package.json new file mode 100644 index 0000000000..9171f6b71a --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-serde/package.json @@ -0,0 +1,53 @@ +{ + "name": "@aws-sdk/middleware-serde", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-serde", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-serde" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-signing/LICENSE b/server/node_modules/@aws-sdk/middleware-signing/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/middleware-signing/README.md b/server/node_modules/@aws-sdk/middleware-signing/README.md new file mode 100644 index 0000000000..22cb5d4091 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/signer-middleware + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-signing/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-signing) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-signing.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-signing) diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/configurations.js b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/configurations.js new file mode 100644 index 0000000000..ce0d441588 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/configurations.js @@ -0,0 +1,108 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveSigV4AuthConfig = exports.resolveAwsAuthConfig = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const signature_v4_1 = require("@aws-sdk/signature-v4"); +const util_middleware_1 = require("@aws-sdk/util-middleware"); +const CREDENTIAL_EXPIRE_WINDOW = 300000; +const resolveAwsAuthConfig = (input) => { + const normalizedCreds = input.credentials + ? normalizeCredentialProvider(input.credentials) + : input.credentialDefaultProvider(input); + const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; + let signer; + if (input.signer) { + signer = (0, util_middleware_1.normalizeProvider)(input.signer); + } + else if (input.regionInfoProvider) { + signer = () => (0, util_middleware_1.normalizeProvider)(input.region)() + .then(async (region) => [ + (await input.regionInfoProvider(region, { + useFipsEndpoint: await input.useFipsEndpoint(), + useDualstackEndpoint: await input.useDualstackEndpoint(), + })) || {}, + region, + ]) + .then(([regionInfo, region]) => { + const { signingRegion, signingService } = regionInfo; + input.signingRegion = input.signingRegion || signingRegion || region; + input.signingName = input.signingName || signingService || input.serviceId; + const params = { + ...input, + credentials: normalizedCreds, + region: input.signingRegion, + service: input.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = input.signerConstructor || signature_v4_1.SignatureV4; + return new SignerCtor(params); + }); + } + else { + signer = async (authScheme) => { + authScheme = Object.assign({}, { + name: "sigv4", + signingName: input.signingName || input.defaultSigningName, + signingRegion: await (0, util_middleware_1.normalizeProvider)(input.region)(), + properties: {}, + }, authScheme); + const signingRegion = authScheme.signingRegion; + const signingService = authScheme.signingName; + input.signingRegion = input.signingRegion || signingRegion; + input.signingName = input.signingName || signingService || input.serviceId; + const params = { + ...input, + credentials: normalizedCreds, + region: input.signingRegion, + service: input.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = input.signerConstructor || signature_v4_1.SignatureV4; + return new SignerCtor(params); + }; + } + return { + ...input, + systemClockOffset, + signingEscapePath, + credentials: normalizedCreds, + signer, + }; +}; +exports.resolveAwsAuthConfig = resolveAwsAuthConfig; +const resolveSigV4AuthConfig = (input) => { + const normalizedCreds = input.credentials + ? normalizeCredentialProvider(input.credentials) + : input.credentialDefaultProvider(input); + const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; + let signer; + if (input.signer) { + signer = (0, util_middleware_1.normalizeProvider)(input.signer); + } + else { + signer = (0, util_middleware_1.normalizeProvider)(new signature_v4_1.SignatureV4({ + credentials: normalizedCreds, + region: input.region, + service: input.signingName, + sha256, + uriEscapePath: signingEscapePath, + })); + } + return { + ...input, + systemClockOffset, + signingEscapePath, + credentials: normalizedCreds, + signer, + }; +}; +exports.resolveSigV4AuthConfig = resolveSigV4AuthConfig; +const normalizeCredentialProvider = (credentials) => { + if (typeof credentials === "function") { + return (0, property_provider_1.memoize)(credentials, (credentials) => credentials.expiration !== undefined && + credentials.expiration.getTime() - Date.now() < CREDENTIAL_EXPIRE_WINDOW, (credentials) => credentials.expiration !== undefined); + } + return (0, util_middleware_1.normalizeProvider)(credentials); +}; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/index.js new file mode 100644 index 0000000000..a149f7b1b8 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./configurations"), exports); +tslib_1.__exportStar(require("./middleware"), exports); diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/middleware.js b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/middleware.js new file mode 100644 index 0000000000..92ba94a70f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/middleware.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSigV4AuthPlugin = exports.getAwsAuthPlugin = exports.awsAuthMiddlewareOptions = exports.awsAuthMiddleware = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const getSkewCorrectedDate_1 = require("./utils/getSkewCorrectedDate"); +const getUpdatedSystemClockOffset_1 = require("./utils/getUpdatedSystemClockOffset"); +const awsAuthMiddleware = (options) => (next, context) => async function (args) { + var _a, _b, _c, _d; + if (!protocol_http_1.HttpRequest.isInstance(args.request)) + return next(args); + const authScheme = (_c = (_b = (_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.authSchemes) === null || _c === void 0 ? void 0 : _c[0]; + const multiRegionOverride = (authScheme === null || authScheme === void 0 ? void 0 : authScheme.name) === "sigv4a" ? (_d = authScheme === null || authScheme === void 0 ? void 0 : authScheme.signingRegionSet) === null || _d === void 0 ? void 0 : _d.join(",") : undefined; + const signer = await options.signer(authScheme); + const output = await next({ + ...args, + request: await signer.sign(args.request, { + signingDate: (0, getSkewCorrectedDate_1.getSkewCorrectedDate)(options.systemClockOffset), + signingRegion: multiRegionOverride || context["signing_region"], + signingService: context["signing_service"], + }), + }).catch((error) => { + var _a; + const serverTime = (_a = error.ServerTime) !== null && _a !== void 0 ? _a : getDateHeader(error.$response); + if (serverTime) { + options.systemClockOffset = (0, getUpdatedSystemClockOffset_1.getUpdatedSystemClockOffset)(serverTime, options.systemClockOffset); + } + throw error; + }); + const dateHeader = getDateHeader(output.response); + if (dateHeader) { + options.systemClockOffset = (0, getUpdatedSystemClockOffset_1.getUpdatedSystemClockOffset)(dateHeader, options.systemClockOffset); + } + return output; +}; +exports.awsAuthMiddleware = awsAuthMiddleware; +const getDateHeader = (response) => { var _a, _b, _c; return protocol_http_1.HttpResponse.isInstance(response) ? (_b = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.date) !== null && _b !== void 0 ? _b : (_c = response.headers) === null || _c === void 0 ? void 0 : _c.Date : undefined; }; +exports.awsAuthMiddlewareOptions = { + name: "awsAuthMiddleware", + tags: ["SIGNATURE", "AWSAUTH"], + relation: "after", + toMiddleware: "retryMiddleware", + override: true, +}; +const getAwsAuthPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, exports.awsAuthMiddleware)(options), exports.awsAuthMiddlewareOptions); + }, +}); +exports.getAwsAuthPlugin = getAwsAuthPlugin; +exports.getSigV4AuthPlugin = exports.getAwsAuthPlugin; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/getSkewCorrectedDate.js b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/getSkewCorrectedDate.js new file mode 100644 index 0000000000..35c0812203 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/getSkewCorrectedDate.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSkewCorrectedDate = void 0; +const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); +exports.getSkewCorrectedDate = getSkewCorrectedDate; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/getUpdatedSystemClockOffset.js b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/getUpdatedSystemClockOffset.js new file mode 100644 index 0000000000..44070563b6 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/getUpdatedSystemClockOffset.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getUpdatedSystemClockOffset = void 0; +const isClockSkewed_1 = require("./isClockSkewed"); +const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { + const clockTimeInMs = Date.parse(clockTime); + if ((0, isClockSkewed_1.isClockSkewed)(clockTimeInMs, currentSystemClockOffset)) { + return clockTimeInMs - Date.now(); + } + return currentSystemClockOffset; +}; +exports.getUpdatedSystemClockOffset = getUpdatedSystemClockOffset; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/isClockSkewed.js b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/isClockSkewed.js new file mode 100644 index 0000000000..918dbbef89 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-cjs/utils/isClockSkewed.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isClockSkewed = void 0; +const getSkewCorrectedDate_1 = require("./getSkewCorrectedDate"); +const isClockSkewed = (clockTime, systemClockOffset) => Math.abs((0, getSkewCorrectedDate_1.getSkewCorrectedDate)(systemClockOffset).getTime() - clockTime) >= 300000; +exports.isClockSkewed = isClockSkewed; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-es/configurations.js b/server/node_modules/@aws-sdk/middleware-signing/dist-es/configurations.js new file mode 100644 index 0000000000..bccab3561f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-es/configurations.js @@ -0,0 +1,103 @@ +import { memoize } from "@aws-sdk/property-provider"; +import { SignatureV4 } from "@aws-sdk/signature-v4"; +import { normalizeProvider } from "@aws-sdk/util-middleware"; +const CREDENTIAL_EXPIRE_WINDOW = 300000; +export const resolveAwsAuthConfig = (input) => { + const normalizedCreds = input.credentials + ? normalizeCredentialProvider(input.credentials) + : input.credentialDefaultProvider(input); + const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; + let signer; + if (input.signer) { + signer = normalizeProvider(input.signer); + } + else if (input.regionInfoProvider) { + signer = () => normalizeProvider(input.region)() + .then(async (region) => [ + (await input.regionInfoProvider(region, { + useFipsEndpoint: await input.useFipsEndpoint(), + useDualstackEndpoint: await input.useDualstackEndpoint(), + })) || {}, + region, + ]) + .then(([regionInfo, region]) => { + const { signingRegion, signingService } = regionInfo; + input.signingRegion = input.signingRegion || signingRegion || region; + input.signingName = input.signingName || signingService || input.serviceId; + const params = { + ...input, + credentials: normalizedCreds, + region: input.signingRegion, + service: input.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = input.signerConstructor || SignatureV4; + return new SignerCtor(params); + }); + } + else { + signer = async (authScheme) => { + authScheme = Object.assign({}, { + name: "sigv4", + signingName: input.signingName || input.defaultSigningName, + signingRegion: await normalizeProvider(input.region)(), + properties: {}, + }, authScheme); + const signingRegion = authScheme.signingRegion; + const signingService = authScheme.signingName; + input.signingRegion = input.signingRegion || signingRegion; + input.signingName = input.signingName || signingService || input.serviceId; + const params = { + ...input, + credentials: normalizedCreds, + region: input.signingRegion, + service: input.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = input.signerConstructor || SignatureV4; + return new SignerCtor(params); + }; + } + return { + ...input, + systemClockOffset, + signingEscapePath, + credentials: normalizedCreds, + signer, + }; +}; +export const resolveSigV4AuthConfig = (input) => { + const normalizedCreds = input.credentials + ? normalizeCredentialProvider(input.credentials) + : input.credentialDefaultProvider(input); + const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; + let signer; + if (input.signer) { + signer = normalizeProvider(input.signer); + } + else { + signer = normalizeProvider(new SignatureV4({ + credentials: normalizedCreds, + region: input.region, + service: input.signingName, + sha256, + uriEscapePath: signingEscapePath, + })); + } + return { + ...input, + systemClockOffset, + signingEscapePath, + credentials: normalizedCreds, + signer, + }; +}; +const normalizeCredentialProvider = (credentials) => { + if (typeof credentials === "function") { + return memoize(credentials, (credentials) => credentials.expiration !== undefined && + credentials.expiration.getTime() - Date.now() < CREDENTIAL_EXPIRE_WINDOW, (credentials) => credentials.expiration !== undefined); + } + return normalizeProvider(credentials); +}; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-signing/dist-es/index.js new file mode 100644 index 0000000000..ef4de14542 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-es/index.js @@ -0,0 +1,2 @@ +export * from "./configurations"; +export * from "./middleware"; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-es/middleware.js b/server/node_modules/@aws-sdk/middleware-signing/dist-es/middleware.js new file mode 100644 index 0000000000..ff6ad001f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-es/middleware.js @@ -0,0 +1,43 @@ +import { HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; +import { getSkewCorrectedDate } from "./utils/getSkewCorrectedDate"; +import { getUpdatedSystemClockOffset } from "./utils/getUpdatedSystemClockOffset"; +export const awsAuthMiddleware = (options) => (next, context) => async function (args) { + if (!HttpRequest.isInstance(args.request)) + return next(args); + const authScheme = context.endpointV2?.properties?.authSchemes?.[0]; + const multiRegionOverride = authScheme?.name === "sigv4a" ? authScheme?.signingRegionSet?.join(",") : undefined; + const signer = await options.signer(authScheme); + const output = await next({ + ...args, + request: await signer.sign(args.request, { + signingDate: getSkewCorrectedDate(options.systemClockOffset), + signingRegion: multiRegionOverride || context["signing_region"], + signingService: context["signing_service"], + }), + }).catch((error) => { + const serverTime = error.ServerTime ?? getDateHeader(error.$response); + if (serverTime) { + options.systemClockOffset = getUpdatedSystemClockOffset(serverTime, options.systemClockOffset); + } + throw error; + }); + const dateHeader = getDateHeader(output.response); + if (dateHeader) { + options.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, options.systemClockOffset); + } + return output; +}; +const getDateHeader = (response) => HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined; +export const awsAuthMiddlewareOptions = { + name: "awsAuthMiddleware", + tags: ["SIGNATURE", "AWSAUTH"], + relation: "after", + toMiddleware: "retryMiddleware", + override: true, +}; +export const getAwsAuthPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(awsAuthMiddleware(options), awsAuthMiddlewareOptions); + }, +}); +export const getSigV4AuthPlugin = getAwsAuthPlugin; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getSkewCorrectedDate.js b/server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getSkewCorrectedDate.js new file mode 100644 index 0000000000..6ee8036348 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getSkewCorrectedDate.js @@ -0,0 +1 @@ +export const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getUpdatedSystemClockOffset.js b/server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getUpdatedSystemClockOffset.js new file mode 100644 index 0000000000..859c41a284 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getUpdatedSystemClockOffset.js @@ -0,0 +1,8 @@ +import { isClockSkewed } from "./isClockSkewed"; +export const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { + const clockTimeInMs = Date.parse(clockTime); + if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { + return clockTimeInMs - Date.now(); + } + return currentSystemClockOffset; +}; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/isClockSkewed.js b/server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/isClockSkewed.js new file mode 100644 index 0000000000..086d7a8719 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-es/utils/isClockSkewed.js @@ -0,0 +1,2 @@ +import { getSkewCorrectedDate } from "./getSkewCorrectedDate"; +export const isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/configurations.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/configurations.d.ts new file mode 100644 index 0000000000..72a952bb5e --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/configurations.d.ts @@ -0,0 +1,92 @@ +import { SignatureV4CryptoInit, SignatureV4Init } from "@aws-sdk/signature-v4"; +import { AuthScheme, AwsCredentialIdentity, ChecksumConstructor, HashConstructor, Logger, MemoizedProvider, Provider, RegionInfoProvider, RequestSigner } from "@aws-sdk/types"; +export interface AwsAuthInputConfig { + /** + * The credentials used to sign requests. + */ + credentials?: AwsCredentialIdentity | Provider; + /** + * The signer to use when signing requests. + */ + signer?: RequestSigner | ((authScheme?: AuthScheme) => Promise); + /** + * Whether to escape request path when signing the request. + */ + signingEscapePath?: boolean; + /** + * An offset value in milliseconds to apply to all signing times. + */ + systemClockOffset?: number; + /** + * The region where you want to sign your request against. This + * can be different to the region in the endpoint. + */ + signingRegion?: string; + /** + * The injectable SigV4-compatible signer class constructor. If not supplied, + * regular SignatureV4 constructor will be used. + * @private + */ + signerConstructor?: new (options: SignatureV4Init & SignatureV4CryptoInit) => RequestSigner; +} +export interface SigV4AuthInputConfig { + /** + * The credentials used to sign requests. + */ + credentials?: AwsCredentialIdentity | Provider; + /** + * The signer to use when signing requests. + */ + signer?: RequestSigner | ((authScheme?: AuthScheme) => Promise); + /** + * Whether to escape request path when signing the request. + */ + signingEscapePath?: boolean; + /** + * An offset value in milliseconds to apply to all signing times. + */ + systemClockOffset?: number; +} +interface PreviouslyResolved { + credentialDefaultProvider: (input: any) => MemoizedProvider; + region: string | Provider; + regionInfoProvider?: RegionInfoProvider; + signingName?: string; + defaultSigningName?: string; + serviceId: string; + sha256: ChecksumConstructor | HashConstructor; + useFipsEndpoint: Provider; + useDualstackEndpoint: Provider; +} +interface SigV4PreviouslyResolved { + credentialDefaultProvider: (input: any) => MemoizedProvider; + region: string | Provider; + signingName: string; + sha256: ChecksumConstructor | HashConstructor; + logger?: Logger; +} +export interface AwsAuthResolvedConfig { + /** + * Resolved value for input config {@link AwsAuthInputConfig.credentials} + * This provider MAY memoize the loaded credentials for certain period. + * See {@link MemoizedProvider} for more information. + */ + credentials: MemoizedProvider; + /** + * Resolved value for input config {@link AwsAuthInputConfig.signer} + */ + signer: (authScheme?: AuthScheme) => Promise; + /** + * Resolved value for input config {@link AwsAuthInputConfig.signingEscapePath} + */ + signingEscapePath: boolean; + /** + * Resolved value for input config {@link AwsAuthInputConfig.systemClockOffset} + */ + systemClockOffset: number; +} +export interface SigV4AuthResolvedConfig extends AwsAuthResolvedConfig { +} +export declare const resolveAwsAuthConfig: (input: T & AwsAuthInputConfig & PreviouslyResolved) => T & AwsAuthResolvedConfig; +export declare const resolveSigV4AuthConfig: (input: T & SigV4AuthInputConfig & SigV4PreviouslyResolved) => T & SigV4AuthResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/index.d.ts new file mode 100644 index 0000000000..ef4de14542 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/index.d.ts @@ -0,0 +1,2 @@ +export * from "./configurations"; +export * from "./middleware"; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/middleware.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/middleware.d.ts new file mode 100644 index 0000000000..b173775960 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/middleware.d.ts @@ -0,0 +1,6 @@ +import { FinalizeRequestMiddleware, Pluggable, RelativeMiddlewareOptions } from "@aws-sdk/types"; +import { AwsAuthResolvedConfig } from "./configurations"; +export declare const awsAuthMiddleware: (options: AwsAuthResolvedConfig) => FinalizeRequestMiddleware; +export declare const awsAuthMiddlewareOptions: RelativeMiddlewareOptions; +export declare const getAwsAuthPlugin: (options: AwsAuthResolvedConfig) => Pluggable; +export declare const getSigV4AuthPlugin: (options: AwsAuthResolvedConfig) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/configurations.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/configurations.d.ts new file mode 100644 index 0000000000..54a6a9dcdf --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/configurations.d.ts @@ -0,0 +1,68 @@ +import { SignatureV4CryptoInit, SignatureV4Init } from "@aws-sdk/signature-v4"; +import { + AuthScheme, + AwsCredentialIdentity, + ChecksumConstructor, + HashConstructor, + Logger, + MemoizedProvider, + Provider, + RegionInfoProvider, + RequestSigner, +} from "@aws-sdk/types"; +export interface AwsAuthInputConfig { + credentials?: AwsCredentialIdentity | Provider; + signer?: + | RequestSigner + | ((authScheme?: AuthScheme) => Promise); + signingEscapePath?: boolean; + systemClockOffset?: number; + signingRegion?: string; + signerConstructor?: new ( + options: SignatureV4Init & SignatureV4CryptoInit + ) => RequestSigner; +} +export interface SigV4AuthInputConfig { + credentials?: AwsCredentialIdentity | Provider; + signer?: + | RequestSigner + | ((authScheme?: AuthScheme) => Promise); + signingEscapePath?: boolean; + systemClockOffset?: number; +} +interface PreviouslyResolved { + credentialDefaultProvider: ( + input: any + ) => MemoizedProvider; + region: string | Provider; + regionInfoProvider?: RegionInfoProvider; + signingName?: string; + defaultSigningName?: string; + serviceId: string; + sha256: ChecksumConstructor | HashConstructor; + useFipsEndpoint: Provider; + useDualstackEndpoint: Provider; +} +interface SigV4PreviouslyResolved { + credentialDefaultProvider: ( + input: any + ) => MemoizedProvider; + region: string | Provider; + signingName: string; + sha256: ChecksumConstructor | HashConstructor; + logger?: Logger; +} +export interface AwsAuthResolvedConfig { + credentials: MemoizedProvider; + signer: (authScheme?: AuthScheme) => Promise; + signingEscapePath: boolean; + systemClockOffset: number; +} +export interface SigV4AuthResolvedConfig extends AwsAuthResolvedConfig {} +export declare const resolveAwsAuthConfig: ( + input: T & AwsAuthInputConfig & PreviouslyResolved +) => T & AwsAuthResolvedConfig; +export declare const resolveSigV4AuthConfig: ( + input: T & SigV4AuthInputConfig & SigV4PreviouslyResolved +) => T & SigV4AuthResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..ef4de14542 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export * from "./configurations"; +export * from "./middleware"; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/middleware.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/middleware.d.ts new file mode 100644 index 0000000000..ca61efe6df --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/middleware.d.ts @@ -0,0 +1,19 @@ +import { + FinalizeRequestMiddleware, + Pluggable, + RelativeMiddlewareOptions, +} from "@aws-sdk/types"; +import { AwsAuthResolvedConfig } from "./configurations"; +export declare const awsAuthMiddleware: < + Input extends object, + Output extends object +>( + options: AwsAuthResolvedConfig +) => FinalizeRequestMiddleware; +export declare const awsAuthMiddlewareOptions: RelativeMiddlewareOptions; +export declare const getAwsAuthPlugin: ( + options: AwsAuthResolvedConfig +) => Pluggable; +export declare const getSigV4AuthPlugin: ( + options: AwsAuthResolvedConfig +) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getSkewCorrectedDate.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getSkewCorrectedDate.d.ts new file mode 100644 index 0000000000..741c5ea3a5 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getSkewCorrectedDate.d.ts @@ -0,0 +1 @@ +export declare const getSkewCorrectedDate: (systemClockOffset: number) => Date; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getUpdatedSystemClockOffset.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getUpdatedSystemClockOffset.d.ts new file mode 100644 index 0000000000..eae331176c --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getUpdatedSystemClockOffset.d.ts @@ -0,0 +1,4 @@ +export declare const getUpdatedSystemClockOffset: ( + clockTime: string, + currentSystemClockOffset: number +) => number; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/isClockSkewed.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/isClockSkewed.d.ts new file mode 100644 index 0000000000..9f994f8798 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/isClockSkewed.d.ts @@ -0,0 +1,4 @@ +export declare const isClockSkewed: ( + clockTime: number, + systemClockOffset: number +) => boolean; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getSkewCorrectedDate.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getSkewCorrectedDate.d.ts new file mode 100644 index 0000000000..8c887d23ed --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getSkewCorrectedDate.d.ts @@ -0,0 +1,6 @@ +/** + * Returns a date that is corrected for clock skew. + * + * @param systemClockOffset The offset of the system clock in milliseconds. + */ +export declare const getSkewCorrectedDate: (systemClockOffset: number) => Date; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getUpdatedSystemClockOffset.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getUpdatedSystemClockOffset.d.ts new file mode 100644 index 0000000000..66e9199825 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getUpdatedSystemClockOffset.d.ts @@ -0,0 +1,8 @@ +/** + * If clock is skewed, it returns the difference between serverTime and current time. + * If clock is not skewed, it returns currentSystemClockOffset. + * + * @param clockTime The string value of the server time. + * @param currentSystemClockOffset The current system clock offset. + */ +export declare const getUpdatedSystemClockOffset: (clockTime: string, currentSystemClockOffset: number) => number; diff --git a/server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/isClockSkewed.d.ts b/server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/isClockSkewed.d.ts new file mode 100644 index 0000000000..0dde593277 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/dist-types/utils/isClockSkewed.d.ts @@ -0,0 +1,7 @@ +/** + * Checks if the provided date is within the skew window of 300000ms. + * + * @param clockTime - The time to check for skew in milliseconds. + * @param systemClockOffset - The offset of the system clock in milliseconds. + */ +export declare const isClockSkewed: (clockTime: number, systemClockOffset: number) => boolean; diff --git a/server/node_modules/@aws-sdk/middleware-signing/package.json b/server/node_modules/@aws-sdk/middleware-signing/package.json new file mode 100644 index 0000000000..94c7915a6b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-signing/package.json @@ -0,0 +1,57 @@ +{ + "name": "@aws-sdk/middleware-signing", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --passWithNoTests" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/signature-v4": "3.257.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-middleware": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-signing", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-signing" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-stack/LICENSE b/server/node_modules/@aws-sdk/middleware-stack/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/middleware-stack/README.md b/server/node_modules/@aws-sdk/middleware-stack/README.md new file mode 100644 index 0000000000..ed3852442e --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/README.md @@ -0,0 +1,78 @@ +# @aws-sdk/middleware-stack + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-stack/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-stack) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-stack.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-stack) + +The package contains an implementation of middleware stack interface. Middleware +stack is a structure storing middleware in specified order and resolve these +middleware into a single handler. + +A middleware stack has five `Step`s, each of them represents a specific request life cycle: + +- **initialize**: The input is being prepared. Examples of typical initialization tasks include injecting default options computing derived parameters. + +- **serialize**: The input is complete and ready to be serialized. Examples of typical serialization tasks include input validation and building an HTTP request from user input. + +- **build**: The input has been serialized into an HTTP request, but that request may require further modification. Any request alterations will be applied to all retries. Examples of typical build tasks include injecting HTTP headers that describe a stable aspect of the request, such as `Content-Length` or a body checksum. + +- **finalizeRequest**: The request is being prepared to be sent over the wire. The request in this stage should already be semantically complete and should therefore only be altered to match the recipient's expectations. Examples of typical finalization tasks include request signing and injecting hop-by-hop headers. + +- **deserialize**: The response has arrived, the middleware here will deserialize the raw response object to structured response + +## Adding Middleware + +There are two ways to add middleware to a middleware stack. They both add middleware to specified `Step` but they provide fine-grained location control differently. + +### Absolute Location + +You can add middleware to specified step with: + +```javascript +stack.add(middleware, { + step: "finalizeRequest", +}); +``` + +This approach works for most cases. Sometimes you want your middleware to be executed in the front of the `Step`, you can set the `Priority` to `high`. Set the `Priority` to `low` then this middleware will be executed at the end of `Step`: + +```javascript +stack.add(middleware, { + step: "finalizeRequest", + priority: "high", +}); +``` + +If multiple middleware is added to same `step` with same `priority`, the order of them is determined by the order of adding them. + +### Relative Location + +In some cases, you might want to execute your middleware before some other known middleware, then you can use `addRelativeTo()`: + +```javascript +stack.add(middleware, { + step: "finalizeRequest", + name: "myMiddleware", +}); +stack.addRelativeTo(anotherMiddleware, { + relation: "before", //or 'after' + toMiddleware: "myMiddleware", +}); +``` + +## Removing Middleware + +You can remove middleware by name one at a time: + +```javascript +stack.remove("Middleware1"); +``` + +If you specify tags for middleware, you can remove multiple middleware at a time according to tag: + +```javascript +stack.add(middleware, { + step: "finalizeRequest", + tags: ["final"], +}); +stack.removeByTag("final"); +``` diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-cjs/MiddlewareStack.js b/server/node_modules/@aws-sdk/middleware-stack/dist-cjs/MiddlewareStack.js new file mode 100644 index 0000000000..58a3c3517a --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-cjs/MiddlewareStack.js @@ -0,0 +1,225 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.constructStack = void 0; +const constructStack = () => { + let absoluteEntries = []; + let relativeEntries = []; + const entriesNameSet = new Set(); + const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || + priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]); + const removeByName = (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + if (entry.name && entry.name === toRemove) { + isRemoved = true; + entriesNameSet.delete(toRemove); + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const removeByReference = (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + if (entry.middleware === toRemove) { + isRemoved = true; + if (entry.name) + entriesNameSet.delete(entry.name); + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const cloneTo = (toStack) => { + absoluteEntries.forEach((entry) => { + toStack.add(entry.middleware, { ...entry }); + }); + relativeEntries.forEach((entry) => { + toStack.addRelativeTo(entry.middleware, { ...entry }); + }); + return toStack; + }; + const expandRelativeMiddlewareList = (from) => { + const expandedMiddlewareList = []; + from.before.forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } + else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + expandedMiddlewareList.push(from); + from.after.reverse().forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } + else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + return expandedMiddlewareList; + }; + const getMiddlewareList = (debug = false) => { + const normalizedAbsoluteEntries = []; + const normalizedRelativeEntries = []; + const normalizedEntriesNameMap = {}; + absoluteEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [], + }; + if (normalizedEntry.name) + normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry; + normalizedAbsoluteEntries.push(normalizedEntry); + }); + relativeEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [], + }; + if (normalizedEntry.name) + normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry; + normalizedRelativeEntries.push(normalizedEntry); + }); + normalizedRelativeEntries.forEach((entry) => { + if (entry.toMiddleware) { + const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; + if (toMiddleware === undefined) { + if (debug) { + return; + } + throw new Error(`${entry.toMiddleware} is not found when adding ${entry.name || "anonymous"} middleware ${entry.relation} ${entry.toMiddleware}`); + } + if (entry.relation === "after") { + toMiddleware.after.push(entry); + } + if (entry.relation === "before") { + toMiddleware.before.push(entry); + } + } + }); + const mainChain = sort(normalizedAbsoluteEntries) + .map(expandRelativeMiddlewareList) + .reduce((wholeList, expendedMiddlewareList) => { + wholeList.push(...expendedMiddlewareList); + return wholeList; + }, []); + return mainChain; + }; + const stack = { + add: (middleware, options = {}) => { + const { name, override } = options; + const entry = { + step: "initialize", + priority: "normal", + middleware, + ...options, + }; + if (name) { + if (entriesNameSet.has(name)) { + if (!override) + throw new Error(`Duplicate middleware name '${name}'`); + const toOverrideIndex = absoluteEntries.findIndex((entry) => entry.name === name); + const toOverride = absoluteEntries[toOverrideIndex]; + if (toOverride.step !== entry.step || toOverride.priority !== entry.priority) { + throw new Error(`"${name}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be ` + + `overridden by same-name middleware with ${entry.priority} priority in ${entry.step} step.`); + } + absoluteEntries.splice(toOverrideIndex, 1); + } + entriesNameSet.add(name); + } + absoluteEntries.push(entry); + }, + addRelativeTo: (middleware, options) => { + const { name, override } = options; + const entry = { + middleware, + ...options, + }; + if (name) { + if (entriesNameSet.has(name)) { + if (!override) + throw new Error(`Duplicate middleware name '${name}'`); + const toOverrideIndex = relativeEntries.findIndex((entry) => entry.name === name); + const toOverride = relativeEntries[toOverrideIndex]; + if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { + throw new Error(`"${name}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden ` + + `by same-name middleware ${entry.relation} "${entry.toMiddleware}" middleware.`); + } + relativeEntries.splice(toOverrideIndex, 1); + } + entriesNameSet.add(name); + } + relativeEntries.push(entry); + }, + clone: () => cloneTo((0, exports.constructStack)()), + use: (plugin) => { + plugin.applyToStack(stack); + }, + remove: (toRemove) => { + if (typeof toRemove === "string") + return removeByName(toRemove); + else + return removeByReference(toRemove); + }, + removeByTag: (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + const { tags, name } = entry; + if (tags && tags.includes(toRemove)) { + if (name) + entriesNameSet.delete(name); + isRemoved = true; + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, + concat: (from) => { + const cloned = cloneTo((0, exports.constructStack)()); + cloned.use(from); + return cloned; + }, + applyToStack: cloneTo, + identify: () => { + return getMiddlewareList(true).map((mw) => { + return mw.name + ": " + (mw.tags || []).join(","); + }); + }, + resolve: (handler, context) => { + for (const middleware of getMiddlewareList() + .map((entry) => entry.middleware) + .reverse()) { + handler = middleware(handler, context); + } + return handler; + }, + }; + return stack; +}; +exports.constructStack = constructStack; +const stepWeights = { + initialize: 5, + serialize: 4, + build: 3, + finalizeRequest: 2, + deserialize: 1, +}; +const priorityWeights = { + high: 3, + normal: 2, + low: 1, +}; diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-stack/dist-cjs/index.js new file mode 100644 index 0000000000..fc3b85ffba --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./MiddlewareStack"), exports); diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-cjs/types.js b/server/node_modules/@aws-sdk/middleware-stack/dist-cjs/types.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-cjs/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-es/MiddlewareStack.js b/server/node_modules/@aws-sdk/middleware-stack/dist-es/MiddlewareStack.js new file mode 100644 index 0000000000..84727b4842 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-es/MiddlewareStack.js @@ -0,0 +1,221 @@ +export const constructStack = () => { + let absoluteEntries = []; + let relativeEntries = []; + const entriesNameSet = new Set(); + const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || + priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]); + const removeByName = (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + if (entry.name && entry.name === toRemove) { + isRemoved = true; + entriesNameSet.delete(toRemove); + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const removeByReference = (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + if (entry.middleware === toRemove) { + isRemoved = true; + if (entry.name) + entriesNameSet.delete(entry.name); + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const cloneTo = (toStack) => { + absoluteEntries.forEach((entry) => { + toStack.add(entry.middleware, { ...entry }); + }); + relativeEntries.forEach((entry) => { + toStack.addRelativeTo(entry.middleware, { ...entry }); + }); + return toStack; + }; + const expandRelativeMiddlewareList = (from) => { + const expandedMiddlewareList = []; + from.before.forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } + else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + expandedMiddlewareList.push(from); + from.after.reverse().forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } + else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + return expandedMiddlewareList; + }; + const getMiddlewareList = (debug = false) => { + const normalizedAbsoluteEntries = []; + const normalizedRelativeEntries = []; + const normalizedEntriesNameMap = {}; + absoluteEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [], + }; + if (normalizedEntry.name) + normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry; + normalizedAbsoluteEntries.push(normalizedEntry); + }); + relativeEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [], + }; + if (normalizedEntry.name) + normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry; + normalizedRelativeEntries.push(normalizedEntry); + }); + normalizedRelativeEntries.forEach((entry) => { + if (entry.toMiddleware) { + const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; + if (toMiddleware === undefined) { + if (debug) { + return; + } + throw new Error(`${entry.toMiddleware} is not found when adding ${entry.name || "anonymous"} middleware ${entry.relation} ${entry.toMiddleware}`); + } + if (entry.relation === "after") { + toMiddleware.after.push(entry); + } + if (entry.relation === "before") { + toMiddleware.before.push(entry); + } + } + }); + const mainChain = sort(normalizedAbsoluteEntries) + .map(expandRelativeMiddlewareList) + .reduce((wholeList, expendedMiddlewareList) => { + wholeList.push(...expendedMiddlewareList); + return wholeList; + }, []); + return mainChain; + }; + const stack = { + add: (middleware, options = {}) => { + const { name, override } = options; + const entry = { + step: "initialize", + priority: "normal", + middleware, + ...options, + }; + if (name) { + if (entriesNameSet.has(name)) { + if (!override) + throw new Error(`Duplicate middleware name '${name}'`); + const toOverrideIndex = absoluteEntries.findIndex((entry) => entry.name === name); + const toOverride = absoluteEntries[toOverrideIndex]; + if (toOverride.step !== entry.step || toOverride.priority !== entry.priority) { + throw new Error(`"${name}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be ` + + `overridden by same-name middleware with ${entry.priority} priority in ${entry.step} step.`); + } + absoluteEntries.splice(toOverrideIndex, 1); + } + entriesNameSet.add(name); + } + absoluteEntries.push(entry); + }, + addRelativeTo: (middleware, options) => { + const { name, override } = options; + const entry = { + middleware, + ...options, + }; + if (name) { + if (entriesNameSet.has(name)) { + if (!override) + throw new Error(`Duplicate middleware name '${name}'`); + const toOverrideIndex = relativeEntries.findIndex((entry) => entry.name === name); + const toOverride = relativeEntries[toOverrideIndex]; + if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { + throw new Error(`"${name}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden ` + + `by same-name middleware ${entry.relation} "${entry.toMiddleware}" middleware.`); + } + relativeEntries.splice(toOverrideIndex, 1); + } + entriesNameSet.add(name); + } + relativeEntries.push(entry); + }, + clone: () => cloneTo(constructStack()), + use: (plugin) => { + plugin.applyToStack(stack); + }, + remove: (toRemove) => { + if (typeof toRemove === "string") + return removeByName(toRemove); + else + return removeByReference(toRemove); + }, + removeByTag: (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + const { tags, name } = entry; + if (tags && tags.includes(toRemove)) { + if (name) + entriesNameSet.delete(name); + isRemoved = true; + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, + concat: (from) => { + const cloned = cloneTo(constructStack()); + cloned.use(from); + return cloned; + }, + applyToStack: cloneTo, + identify: () => { + return getMiddlewareList(true).map((mw) => { + return mw.name + ": " + (mw.tags || []).join(","); + }); + }, + resolve: (handler, context) => { + for (const middleware of getMiddlewareList() + .map((entry) => entry.middleware) + .reverse()) { + handler = middleware(handler, context); + } + return handler; + }, + }; + return stack; +}; +const stepWeights = { + initialize: 5, + serialize: 4, + build: 3, + finalizeRequest: 2, + deserialize: 1, +}; +const priorityWeights = { + high: 3, + normal: 2, + low: 1, +}; diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-stack/dist-es/index.js new file mode 100644 index 0000000000..16f56ce96a --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-es/index.js @@ -0,0 +1 @@ +export * from "./MiddlewareStack"; diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-es/types.js b/server/node_modules/@aws-sdk/middleware-stack/dist-es/types.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-es/types.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-types/MiddlewareStack.d.ts b/server/node_modules/@aws-sdk/middleware-stack/dist-types/MiddlewareStack.d.ts new file mode 100644 index 0000000000..5091994fc8 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-types/MiddlewareStack.d.ts @@ -0,0 +1,2 @@ +import { MiddlewareStack } from "@aws-sdk/types"; +export declare const constructStack: () => MiddlewareStack; diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-stack/dist-types/index.d.ts new file mode 100644 index 0000000000..16f56ce96a --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./MiddlewareStack"; diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/MiddlewareStack.d.ts b/server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/MiddlewareStack.d.ts new file mode 100644 index 0000000000..a001ff4c40 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/MiddlewareStack.d.ts @@ -0,0 +1,5 @@ +import { MiddlewareStack } from "@aws-sdk/types"; +export declare const constructStack: < + Input extends object, + Output extends object +>() => MiddlewareStack; diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..16f56ce96a --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./MiddlewareStack"; diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/types.d.ts b/server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/types.d.ts new file mode 100644 index 0000000000..856057fe26 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-types/ts3.4/types.d.ts @@ -0,0 +1,47 @@ +import { + AbsoluteLocation, + HandlerOptions, + MiddlewareType, + Priority, + RelativeLocation, + Step, +} from "@aws-sdk/types"; +export interface MiddlewareEntry + extends HandlerOptions { + middleware: MiddlewareType; +} +export interface AbsoluteMiddlewareEntry< + Input extends object, + Output extends object +> extends MiddlewareEntry, + AbsoluteLocation { + step: Step; + priority: Priority; +} +export interface RelativeMiddlewareEntry< + Input extends object, + Output extends object +> extends MiddlewareEntry, + RelativeLocation {} +export declare type Normalized< + T extends MiddlewareEntry, + Input extends object = {}, + Output extends object = {} +> = T & { + after: Normalized, Input, Output>[]; + before: Normalized, Input, Output>[]; +}; +export interface NormalizedRelativeEntry< + Input extends object, + Output extends object +> extends HandlerOptions { + step: Step; + middleware: MiddlewareType; + next?: NormalizedRelativeEntry; + prev?: NormalizedRelativeEntry; + priority: null; +} +export declare type NamedMiddlewareEntriesMap< + Input extends object, + Output extends object +> = Record>; diff --git a/server/node_modules/@aws-sdk/middleware-stack/dist-types/types.d.ts b/server/node_modules/@aws-sdk/middleware-stack/dist-types/types.d.ts new file mode 100644 index 0000000000..48b6d26987 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/dist-types/types.d.ts @@ -0,0 +1,22 @@ +import { AbsoluteLocation, HandlerOptions, MiddlewareType, Priority, RelativeLocation, Step } from "@aws-sdk/types"; +export interface MiddlewareEntry extends HandlerOptions { + middleware: MiddlewareType; +} +export interface AbsoluteMiddlewareEntry extends MiddlewareEntry, AbsoluteLocation { + step: Step; + priority: Priority; +} +export interface RelativeMiddlewareEntry extends MiddlewareEntry, RelativeLocation { +} +export declare type Normalized, Input extends object = {}, Output extends object = {}> = T & { + after: Normalized, Input, Output>[]; + before: Normalized, Input, Output>[]; +}; +export interface NormalizedRelativeEntry extends HandlerOptions { + step: Step; + middleware: MiddlewareType; + next?: NormalizedRelativeEntry; + prev?: NormalizedRelativeEntry; + priority: null; +} +export declare type NamedMiddlewareEntriesMap = Record>; diff --git a/server/node_modules/@aws-sdk/middleware-stack/package.json b/server/node_modules/@aws-sdk/middleware-stack/package.json new file mode 100644 index 0000000000..550dfc92fd --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-stack/package.json @@ -0,0 +1,55 @@ +{ + "name": "@aws-sdk/middleware-stack", + "version": "3.257.0", + "description": "Provides a means for composing multiple middleware functions into a single handler", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "email": "", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "dependencies": { + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/types": "3.257.0", + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-stack", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-stack" + } +} diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/LICENSE b/server/node_modules/@aws-sdk/middleware-user-agent/LICENSE new file mode 100644 index 0000000000..e907b58668 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/README.md b/server/node_modules/@aws-sdk/middleware-user-agent/README.md new file mode 100644 index 0000000000..a0bf1a9250 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/middleware-user-agent + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-user-agent/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-user-agent) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-user-agent.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-user-agent) diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/configurations.js b/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/configurations.js new file mode 100644 index 0000000000..6dbaf96ce9 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/configurations.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveUserAgentConfig = void 0; +function resolveUserAgentConfig(input) { + return { + ...input, + customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent, + }; +} +exports.resolveUserAgentConfig = resolveUserAgentConfig; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/constants.js b/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/constants.js new file mode 100644 index 0000000000..33081fbb2f --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/constants.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UA_ESCAPE_REGEX = exports.SPACE = exports.X_AMZ_USER_AGENT = exports.USER_AGENT = void 0; +exports.USER_AGENT = "user-agent"; +exports.X_AMZ_USER_AGENT = "x-amz-user-agent"; +exports.SPACE = " "; +exports.UA_ESCAPE_REGEX = /[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js b/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js new file mode 100644 index 0000000000..bc28e3aaf8 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./configurations"), exports); +tslib_1.__exportStar(require("./user-agent-middleware"), exports); diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/user-agent-middleware.js b/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/user-agent-middleware.js new file mode 100644 index 0000000000..6ca2920aa6 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/user-agent-middleware.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getUserAgentPlugin = exports.getUserAgentMiddlewareOptions = exports.userAgentMiddleware = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const constants_1 = require("./constants"); +const userAgentMiddleware = (options) => (next, context) => async (args) => { + var _a, _b; + const { request } = args; + if (!protocol_http_1.HttpRequest.isInstance(request)) + return next(args); + const { headers } = request; + const userAgent = ((_a = context === null || context === void 0 ? void 0 : context.userAgent) === null || _a === void 0 ? void 0 : _a.map(escapeUserAgent)) || []; + const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); + const customUserAgent = ((_b = options === null || options === void 0 ? void 0 : options.customUserAgent) === null || _b === void 0 ? void 0 : _b.map(escapeUserAgent)) || []; + const sdkUserAgentValue = [...defaultUserAgent, ...userAgent, ...customUserAgent].join(constants_1.SPACE); + const normalUAValue = [ + ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), + ...customUserAgent, + ].join(constants_1.SPACE); + if (options.runtime !== "browser") { + if (normalUAValue) { + headers[constants_1.X_AMZ_USER_AGENT] = headers[constants_1.X_AMZ_USER_AGENT] + ? `${headers[constants_1.USER_AGENT]} ${normalUAValue}` + : normalUAValue; + } + headers[constants_1.USER_AGENT] = sdkUserAgentValue; + } + else { + headers[constants_1.X_AMZ_USER_AGENT] = sdkUserAgentValue; + } + return next({ + ...args, + request, + }); +}; +exports.userAgentMiddleware = userAgentMiddleware; +const escapeUserAgent = ([name, version]) => { + const prefixSeparatorIndex = name.indexOf("/"); + const prefix = name.substring(0, prefixSeparatorIndex); + let uaName = name.substring(prefixSeparatorIndex + 1); + if (prefix === "api") { + uaName = uaName.toLowerCase(); + } + return [prefix, uaName, version] + .filter((item) => item && item.length > 0) + .map((item) => item === null || item === void 0 ? void 0 : item.replace(constants_1.UA_ESCAPE_REGEX, "_")) + .join("/"); +}; +exports.getUserAgentMiddlewareOptions = { + name: "getUserAgentMiddleware", + step: "build", + priority: "low", + tags: ["SET_USER_AGENT", "USER_AGENT"], + override: true, +}; +const getUserAgentPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.userAgentMiddleware)(config), exports.getUserAgentMiddlewareOptions); + }, +}); +exports.getUserAgentPlugin = getUserAgentPlugin; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js b/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js new file mode 100644 index 0000000000..aaa099ef91 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js @@ -0,0 +1,6 @@ +export function resolveUserAgentConfig(input) { + return { + ...input, + customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent, + }; +} diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js b/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js new file mode 100644 index 0000000000..f4f2ea1772 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js @@ -0,0 +1,4 @@ +export const USER_AGENT = "user-agent"; +export const X_AMZ_USER_AGENT = "x-amz-user-agent"; +export const SPACE = " "; +export const UA_ESCAPE_REGEX = /[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js b/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js new file mode 100644 index 0000000000..0456ec7b37 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js @@ -0,0 +1,2 @@ +export * from "./configurations"; +export * from "./user-agent-middleware"; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js b/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js new file mode 100644 index 0000000000..c40376bab9 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js @@ -0,0 +1,55 @@ +import { HttpRequest } from "@aws-sdk/protocol-http"; +import { SPACE, UA_ESCAPE_REGEX, USER_AGENT, X_AMZ_USER_AGENT } from "./constants"; +export const userAgentMiddleware = (options) => (next, context) => async (args) => { + const { request } = args; + if (!HttpRequest.isInstance(request)) + return next(args); + const { headers } = request; + const userAgent = context?.userAgent?.map(escapeUserAgent) || []; + const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); + const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || []; + const sdkUserAgentValue = [...defaultUserAgent, ...userAgent, ...customUserAgent].join(SPACE); + const normalUAValue = [ + ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), + ...customUserAgent, + ].join(SPACE); + if (options.runtime !== "browser") { + if (normalUAValue) { + headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] + ? `${headers[USER_AGENT]} ${normalUAValue}` + : normalUAValue; + } + headers[USER_AGENT] = sdkUserAgentValue; + } + else { + headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; + } + return next({ + ...args, + request, + }); +}; +const escapeUserAgent = ([name, version]) => { + const prefixSeparatorIndex = name.indexOf("/"); + const prefix = name.substring(0, prefixSeparatorIndex); + let uaName = name.substring(prefixSeparatorIndex + 1); + if (prefix === "api") { + uaName = uaName.toLowerCase(); + } + return [prefix, uaName, version] + .filter((item) => item && item.length > 0) + .map((item) => item?.replace(UA_ESCAPE_REGEX, "_")) + .join("/"); +}; +export const getUserAgentMiddlewareOptions = { + name: "getUserAgentMiddleware", + step: "build", + priority: "low", + tags: ["SET_USER_AGENT", "USER_AGENT"], + override: true, +}; +export const getUserAgentPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); + }, +}); diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/configurations.d.ts b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/configurations.d.ts new file mode 100644 index 0000000000..3948d07268 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/configurations.d.ts @@ -0,0 +1,28 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; +export interface UserAgentInputConfig { + /** + * The custom user agent header that would be appended to default one + */ + customUserAgent?: string | UserAgent; +} +interface PreviouslyResolved { + defaultUserAgentProvider: Provider; + runtime: string; +} +export interface UserAgentResolvedConfig { + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header. + * @internal + */ + defaultUserAgentProvider: Provider; + /** + * The custom user agent header that would be appended to default one + */ + customUserAgent?: UserAgent; + /** + * The runtime environment + */ + runtime: string; +} +export declare function resolveUserAgentConfig(input: T & PreviouslyResolved & UserAgentInputConfig): T & UserAgentResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/constants.d.ts b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/constants.d.ts new file mode 100644 index 0000000000..4952d1400d --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/constants.d.ts @@ -0,0 +1,4 @@ +export declare const USER_AGENT = "user-agent"; +export declare const X_AMZ_USER_AGENT = "x-amz-user-agent"; +export declare const SPACE = " "; +export declare const UA_ESCAPE_REGEX: RegExp; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/index.d.ts b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/index.d.ts new file mode 100644 index 0000000000..0456ec7b37 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/index.d.ts @@ -0,0 +1,2 @@ +export * from "./configurations"; +export * from "./user-agent-middleware"; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/configurations.d.ts b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/configurations.d.ts new file mode 100644 index 0000000000..c27abe0237 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/configurations.d.ts @@ -0,0 +1,17 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; +export interface UserAgentInputConfig { + customUserAgent?: string | UserAgent; +} +interface PreviouslyResolved { + defaultUserAgentProvider: Provider; + runtime: string; +} +export interface UserAgentResolvedConfig { + defaultUserAgentProvider: Provider; + customUserAgent?: UserAgent; + runtime: string; +} +export declare function resolveUserAgentConfig( + input: T & PreviouslyResolved & UserAgentInputConfig +): T & UserAgentResolvedConfig; +export {}; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/constants.d.ts b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/constants.d.ts new file mode 100644 index 0000000000..4952d1400d --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/constants.d.ts @@ -0,0 +1,4 @@ +export declare const USER_AGENT = "user-agent"; +export declare const X_AMZ_USER_AGENT = "x-amz-user-agent"; +export declare const SPACE = " "; +export declare const UA_ESCAPE_REGEX: RegExp; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..0456ec7b37 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export * from "./configurations"; +export * from "./user-agent-middleware"; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/user-agent-middleware.d.ts b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/user-agent-middleware.d.ts new file mode 100644 index 0000000000..60e67d9f44 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/user-agent-middleware.d.ts @@ -0,0 +1,20 @@ +import { + AbsoluteLocation, + BuildHandler, + BuildHandlerOptions, + HandlerExecutionContext, + MetadataBearer, + Pluggable, +} from "@aws-sdk/types"; +import { UserAgentResolvedConfig } from "./configurations"; +export declare const userAgentMiddleware: ( + options: UserAgentResolvedConfig +) => ( + next: BuildHandler, + context: HandlerExecutionContext +) => BuildHandler; +export declare const getUserAgentMiddlewareOptions: BuildHandlerOptions & + AbsoluteLocation; +export declare const getUserAgentPlugin: ( + config: UserAgentResolvedConfig +) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/user-agent-middleware.d.ts b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/user-agent-middleware.d.ts new file mode 100644 index 0000000000..082a5797ab --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/dist-types/user-agent-middleware.d.ts @@ -0,0 +1,17 @@ +import { AbsoluteLocation, BuildHandler, BuildHandlerOptions, HandlerExecutionContext, MetadataBearer, Pluggable } from "@aws-sdk/types"; +import { UserAgentResolvedConfig } from "./configurations"; +/** + * Build user agent header sections from: + * 1. runtime-specific default user agent provider; + * 2. custom user agent from `customUserAgent` client config; + * 3. handler execution context set by internal SDK components; + * The built user agent will be set to `x-amz-user-agent` header for ALL the + * runtimes. + * Please note that any override to the `user-agent` or `x-amz-user-agent` header + * in the HTTP request is discouraged. Please use `customUserAgent` client + * config or middleware setting the `userAgent` context to generate desired user + * agent. + */ +export declare const userAgentMiddleware: (options: UserAgentResolvedConfig) => (next: BuildHandler, context: HandlerExecutionContext) => BuildHandler; +export declare const getUserAgentMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation; +export declare const getUserAgentPlugin: (config: UserAgentResolvedConfig) => Pluggable; diff --git a/server/node_modules/@aws-sdk/middleware-user-agent/package.json b/server/node_modules/@aws-sdk/middleware-user-agent/package.json new file mode 100644 index 0000000000..0c248217a3 --- /dev/null +++ b/server/node_modules/@aws-sdk/middleware-user-agent/package.json @@ -0,0 +1,55 @@ +{ + "name": "@aws-sdk/middleware-user-agent", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --passWithNoTests" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/middleware-stack": "3.257.0", + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/middleware-user-agent", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/middleware-user-agent" + } +} diff --git a/server/node_modules/@aws-sdk/node-config-provider/LICENSE b/server/node_modules/@aws-sdk/node-config-provider/LICENSE new file mode 100644 index 0000000000..74d4e5c31f --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/node-config-provider/README.md b/server/node_modules/@aws-sdk/node-config-provider/README.md new file mode 100644 index 0000000000..05b83aca96 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/node-config-provider + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/node-config-provider/latest.svg)](https://www.npmjs.com/package/@aws-sdk/node-config-provider) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/node-config-provider.svg)](https://www.npmjs.com/package/@aws-sdk/node-config-provider) diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/configLoader.js b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/configLoader.js new file mode 100644 index 0000000000..10d3e4d8de --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/configLoader.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadConfig = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const fromEnv_1 = require("./fromEnv"); +const fromSharedConfigFiles_1 = require("./fromSharedConfigFiles"); +const fromStatic_1 = require("./fromStatic"); +const loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)((0, fromEnv_1.fromEnv)(environmentVariableSelector), (0, fromSharedConfigFiles_1.fromSharedConfigFiles)(configFileSelector, configuration), (0, fromStatic_1.fromStatic)(defaultValue))); +exports.loadConfig = loadConfig; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromEnv.js b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromEnv.js new file mode 100644 index 0000000000..79650b155c --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromEnv.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromEnv = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const fromEnv = (envVarSelector) => async () => { + try { + const config = envVarSelector(process.env); + if (config === undefined) { + throw new Error(); + } + return config; + } + catch (e) { + throw new property_provider_1.CredentialsProviderError(e.message || `Cannot load config from environment variables with getter: ${envVarSelector}`); + } +}; +exports.fromEnv = fromEnv; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromSharedConfigFiles.js b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromSharedConfigFiles.js new file mode 100644 index 0000000000..01d2898c6b --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromSharedConfigFiles.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromSharedConfigFiles = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader"); +const fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { + const profile = (0, shared_ini_file_loader_1.getProfileName)(init); + const { configFile, credentialsFile } = await (0, shared_ini_file_loader_1.loadSharedConfigFiles)(init); + const profileFromCredentials = credentialsFile[profile] || {}; + const profileFromConfig = configFile[profile] || {}; + const mergedProfile = preferredFile === "config" + ? { ...profileFromCredentials, ...profileFromConfig } + : { ...profileFromConfig, ...profileFromCredentials }; + try { + const configValue = configSelector(mergedProfile); + if (configValue === undefined) { + throw new Error(); + } + return configValue; + } + catch (e) { + throw new property_provider_1.CredentialsProviderError(e.message || + `Cannot load config for profile ${profile} in SDK configuration files with getter: ${configSelector}`); + } +}; +exports.fromSharedConfigFiles = fromSharedConfigFiles; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromStatic.js b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromStatic.js new file mode 100644 index 0000000000..4570dc51a7 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromStatic.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromStatic = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const isFunction = (func) => typeof func === "function"; +const fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, property_provider_1.fromStatic)(defaultValue); +exports.fromStatic = fromStatic; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/index.js b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/index.js new file mode 100644 index 0000000000..ecf3535eb2 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./configLoader"), exports); diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-es/configLoader.js b/server/node_modules/@aws-sdk/node-config-provider/dist-es/configLoader.js new file mode 100644 index 0000000000..9959aa5b84 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-es/configLoader.js @@ -0,0 +1,5 @@ +import { chain, memoize } from "@aws-sdk/property-provider"; +import { fromEnv } from "./fromEnv"; +import { fromSharedConfigFiles } from "./fromSharedConfigFiles"; +import { fromStatic } from "./fromStatic"; +export const loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => memoize(chain(fromEnv(environmentVariableSelector), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue))); diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-es/fromEnv.js b/server/node_modules/@aws-sdk/node-config-provider/dist-es/fromEnv.js new file mode 100644 index 0000000000..3aa474e237 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-es/fromEnv.js @@ -0,0 +1,13 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +export const fromEnv = (envVarSelector) => async () => { + try { + const config = envVarSelector(process.env); + if (config === undefined) { + throw new Error(); + } + return config; + } + catch (e) { + throw new CredentialsProviderError(e.message || `Cannot load config from environment variables with getter: ${envVarSelector}`); + } +}; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-es/fromSharedConfigFiles.js b/server/node_modules/@aws-sdk/node-config-provider/dist-es/fromSharedConfigFiles.js new file mode 100644 index 0000000000..706368d57a --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-es/fromSharedConfigFiles.js @@ -0,0 +1,22 @@ +import { CredentialsProviderError } from "@aws-sdk/property-provider"; +import { getProfileName, loadSharedConfigFiles } from "@aws-sdk/shared-ini-file-loader"; +export const fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { + const profile = getProfileName(init); + const { configFile, credentialsFile } = await loadSharedConfigFiles(init); + const profileFromCredentials = credentialsFile[profile] || {}; + const profileFromConfig = configFile[profile] || {}; + const mergedProfile = preferredFile === "config" + ? { ...profileFromCredentials, ...profileFromConfig } + : { ...profileFromConfig, ...profileFromCredentials }; + try { + const configValue = configSelector(mergedProfile); + if (configValue === undefined) { + throw new Error(); + } + return configValue; + } + catch (e) { + throw new CredentialsProviderError(e.message || + `Cannot load config for profile ${profile} in SDK configuration files with getter: ${configSelector}`); + } +}; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-es/fromStatic.js b/server/node_modules/@aws-sdk/node-config-provider/dist-es/fromStatic.js new file mode 100644 index 0000000000..b99f93ad86 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-es/fromStatic.js @@ -0,0 +1,3 @@ +import { fromStatic as convertToProvider } from "@aws-sdk/property-provider"; +const isFunction = (func) => typeof func === "function"; +export const fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : convertToProvider(defaultValue); diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-es/index.js b/server/node_modules/@aws-sdk/node-config-provider/dist-es/index.js new file mode 100644 index 0000000000..2d035d9111 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-es/index.js @@ -0,0 +1 @@ +export * from "./configLoader"; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/configLoader.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/configLoader.d.ts new file mode 100644 index 0000000000..c5dc4ed8cb --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/configLoader.d.ts @@ -0,0 +1,22 @@ +import { Provider } from "@aws-sdk/types"; +import { GetterFromEnv } from "./fromEnv"; +import { GetterFromConfig, SharedConfigInit } from "./fromSharedConfigFiles"; +import { FromStaticConfig } from "./fromStatic"; +export declare type LocalConfigOptions = SharedConfigInit; +export interface LoadedConfigSelectors { + /** + * A getter function getting the config values from all the environment + * variables. + */ + environmentVariableSelector: GetterFromEnv; + /** + * A getter function getting config values associated with the inferred + * profile from shared INI files + */ + configFileSelector: GetterFromConfig; + /** + * Default value or getter + */ + default: FromStaticConfig; +} +export declare const loadConfig: ({ environmentVariableSelector, configFileSelector, default: defaultValue }: LoadedConfigSelectors, configuration?: LocalConfigOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/fromEnv.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/fromEnv.d.ts new file mode 100644 index 0000000000..524bceccc7 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/fromEnv.d.ts @@ -0,0 +1,7 @@ +import { Provider } from "@aws-sdk/types"; +export declare type GetterFromEnv = (env: Record) => T | undefined; +/** + * Get config value given the environment variable name or getter from + * environment variable. + */ +export declare const fromEnv: (envVarSelector: GetterFromEnv) => Provider; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/fromSharedConfigFiles.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/fromSharedConfigFiles.d.ts new file mode 100644 index 0000000000..e6dfa0be0f --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/fromSharedConfigFiles.d.ts @@ -0,0 +1,15 @@ +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { Profile, Provider } from "@aws-sdk/types"; +export interface SharedConfigInit extends SourceProfileInit { + /** + * The preferred shared ini file to load the config. "config" option refers to + * the shared config file(defaults to `~/.aws/config`). "credentials" option + * refers to the shared credentials file(defaults to `~/.aws/credentials`) + */ + preferredFile?: "config" | "credentials"; +} +export declare type GetterFromConfig = (profile: Profile) => T | undefined; +/** + * Get config value from the shared config files with inferred profile name. + */ +export declare const fromSharedConfigFiles: (configSelector: GetterFromConfig, { preferredFile, ...init }?: SharedConfigInit) => Provider; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/fromStatic.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/fromStatic.d.ts new file mode 100644 index 0000000000..45b8353b8c --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/fromStatic.d.ts @@ -0,0 +1,3 @@ +import { Provider } from "@aws-sdk/types"; +export declare type FromStaticConfig = T | (() => T) | Provider; +export declare const fromStatic: (defaultValue: FromStaticConfig) => Provider; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/index.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/index.d.ts new file mode 100644 index 0000000000..2d035d9111 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./configLoader"; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/configLoader.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/configLoader.d.ts new file mode 100644 index 0000000000..1a6fe5eb8b --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/configLoader.d.ts @@ -0,0 +1,18 @@ +import { Provider } from "@aws-sdk/types"; +import { GetterFromEnv } from "./fromEnv"; +import { GetterFromConfig, SharedConfigInit } from "./fromSharedConfigFiles"; +import { FromStaticConfig } from "./fromStatic"; +export declare type LocalConfigOptions = SharedConfigInit; +export interface LoadedConfigSelectors { + environmentVariableSelector: GetterFromEnv; + configFileSelector: GetterFromConfig; + default: FromStaticConfig; +} +export declare const loadConfig: ( + { + environmentVariableSelector, + configFileSelector, + default: defaultValue, + }: LoadedConfigSelectors, + configuration?: LocalConfigOptions +) => Provider; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromEnv.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromEnv.d.ts new file mode 100644 index 0000000000..5fe87437e4 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromEnv.d.ts @@ -0,0 +1,7 @@ +import { Provider } from "@aws-sdk/types"; +export declare type GetterFromEnv = ( + env: Record +) => T | undefined; +export declare const fromEnv: ( + envVarSelector: GetterFromEnv +) => Provider; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromSharedConfigFiles.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromSharedConfigFiles.d.ts new file mode 100644 index 0000000000..ca2c213fa7 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromSharedConfigFiles.d.ts @@ -0,0 +1,10 @@ +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { Profile, Provider } from "@aws-sdk/types"; +export interface SharedConfigInit extends SourceProfileInit { + preferredFile?: "config" | "credentials"; +} +export declare type GetterFromConfig = (profile: Profile) => T | undefined; +export declare const fromSharedConfigFiles: ( + configSelector: GetterFromConfig, + { preferredFile, ...init }?: SharedConfigInit +) => Provider; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromStatic.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromStatic.d.ts new file mode 100644 index 0000000000..05f4539987 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/fromStatic.d.ts @@ -0,0 +1,5 @@ +import { Provider } from "@aws-sdk/types"; +export declare type FromStaticConfig = T | (() => T) | Provider; +export declare const fromStatic: ( + defaultValue: FromStaticConfig +) => Provider; diff --git a/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..2d035d9111 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./configLoader"; diff --git a/server/node_modules/@aws-sdk/node-config-provider/package.json b/server/node_modules/@aws-sdk/node-config-provider/package.json new file mode 100644 index 0000000000..8f2bc81755 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-config-provider/package.json @@ -0,0 +1,58 @@ +{ + "name": "@aws-sdk/node-config-provider", + "version": "3.259.0", + "description": "Load config default values from ini config files and environmental variable", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --passWithNoTests" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "email": "", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/node-config-provider", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/node-config-provider" + } +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/LICENSE b/server/node_modules/@aws-sdk/node-http-handler/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/node-http-handler/README.md b/server/node_modules/@aws-sdk/node-http-handler/README.md new file mode 100644 index 0000000000..09d03a0bbd --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/node-http-handler + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/node-http-handler/latest.svg)](https://www.npmjs.com/package/@aws-sdk/node-http-handler) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/node-http-handler.svg)](https://www.npmjs.com/package/@aws-sdk/node-http-handler) diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/constants.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/constants.js new file mode 100644 index 0000000000..b156b5552a --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; +exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/get-transformed-headers.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/get-transformed-headers.js new file mode 100644 index 0000000000..a3c77d8c59 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/get-transformed-headers.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTransformedHeaders = void 0; +const getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}; +exports.getTransformedHeaders = getTransformedHeaders; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/index.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/index.js new file mode 100644 index 0000000000..5dfae92f81 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./node-http-handler"), exports); +tslib_1.__exportStar(require("./node-http2-handler"), exports); +tslib_1.__exportStar(require("./stream-collector"), exports); diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http-handler.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http-handler.js new file mode 100644 index 0000000000..2d4e8d6f68 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http-handler.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodeHttpHandler = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const querystring_builder_1 = require("@aws-sdk/querystring-builder"); +const http_1 = require("http"); +const https_1 = require("https"); +const constants_1 = require("./constants"); +const get_transformed_headers_1 = require("./get-transformed-headers"); +const set_connection_timeout_1 = require("./set-connection-timeout"); +const set_socket_timeout_1 = require("./set-socket-timeout"); +const write_request_body_1 = require("./write-request-body"); +class NodeHttpHandler { + constructor(options) { + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }) + .catch(reject); + } + else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + resolveDefaultConfig(options) { + const { connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + socketTimeout, + httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), + httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), + }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); + (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + return new Promise((resolve, reject) => { + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path: queryString ? `${request.path}?${queryString}` : request.path, + port: request.port, + agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, + }; + const requestFunc = isSSL ? https_1.request : http_1.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new protocol_http_1.HttpResponse({ + statusCode: res.statusCode || -1, + headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), + body: res, + }); + resolve({ response: httpResponse }); + }); + req.on("error", (err) => { + if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { + reject(Object.assign(err, { name: "TimeoutError" })); + } + else { + reject(err); + } + }); + (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); + (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.socketTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + (0, write_request_body_1.writeRequestBody)(req, request); + }); + } +} +exports.NodeHttpHandler = NodeHttpHandler; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js new file mode 100644 index 0000000000..a64977a9df --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodeHttp2Handler = void 0; +const protocol_http_1 = require("@aws-sdk/protocol-http"); +const querystring_builder_1 = require("@aws-sdk/querystring-builder"); +const http2_1 = require("http2"); +const get_transformed_headers_1 = require("./get-transformed-headers"); +const write_request_body_1 = require("./write-request-body"); +class NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((opts) => { + resolve(opts || {}); + }) + .catch(reject); + } + else { + resolve(options || {}); + } + }); + this.sessionCache = new Map(); + } + destroy() { + for (const sessions of this.sessionCache.values()) { + sessions.forEach((session) => this.destroySession(session)); + } + this.sessionCache.clear(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((resolve, rejectOriginal) => { + let fulfilled = false; + if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectOriginal(abortError); + return; + } + const { hostname, method, port, protocol, path, query } = request; + const authority = `${protocol}//${hostname}${port ? `:${port}` : ""}`; + const session = this.getSession(authority, disableConcurrentStreams || false); + const reject = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + rejectOriginal(err); + }; + const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); + const req = session.request({ + ...request.headers, + [http2_1.constants.HTTP2_HEADER_PATH]: queryString ? `${path}?${queryString}` : path, + [http2_1.constants.HTTP2_HEADER_METHOD]: method, + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new protocol_http_1.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), + body: req, + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.deleteSessionFromCache(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + reject(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + req.on("frameError", (type, code, id) => { + reject(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); + }); + req.on("error", reject); + req.on("aborted", () => { + reject(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)); + }); + req.on("close", () => { + session.unref(); + if (disableConcurrentStreams) { + session.destroy(); + } + if (!fulfilled) { + reject(new Error("Unexpected error: http2 request did not get a response")); + } + }); + (0, write_request_body_1.writeRequestBody)(req, request); + }); + } + getSession(authority, disableConcurrentStreams) { + var _a; + const sessionCache = this.sessionCache; + const existingSessions = sessionCache.get(authority) || []; + if (existingSessions.length > 0 && !disableConcurrentStreams) + return existingSessions[0]; + const newSession = (0, http2_1.connect)(authority); + newSession.unref(); + const destroySessionCb = () => { + this.destroySession(newSession); + this.deleteSessionFromCache(authority, newSession); + }; + newSession.on("goaway", destroySessionCb); + newSession.on("error", destroySessionCb); + newSession.on("frameError", destroySessionCb); + newSession.on("close", () => this.deleteSessionFromCache(authority, newSession)); + if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionTimeout) { + newSession.setTimeout(this.config.sessionTimeout, destroySessionCb); + } + existingSessions.push(newSession); + sessionCache.set(authority, existingSessions); + return newSession; + } + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } + deleteSessionFromCache(authority, session) { + const existingSessions = this.sessionCache.get(authority) || []; + if (!existingSessions.includes(session)) { + return; + } + this.sessionCache.set(authority, existingSessions.filter((s) => s !== session)); + } +} +exports.NodeHttp2Handler = NodeHttp2Handler; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/readable.mock.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/readable.mock.js new file mode 100644 index 0000000000..d17c5bbea6 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/readable.mock.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadFromBuffers = void 0; +const stream_1 = require("stream"); +class ReadFromBuffers extends stream_1.Readable { + constructor(options) { + super(options); + this.numBuffersRead = 0; + this.buffersToRead = options.buffers; + this.errorAfter = typeof options.errorAfter === "number" ? options.errorAfter : -1; + } + _read() { + if (this.errorAfter !== -1 && this.errorAfter === this.numBuffersRead) { + this.emit("error", new Error("Mock Error")); + return; + } + if (this.numBuffersRead >= this.buffersToRead.length) { + return this.push(null); + } + return this.push(this.buffersToRead[this.numBuffersRead++]); + } +} +exports.ReadFromBuffers = ReadFromBuffers; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/server.mock.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/server.mock.js new file mode 100644 index 0000000000..f5e030d6be --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/server.mock.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createMockHttp2Server = exports.createMockHttpServer = exports.createMockHttpsServer = exports.createContinueResponseFunction = exports.createResponseFunctionWithDelay = exports.createResponseFunction = void 0; +const fs_1 = require("fs"); +const http_1 = require("http"); +const http2_1 = require("http2"); +const https_1 = require("https"); +const path_1 = require("path"); +const stream_1 = require("stream"); +const fixturesDir = (0, path_1.join)(__dirname, "..", "fixtures"); +const setResponseHeaders = (response, headers) => { + for (const [key, value] of Object.entries(headers)) { + response.setHeader(key, value); + } +}; +const setResponseBody = (response, body) => { + if (body instanceof stream_1.Readable) { + body.pipe(response); + } + else { + response.end(body); + } +}; +const createResponseFunction = (httpResp) => (request, response) => { + response.statusCode = httpResp.statusCode; + setResponseHeaders(response, httpResp.headers); + setResponseBody(response, httpResp.body); +}; +exports.createResponseFunction = createResponseFunction; +const createResponseFunctionWithDelay = (httpResp, delay) => (request, response) => { + response.statusCode = httpResp.statusCode; + setResponseHeaders(response, httpResp.headers); + setTimeout(() => setResponseBody(response, httpResp.body), delay); +}; +exports.createResponseFunctionWithDelay = createResponseFunctionWithDelay; +const createContinueResponseFunction = (httpResp) => (request, response) => { + response.writeContinue(); + setTimeout(() => { + (0, exports.createResponseFunction)(httpResp)(request, response); + }, 100); +}; +exports.createContinueResponseFunction = createContinueResponseFunction; +const createMockHttpsServer = () => { + const server = (0, https_1.createServer)({ + key: (0, fs_1.readFileSync)((0, path_1.join)(fixturesDir, "test-server-key.pem")), + cert: (0, fs_1.readFileSync)((0, path_1.join)(fixturesDir, "test-server-cert.pem")), + }); + return server; +}; +exports.createMockHttpsServer = createMockHttpsServer; +const createMockHttpServer = () => { + const server = (0, http_1.createServer)(); + return server; +}; +exports.createMockHttpServer = createMockHttpServer; +const createMockHttp2Server = () => { + const server = (0, http2_1.createServer)(); + return server; +}; +exports.createMockHttp2Server = createMockHttp2Server; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/set-connection-timeout.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/set-connection-timeout.js new file mode 100644 index 0000000000..cdaee7b2c1 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/set-connection-timeout.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setConnectionTimeout = void 0; +const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + request.on("socket", (socket) => { + if (socket.connecting) { + const timeoutId = setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError", + })); + }, timeoutInMs); + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } + }); +}; +exports.setConnectionTimeout = setConnectionTimeout; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/set-socket-timeout.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/set-socket-timeout.js new file mode 100644 index 0000000000..aeb63b59f5 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/set-socket-timeout.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setSocketTimeout = void 0; +const setSocketTimeout = (request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}; +exports.setSocketTimeout = setSocketTimeout; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/collector.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/collector.js new file mode 100644 index 0000000000..33a3433133 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/collector.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Collector = void 0; +const stream_1 = require("stream"); +class Collector extends stream_1.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +} +exports.Collector = Collector; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/index.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/index.js new file mode 100644 index 0000000000..a06c706ac8 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/index.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.streamCollector = void 0; +const collector_1 = require("./collector"); +const streamCollector = (stream) => new Promise((resolve, reject) => { + const collector = new collector_1.Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function () { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}); +exports.streamCollector = streamCollector; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/readable.mock.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/readable.mock.js new file mode 100644 index 0000000000..1a880b856e --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/stream-collector/readable.mock.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadFromBuffers = void 0; +const stream_1 = require("stream"); +class ReadFromBuffers extends stream_1.Readable { + constructor(options) { + super(options); + this.numBuffersRead = 0; + this.buffersToRead = options.buffers; + this.errorAfter = typeof options.errorAfter === "number" ? options.errorAfter : -1; + } + _read(size) { + if (this.errorAfter !== -1 && this.errorAfter === this.numBuffersRead) { + this.emit("error", new Error("Mock Error")); + return; + } + if (this.numBuffersRead >= this.buffersToRead.length) { + return this.push(null); + } + return this.push(this.buffersToRead[this.numBuffersRead++]); + } +} +exports.ReadFromBuffers = ReadFromBuffers; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/write-request-body.js b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/write-request-body.js new file mode 100644 index 0000000000..03f1306dbe --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-cjs/write-request-body.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeRequestBody = void 0; +const stream_1 = require("stream"); +function writeRequestBody(httpRequest, request) { + const expect = request.headers["Expect"] || request.headers["expect"]; + if (expect === "100-continue") { + httpRequest.on("continue", () => { + writeBody(httpRequest, request.body); + }); + } + else { + writeBody(httpRequest, request.body); + } +} +exports.writeRequestBody = writeRequestBody; +function writeBody(httpRequest, body) { + if (body instanceof stream_1.Readable) { + body.pipe(httpRequest); + } + else if (body) { + httpRequest.end(Buffer.from(body)); + } + else { + httpRequest.end(); + } +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/constants.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/constants.js new file mode 100644 index 0000000000..0619d286a8 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/constants.js @@ -0,0 +1 @@ +export const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/get-transformed-headers.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/get-transformed-headers.js new file mode 100644 index 0000000000..562883c6b0 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/get-transformed-headers.js @@ -0,0 +1,9 @@ +const getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}; +export { getTransformedHeaders }; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/index.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/index.js new file mode 100644 index 0000000000..09c0b9a566 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/index.js @@ -0,0 +1,3 @@ +export * from "./node-http-handler"; +export * from "./node-http2-handler"; +export * from "./stream-collector"; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/node-http-handler.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/node-http-handler.js new file mode 100644 index 0000000000..5d2b64d5e9 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/node-http-handler.js @@ -0,0 +1,95 @@ +import { HttpResponse } from "@aws-sdk/protocol-http"; +import { buildQueryString } from "@aws-sdk/querystring-builder"; +import { Agent as hAgent, request as hRequest } from "http"; +import { Agent as hsAgent, request as hsRequest } from "https"; +import { NODEJS_TIMEOUT_ERROR_CODES } from "./constants"; +import { getTransformedHeaders } from "./get-transformed-headers"; +import { setConnectionTimeout } from "./set-connection-timeout"; +import { setSocketTimeout } from "./set-socket-timeout"; +import { writeRequestBody } from "./write-request-body"; +export class NodeHttpHandler { + constructor(options) { + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }) + .catch(reject); + } + else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + resolveDefaultConfig(options) { + const { connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + socketTimeout, + httpAgent: httpAgent || new hAgent({ keepAlive, maxSockets }), + httpsAgent: httpsAgent || new hsAgent({ keepAlive, maxSockets }), + }; + } + destroy() { + this.config?.httpAgent?.destroy(); + this.config?.httpsAgent?.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + return new Promise((resolve, reject) => { + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal?.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const queryString = buildQueryString(request.query || {}); + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path: queryString ? `${request.path}?${queryString}` : request.path, + port: request.port, + agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, + }; + const requestFunc = isSSL ? hsRequest : hRequest; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new HttpResponse({ + statusCode: res.statusCode || -1, + headers: getTransformedHeaders(res.headers), + body: res, + }); + resolve({ response: httpResponse }); + }); + req.on("error", (err) => { + if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { + reject(Object.assign(err, { name: "TimeoutError" })); + } + else { + reject(err); + } + }); + setConnectionTimeout(req, reject, this.config.connectionTimeout); + setSocketTimeout(req, reject, this.config.socketTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + writeRequestBody(req, request); + }); + } +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/node-http2-handler.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/node-http2-handler.js new file mode 100644 index 0000000000..d643cfeae5 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/node-http2-handler.js @@ -0,0 +1,142 @@ +import { HttpResponse } from "@aws-sdk/protocol-http"; +import { buildQueryString } from "@aws-sdk/querystring-builder"; +import { connect, constants } from "http2"; +import { getTransformedHeaders } from "./get-transformed-headers"; +import { writeRequestBody } from "./write-request-body"; +export class NodeHttp2Handler { + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((opts) => { + resolve(opts || {}); + }) + .catch(reject); + } + else { + resolve(options || {}); + } + }); + this.sessionCache = new Map(); + } + destroy() { + for (const sessions of this.sessionCache.values()) { + sessions.forEach((session) => this.destroySession(session)); + } + this.sessionCache.clear(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((resolve, rejectOriginal) => { + let fulfilled = false; + if (abortSignal?.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectOriginal(abortError); + return; + } + const { hostname, method, port, protocol, path, query } = request; + const authority = `${protocol}//${hostname}${port ? `:${port}` : ""}`; + const session = this.getSession(authority, disableConcurrentStreams || false); + const reject = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + rejectOriginal(err); + }; + const queryString = buildQueryString(query || {}); + const req = session.request({ + ...request.headers, + [constants.HTTP2_HEADER_PATH]: queryString ? `${path}?${queryString}` : path, + [constants.HTTP2_HEADER_METHOD]: method, + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req, + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.deleteSessionFromCache(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + reject(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + req.on("frameError", (type, code, id) => { + reject(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); + }); + req.on("error", reject); + req.on("aborted", () => { + reject(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)); + }); + req.on("close", () => { + session.unref(); + if (disableConcurrentStreams) { + session.destroy(); + } + if (!fulfilled) { + reject(new Error("Unexpected error: http2 request did not get a response")); + } + }); + writeRequestBody(req, request); + }); + } + getSession(authority, disableConcurrentStreams) { + const sessionCache = this.sessionCache; + const existingSessions = sessionCache.get(authority) || []; + if (existingSessions.length > 0 && !disableConcurrentStreams) + return existingSessions[0]; + const newSession = connect(authority); + newSession.unref(); + const destroySessionCb = () => { + this.destroySession(newSession); + this.deleteSessionFromCache(authority, newSession); + }; + newSession.on("goaway", destroySessionCb); + newSession.on("error", destroySessionCb); + newSession.on("frameError", destroySessionCb); + newSession.on("close", () => this.deleteSessionFromCache(authority, newSession)); + if (this.config?.sessionTimeout) { + newSession.setTimeout(this.config.sessionTimeout, destroySessionCb); + } + existingSessions.push(newSession); + sessionCache.set(authority, existingSessions); + return newSession; + } + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } + deleteSessionFromCache(authority, session) { + const existingSessions = this.sessionCache.get(authority) || []; + if (!existingSessions.includes(session)) { + return; + } + this.sessionCache.set(authority, existingSessions.filter((s) => s !== session)); + } +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/readable.mock.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/readable.mock.js new file mode 100644 index 0000000000..41fb0b67cc --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/readable.mock.js @@ -0,0 +1,19 @@ +import { Readable } from "stream"; +export class ReadFromBuffers extends Readable { + constructor(options) { + super(options); + this.numBuffersRead = 0; + this.buffersToRead = options.buffers; + this.errorAfter = typeof options.errorAfter === "number" ? options.errorAfter : -1; + } + _read() { + if (this.errorAfter !== -1 && this.errorAfter === this.numBuffersRead) { + this.emit("error", new Error("Mock Error")); + return; + } + if (this.numBuffersRead >= this.buffersToRead.length) { + return this.push(null); + } + return this.push(this.buffersToRead[this.numBuffersRead++]); + } +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/server.mock.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/server.mock.js new file mode 100644 index 0000000000..c6ad037c81 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/server.mock.js @@ -0,0 +1,51 @@ +import { readFileSync } from "fs"; +import { createServer as createHttpServer } from "http"; +import { createServer as createHttp2Server } from "http2"; +import { createServer as createHttpsServer } from "https"; +import { join } from "path"; +import { Readable } from "stream"; +const fixturesDir = join(__dirname, "..", "fixtures"); +const setResponseHeaders = (response, headers) => { + for (const [key, value] of Object.entries(headers)) { + response.setHeader(key, value); + } +}; +const setResponseBody = (response, body) => { + if (body instanceof Readable) { + body.pipe(response); + } + else { + response.end(body); + } +}; +export const createResponseFunction = (httpResp) => (request, response) => { + response.statusCode = httpResp.statusCode; + setResponseHeaders(response, httpResp.headers); + setResponseBody(response, httpResp.body); +}; +export const createResponseFunctionWithDelay = (httpResp, delay) => (request, response) => { + response.statusCode = httpResp.statusCode; + setResponseHeaders(response, httpResp.headers); + setTimeout(() => setResponseBody(response, httpResp.body), delay); +}; +export const createContinueResponseFunction = (httpResp) => (request, response) => { + response.writeContinue(); + setTimeout(() => { + createResponseFunction(httpResp)(request, response); + }, 100); +}; +export const createMockHttpsServer = () => { + const server = createHttpsServer({ + key: readFileSync(join(fixturesDir, "test-server-key.pem")), + cert: readFileSync(join(fixturesDir, "test-server-cert.pem")), + }); + return server; +}; +export const createMockHttpServer = () => { + const server = createHttpServer(); + return server; +}; +export const createMockHttp2Server = () => { + const server = createHttp2Server(); + return server; +}; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/set-connection-timeout.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/set-connection-timeout.js new file mode 100644 index 0000000000..285a46544a --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/set-connection-timeout.js @@ -0,0 +1,18 @@ +export const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + request.on("socket", (socket) => { + if (socket.connecting) { + const timeoutId = setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError", + })); + }, timeoutInMs); + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } + }); +}; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/set-socket-timeout.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/set-socket-timeout.js new file mode 100644 index 0000000000..aa710c31aa --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/set-socket-timeout.js @@ -0,0 +1,6 @@ +export const setSocketTimeout = (request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/collector.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/collector.js new file mode 100644 index 0000000000..c3737e9f1c --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/collector.js @@ -0,0 +1,11 @@ +import { Writable } from "stream"; +export class Collector extends Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/index.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/index.js new file mode 100644 index 0000000000..7e6cd8b66f --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/index.js @@ -0,0 +1,14 @@ +import { Collector } from "./collector"; +export const streamCollector = (stream) => new Promise((resolve, reject) => { + const collector = new Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function () { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}); diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/readable.mock.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/readable.mock.js new file mode 100644 index 0000000000..2f653c5060 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/stream-collector/readable.mock.js @@ -0,0 +1,19 @@ +import { Readable } from "stream"; +export class ReadFromBuffers extends Readable { + constructor(options) { + super(options); + this.numBuffersRead = 0; + this.buffersToRead = options.buffers; + this.errorAfter = typeof options.errorAfter === "number" ? options.errorAfter : -1; + } + _read(size) { + if (this.errorAfter !== -1 && this.errorAfter === this.numBuffersRead) { + this.emit("error", new Error("Mock Error")); + return; + } + if (this.numBuffersRead >= this.buffersToRead.length) { + return this.push(null); + } + return this.push(this.buffersToRead[this.numBuffersRead++]); + } +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-es/write-request-body.js b/server/node_modules/@aws-sdk/node-http-handler/dist-es/write-request-body.js new file mode 100644 index 0000000000..4b76ca7f60 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-es/write-request-body.js @@ -0,0 +1,23 @@ +import { Readable } from "stream"; +export function writeRequestBody(httpRequest, request) { + const expect = request.headers["Expect"] || request.headers["expect"]; + if (expect === "100-continue") { + httpRequest.on("continue", () => { + writeBody(httpRequest, request.body); + }); + } + else { + writeBody(httpRequest, request.body); + } +} +function writeBody(httpRequest, body) { + if (body instanceof Readable) { + body.pipe(httpRequest); + } + else if (body) { + httpRequest.end(Buffer.from(body)); + } + else { + httpRequest.end(); + } +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/constants.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/constants.d.ts new file mode 100644 index 0000000000..1e55e81589 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/constants.d.ts @@ -0,0 +1,5 @@ +/** + * Node.js system error codes that indicate timeout. + * @deprecated use NODEJS_TIMEOUT_ERROR_CODES from @aws-sdk/service-error-classification/constants + */ +export declare const NODEJS_TIMEOUT_ERROR_CODES: string[]; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/get-transformed-headers.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/get-transformed-headers.d.ts new file mode 100644 index 0000000000..f789b5910f --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/get-transformed-headers.d.ts @@ -0,0 +1,4 @@ +import { HeaderBag } from "@aws-sdk/types"; +import { IncomingHttpHeaders } from "http2"; +declare const getTransformedHeaders: (headers: IncomingHttpHeaders) => HeaderBag; +export { getTransformedHeaders }; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/index.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/index.d.ts new file mode 100644 index 0000000000..09c0b9a566 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/index.d.ts @@ -0,0 +1,3 @@ +export * from "./node-http-handler"; +export * from "./node-http2-handler"; +export * from "./stream-collector"; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/node-http-handler.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/node-http-handler.d.ts new file mode 100644 index 0000000000..c522d34d23 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/node-http-handler.d.ts @@ -0,0 +1,35 @@ +/// +import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; +import { HttpHandlerOptions, Provider } from "@aws-sdk/types"; +import { Agent as hAgent } from "http"; +import { Agent as hsAgent } from "https"; +/** + * Represents the http options that can be passed to a node http client. + */ +export interface NodeHttpHandlerOptions { + /** + * The maximum time in milliseconds that the connection phase of a request + * may take before the connection attempt is abandoned. + */ + connectionTimeout?: number; + /** + * The maximum time in milliseconds that a socket may remain idle before it + * is closed. + */ + socketTimeout?: number; + httpAgent?: hAgent; + httpsAgent?: hsAgent; +} +export declare class NodeHttpHandler implements HttpHandler { + private config?; + private readonly configProvider; + readonly metadata: { + handlerProtocol: string; + }; + constructor(options?: NodeHttpHandlerOptions | Provider); + private resolveDefaultConfig; + destroy(): void; + handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{ + response: HttpResponse; + }>; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/node-http2-handler.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/node-http2-handler.d.ts new file mode 100644 index 0000000000..91e9924900 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/node-http2-handler.d.ts @@ -0,0 +1,57 @@ +import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; +import { HttpHandlerOptions, Provider } from "@aws-sdk/types"; +/** + * Represents the http2 options that can be passed to a node http2 client. + */ +export interface NodeHttp2HandlerOptions { + /** + * The maximum time in milliseconds that a stream may remain idle before it + * is closed. + */ + requestTimeout?: number; + /** + * The maximum time in milliseconds that a session or socket may remain idle + * before it is closed. + * https://nodejs.org/docs/latest-v12.x/api/http2.html#http2_http2session_and_sockets + */ + sessionTimeout?: number; + /** + * Disables processing concurrent streams on a ClientHttp2Session instance. When set + * to true, the handler will create a new session instance for each request to a URL. + * **Default:** false. + * https://nodejs.org/api/http2.html#http2_class_clienthttp2session + */ + disableConcurrentStreams?: boolean; +} +export declare class NodeHttp2Handler implements HttpHandler { + private config?; + private readonly configProvider; + readonly metadata: { + handlerProtocol: string; + }; + private sessionCache; + constructor(options?: NodeHttp2HandlerOptions | Provider); + destroy(): void; + handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{ + response: HttpResponse; + }>; + /** + * Returns a session for the given URL. + * + * @param authority The URL to create a session for. + * @param disableConcurrentStreams If true, a new session will be created for each request. + * @returns A session for the given URL. + */ + private getSession; + /** + * Destroys a session. + * @param session The session to destroy. + */ + private destroySession; + /** + * Delete a session from the connection pool. + * @param authority The authority of the session to delete. + * @param session The session to delete. + */ + private deleteSessionFromCache; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/readable.mock.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/readable.mock.d.ts new file mode 100644 index 0000000000..8f1266fcbd --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/readable.mock.d.ts @@ -0,0 +1,13 @@ +/// +import { Readable, ReadableOptions } from "stream"; +export interface ReadFromBuffersOptions extends ReadableOptions { + buffers: Buffer[]; + errorAfter?: number; +} +export declare class ReadFromBuffers extends Readable { + private buffersToRead; + private numBuffersRead; + private errorAfter; + constructor(options: ReadFromBuffersOptions); + _read(): boolean | undefined; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/server.mock.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/server.mock.d.ts new file mode 100644 index 0000000000..f729064ed9 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/server.mock.d.ts @@ -0,0 +1,10 @@ +import { HttpResponse } from "@aws-sdk/types"; +import { IncomingMessage, Server as HttpServer, ServerResponse } from "http"; +import { Http2Server } from "http2"; +import { Server as HttpsServer } from "https"; +export declare const createResponseFunction: (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => void; +export declare const createResponseFunctionWithDelay: (httpResp: HttpResponse, delay: number) => (request: IncomingMessage, response: ServerResponse) => void; +export declare const createContinueResponseFunction: (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => void; +export declare const createMockHttpsServer: () => HttpsServer; +export declare const createMockHttpServer: () => HttpServer; +export declare const createMockHttp2Server: () => Http2Server; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/set-connection-timeout.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/set-connection-timeout.d.ts new file mode 100644 index 0000000000..d18bb4843e --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/set-connection-timeout.d.ts @@ -0,0 +1,2 @@ +import { ClientRequest } from "http"; +export declare const setConnectionTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number) => void; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/set-socket-timeout.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/set-socket-timeout.d.ts new file mode 100644 index 0000000000..f056b73425 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/set-socket-timeout.d.ts @@ -0,0 +1,2 @@ +import { ClientRequest } from "http"; +export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number) => void; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/collector.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/collector.d.ts new file mode 100644 index 0000000000..679890f08a --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/collector.d.ts @@ -0,0 +1,6 @@ +/// +import { Writable } from "stream"; +export declare class Collector extends Writable { + readonly bufferedBytes: Buffer[]; + _write(chunk: Buffer, encoding: string, callback: (err?: Error) => void): void; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/index.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/index.d.ts new file mode 100644 index 0000000000..be9a6c6f4d --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/index.d.ts @@ -0,0 +1,2 @@ +import { StreamCollector } from "@aws-sdk/types"; +export declare const streamCollector: StreamCollector; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/readable.mock.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/readable.mock.d.ts new file mode 100644 index 0000000000..5549bc6584 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/stream-collector/readable.mock.d.ts @@ -0,0 +1,13 @@ +/// +import { Readable, ReadableOptions } from "stream"; +export interface ReadFromBuffersOptions extends ReadableOptions { + buffers: Buffer[]; + errorAfter?: number; +} +export declare class ReadFromBuffers extends Readable { + private buffersToRead; + private numBuffersRead; + private errorAfter; + constructor(options: ReadFromBuffersOptions); + _read(size: number): boolean | undefined; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/constants.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/constants.d.ts new file mode 100644 index 0000000000..8571c8cafc --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/constants.d.ts @@ -0,0 +1 @@ +export declare const NODEJS_TIMEOUT_ERROR_CODES: string[]; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts new file mode 100644 index 0000000000..604c637e65 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/get-transformed-headers.d.ts @@ -0,0 +1,6 @@ +import { HeaderBag } from "@aws-sdk/types"; +import { IncomingHttpHeaders } from "http2"; +declare const getTransformedHeaders: ( + headers: IncomingHttpHeaders +) => HeaderBag; +export { getTransformedHeaders }; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..09c0b9a566 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/index.d.ts @@ -0,0 +1,3 @@ +export * from "./node-http-handler"; +export * from "./node-http2-handler"; +export * from "./stream-collector"; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts new file mode 100644 index 0000000000..acb685e7b9 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts @@ -0,0 +1,28 @@ +import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; +import { HttpHandlerOptions, Provider } from "@aws-sdk/types"; +import { Agent as hAgent } from "http"; +import { Agent as hsAgent } from "https"; +export interface NodeHttpHandlerOptions { + connectionTimeout?: number; + socketTimeout?: number; + httpAgent?: hAgent; + httpsAgent?: hsAgent; +} +export declare class NodeHttpHandler implements HttpHandler { + private config?; + private readonly configProvider; + readonly metadata: { + handlerProtocol: string; + }; + constructor( + options?: NodeHttpHandlerOptions | Provider + ); + private resolveDefaultConfig; + destroy(): void; + handle( + request: HttpRequest, + { abortSignal }?: HttpHandlerOptions + ): Promise<{ + response: HttpResponse; + }>; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts new file mode 100644 index 0000000000..2ef1726923 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts @@ -0,0 +1,28 @@ +import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; +import { HttpHandlerOptions, Provider } from "@aws-sdk/types"; +export interface NodeHttp2HandlerOptions { + requestTimeout?: number; + sessionTimeout?: number; + disableConcurrentStreams?: boolean; +} +export declare class NodeHttp2Handler implements HttpHandler { + private config?; + private readonly configProvider; + readonly metadata: { + handlerProtocol: string; + }; + private sessionCache; + constructor( + options?: NodeHttp2HandlerOptions | Provider + ); + destroy(): void; + handle( + request: HttpRequest, + { abortSignal }?: HttpHandlerOptions + ): Promise<{ + response: HttpResponse; + }>; + private getSession; + private destroySession; + private deleteSessionFromCache; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/readable.mock.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/readable.mock.d.ts new file mode 100644 index 0000000000..f2d905af41 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/readable.mock.d.ts @@ -0,0 +1,12 @@ +import { Readable, ReadableOptions } from "stream"; +export interface ReadFromBuffersOptions extends ReadableOptions { + buffers: Buffer[]; + errorAfter?: number; +} +export declare class ReadFromBuffers extends Readable { + private buffersToRead; + private numBuffersRead; + private errorAfter; + constructor(options: ReadFromBuffersOptions); + _read(): boolean | undefined; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/server.mock.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/server.mock.d.ts new file mode 100644 index 0000000000..36d08d1bb6 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/server.mock.d.ts @@ -0,0 +1,17 @@ +import { HttpResponse } from "@aws-sdk/types"; +import { IncomingMessage, Server as HttpServer, ServerResponse } from "http"; +import { Http2Server } from "http2"; +import { Server as HttpsServer } from "https"; +export declare const createResponseFunction: ( + httpResp: HttpResponse +) => (request: IncomingMessage, response: ServerResponse) => void; +export declare const createResponseFunctionWithDelay: ( + httpResp: HttpResponse, + delay: number +) => (request: IncomingMessage, response: ServerResponse) => void; +export declare const createContinueResponseFunction: ( + httpResp: HttpResponse +) => (request: IncomingMessage, response: ServerResponse) => void; +export declare const createMockHttpsServer: () => HttpsServer; +export declare const createMockHttpServer: () => HttpServer; +export declare const createMockHttp2Server: () => Http2Server; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts new file mode 100644 index 0000000000..5d3ca2af2a --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts @@ -0,0 +1,6 @@ +import { ClientRequest } from "http"; +export declare const setConnectionTimeout: ( + request: ClientRequest, + reject: (err: Error) => void, + timeoutInMs?: number +) => void; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts new file mode 100644 index 0000000000..31b35cdfc4 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts @@ -0,0 +1,6 @@ +import { ClientRequest } from "http"; +export declare const setSocketTimeout: ( + request: ClientRequest, + reject: (err: Error) => void, + timeoutInMs?: number +) => void; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts new file mode 100644 index 0000000000..531e41b18e --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts @@ -0,0 +1,9 @@ +import { Writable } from "stream"; +export declare class Collector extends Writable { + readonly bufferedBytes: Buffer[]; + _write( + chunk: Buffer, + encoding: string, + callback: (err?: Error) => void + ): void; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts new file mode 100644 index 0000000000..be9a6c6f4d --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/index.d.ts @@ -0,0 +1,2 @@ +import { StreamCollector } from "@aws-sdk/types"; +export declare const streamCollector: StreamCollector; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts new file mode 100644 index 0000000000..cf11620307 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts @@ -0,0 +1,12 @@ +import { Readable, ReadableOptions } from "stream"; +export interface ReadFromBuffersOptions extends ReadableOptions { + buffers: Buffer[]; + errorAfter?: number; +} +export declare class ReadFromBuffers extends Readable { + private buffersToRead; + private numBuffersRead; + private errorAfter; + constructor(options: ReadFromBuffersOptions); + _read(size: number): boolean | undefined; +} diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/write-request-body.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/write-request-body.d.ts new file mode 100644 index 0000000000..33a8b551e7 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/ts3.4/write-request-body.d.ts @@ -0,0 +1,7 @@ +import { HttpRequest } from "@aws-sdk/types"; +import { ClientRequest } from "http"; +import { ClientHttp2Stream } from "http2"; +export declare function writeRequestBody( + httpRequest: ClientRequest | ClientHttp2Stream, + request: HttpRequest +): void; diff --git a/server/node_modules/@aws-sdk/node-http-handler/dist-types/write-request-body.d.ts b/server/node_modules/@aws-sdk/node-http-handler/dist-types/write-request-body.d.ts new file mode 100644 index 0000000000..c0fca0e51a --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/dist-types/write-request-body.d.ts @@ -0,0 +1,5 @@ +/// +import { HttpRequest } from "@aws-sdk/types"; +import { ClientRequest } from "http"; +import { ClientHttp2Stream } from "http2"; +export declare function writeRequestBody(httpRequest: ClientRequest | ClientHttp2Stream, request: HttpRequest): void; diff --git a/server/node_modules/@aws-sdk/node-http-handler/package.json b/server/node_modules/@aws-sdk/node-http-handler/package.json new file mode 100644 index 0000000000..fd5c606637 --- /dev/null +++ b/server/node_modules/@aws-sdk/node-http-handler/package.json @@ -0,0 +1,59 @@ +{ + "name": "@aws-sdk/node-http-handler", + "version": "3.257.0", + "description": "Provides a way to make requests", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --coverage" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "email": "", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "dependencies": { + "@aws-sdk/abort-controller": "3.257.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/querystring-builder": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/node-http-handler", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/node-http-handler" + } +} diff --git a/server/node_modules/@aws-sdk/property-provider/LICENSE b/server/node_modules/@aws-sdk/property-provider/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/property-provider/README.md b/server/node_modules/@aws-sdk/property-provider/README.md new file mode 100644 index 0000000000..f910eb0eff --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/property-provider + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/property-provider/latest.svg)](https://www.npmjs.com/package/@aws-sdk/property-provider) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/property-provider.svg)](https://www.npmjs.com/package/@aws-sdk/property-provider) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/property-provider/dist-cjs/CredentialsProviderError.js b/server/node_modules/@aws-sdk/property-provider/dist-cjs/CredentialsProviderError.js new file mode 100644 index 0000000000..ccde548c6c --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-cjs/CredentialsProviderError.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CredentialsProviderError = void 0; +const ProviderError_1 = require("./ProviderError"); +class CredentialsProviderError extends ProviderError_1.ProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "CredentialsProviderError"; + Object.setPrototypeOf(this, CredentialsProviderError.prototype); + } +} +exports.CredentialsProviderError = CredentialsProviderError; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-cjs/ProviderError.js b/server/node_modules/@aws-sdk/property-provider/dist-cjs/ProviderError.js new file mode 100644 index 0000000000..4caa884344 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-cjs/ProviderError.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProviderError = void 0; +class ProviderError extends Error { + constructor(message, tryNextLink = true) { + super(message); + this.tryNextLink = tryNextLink; + this.name = "ProviderError"; + Object.setPrototypeOf(this, ProviderError.prototype); + } + static from(error, tryNextLink = true) { + return Object.assign(new this(error.message, tryNextLink), error); + } +} +exports.ProviderError = ProviderError; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-cjs/TokenProviderError.js b/server/node_modules/@aws-sdk/property-provider/dist-cjs/TokenProviderError.js new file mode 100644 index 0000000000..e7f69e1bf2 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-cjs/TokenProviderError.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TokenProviderError = void 0; +const ProviderError_1 = require("./ProviderError"); +class TokenProviderError extends ProviderError_1.ProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "TokenProviderError"; + Object.setPrototypeOf(this, TokenProviderError.prototype); + } +} +exports.TokenProviderError = TokenProviderError; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-cjs/chain.js b/server/node_modules/@aws-sdk/property-provider/dist-cjs/chain.js new file mode 100644 index 0000000000..07c6fc4d89 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-cjs/chain.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.chain = void 0; +const ProviderError_1 = require("./ProviderError"); +function chain(...providers) { + return () => { + let promise = Promise.reject(new ProviderError_1.ProviderError("No providers in chain")); + for (const provider of providers) { + promise = promise.catch((err) => { + if (err === null || err === void 0 ? void 0 : err.tryNextLink) { + return provider(); + } + throw err; + }); + } + return promise; + }; +} +exports.chain = chain; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-cjs/fromStatic.js b/server/node_modules/@aws-sdk/property-provider/dist-cjs/fromStatic.js new file mode 100644 index 0000000000..e7b9e8e8f2 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-cjs/fromStatic.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromStatic = void 0; +const fromStatic = (staticValue) => () => Promise.resolve(staticValue); +exports.fromStatic = fromStatic; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-cjs/index.js b/server/node_modules/@aws-sdk/property-provider/dist-cjs/index.js new file mode 100644 index 0000000000..f5628a3e04 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-cjs/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./CredentialsProviderError"), exports); +tslib_1.__exportStar(require("./ProviderError"), exports); +tslib_1.__exportStar(require("./TokenProviderError"), exports); +tslib_1.__exportStar(require("./chain"), exports); +tslib_1.__exportStar(require("./fromStatic"), exports); +tslib_1.__exportStar(require("./memoize"), exports); diff --git a/server/node_modules/@aws-sdk/property-provider/dist-cjs/memoize.js b/server/node_modules/@aws-sdk/property-provider/dist-cjs/memoize.js new file mode 100644 index 0000000000..17c15a0b30 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-cjs/memoize.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.memoize = void 0; +const memoize = (provider, isExpired, requiresRefresh) => { + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = async () => { + if (!pending) { + pending = provider(); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } + finally { + pending = undefined; + } + return resolved; + }; + if (isExpired === undefined) { + return async (options) => { + if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(); + } + if (isConstant) { + return resolved; + } + if (requiresRefresh && !requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(); + return resolved; + } + return resolved; + }; +}; +exports.memoize = memoize; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-es/CredentialsProviderError.js b/server/node_modules/@aws-sdk/property-provider/dist-es/CredentialsProviderError.js new file mode 100644 index 0000000000..959f4d43bf --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-es/CredentialsProviderError.js @@ -0,0 +1,9 @@ +import { ProviderError } from "./ProviderError"; +export class CredentialsProviderError extends ProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "CredentialsProviderError"; + Object.setPrototypeOf(this, CredentialsProviderError.prototype); + } +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-es/ProviderError.js b/server/node_modules/@aws-sdk/property-provider/dist-es/ProviderError.js new file mode 100644 index 0000000000..cedfe3e49b --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-es/ProviderError.js @@ -0,0 +1,11 @@ +export class ProviderError extends Error { + constructor(message, tryNextLink = true) { + super(message); + this.tryNextLink = tryNextLink; + this.name = "ProviderError"; + Object.setPrototypeOf(this, ProviderError.prototype); + } + static from(error, tryNextLink = true) { + return Object.assign(new this(error.message, tryNextLink), error); + } +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-es/TokenProviderError.js b/server/node_modules/@aws-sdk/property-provider/dist-es/TokenProviderError.js new file mode 100644 index 0000000000..1f6c974903 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-es/TokenProviderError.js @@ -0,0 +1,9 @@ +import { ProviderError } from "./ProviderError"; +export class TokenProviderError extends ProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "TokenProviderError"; + Object.setPrototypeOf(this, TokenProviderError.prototype); + } +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-es/chain.js b/server/node_modules/@aws-sdk/property-provider/dist-es/chain.js new file mode 100644 index 0000000000..7e65d65374 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-es/chain.js @@ -0,0 +1,15 @@ +import { ProviderError } from "./ProviderError"; +export function chain(...providers) { + return () => { + let promise = Promise.reject(new ProviderError("No providers in chain")); + for (const provider of providers) { + promise = promise.catch((err) => { + if (err?.tryNextLink) { + return provider(); + } + throw err; + }); + } + return promise; + }; +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-es/fromStatic.js b/server/node_modules/@aws-sdk/property-provider/dist-es/fromStatic.js new file mode 100644 index 0000000000..67da7a75d5 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-es/fromStatic.js @@ -0,0 +1 @@ +export const fromStatic = (staticValue) => () => Promise.resolve(staticValue); diff --git a/server/node_modules/@aws-sdk/property-provider/dist-es/index.js b/server/node_modules/@aws-sdk/property-provider/dist-es/index.js new file mode 100644 index 0000000000..15d14e5b64 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-es/index.js @@ -0,0 +1,6 @@ +export * from "./CredentialsProviderError"; +export * from "./ProviderError"; +export * from "./TokenProviderError"; +export * from "./chain"; +export * from "./fromStatic"; +export * from "./memoize"; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-es/memoize.js b/server/node_modules/@aws-sdk/property-provider/dist-es/memoize.js new file mode 100644 index 0000000000..e04839ab44 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-es/memoize.js @@ -0,0 +1,45 @@ +export const memoize = (provider, isExpired, requiresRefresh) => { + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = async () => { + if (!pending) { + pending = provider(); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } + finally { + pending = undefined; + } + return resolved; + }; + if (isExpired === undefined) { + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(); + } + if (isConstant) { + return resolved; + } + if (requiresRefresh && !requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(); + return resolved; + } + return resolved; + }; +}; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/CredentialsProviderError.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/CredentialsProviderError.d.ts new file mode 100644 index 0000000000..77984f3e39 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/CredentialsProviderError.d.ts @@ -0,0 +1,15 @@ +import { ProviderError } from "./ProviderError"; +/** + * An error representing a failure of an individual credential provider. + * + * This error class has special meaning to the {@link chain} method. If a + * provider in the chain is rejected with an error, the chain will only proceed + * to the next provider if the value of the `tryNextLink` property on the error + * is truthy. This allows individual providers to halt the chain and also + * ensures the chain will stop if an entirely unexpected error is encountered. + */ +export declare class CredentialsProviderError extends ProviderError { + readonly tryNextLink: boolean; + name: string; + constructor(message: string, tryNextLink?: boolean); +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/ProviderError.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/ProviderError.d.ts new file mode 100644 index 0000000000..4922aa22d2 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/ProviderError.d.ts @@ -0,0 +1,15 @@ +/** + * An error representing a failure of an individual provider. + * + * This error class has special meaning to the {@link chain} method. If a + * provider in the chain is rejected with an error, the chain will only proceed + * to the next provider if the value of the `tryNextLink` property on the error + * is truthy. This allows individual providers to halt the chain and also + * ensures the chain will stop if an entirely unexpected error is encountered. + */ +export declare class ProviderError extends Error { + readonly tryNextLink: boolean; + name: string; + constructor(message: string, tryNextLink?: boolean); + static from(error: Error, tryNextLink?: boolean): ProviderError; +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/TokenProviderError.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/TokenProviderError.d.ts new file mode 100644 index 0000000000..034a5f1d9b --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/TokenProviderError.d.ts @@ -0,0 +1,15 @@ +import { ProviderError } from "./ProviderError"; +/** + * An error representing a failure of an individual token provider. + * + * This error class has special meaning to the {@link chain} method. If a + * provider in the chain is rejected with an error, the chain will only proceed + * to the next provider if the value of the `tryNextLink` property on the error + * is truthy. This allows individual providers to halt the chain and also + * ensures the chain will stop if an entirely unexpected error is encountered. + */ +export declare class TokenProviderError extends ProviderError { + readonly tryNextLink: boolean; + name: string; + constructor(message: string, tryNextLink?: boolean); +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/chain.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/chain.d.ts new file mode 100644 index 0000000000..357ab50c97 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/chain.d.ts @@ -0,0 +1,11 @@ +import { Provider } from "@aws-sdk/types"; +/** + * Compose a single credential provider function from multiple credential + * providers. The first provider in the argument list will always be invoked; + * subsequent providers in the list will be invoked in the order in which the + * were received if the preceding provider did not successfully resolve. + * + * If no providers were received or no provider resolves successfully, the + * returned promise will be rejected. + */ +export declare function chain(...providers: Array>): Provider; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/fromStatic.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/fromStatic.d.ts new file mode 100644 index 0000000000..ae4969e571 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/fromStatic.d.ts @@ -0,0 +1,2 @@ +import { Provider } from "@aws-sdk/types"; +export declare const fromStatic: (staticValue: T) => Provider; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/index.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/index.d.ts new file mode 100644 index 0000000000..15d14e5b64 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/index.d.ts @@ -0,0 +1,6 @@ +export * from "./CredentialsProviderError"; +export * from "./ProviderError"; +export * from "./TokenProviderError"; +export * from "./chain"; +export * from "./fromStatic"; +export * from "./memoize"; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/memoize.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/memoize.d.ts new file mode 100644 index 0000000000..6ced6b9670 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/memoize.d.ts @@ -0,0 +1,37 @@ +import { MemoizedProvider, Provider } from "@aws-sdk/types"; +interface MemoizeOverload { + /** + * + * Decorates a provider function with either static memoization. + * + * To create a statically memoized provider, supply a provider as the only + * argument to this function. The provider will be invoked once, and all + * invocations of the provider returned by `memoize` will return the same + * promise object. + * + * @param provider The provider whose result should be cached indefinitely. + */ + (provider: Provider): MemoizedProvider; + /** + * Decorates a provider function with refreshing memoization. + * + * @param provider The provider whose result should be cached. + * @param isExpired A function that will evaluate the resolved value and + * determine if it is expired. For example, when + * memoizing AWS credential providers, this function + * should return `true` when the credential's + * expiration is in the past (or very near future) and + * `false` otherwise. + * @param requiresRefresh A function that will evaluate the resolved value and + * determine if it represents static value or one that + * will eventually need to be refreshed. For example, + * AWS credentials that have no defined expiration will + * never need to be refreshed, so this function would + * return `true` if the credentials resolved by the + * underlying provider had an expiration and `false` + * otherwise. + */ + (provider: Provider, isExpired: (resolved: T) => boolean, requiresRefresh?: (resolved: T) => boolean): MemoizedProvider; +} +export declare const memoize: MemoizeOverload; +export {}; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/CredentialsProviderError.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/CredentialsProviderError.d.ts new file mode 100644 index 0000000000..f85f2f260e --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/CredentialsProviderError.d.ts @@ -0,0 +1,6 @@ +import { ProviderError } from "./ProviderError"; +export declare class CredentialsProviderError extends ProviderError { + readonly tryNextLink: boolean; + name: string; + constructor(message: string, tryNextLink?: boolean); +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/ProviderError.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/ProviderError.d.ts new file mode 100644 index 0000000000..5f2f2cbd00 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/ProviderError.d.ts @@ -0,0 +1,6 @@ +export declare class ProviderError extends Error { + readonly tryNextLink: boolean; + name: string; + constructor(message: string, tryNextLink?: boolean); + static from(error: Error, tryNextLink?: boolean): ProviderError; +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/TokenProviderError.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/TokenProviderError.d.ts new file mode 100644 index 0000000000..d0471bee04 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/TokenProviderError.d.ts @@ -0,0 +1,6 @@ +import { ProviderError } from "./ProviderError"; +export declare class TokenProviderError extends ProviderError { + readonly tryNextLink: boolean; + name: string; + constructor(message: string, tryNextLink?: boolean); +} diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/chain.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/chain.d.ts new file mode 100644 index 0000000000..ac6cddb41d --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/chain.d.ts @@ -0,0 +1,2 @@ +import { Provider } from "@aws-sdk/types"; +export declare function chain(...providers: Array>): Provider; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/fromStatic.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/fromStatic.d.ts new file mode 100644 index 0000000000..ae4969e571 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/fromStatic.d.ts @@ -0,0 +1,2 @@ +import { Provider } from "@aws-sdk/types"; +export declare const fromStatic: (staticValue: T) => Provider; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..15d14e5b64 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/index.d.ts @@ -0,0 +1,6 @@ +export * from "./CredentialsProviderError"; +export * from "./ProviderError"; +export * from "./TokenProviderError"; +export * from "./chain"; +export * from "./fromStatic"; +export * from "./memoize"; diff --git a/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/memoize.d.ts b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/memoize.d.ts new file mode 100644 index 0000000000..4e29852983 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/dist-types/ts3.4/memoize.d.ts @@ -0,0 +1,11 @@ +import { MemoizedProvider, Provider } from "@aws-sdk/types"; +interface MemoizeOverload { + (provider: Provider): MemoizedProvider; + ( + provider: Provider, + isExpired: (resolved: T) => boolean, + requiresRefresh?: (resolved: T) => boolean + ): MemoizedProvider; +} +export declare const memoize: MemoizeOverload; +export {}; diff --git a/server/node_modules/@aws-sdk/property-provider/package.json b/server/node_modules/@aws-sdk/property-provider/package.json new file mode 100644 index 0000000000..fe2c39f431 --- /dev/null +++ b/server/node_modules/@aws-sdk/property-provider/package.json @@ -0,0 +1,53 @@ +{ + "name": "@aws-sdk/property-provider", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/property-provider", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/property-provider" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/protocol-http/LICENSE b/server/node_modules/@aws-sdk/protocol-http/LICENSE new file mode 100644 index 0000000000..e907b58668 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/protocol-http/README.md b/server/node_modules/@aws-sdk/protocol-http/README.md new file mode 100644 index 0000000000..860b71ab12 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/protocol-http + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/protocol-http/latest.svg)](https://www.npmjs.com/package/@aws-sdk/protocol-http) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/protocol-http.svg)](https://www.npmjs.com/package/@aws-sdk/protocol-http) diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpHandler.js b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpHandler.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpHandler.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpRequest.js b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpRequest.js new file mode 100644 index 0000000000..57e4048608 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpRequest.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HttpRequest = void 0; +class HttpRequest { + constructor(options) { + this.method = options.method || "GET"; + this.hostname = options.hostname || "localhost"; + this.port = options.port; + this.query = options.query || {}; + this.headers = options.headers || {}; + this.body = options.body; + this.protocol = options.protocol + ? options.protocol.slice(-1) !== ":" + ? `${options.protocol}:` + : options.protocol + : "https:"; + this.path = options.path ? (options.path.charAt(0) !== "/" ? `/${options.path}` : options.path) : "/"; + } + static isInstance(request) { + if (!request) + return false; + const req = request; + return ("method" in req && + "protocol" in req && + "hostname" in req && + "path" in req && + typeof req["query"] === "object" && + typeof req["headers"] === "object"); + } + clone() { + const cloned = new HttpRequest({ + ...this, + headers: { ...this.headers }, + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +} +exports.HttpRequest = HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param, + }; + }, {}); +} diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpResponse.js b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpResponse.js new file mode 100644 index 0000000000..699c8eecec --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/httpResponse.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HttpResponse = void 0; +class HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +} +exports.HttpResponse = HttpResponse; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-cjs/index.js b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/index.js new file mode 100644 index 0000000000..56b5e11702 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./httpHandler"), exports); +tslib_1.__exportStar(require("./httpRequest"), exports); +tslib_1.__exportStar(require("./httpResponse"), exports); +tslib_1.__exportStar(require("./isValidHostname"), exports); diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-cjs/isValidHostname.js b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/isValidHostname.js new file mode 100644 index 0000000000..9e5547e583 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-cjs/isValidHostname.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isValidHostname = void 0; +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +exports.isValidHostname = isValidHostname; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-es/httpHandler.js b/server/node_modules/@aws-sdk/protocol-http/dist-es/httpHandler.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-es/httpHandler.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-es/httpRequest.js b/server/node_modules/@aws-sdk/protocol-http/dist-es/httpRequest.js new file mode 100644 index 0000000000..621db2ece3 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-es/httpRequest.js @@ -0,0 +1,45 @@ +export class HttpRequest { + constructor(options) { + this.method = options.method || "GET"; + this.hostname = options.hostname || "localhost"; + this.port = options.port; + this.query = options.query || {}; + this.headers = options.headers || {}; + this.body = options.body; + this.protocol = options.protocol + ? options.protocol.slice(-1) !== ":" + ? `${options.protocol}:` + : options.protocol + : "https:"; + this.path = options.path ? (options.path.charAt(0) !== "/" ? `/${options.path}` : options.path) : "/"; + } + static isInstance(request) { + if (!request) + return false; + const req = request; + return ("method" in req && + "protocol" in req && + "hostname" in req && + "path" in req && + typeof req["query"] === "object" && + typeof req["headers"] === "object"); + } + clone() { + const cloned = new HttpRequest({ + ...this, + headers: { ...this.headers }, + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; + } +} +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param, + }; + }, {}); +} diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-es/httpResponse.js b/server/node_modules/@aws-sdk/protocol-http/dist-es/httpResponse.js new file mode 100644 index 0000000000..1dfa7dec0a --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-es/httpResponse.js @@ -0,0 +1,13 @@ +export class HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } +} diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-es/index.js b/server/node_modules/@aws-sdk/protocol-http/dist-es/index.js new file mode 100644 index 0000000000..93831fb19d --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-es/index.js @@ -0,0 +1,4 @@ +export * from "./httpHandler"; +export * from "./httpRequest"; +export * from "./httpResponse"; +export * from "./isValidHostname"; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-es/isValidHostname.js b/server/node_modules/@aws-sdk/protocol-http/dist-es/isValidHostname.js new file mode 100644 index 0000000000..464c7db58e --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-es/isValidHostname.js @@ -0,0 +1,4 @@ +export function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/httpHandler.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/httpHandler.d.ts new file mode 100644 index 0000000000..8da5d34120 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/httpHandler.d.ts @@ -0,0 +1,4 @@ +import { HttpHandlerOptions, RequestHandler } from "@aws-sdk/types"; +import { HttpRequest } from "./httpRequest"; +import { HttpResponse } from "./httpResponse"; +export declare type HttpHandler = RequestHandler; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/httpRequest.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/httpRequest.d.ts new file mode 100644 index 0000000000..8d8d66a3e0 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/httpRequest.d.ts @@ -0,0 +1,20 @@ +import { Endpoint, HeaderBag, HttpMessage, HttpRequest as IHttpRequest, QueryParameterBag } from "@aws-sdk/types"; +declare type HttpRequestOptions = Partial & Partial & { + method?: string; +}; +export interface HttpRequest extends IHttpRequest { +} +export declare class HttpRequest implements HttpMessage, Endpoint { + method: string; + protocol: string; + hostname: string; + port?: number; + path: string; + query: QueryParameterBag; + headers: HeaderBag; + body?: any; + constructor(options: HttpRequestOptions); + static isInstance(request: unknown): request is HttpRequest; + clone(): HttpRequest; +} +export {}; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/httpResponse.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/httpResponse.d.ts new file mode 100644 index 0000000000..4688c2ad6f --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/httpResponse.d.ts @@ -0,0 +1,14 @@ +import { HeaderBag, HttpMessage, HttpResponse as IHttpResponse } from "@aws-sdk/types"; +declare type HttpResponseOptions = Partial & { + statusCode: number; +}; +export interface HttpResponse extends IHttpResponse { +} +export declare class HttpResponse { + statusCode: number; + headers: HeaderBag; + body?: any; + constructor(options: HttpResponseOptions); + static isInstance(response: unknown): response is HttpResponse; +} +export {}; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/index.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/index.d.ts new file mode 100644 index 0000000000..93831fb19d --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/index.d.ts @@ -0,0 +1,4 @@ +export * from "./httpHandler"; +export * from "./httpRequest"; +export * from "./httpResponse"; +export * from "./isValidHostname"; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/isValidHostname.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/isValidHostname.d.ts new file mode 100644 index 0000000000..6fb5bcb33d --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/isValidHostname.d.ts @@ -0,0 +1 @@ +export declare function isValidHostname(hostname: string): boolean; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpHandler.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpHandler.d.ts new file mode 100644 index 0000000000..47fff4c8e0 --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpHandler.d.ts @@ -0,0 +1,8 @@ +import { HttpHandlerOptions, RequestHandler } from "@aws-sdk/types"; +import { HttpRequest } from "./httpRequest"; +import { HttpResponse } from "./httpResponse"; +export declare type HttpHandler = RequestHandler< + HttpRequest, + HttpResponse, + HttpHandlerOptions +>; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpRequest.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpRequest.d.ts new file mode 100644 index 0000000000..bdebafb46f --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpRequest.d.ts @@ -0,0 +1,26 @@ +import { + Endpoint, + HeaderBag, + HttpMessage, + HttpRequest as IHttpRequest, + QueryParameterBag, +} from "@aws-sdk/types"; +declare type HttpRequestOptions = Partial & + Partial & { + method?: string; + }; +export interface HttpRequest extends IHttpRequest {} +export declare class HttpRequest implements HttpMessage, Endpoint { + method: string; + protocol: string; + hostname: string; + port?: number; + path: string; + query: QueryParameterBag; + headers: HeaderBag; + body?: any; + constructor(options: HttpRequestOptions); + static isInstance(request: unknown): request is HttpRequest; + clone(): HttpRequest; +} +export {}; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpResponse.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpResponse.d.ts new file mode 100644 index 0000000000..da941bacea --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/httpResponse.d.ts @@ -0,0 +1,17 @@ +import { + HeaderBag, + HttpMessage, + HttpResponse as IHttpResponse, +} from "@aws-sdk/types"; +declare type HttpResponseOptions = Partial & { + statusCode: number; +}; +export interface HttpResponse extends IHttpResponse {} +export declare class HttpResponse { + statusCode: number; + headers: HeaderBag; + body?: any; + constructor(options: HttpResponseOptions); + static isInstance(response: unknown): response is HttpResponse; +} +export {}; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..93831fb19d --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/index.d.ts @@ -0,0 +1,4 @@ +export * from "./httpHandler"; +export * from "./httpRequest"; +export * from "./httpResponse"; +export * from "./isValidHostname"; diff --git a/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/isValidHostname.d.ts b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/isValidHostname.d.ts new file mode 100644 index 0000000000..6fb5bcb33d --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/dist-types/ts3.4/isValidHostname.d.ts @@ -0,0 +1 @@ +export declare function isValidHostname(hostname: string): boolean; diff --git a/server/node_modules/@aws-sdk/protocol-http/package.json b/server/node_modules/@aws-sdk/protocol-http/package.json new file mode 100644 index 0000000000..b9b487fb3f --- /dev/null +++ b/server/node_modules/@aws-sdk/protocol-http/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/protocol-http", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "email": "", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/protocol-http", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/protocol-http" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/querystring-builder/LICENSE b/server/node_modules/@aws-sdk/querystring-builder/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-builder/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/querystring-builder/README.md b/server/node_modules/@aws-sdk/querystring-builder/README.md new file mode 100644 index 0000000000..8587bd3acb --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-builder/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/querystring-builder + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/querystring-builder/latest.svg)](https://www.npmjs.com/package/@aws-sdk/querystring-builder) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/querystring-builder.svg)](https://www.npmjs.com/package/@aws-sdk/querystring-builder) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/querystring-builder/dist-cjs/index.js b/server/node_modules/@aws-sdk/querystring-builder/dist-cjs/index.js new file mode 100644 index 0000000000..a55e10d042 --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-builder/dist-cjs/index.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildQueryString = void 0; +const util_uri_escape_1 = require("@aws-sdk/util-uri-escape"); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, util_uri_escape_1.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); + } + } + else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; + } + parts.push(qsEntry); + } + } + return parts.join("&"); +} +exports.buildQueryString = buildQueryString; diff --git a/server/node_modules/@aws-sdk/querystring-builder/dist-es/index.js b/server/node_modules/@aws-sdk/querystring-builder/dist-es/index.js new file mode 100644 index 0000000000..60121a6237 --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-builder/dist-es/index.js @@ -0,0 +1,21 @@ +import { escapeUri } from "@aws-sdk/util-uri-escape"; +export function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = escapeUri(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${escapeUri(value[i])}`); + } + } + else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${escapeUri(value)}`; + } + parts.push(qsEntry); + } + } + return parts.join("&"); +} diff --git a/server/node_modules/@aws-sdk/querystring-builder/dist-types/index.d.ts b/server/node_modules/@aws-sdk/querystring-builder/dist-types/index.d.ts new file mode 100644 index 0000000000..37dd3412f9 --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-builder/dist-types/index.d.ts @@ -0,0 +1,2 @@ +import { QueryParameterBag } from "@aws-sdk/types"; +export declare function buildQueryString(query: QueryParameterBag): string; diff --git a/server/node_modules/@aws-sdk/querystring-builder/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/querystring-builder/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..37dd3412f9 --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-builder/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +import { QueryParameterBag } from "@aws-sdk/types"; +export declare function buildQueryString(query: QueryParameterBag): string; diff --git a/server/node_modules/@aws-sdk/querystring-builder/package.json b/server/node_modules/@aws-sdk/querystring-builder/package.json new file mode 100644 index 0000000000..32fb60d77c --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-builder/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/querystring-builder", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "exit 0" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/querystring-builder", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/querystring-builder" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/querystring-parser/LICENSE b/server/node_modules/@aws-sdk/querystring-parser/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-parser/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/querystring-parser/README.md b/server/node_modules/@aws-sdk/querystring-parser/README.md new file mode 100644 index 0000000000..49488dd145 --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-parser/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/querystring-parser + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/querystring-parser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/querystring-parser) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/querystring-parser.svg)](https://www.npmjs.com/package/@aws-sdk/querystring-parser) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/querystring-parser/dist-cjs/index.js b/server/node_modules/@aws-sdk/querystring-parser/dist-cjs/index.js new file mode 100644 index 0000000000..516d23b79b --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-parser/dist-cjs/index.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseQueryString = void 0; +function parseQueryString(querystring) { + const query = {}; + querystring = querystring.replace(/^\?/, ""); + if (querystring) { + for (const pair of querystring.split("&")) { + let [key, value = null] = pair.split("="); + key = decodeURIComponent(key); + if (value) { + value = decodeURIComponent(value); + } + if (!(key in query)) { + query[key] = value; + } + else if (Array.isArray(query[key])) { + query[key].push(value); + } + else { + query[key] = [query[key], value]; + } + } + } + return query; +} +exports.parseQueryString = parseQueryString; diff --git a/server/node_modules/@aws-sdk/querystring-parser/dist-es/index.js b/server/node_modules/@aws-sdk/querystring-parser/dist-es/index.js new file mode 100644 index 0000000000..bd7bf004b9 --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-parser/dist-es/index.js @@ -0,0 +1,23 @@ +export function parseQueryString(querystring) { + const query = {}; + querystring = querystring.replace(/^\?/, ""); + if (querystring) { + for (const pair of querystring.split("&")) { + let [key, value = null] = pair.split("="); + key = decodeURIComponent(key); + if (value) { + value = decodeURIComponent(value); + } + if (!(key in query)) { + query[key] = value; + } + else if (Array.isArray(query[key])) { + query[key].push(value); + } + else { + query[key] = [query[key], value]; + } + } + } + return query; +} diff --git a/server/node_modules/@aws-sdk/querystring-parser/dist-types/index.d.ts b/server/node_modules/@aws-sdk/querystring-parser/dist-types/index.d.ts new file mode 100644 index 0000000000..ec07033b6b --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-parser/dist-types/index.d.ts @@ -0,0 +1,2 @@ +import { QueryParameterBag } from "@aws-sdk/types"; +export declare function parseQueryString(querystring: string): QueryParameterBag; diff --git a/server/node_modules/@aws-sdk/querystring-parser/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/querystring-parser/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..8c9dc2fd01 --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-parser/dist-types/ts3.4/index.d.ts @@ -0,0 +1,4 @@ +import { QueryParameterBag } from "@aws-sdk/types"; +export declare function parseQueryString( + querystring: string +): QueryParameterBag; diff --git a/server/node_modules/@aws-sdk/querystring-parser/package.json b/server/node_modules/@aws-sdk/querystring-parser/package.json new file mode 100644 index 0000000000..74f21e9f1d --- /dev/null +++ b/server/node_modules/@aws-sdk/querystring-parser/package.json @@ -0,0 +1,53 @@ +{ + "name": "@aws-sdk/querystring-parser", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/querystring-parser", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/querystring-parser" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/service-error-classification/LICENSE b/server/node_modules/@aws-sdk/service-error-classification/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/service-error-classification/README.md b/server/node_modules/@aws-sdk/service-error-classification/README.md new file mode 100644 index 0000000000..fe513b6110 --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/service-error-classification + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/service-error-classification/latest.svg)](https://www.npmjs.com/package/@aws-sdk/service-error-classification) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/service-error-classification.svg)](https://www.npmjs.com/package/@aws-sdk/service-error-classification) diff --git a/server/node_modules/@aws-sdk/service-error-classification/dist-cjs/constants.js b/server/node_modules/@aws-sdk/service-error-classification/dist-cjs/constants.js new file mode 100644 index 0000000000..d9913ce637 --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/dist-cjs/constants.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NODEJS_TIMEOUT_ERROR_CODES = exports.TRANSIENT_ERROR_STATUS_CODES = exports.TRANSIENT_ERROR_CODES = exports.THROTTLING_ERROR_CODES = exports.CLOCK_SKEW_ERROR_CODES = void 0; +exports.CLOCK_SKEW_ERROR_CODES = [ + "AuthFailure", + "InvalidSignatureException", + "RequestExpired", + "RequestInTheFuture", + "RequestTimeTooSkewed", + "SignatureDoesNotMatch", +]; +exports.THROTTLING_ERROR_CODES = [ + "BandwidthLimitExceeded", + "EC2ThrottledException", + "LimitExceededException", + "PriorRequestNotComplete", + "ProvisionedThroughputExceededException", + "RequestLimitExceeded", + "RequestThrottled", + "RequestThrottledException", + "SlowDown", + "ThrottledException", + "Throttling", + "ThrottlingException", + "TooManyRequestsException", + "TransactionInProgressException", +]; +exports.TRANSIENT_ERROR_CODES = ["AbortError", "TimeoutError", "RequestTimeout", "RequestTimeoutException"]; +exports.TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; +exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; diff --git a/server/node_modules/@aws-sdk/service-error-classification/dist-cjs/index.js b/server/node_modules/@aws-sdk/service-error-classification/dist-cjs/index.js new file mode 100644 index 0000000000..95631bb8e3 --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/dist-cjs/index.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isServerError = exports.isTransientError = exports.isThrottlingError = exports.isClockSkewError = exports.isRetryableByTrait = void 0; +const constants_1 = require("./constants"); +const isRetryableByTrait = (error) => error.$retryable !== undefined; +exports.isRetryableByTrait = isRetryableByTrait; +const isClockSkewError = (error) => constants_1.CLOCK_SKEW_ERROR_CODES.includes(error.name); +exports.isClockSkewError = isClockSkewError; +const isThrottlingError = (error) => { + var _a, _b; + return ((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) === 429 || + constants_1.THROTTLING_ERROR_CODES.includes(error.name) || + ((_b = error.$retryable) === null || _b === void 0 ? void 0 : _b.throttling) == true; +}; +exports.isThrottlingError = isThrottlingError; +const isTransientError = (error) => { + var _a; + return constants_1.TRANSIENT_ERROR_CODES.includes(error.name) || + constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes((error === null || error === void 0 ? void 0 : error.code) || "") || + constants_1.TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) || 0); +}; +exports.isTransientError = isTransientError; +const isServerError = (error) => { + var _a; + if (((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) !== undefined) { + const statusCode = error.$metadata.httpStatusCode; + if (500 <= statusCode && statusCode <= 599 && !(0, exports.isTransientError)(error)) { + return true; + } + return false; + } + return false; +}; +exports.isServerError = isServerError; diff --git a/server/node_modules/@aws-sdk/service-error-classification/dist-es/constants.js b/server/node_modules/@aws-sdk/service-error-classification/dist-es/constants.js new file mode 100644 index 0000000000..0c37bc453f --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/dist-es/constants.js @@ -0,0 +1,27 @@ +export const CLOCK_SKEW_ERROR_CODES = [ + "AuthFailure", + "InvalidSignatureException", + "RequestExpired", + "RequestInTheFuture", + "RequestTimeTooSkewed", + "SignatureDoesNotMatch", +]; +export const THROTTLING_ERROR_CODES = [ + "BandwidthLimitExceeded", + "EC2ThrottledException", + "LimitExceededException", + "PriorRequestNotComplete", + "ProvisionedThroughputExceededException", + "RequestLimitExceeded", + "RequestThrottled", + "RequestThrottledException", + "SlowDown", + "ThrottledException", + "Throttling", + "ThrottlingException", + "TooManyRequestsException", + "TransactionInProgressException", +]; +export const TRANSIENT_ERROR_CODES = ["AbortError", "TimeoutError", "RequestTimeout", "RequestTimeoutException"]; +export const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; +export const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; diff --git a/server/node_modules/@aws-sdk/service-error-classification/dist-es/index.js b/server/node_modules/@aws-sdk/service-error-classification/dist-es/index.js new file mode 100644 index 0000000000..0b8de2d140 --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/dist-es/index.js @@ -0,0 +1,19 @@ +import { CLOCK_SKEW_ERROR_CODES, NODEJS_TIMEOUT_ERROR_CODES, THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, } from "./constants"; +export const isRetryableByTrait = (error) => error.$retryable !== undefined; +export const isClockSkewError = (error) => CLOCK_SKEW_ERROR_CODES.includes(error.name); +export const isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 || + THROTTLING_ERROR_CODES.includes(error.name) || + error.$retryable?.throttling == true; +export const isTransientError = (error) => TRANSIENT_ERROR_CODES.includes(error.name) || + NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || + TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0); +export const isServerError = (error) => { + if (error.$metadata?.httpStatusCode !== undefined) { + const statusCode = error.$metadata.httpStatusCode; + if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) { + return true; + } + return false; + } + return false; +}; diff --git a/server/node_modules/@aws-sdk/service-error-classification/dist-types/constants.d.ts b/server/node_modules/@aws-sdk/service-error-classification/dist-types/constants.d.ts new file mode 100644 index 0000000000..f07663b1c1 --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/dist-types/constants.d.ts @@ -0,0 +1,26 @@ +/** + * Errors encountered when the client clock and server clock cannot agree on the + * current time. + * + * These errors are retryable, assuming the SDK has enabled clock skew + * correction. + */ +export declare const CLOCK_SKEW_ERROR_CODES: string[]; +/** + * Errors that indicate the SDK is being throttled. + * + * These errors are always retryable. + */ +export declare const THROTTLING_ERROR_CODES: string[]; +/** + * Error codes that indicate transient issues + */ +export declare const TRANSIENT_ERROR_CODES: string[]; +/** + * Error codes that indicate transient issues + */ +export declare const TRANSIENT_ERROR_STATUS_CODES: number[]; +/** + * Node.js system error codes that indicate timeout. + */ +export declare const NODEJS_TIMEOUT_ERROR_CODES: string[]; diff --git a/server/node_modules/@aws-sdk/service-error-classification/dist-types/index.d.ts b/server/node_modules/@aws-sdk/service-error-classification/dist-types/index.d.ts new file mode 100644 index 0000000000..3edd8a3cfd --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/dist-types/index.d.ts @@ -0,0 +1,12 @@ +import { SdkError } from "@aws-sdk/types"; +export declare const isRetryableByTrait: (error: SdkError) => boolean; +export declare const isClockSkewError: (error: SdkError) => boolean; +export declare const isThrottlingError: (error: SdkError) => boolean; +/** + * Though NODEJS_TIMEOUT_ERROR_CODES are platform specific, they are + * included here because there is an error scenario with unknown root + * cause where the NodeHttpHandler does not decorate the Error with + * the name "TimeoutError" to be checked by the TRANSIENT_ERROR_CODES condition. + */ +export declare const isTransientError: (error: SdkError) => boolean; +export declare const isServerError: (error: SdkError) => boolean; diff --git a/server/node_modules/@aws-sdk/service-error-classification/dist-types/ts3.4/constants.d.ts b/server/node_modules/@aws-sdk/service-error-classification/dist-types/ts3.4/constants.d.ts new file mode 100644 index 0000000000..e7e77d35b7 --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/dist-types/ts3.4/constants.d.ts @@ -0,0 +1,5 @@ +export declare const CLOCK_SKEW_ERROR_CODES: string[]; +export declare const THROTTLING_ERROR_CODES: string[]; +export declare const TRANSIENT_ERROR_CODES: string[]; +export declare const TRANSIENT_ERROR_STATUS_CODES: number[]; +export declare const NODEJS_TIMEOUT_ERROR_CODES: string[]; diff --git a/server/node_modules/@aws-sdk/service-error-classification/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/service-error-classification/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..b71b06e013 --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/dist-types/ts3.4/index.d.ts @@ -0,0 +1,6 @@ +import { SdkError } from "@aws-sdk/types"; +export declare const isRetryableByTrait: (error: SdkError) => boolean; +export declare const isClockSkewError: (error: SdkError) => boolean; +export declare const isThrottlingError: (error: SdkError) => boolean; +export declare const isTransientError: (error: SdkError) => boolean; +export declare const isServerError: (error: SdkError) => boolean; diff --git a/server/node_modules/@aws-sdk/service-error-classification/package.json b/server/node_modules/@aws-sdk/service-error-classification/package.json new file mode 100644 index 0000000000..dbf47cd989 --- /dev/null +++ b/server/node_modules/@aws-sdk/service-error-classification/package.json @@ -0,0 +1,50 @@ +{ + "name": "@aws-sdk/service-error-classification", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "devDependencies": { + "@aws-sdk/types": "3.257.0", + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/service-error-classification", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/service-error-classification" + } +} diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/LICENSE b/server/node_modules/@aws-sdk/shared-ini-file-loader/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/README.md b/server/node_modules/@aws-sdk/shared-ini-file-loader/README.md new file mode 100644 index 0000000000..d640774767 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/README.md @@ -0,0 +1,102 @@ +# @aws-sdk/shared-ini-file-loader + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/shared-ini-file-loader/latest.svg)](https://www.npmjs.com/package/@aws-sdk/shared-ini-file-loader) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/shared-ini-file-loader.svg)](https://www.npmjs.com/package/@aws-sdk/shared-ini-file-loader) + +## AWS Shared Configuration File Loader + +This module provides a function that reads from AWS SDK configuration files and +returns a promise that will resolve with a hash of the parsed contents of the +AWS credentials file and of the AWS config file. Given the [sample +files](#sample-files) below, the promise returned by `loadSharedConfigFiles` +would resolve with: + +```javascript +{ + configFile: { + 'default': { + aws_access_key_id: 'foo', + aws_secret_access_key: 'bar', + }, + dev: { + aws_access_key_id: 'foo1', + aws_secret_access_key: 'bar1', + }, + prod: { + aws_access_key_id: 'foo2', + aws_secret_access_key: 'bar2', + }, + 'testing host': { + aws_access_key_id: 'foo4', + aws_secret_access_key: 'bar4', + } + }, + credentialsFile: { + 'default': { + aws_access_key_id: 'foo', + aws_secret_access_key: 'bar', + }, + dev: { + aws_access_key_id: 'foo1', + aws_secret_access_key: 'bar1', + }, + prod: { + aws_access_key_id: 'foo2', + aws_secret_access_key: 'bar2', + } + }, +} +``` + +If a file is not found, its key (`configFile` or `credentialsFile`) will instead +have a value of an empty object. + +## Supported configuration + +You may customize how the files are loaded by providing an options hash to the +`loadSharedConfigFiles` function. The following options are supported: + +- `filepath` - The path to the shared credentials file. If not specified, the + provider will use the value in the `AWS_SHARED_CREDENTIALS_FILE` environment + variable or a default of `~/.aws/credentials`. +- `configFilepath` - The path to the shared config file. If not specified, the + provider will use the value in the `AWS_CONFIG_FILE` environment variable or a + default of `~/.aws/config`. + +## Sample files + +### `~/.aws/credentials` + +```ini +[default] +aws_access_key_id=foo +aws_secret_access_key=bar + +[dev] +aws_access_key_id=foo2 +aws_secret_access_key=bar2 + +[prod] +aws_access_key_id=foo3 +aws_secret_access_key=bar3 +``` + +### `~/.aws/config` + +```ini +[default] +aws_access_key_id=foo +aws_secret_access_key=bar + +[profile dev] +aws_access_key_id=foo2 +aws_secret_access_key=bar2 + +[profile prod] +aws_access_key_id=foo3 +aws_secret_access_key=bar3 + +[profile "testing host"] +aws_access_key_id=foo4 +aws_secret_access_key=bar4 +``` diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getConfigFilepath.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getConfigFilepath.js new file mode 100644 index 0000000000..576670b3d8 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getConfigFilepath.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getConfigFilepath = exports.ENV_CONFIG_PATH = void 0; +const path_1 = require("path"); +const getHomeDir_1 = require("./getHomeDir"); +exports.ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; +const getConfigFilepath = () => process.env[exports.ENV_CONFIG_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "config"); +exports.getConfigFilepath = getConfigFilepath; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js new file mode 100644 index 0000000000..de9650b1b2 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getCredentialsFilepath = exports.ENV_CREDENTIALS_PATH = void 0; +const path_1 = require("path"); +const getHomeDir_1 = require("./getHomeDir"); +exports.ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; +const getCredentialsFilepath = () => process.env[exports.ENV_CREDENTIALS_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "credentials"); +exports.getCredentialsFilepath = getCredentialsFilepath; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getHomeDir.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getHomeDir.js new file mode 100644 index 0000000000..8528dd3fa9 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getHomeDir.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getHomeDir = void 0; +const os_1 = require("os"); +const path_1 = require("path"); +const getHomeDir = () => { + const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env; + if (HOME) + return HOME; + if (USERPROFILE) + return USERPROFILE; + if (HOMEPATH) + return `${HOMEDRIVE}${HOMEPATH}`; + return (0, os_1.homedir)(); +}; +exports.getHomeDir = getHomeDir; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getProfileData.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getProfileData.js new file mode 100644 index 0000000000..83fb9e6f9a --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getProfileData.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getProfileData = void 0; +const profileKeyRegex = /^profile\s(["'])?([^\1]+)\1$/; +const getProfileData = (data) => Object.entries(data) + .filter(([key]) => profileKeyRegex.test(key)) + .reduce((acc, [key, value]) => ({ ...acc, [profileKeyRegex.exec(key)[2]]: value }), { + ...(data.default && { default: data.default }), +}); +exports.getProfileData = getProfileData; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getProfileName.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getProfileName.js new file mode 100644 index 0000000000..a470ba0611 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getProfileName.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getProfileName = exports.DEFAULT_PROFILE = exports.ENV_PROFILE = void 0; +exports.ENV_PROFILE = "AWS_PROFILE"; +exports.DEFAULT_PROFILE = "default"; +const getProfileName = (init) => init.profile || process.env[exports.ENV_PROFILE] || exports.DEFAULT_PROFILE; +exports.getProfileName = getProfileName; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js new file mode 100644 index 0000000000..30d97b3d86 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSSOTokenFilepath = void 0; +const crypto_1 = require("crypto"); +const path_1 = require("path"); +const getHomeDir_1 = require("./getHomeDir"); +const getSSOTokenFilepath = (id) => { + const hasher = (0, crypto_1.createHash)("sha1"); + const cacheName = hasher.update(id).digest("hex"); + return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); +}; +exports.getSSOTokenFilepath = getSSOTokenFilepath; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js new file mode 100644 index 0000000000..688accb766 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSSOTokenFromFile = void 0; +const fs_1 = require("fs"); +const getSSOTokenFilepath_1 = require("./getSSOTokenFilepath"); +const { readFile } = fs_1.promises; +const getSSOTokenFromFile = async (id) => { + const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); + const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); + return JSON.parse(ssoTokenText); +}; +exports.getSSOTokenFromFile = getSSOTokenFromFile; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSsoSessionData.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSsoSessionData.js new file mode 100644 index 0000000000..f715e0f7aa --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/getSsoSessionData.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSsoSessionData = void 0; +const ssoSessionKeyRegex = /^sso-session\s(["'])?([^\1]+)\1$/; +const getSsoSessionData = (data) => Object.entries(data) + .filter(([key]) => ssoSessionKeyRegex.test(key)) + .reduce((acc, [key, value]) => ({ ...acc, [ssoSessionKeyRegex.exec(key)[2]]: value }), {}); +exports.getSsoSessionData = getSsoSessionData; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/index.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/index.js new file mode 100644 index 0000000000..952c6a6634 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./getHomeDir"), exports); +tslib_1.__exportStar(require("./getProfileName"), exports); +tslib_1.__exportStar(require("./getSSOTokenFilepath"), exports); +tslib_1.__exportStar(require("./getSSOTokenFromFile"), exports); +tslib_1.__exportStar(require("./loadSharedConfigFiles"), exports); +tslib_1.__exportStar(require("./loadSsoSessionData"), exports); +tslib_1.__exportStar(require("./parseKnownFiles"), exports); +tslib_1.__exportStar(require("./types"), exports); diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js new file mode 100644 index 0000000000..644a127ec3 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadSharedConfigFiles = void 0; +const getConfigFilepath_1 = require("./getConfigFilepath"); +const getCredentialsFilepath_1 = require("./getCredentialsFilepath"); +const getProfileData_1 = require("./getProfileData"); +const parseIni_1 = require("./parseIni"); +const slurpFile_1 = require("./slurpFile"); +const swallowError = () => ({}); +const loadSharedConfigFiles = async (init = {}) => { + const { filepath = (0, getCredentialsFilepath_1.getCredentialsFilepath)(), configFilepath = (0, getConfigFilepath_1.getConfigFilepath)() } = init; + const parsedFiles = await Promise.all([ + (0, slurpFile_1.slurpFile)(configFilepath).then(parseIni_1.parseIni).then(getProfileData_1.getProfileData).catch(swallowError), + (0, slurpFile_1.slurpFile)(filepath).then(parseIni_1.parseIni).catch(swallowError), + ]); + return { + configFile: parsedFiles[0], + credentialsFile: parsedFiles[1], + }; +}; +exports.loadSharedConfigFiles = loadSharedConfigFiles; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js new file mode 100644 index 0000000000..e201088afb --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadSsoSessionData = void 0; +const getConfigFilepath_1 = require("./getConfigFilepath"); +const getSsoSessionData_1 = require("./getSsoSessionData"); +const parseIni_1 = require("./parseIni"); +const slurpFile_1 = require("./slurpFile"); +const swallowError = () => ({}); +const loadSsoSessionData = async (init = {}) => { + var _a; + return (0, slurpFile_1.slurpFile)((_a = init.configFilepath) !== null && _a !== void 0 ? _a : (0, getConfigFilepath_1.getConfigFilepath)()) + .then(parseIni_1.parseIni) + .then(getSsoSessionData_1.getSsoSessionData) + .catch(swallowError); +}; +exports.loadSsoSessionData = loadSsoSessionData; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/parseIni.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/parseIni.js new file mode 100644 index 0000000000..9e772f7162 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/parseIni.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseIni = void 0; +const profileNameBlockList = ["__proto__", "profile __proto__"]; +const parseIni = (iniData) => { + const map = {}; + let currentSection; + for (let line of iniData.split(/\r?\n/)) { + line = line.split(/(^|\s)[;#]/)[0].trim(); + const isSection = line[0] === "[" && line[line.length - 1] === "]"; + if (isSection) { + currentSection = line.substring(1, line.length - 1); + if (profileNameBlockList.includes(currentSection)) { + throw new Error(`Found invalid profile name "${currentSection}"`); + } + } + else if (currentSection) { + const indexOfEqualsSign = line.indexOf("="); + const start = 0; + const end = line.length - 1; + const isAssignment = indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end; + if (isAssignment) { + const [name, value] = [ + line.substring(0, indexOfEqualsSign).trim(), + line.substring(indexOfEqualsSign + 1).trim(), + ]; + map[currentSection] = map[currentSection] || {}; + map[currentSection][name] = value; + } + } + } + return map; +}; +exports.parseIni = parseIni; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/parseKnownFiles.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/parseKnownFiles.js new file mode 100644 index 0000000000..b08d78f8d6 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/parseKnownFiles.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseKnownFiles = void 0; +const loadSharedConfigFiles_1 = require("./loadSharedConfigFiles"); +const parseKnownFiles = async (init) => { + const parsedFiles = await (0, loadSharedConfigFiles_1.loadSharedConfigFiles)(init); + return { + ...parsedFiles.configFile, + ...parsedFiles.credentialsFile, + }; +}; +exports.parseKnownFiles = parseKnownFiles; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/slurpFile.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/slurpFile.js new file mode 100644 index 0000000000..d6316324c2 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/slurpFile.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.slurpFile = void 0; +const fs_1 = require("fs"); +const { readFile } = fs_1.promises; +const filePromisesHash = {}; +const slurpFile = (path) => { + if (!filePromisesHash[path]) { + filePromisesHash[path] = readFile(path, "utf8"); + } + return filePromisesHash[path]; +}; +exports.slurpFile = slurpFile; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/types.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/types.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-cjs/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getConfigFilepath.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getConfigFilepath.js new file mode 100644 index 0000000000..ca07c2ddc9 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getConfigFilepath.js @@ -0,0 +1,4 @@ +import { join } from "path"; +import { getHomeDir } from "./getHomeDir"; +export const ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; +export const getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join(getHomeDir(), ".aws", "config"); diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getCredentialsFilepath.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getCredentialsFilepath.js new file mode 100644 index 0000000000..393c0ae529 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getCredentialsFilepath.js @@ -0,0 +1,4 @@ +import { join } from "path"; +import { getHomeDir } from "./getHomeDir"; +export const ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; +export const getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join(getHomeDir(), ".aws", "credentials"); diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getHomeDir.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getHomeDir.js new file mode 100644 index 0000000000..42dacb869c --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getHomeDir.js @@ -0,0 +1,12 @@ +import { homedir } from "os"; +import { sep } from "path"; +export const getHomeDir = () => { + const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${sep}` } = process.env; + if (HOME) + return HOME; + if (USERPROFILE) + return USERPROFILE; + if (HOMEPATH) + return `${HOMEDRIVE}${HOMEPATH}`; + return homedir(); +}; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getProfileData.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getProfileData.js new file mode 100644 index 0000000000..9b684ae3ab --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getProfileData.js @@ -0,0 +1,6 @@ +const profileKeyRegex = /^profile\s(["'])?([^\1]+)\1$/; +export const getProfileData = (data) => Object.entries(data) + .filter(([key]) => profileKeyRegex.test(key)) + .reduce((acc, [key, value]) => ({ ...acc, [profileKeyRegex.exec(key)[2]]: value }), { + ...(data.default && { default: data.default }), +}); diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getProfileName.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getProfileName.js new file mode 100644 index 0000000000..acc29f077f --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getProfileName.js @@ -0,0 +1,3 @@ +export const ENV_PROFILE = "AWS_PROFILE"; +export const DEFAULT_PROFILE = "default"; +export const getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js new file mode 100644 index 0000000000..a44b4ad70e --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js @@ -0,0 +1,8 @@ +import { createHash } from "crypto"; +import { join } from "path"; +import { getHomeDir } from "./getHomeDir"; +export const getSSOTokenFilepath = (id) => { + const hasher = createHash("sha1"); + const cacheName = hasher.update(id).digest("hex"); + return join(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`); +}; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js new file mode 100644 index 0000000000..42659dbdf8 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js @@ -0,0 +1,8 @@ +import { promises as fsPromises } from "fs"; +import { getSSOTokenFilepath } from "./getSSOTokenFilepath"; +const { readFile } = fsPromises; +export const getSSOTokenFromFile = async (id) => { + const ssoTokenFilepath = getSSOTokenFilepath(id); + const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); + return JSON.parse(ssoTokenText); +}; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSsoSessionData.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSsoSessionData.js new file mode 100644 index 0000000000..fb239276f0 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getSsoSessionData.js @@ -0,0 +1,4 @@ +const ssoSessionKeyRegex = /^sso-session\s(["'])?([^\1]+)\1$/; +export const getSsoSessionData = (data) => Object.entries(data) + .filter(([key]) => ssoSessionKeyRegex.test(key)) + .reduce((acc, [key, value]) => ({ ...acc, [ssoSessionKeyRegex.exec(key)[2]]: value }), {}); diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/index.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/index.js new file mode 100644 index 0000000000..3e8b2c7470 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/index.js @@ -0,0 +1,8 @@ +export * from "./getHomeDir"; +export * from "./getProfileName"; +export * from "./getSSOTokenFilepath"; +export * from "./getSSOTokenFromFile"; +export * from "./loadSharedConfigFiles"; +export * from "./loadSsoSessionData"; +export * from "./parseKnownFiles"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js new file mode 100644 index 0000000000..afe2420541 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js @@ -0,0 +1,17 @@ +import { getConfigFilepath } from "./getConfigFilepath"; +import { getCredentialsFilepath } from "./getCredentialsFilepath"; +import { getProfileData } from "./getProfileData"; +import { parseIni } from "./parseIni"; +import { slurpFile } from "./slurpFile"; +const swallowError = () => ({}); +export const loadSharedConfigFiles = async (init = {}) => { + const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; + const parsedFiles = await Promise.all([ + slurpFile(configFilepath).then(parseIni).then(getProfileData).catch(swallowError), + slurpFile(filepath).then(parseIni).catch(swallowError), + ]); + return { + configFile: parsedFiles[0], + credentialsFile: parsedFiles[1], + }; +}; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSsoSessionData.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSsoSessionData.js new file mode 100644 index 0000000000..3bd730b13d --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSsoSessionData.js @@ -0,0 +1,9 @@ +import { getConfigFilepath } from "./getConfigFilepath"; +import { getSsoSessionData } from "./getSsoSessionData"; +import { parseIni } from "./parseIni"; +import { slurpFile } from "./slurpFile"; +const swallowError = () => ({}); +export const loadSsoSessionData = async (init = {}) => slurpFile(init.configFilepath ?? getConfigFilepath()) + .then(parseIni) + .then(getSsoSessionData) + .catch(swallowError); diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/parseIni.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/parseIni.js new file mode 100644 index 0000000000..6b8fbfc8c7 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/parseIni.js @@ -0,0 +1,30 @@ +const profileNameBlockList = ["__proto__", "profile __proto__"]; +export const parseIni = (iniData) => { + const map = {}; + let currentSection; + for (let line of iniData.split(/\r?\n/)) { + line = line.split(/(^|\s)[;#]/)[0].trim(); + const isSection = line[0] === "[" && line[line.length - 1] === "]"; + if (isSection) { + currentSection = line.substring(1, line.length - 1); + if (profileNameBlockList.includes(currentSection)) { + throw new Error(`Found invalid profile name "${currentSection}"`); + } + } + else if (currentSection) { + const indexOfEqualsSign = line.indexOf("="); + const start = 0; + const end = line.length - 1; + const isAssignment = indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end; + if (isAssignment) { + const [name, value] = [ + line.substring(0, indexOfEqualsSign).trim(), + line.substring(indexOfEqualsSign + 1).trim(), + ]; + map[currentSection] = map[currentSection] || {}; + map[currentSection][name] = value; + } + } + } + return map; +}; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/parseKnownFiles.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/parseKnownFiles.js new file mode 100644 index 0000000000..6380d3f482 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/parseKnownFiles.js @@ -0,0 +1,8 @@ +import { loadSharedConfigFiles } from "./loadSharedConfigFiles"; +export const parseKnownFiles = async (init) => { + const parsedFiles = await loadSharedConfigFiles(init); + return { + ...parsedFiles.configFile, + ...parsedFiles.credentialsFile, + }; +}; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/slurpFile.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/slurpFile.js new file mode 100644 index 0000000000..1a6545a90d --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/slurpFile.js @@ -0,0 +1,9 @@ +import { promises as fsPromises } from "fs"; +const { readFile } = fsPromises; +const filePromisesHash = {}; +export const slurpFile = (path) => { + if (!filePromisesHash[path]) { + filePromisesHash[path] = readFile(path, "utf8"); + } + return filePromisesHash[path]; +}; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/types.js b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/types.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/types.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getConfigFilepath.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getConfigFilepath.d.ts new file mode 100644 index 0000000000..1d123bedd6 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getConfigFilepath.d.ts @@ -0,0 +1,2 @@ +export declare const ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; +export declare const getConfigFilepath: () => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getCredentialsFilepath.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getCredentialsFilepath.d.ts new file mode 100644 index 0000000000..26fda4a60f --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getCredentialsFilepath.d.ts @@ -0,0 +1,2 @@ +export declare const ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; +export declare const getCredentialsFilepath: () => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getHomeDir.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getHomeDir.d.ts new file mode 100644 index 0000000000..5d15bf1aec --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getHomeDir.d.ts @@ -0,0 +1,6 @@ +/** + * Get the HOME directory for the current runtime. + * + * @internal + */ +export declare const getHomeDir: () => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getProfileData.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getProfileData.d.ts new file mode 100644 index 0000000000..fd152362bc --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getProfileData.d.ts @@ -0,0 +1,7 @@ +import { ParsedIniData } from "@aws-sdk/types"; +/** + * Returns the profile data from parsed ini data. + * * Returns data for `default` + * * Reads profileName after profile prefix including/excluding quotes + */ +export declare const getProfileData: (data: ParsedIniData) => ParsedIniData; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getProfileName.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getProfileName.d.ts new file mode 100644 index 0000000000..0cccd920ca --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getProfileName.d.ts @@ -0,0 +1,5 @@ +export declare const ENV_PROFILE = "AWS_PROFILE"; +export declare const DEFAULT_PROFILE = "default"; +export declare const getProfileName: (init: { + profile?: string; +}) => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSSOTokenFilepath.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSSOTokenFilepath.d.ts new file mode 100644 index 0000000000..451303ddb6 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSSOTokenFilepath.d.ts @@ -0,0 +1,4 @@ +/** + * Returns the filepath of the file where SSO token is stored. + */ +export declare const getSSOTokenFilepath: (id: string) => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSSOTokenFromFile.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSSOTokenFromFile.d.ts new file mode 100644 index 0000000000..52064923d5 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSSOTokenFromFile.d.ts @@ -0,0 +1,44 @@ +/** + * Cached SSO token retrieved from SSO login flow. + */ +export interface SSOToken { + /** + * A base64 encoded string returned by the sso-oidc service. + */ + accessToken: string; + /** + * The expiration time of the accessToken as an RFC 3339 formatted timestamp. + */ + expiresAt: string; + /** + * The token used to obtain an access token in the event that the accessToken is invalid or expired. + */ + refreshToken?: string; + /** + * The unique identifier string for each client. The client ID generated when performing the registration + * portion of the OIDC authorization flow. This is used to refresh the accessToken. + */ + clientId?: string; + /** + * A secret string generated when performing the registration portion of the OIDC authorization flow. + * This is used to refresh the accessToken. + */ + clientSecret?: string; + /** + * The expiration time of the client registration (clientId and clientSecret) as an RFC 3339 formatted timestamp. + */ + registrationExpiresAt?: string; + /** + * The configured sso_region for the profile that credentials are being resolved for. + */ + region?: string; + /** + * The configured sso_start_url for the profile that credentials are being resolved for. + */ + startUrl?: string; +} +/** + * @param id - can be either a start URL or the SSO session name. + * Returns the SSO token from the file system. + */ +export declare const getSSOTokenFromFile: (id: string) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSsoSessionData.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSsoSessionData.d.ts new file mode 100644 index 0000000000..bac51158f2 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/getSsoSessionData.d.ts @@ -0,0 +1,6 @@ +import { ParsedIniData } from "@aws-sdk/types"; +/** + * Returns the sso-session data from parsed ini data by reading + * ssoSessionName after sso-session prefix including/excluding quotes + */ +export declare const getSsoSessionData: (data: ParsedIniData) => ParsedIniData; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/index.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/index.d.ts new file mode 100644 index 0000000000..3e8b2c7470 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/index.d.ts @@ -0,0 +1,8 @@ +export * from "./getHomeDir"; +export * from "./getProfileName"; +export * from "./getSSOTokenFilepath"; +export * from "./getSSOTokenFromFile"; +export * from "./loadSharedConfigFiles"; +export * from "./loadSsoSessionData"; +export * from "./parseKnownFiles"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/loadSharedConfigFiles.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/loadSharedConfigFiles.d.ts new file mode 100644 index 0000000000..d5b337c5be --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/loadSharedConfigFiles.d.ts @@ -0,0 +1,16 @@ +import { SharedConfigFiles } from "@aws-sdk/types"; +export interface SharedConfigInit { + /** + * The path at which to locate the ini credentials file. Defaults to the + * value of the `AWS_SHARED_CREDENTIALS_FILE` environment variable (if + * defined) or `~/.aws/credentials` otherwise. + */ + filepath?: string; + /** + * The path at which to locate the ini config file. Defaults to the value of + * the `AWS_CONFIG_FILE` environment variable (if defined) or + * `~/.aws/config` otherwise. + */ + configFilepath?: string; +} +export declare const loadSharedConfigFiles: (init?: SharedConfigInit) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/loadSsoSessionData.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/loadSsoSessionData.d.ts new file mode 100644 index 0000000000..8ec206ee75 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/loadSsoSessionData.d.ts @@ -0,0 +1,10 @@ +import { ParsedIniData } from "@aws-sdk/types"; +export interface SsoSessionInit { + /** + * The path at which to locate the ini config file. Defaults to the value of + * the `AWS_CONFIG_FILE` environment variable (if defined) or + * `~/.aws/config` otherwise. + */ + configFilepath?: string; +} +export declare const loadSsoSessionData: (init?: SsoSessionInit) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/parseIni.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/parseIni.d.ts new file mode 100644 index 0000000000..bb1ae2e052 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/parseIni.d.ts @@ -0,0 +1,2 @@ +import { ParsedIniData } from "@aws-sdk/types"; +export declare const parseIni: (iniData: string) => ParsedIniData; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/parseKnownFiles.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/parseKnownFiles.d.ts new file mode 100644 index 0000000000..06cdb3117b --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/parseKnownFiles.d.ts @@ -0,0 +1,15 @@ +import { ParsedIniData } from "@aws-sdk/types"; +import { SharedConfigInit } from "./loadSharedConfigFiles"; +export interface SourceProfileInit extends SharedConfigInit { + /** + * The configuration profile to use. + */ + profile?: string; +} +/** + * Load profiles from credentials and config INI files and normalize them into a + * single profile list. + * + * @internal + */ +export declare const parseKnownFiles: (init: SourceProfileInit) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/slurpFile.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/slurpFile.d.ts new file mode 100644 index 0000000000..cdb8139f12 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/slurpFile.d.ts @@ -0,0 +1 @@ +export declare const slurpFile: (path: string) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getConfigFilepath.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getConfigFilepath.d.ts new file mode 100644 index 0000000000..1d123bedd6 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getConfigFilepath.d.ts @@ -0,0 +1,2 @@ +export declare const ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; +export declare const getConfigFilepath: () => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getCredentialsFilepath.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getCredentialsFilepath.d.ts new file mode 100644 index 0000000000..26fda4a60f --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getCredentialsFilepath.d.ts @@ -0,0 +1,2 @@ +export declare const ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; +export declare const getCredentialsFilepath: () => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getHomeDir.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getHomeDir.d.ts new file mode 100644 index 0000000000..9a396f222d --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getHomeDir.d.ts @@ -0,0 +1 @@ +export declare const getHomeDir: () => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getProfileData.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getProfileData.d.ts new file mode 100644 index 0000000000..e8f417b7b2 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getProfileData.d.ts @@ -0,0 +1,2 @@ +import { ParsedIniData } from "@aws-sdk/types"; +export declare const getProfileData: (data: ParsedIniData) => ParsedIniData; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getProfileName.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getProfileName.d.ts new file mode 100644 index 0000000000..4fcc36577e --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getProfileName.d.ts @@ -0,0 +1,3 @@ +export declare const ENV_PROFILE = "AWS_PROFILE"; +export declare const DEFAULT_PROFILE = "default"; +export declare const getProfileName: (init: { profile?: string }) => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFilepath.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFilepath.d.ts new file mode 100644 index 0000000000..8d4107069b --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFilepath.d.ts @@ -0,0 +1 @@ +export declare const getSSOTokenFilepath: (id: string) => string; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFromFile.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFromFile.d.ts new file mode 100644 index 0000000000..660b2b3b8d --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFromFile.d.ts @@ -0,0 +1,11 @@ +export interface SSOToken { + accessToken: string; + expiresAt: string; + refreshToken?: string; + clientId?: string; + clientSecret?: string; + registrationExpiresAt?: string; + region?: string; + startUrl?: string; +} +export declare const getSSOTokenFromFile: (id: string) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSsoSessionData.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSsoSessionData.d.ts new file mode 100644 index 0000000000..60ff003853 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/getSsoSessionData.d.ts @@ -0,0 +1,2 @@ +import { ParsedIniData } from "@aws-sdk/types"; +export declare const getSsoSessionData: (data: ParsedIniData) => ParsedIniData; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..3e8b2c7470 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/index.d.ts @@ -0,0 +1,8 @@ +export * from "./getHomeDir"; +export * from "./getProfileName"; +export * from "./getSSOTokenFilepath"; +export * from "./getSSOTokenFromFile"; +export * from "./loadSharedConfigFiles"; +export * from "./loadSsoSessionData"; +export * from "./parseKnownFiles"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/loadSharedConfigFiles.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/loadSharedConfigFiles.d.ts new file mode 100644 index 0000000000..37ab9f5b8c --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/loadSharedConfigFiles.d.ts @@ -0,0 +1,8 @@ +import { SharedConfigFiles } from "@aws-sdk/types"; +export interface SharedConfigInit { + filepath?: string; + configFilepath?: string; +} +export declare const loadSharedConfigFiles: ( + init?: SharedConfigInit +) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/loadSsoSessionData.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/loadSsoSessionData.d.ts new file mode 100644 index 0000000000..edaf6c833c --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/loadSsoSessionData.d.ts @@ -0,0 +1,7 @@ +import { ParsedIniData } from "@aws-sdk/types"; +export interface SsoSessionInit { + configFilepath?: string; +} +export declare const loadSsoSessionData: ( + init?: SsoSessionInit +) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/parseIni.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/parseIni.d.ts new file mode 100644 index 0000000000..bb1ae2e052 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/parseIni.d.ts @@ -0,0 +1,2 @@ +import { ParsedIniData } from "@aws-sdk/types"; +export declare const parseIni: (iniData: string) => ParsedIniData; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/parseKnownFiles.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/parseKnownFiles.d.ts new file mode 100644 index 0000000000..69e6413b7f --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/parseKnownFiles.d.ts @@ -0,0 +1,8 @@ +import { ParsedIniData } from "@aws-sdk/types"; +import { SharedConfigInit } from "./loadSharedConfigFiles"; +export interface SourceProfileInit extends SharedConfigInit { + profile?: string; +} +export declare const parseKnownFiles: ( + init: SourceProfileInit +) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/slurpFile.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/slurpFile.d.ts new file mode 100644 index 0000000000..cdb8139f12 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/slurpFile.d.ts @@ -0,0 +1 @@ +export declare const slurpFile: (path: string) => Promise; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/types.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/types.d.ts new file mode 100644 index 0000000000..c4f1712135 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/ts3.4/types.d.ts @@ -0,0 +1,8 @@ +import { + ParsedIniData as __ParsedIniData, + Profile as __Profile, + SharedConfigFiles as __SharedConfigFiles, +} from "@aws-sdk/types"; +export declare type Profile = __Profile; +export declare type ParsedIniData = __ParsedIniData; +export declare type SharedConfigFiles = __SharedConfigFiles; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/types.d.ts b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/types.d.ts new file mode 100644 index 0000000000..68b55ab2a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/dist-types/types.d.ts @@ -0,0 +1,13 @@ +import { ParsedIniData as __ParsedIniData, Profile as __Profile, SharedConfigFiles as __SharedConfigFiles } from "@aws-sdk/types"; +/** + * @deprecated Use Profile from "@aws-sdk/types" instead + */ +export declare type Profile = __Profile; +/** + * @deprecated Use ParsedIniData from "@aws-sdk/types" instead + */ +export declare type ParsedIniData = __ParsedIniData; +/** + * @deprecated Use SharedConfigFiles from "@aws-sdk/types" instead + */ +export declare type SharedConfigFiles = __SharedConfigFiles; diff --git a/server/node_modules/@aws-sdk/shared-ini-file-loader/package.json b/server/node_modules/@aws-sdk/shared-ini-file-loader/package.json new file mode 100644 index 0000000000..c17f6c2bec --- /dev/null +++ b/server/node_modules/@aws-sdk/shared-ini-file-loader/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/shared-ini-file-loader", + "version": "3.257.0", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/shared-ini-file-loader", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/shared-ini-file-loader" + } +} diff --git a/server/node_modules/@aws-sdk/signature-v4/LICENSE b/server/node_modules/@aws-sdk/signature-v4/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/signature-v4/README.md b/server/node_modules/@aws-sdk/signature-v4/README.md new file mode 100644 index 0000000000..7409e6db43 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/signature-v4 + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/signature-v4/latest.svg)](https://www.npmjs.com/package/@aws-sdk/signature-v4) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/signature-v4.svg)](https://www.npmjs.com/package/@aws-sdk/signature-v4) diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/SignatureV4.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/SignatureV4.js new file mode 100644 index 0000000000..7f65ebcff0 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/SignatureV4.js @@ -0,0 +1,175 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SignatureV4 = void 0; +const util_hex_encoding_1 = require("@aws-sdk/util-hex-encoding"); +const util_middleware_1 = require("@aws-sdk/util-middleware"); +const util_utf8_1 = require("@aws-sdk/util-utf8"); +const constants_1 = require("./constants"); +const credentialDerivation_1 = require("./credentialDerivation"); +const getCanonicalHeaders_1 = require("./getCanonicalHeaders"); +const getCanonicalQuery_1 = require("./getCanonicalQuery"); +const getPayloadHash_1 = require("./getPayloadHash"); +const headerUtil_1 = require("./headerUtil"); +const moveHeadersToQuery_1 = require("./moveHeadersToQuery"); +const prepareRequest_1 = require("./prepareRequest"); +const utilDate_1 = require("./utilDate"); +class SignatureV4 { + constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { + this.service = service; + this.sha256 = sha256; + this.uriEscapePath = uriEscapePath; + this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; + this.regionProvider = (0, util_middleware_1.normalizeProvider)(region); + this.credentialProvider = (0, util_middleware_1.normalizeProvider)(credentials); + } + async presign(originalRequest, options = {}) { + const { signingDate = new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, signingRegion, signingService, } = options; + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); + const { longDate, shortDate } = formatDate(signingDate); + if (expiresIn > constants_1.MAX_PRESIGNED_TTL) { + return Promise.reject("Signature version 4 presigned URLs" + " must have an expiration date less than one week in" + " the future"); + } + const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); + const request = (0, moveHeadersToQuery_1.moveHeadersToQuery)((0, prepareRequest_1.prepareRequest)(originalRequest), { unhoistableHeaders }); + if (credentials.sessionToken) { + request.query[constants_1.TOKEN_QUERY_PARAM] = credentials.sessionToken; + } + request.query[constants_1.ALGORITHM_QUERY_PARAM] = constants_1.ALGORITHM_IDENTIFIER; + request.query[constants_1.CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; + request.query[constants_1.AMZ_DATE_QUERY_PARAM] = longDate; + request.query[constants_1.EXPIRES_QUERY_PARAM] = expiresIn.toString(10); + const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); + request.query[constants_1.SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); + request.query[constants_1.SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await (0, getPayloadHash_1.getPayloadHash)(originalRequest, this.sha256))); + return request; + } + async sign(toSign, options) { + if (typeof toSign === "string") { + return this.signString(toSign, options); + } + else if (toSign.headers && toSign.payload) { + return this.signEvent(toSign, options); + } + else { + return this.signRequest(toSign, options); + } + } + async signEvent({ headers, payload }, { signingDate = new Date(), priorSignature, signingRegion, signingService }) { + const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); + const { shortDate, longDate } = formatDate(signingDate); + const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); + const hashedPayload = await (0, getPayloadHash_1.getPayloadHash)({ headers: {}, body: payload }, this.sha256); + const hash = new this.sha256(); + hash.update(headers); + const hashedHeaders = (0, util_hex_encoding_1.toHex)(await hash.digest()); + const stringToSign = [ + constants_1.EVENT_ALGORITHM_IDENTIFIER, + longDate, + scope, + priorSignature, + hashedHeaders, + hashedPayload, + ].join("\n"); + return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); + } + async signString(stringToSign, { signingDate = new Date(), signingRegion, signingService } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); + const { shortDate } = formatDate(signingDate); + const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); + hash.update((0, util_utf8_1.toUint8Array)(stringToSign)); + return (0, util_hex_encoding_1.toHex)(await hash.digest()); + } + async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); + const request = (0, prepareRequest_1.prepareRequest)(requestToSign); + const { longDate, shortDate } = formatDate(signingDate); + const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); + request.headers[constants_1.AMZ_DATE_HEADER] = longDate; + if (credentials.sessionToken) { + request.headers[constants_1.TOKEN_HEADER] = credentials.sessionToken; + } + const payloadHash = await (0, getPayloadHash_1.getPayloadHash)(request, this.sha256); + if (!(0, headerUtil_1.hasHeader)(constants_1.SHA256_HEADER, request.headers) && this.applyChecksum) { + request.headers[constants_1.SHA256_HEADER] = payloadHash; + } + const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); + const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); + request.headers[constants_1.AUTH_HEADER] = + `${constants_1.ALGORITHM_IDENTIFIER} ` + + `Credential=${credentials.accessKeyId}/${scope}, ` + + `SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, ` + + `Signature=${signature}`; + return request; + } + createCanonicalRequest(request, canonicalHeaders, payloadHash) { + const sortedHeaders = Object.keys(canonicalHeaders).sort(); + return `${request.method} +${this.getCanonicalPath(request)} +${(0, getCanonicalQuery_1.getCanonicalQuery)(request)} +${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} + +${sortedHeaders.join(";")} +${payloadHash}`; + } + async createStringToSign(longDate, credentialScope, canonicalRequest) { + const hash = new this.sha256(); + hash.update((0, util_utf8_1.toUint8Array)(canonicalRequest)); + const hashedRequest = await hash.digest(); + return `${constants_1.ALGORITHM_IDENTIFIER} +${longDate} +${credentialScope} +${(0, util_hex_encoding_1.toHex)(hashedRequest)}`; + } + getCanonicalPath({ path }) { + if (this.uriEscapePath) { + const normalizedPathSegments = []; + for (const pathSegment of path.split("/")) { + if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0) + continue; + if (pathSegment === ".") + continue; + if (pathSegment === "..") { + normalizedPathSegments.pop(); + } + else { + normalizedPathSegments.push(pathSegment); + } + } + const normalizedPath = `${(path === null || path === void 0 ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path === null || path === void 0 ? void 0 : path.endsWith("/")) ? "/" : ""}`; + const doubleEncoded = encodeURIComponent(normalizedPath); + return doubleEncoded.replace(/%2F/g, "/"); + } + return path; + } + async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { + const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); + const hash = new this.sha256(await keyPromise); + hash.update((0, util_utf8_1.toUint8Array)(stringToSign)); + return (0, util_hex_encoding_1.toHex)(await hash.digest()); + } + getSigningKey(credentials, region, shortDate, service) { + return (0, credentialDerivation_1.getSigningKey)(this.sha256, credentials, shortDate, region, service || this.service); + } + validateResolvedCredentials(credentials) { + if (typeof credentials !== "object" || + typeof credentials.accessKeyId !== "string" || + typeof credentials.secretAccessKey !== "string") { + throw new Error("Resolved credential object is not valid"); + } + } +} +exports.SignatureV4 = SignatureV4; +const formatDate = (now) => { + const longDate = (0, utilDate_1.iso8601)(now).replace(/[\-:]/g, ""); + return { + longDate, + shortDate: longDate.slice(0, 8), + }; +}; +const getCanonicalHeaderList = (headers) => Object.keys(headers).sort().join(";"); diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/cloneRequest.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/cloneRequest.js new file mode 100644 index 0000000000..b562c5abff --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/cloneRequest.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.cloneQuery = exports.cloneRequest = void 0; +const cloneRequest = ({ headers, query, ...rest }) => ({ + ...rest, + headers: { ...headers }, + query: query ? (0, exports.cloneQuery)(query) : undefined, +}); +exports.cloneRequest = cloneRequest; +const cloneQuery = (query) => Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param, + }; +}, {}); +exports.cloneQuery = cloneQuery; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/constants.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/constants.js new file mode 100644 index 0000000000..5ac2966ec9 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/constants.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MAX_PRESIGNED_TTL = exports.KEY_TYPE_IDENTIFIER = exports.MAX_CACHE_SIZE = exports.UNSIGNED_PAYLOAD = exports.EVENT_ALGORITHM_IDENTIFIER = exports.ALGORITHM_IDENTIFIER_V4A = exports.ALGORITHM_IDENTIFIER = exports.UNSIGNABLE_PATTERNS = exports.SEC_HEADER_PATTERN = exports.PROXY_HEADER_PATTERN = exports.ALWAYS_UNSIGNABLE_HEADERS = exports.HOST_HEADER = exports.TOKEN_HEADER = exports.SHA256_HEADER = exports.SIGNATURE_HEADER = exports.GENERATED_HEADERS = exports.DATE_HEADER = exports.AMZ_DATE_HEADER = exports.AUTH_HEADER = exports.REGION_SET_PARAM = exports.TOKEN_QUERY_PARAM = exports.SIGNATURE_QUERY_PARAM = exports.EXPIRES_QUERY_PARAM = exports.SIGNED_HEADERS_QUERY_PARAM = exports.AMZ_DATE_QUERY_PARAM = exports.CREDENTIAL_QUERY_PARAM = exports.ALGORITHM_QUERY_PARAM = void 0; +exports.ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; +exports.CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; +exports.AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; +exports.SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; +exports.EXPIRES_QUERY_PARAM = "X-Amz-Expires"; +exports.SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; +exports.TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; +exports.REGION_SET_PARAM = "X-Amz-Region-Set"; +exports.AUTH_HEADER = "authorization"; +exports.AMZ_DATE_HEADER = exports.AMZ_DATE_QUERY_PARAM.toLowerCase(); +exports.DATE_HEADER = "date"; +exports.GENERATED_HEADERS = [exports.AUTH_HEADER, exports.AMZ_DATE_HEADER, exports.DATE_HEADER]; +exports.SIGNATURE_HEADER = exports.SIGNATURE_QUERY_PARAM.toLowerCase(); +exports.SHA256_HEADER = "x-amz-content-sha256"; +exports.TOKEN_HEADER = exports.TOKEN_QUERY_PARAM.toLowerCase(); +exports.HOST_HEADER = "host"; +exports.ALWAYS_UNSIGNABLE_HEADERS = { + authorization: true, + "cache-control": true, + connection: true, + expect: true, + from: true, + "keep-alive": true, + "max-forwards": true, + pragma: true, + referer: true, + te: true, + trailer: true, + "transfer-encoding": true, + upgrade: true, + "user-agent": true, + "x-amzn-trace-id": true, +}; +exports.PROXY_HEADER_PATTERN = /^proxy-/; +exports.SEC_HEADER_PATTERN = /^sec-/; +exports.UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; +exports.ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; +exports.ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; +exports.EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; +exports.UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; +exports.MAX_CACHE_SIZE = 50; +exports.KEY_TYPE_IDENTIFIER = "aws4_request"; +exports.MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/credentialDerivation.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/credentialDerivation.js new file mode 100644 index 0000000000..eb28c9cdcf --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/credentialDerivation.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clearCredentialCache = exports.getSigningKey = exports.createScope = void 0; +const util_hex_encoding_1 = require("@aws-sdk/util-hex-encoding"); +const util_utf8_1 = require("@aws-sdk/util-utf8"); +const constants_1 = require("./constants"); +const signingKeyCache = {}; +const cacheQueue = []; +const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${constants_1.KEY_TYPE_IDENTIFIER}`; +exports.createScope = createScope; +const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { + const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); + const cacheKey = `${shortDate}:${region}:${service}:${(0, util_hex_encoding_1.toHex)(credsHash)}:${credentials.sessionToken}`; + if (cacheKey in signingKeyCache) { + return signingKeyCache[cacheKey]; + } + cacheQueue.push(cacheKey); + while (cacheQueue.length > constants_1.MAX_CACHE_SIZE) { + delete signingKeyCache[cacheQueue.shift()]; + } + let key = `AWS4${credentials.secretAccessKey}`; + for (const signable of [shortDate, region, service, constants_1.KEY_TYPE_IDENTIFIER]) { + key = await hmac(sha256Constructor, key, signable); + } + return (signingKeyCache[cacheKey] = key); +}; +exports.getSigningKey = getSigningKey; +const clearCredentialCache = () => { + cacheQueue.length = 0; + Object.keys(signingKeyCache).forEach((cacheKey) => { + delete signingKeyCache[cacheKey]; + }); +}; +exports.clearCredentialCache = clearCredentialCache; +const hmac = (ctor, secret, data) => { + const hash = new ctor(secret); + hash.update((0, util_utf8_1.toUint8Array)(data)); + return hash.digest(); +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/getCanonicalHeaders.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/getCanonicalHeaders.js new file mode 100644 index 0000000000..d34763c5d3 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/getCanonicalHeaders.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getCanonicalHeaders = void 0; +const constants_1 = require("./constants"); +const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => { + const canonical = {}; + for (const headerName of Object.keys(headers).sort()) { + if (headers[headerName] == undefined) { + continue; + } + const canonicalHeaderName = headerName.toLowerCase(); + if (canonicalHeaderName in constants_1.ALWAYS_UNSIGNABLE_HEADERS || + (unsignableHeaders === null || unsignableHeaders === void 0 ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || + constants_1.PROXY_HEADER_PATTERN.test(canonicalHeaderName) || + constants_1.SEC_HEADER_PATTERN.test(canonicalHeaderName)) { + if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) { + continue; + } + } + canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); + } + return canonical; +}; +exports.getCanonicalHeaders = getCanonicalHeaders; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/getCanonicalQuery.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/getCanonicalQuery.js new file mode 100644 index 0000000000..e812715a01 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/getCanonicalQuery.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getCanonicalQuery = void 0; +const util_uri_escape_1 = require("@aws-sdk/util-uri-escape"); +const constants_1 = require("./constants"); +const getCanonicalQuery = ({ query = {} }) => { + const keys = []; + const serialized = {}; + for (const key of Object.keys(query).sort()) { + if (key.toLowerCase() === constants_1.SIGNATURE_HEADER) { + continue; + } + keys.push(key); + const value = query[key]; + if (typeof value === "string") { + serialized[key] = `${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`; + } + else if (Array.isArray(value)) { + serialized[key] = value + .slice(0) + .sort() + .reduce((encoded, value) => encoded.concat([`${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`]), []) + .join("&"); + } + } + return keys + .map((key) => serialized[key]) + .filter((serialized) => serialized) + .join("&"); +}; +exports.getCanonicalQuery = getCanonicalQuery; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/getPayloadHash.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/getPayloadHash.js new file mode 100644 index 0000000000..dd6b80a5c8 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/getPayloadHash.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getPayloadHash = void 0; +const is_array_buffer_1 = require("@aws-sdk/is-array-buffer"); +const util_hex_encoding_1 = require("@aws-sdk/util-hex-encoding"); +const util_utf8_1 = require("@aws-sdk/util-utf8"); +const constants_1 = require("./constants"); +const getPayloadHash = async ({ headers, body }, hashConstructor) => { + for (const headerName of Object.keys(headers)) { + if (headerName.toLowerCase() === constants_1.SHA256_HEADER) { + return headers[headerName]; + } + } + if (body == undefined) { + return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + } + else if (typeof body === "string" || ArrayBuffer.isView(body) || (0, is_array_buffer_1.isArrayBuffer)(body)) { + const hashCtor = new hashConstructor(); + hashCtor.update((0, util_utf8_1.toUint8Array)(body)); + return (0, util_hex_encoding_1.toHex)(await hashCtor.digest()); + } + return constants_1.UNSIGNED_PAYLOAD; +}; +exports.getPayloadHash = getPayloadHash; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/headerUtil.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/headerUtil.js new file mode 100644 index 0000000000..c3b08b226e --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/headerUtil.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deleteHeader = exports.getHeaderValue = exports.hasHeader = void 0; +const hasHeader = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; + } + } + return false; +}; +exports.hasHeader = hasHeader; +const getHeaderValue = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return headers[headerName]; + } + } + return undefined; +}; +exports.getHeaderValue = getHeaderValue; +const deleteHeader = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + delete headers[headerName]; + } + } +}; +exports.deleteHeader = deleteHeader; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/index.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/index.js new file mode 100644 index 0000000000..e554d4a276 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/index.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.prepareRequest = exports.moveHeadersToQuery = exports.getPayloadHash = exports.getCanonicalQuery = exports.getCanonicalHeaders = void 0; +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./SignatureV4"), exports); +var getCanonicalHeaders_1 = require("./getCanonicalHeaders"); +Object.defineProperty(exports, "getCanonicalHeaders", { enumerable: true, get: function () { return getCanonicalHeaders_1.getCanonicalHeaders; } }); +var getCanonicalQuery_1 = require("./getCanonicalQuery"); +Object.defineProperty(exports, "getCanonicalQuery", { enumerable: true, get: function () { return getCanonicalQuery_1.getCanonicalQuery; } }); +var getPayloadHash_1 = require("./getPayloadHash"); +Object.defineProperty(exports, "getPayloadHash", { enumerable: true, get: function () { return getPayloadHash_1.getPayloadHash; } }); +var moveHeadersToQuery_1 = require("./moveHeadersToQuery"); +Object.defineProperty(exports, "moveHeadersToQuery", { enumerable: true, get: function () { return moveHeadersToQuery_1.moveHeadersToQuery; } }); +var prepareRequest_1 = require("./prepareRequest"); +Object.defineProperty(exports, "prepareRequest", { enumerable: true, get: function () { return prepareRequest_1.prepareRequest; } }); +tslib_1.__exportStar(require("./credentialDerivation"), exports); diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/moveHeadersToQuery.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/moveHeadersToQuery.js new file mode 100644 index 0000000000..66c1e0a0f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/moveHeadersToQuery.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.moveHeadersToQuery = void 0; +const cloneRequest_1 = require("./cloneRequest"); +const moveHeadersToQuery = (request, options = {}) => { + var _a; + const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); + for (const name of Object.keys(headers)) { + const lname = name.toLowerCase(); + if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) === null || _a === void 0 ? void 0 : _a.has(lname))) { + query[name] = headers[name]; + delete headers[name]; + } + } + return { + ...request, + headers, + query, + }; +}; +exports.moveHeadersToQuery = moveHeadersToQuery; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/prepareRequest.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/prepareRequest.js new file mode 100644 index 0000000000..b24ca5e490 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/prepareRequest.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.prepareRequest = void 0; +const cloneRequest_1 = require("./cloneRequest"); +const constants_1 = require("./constants"); +const prepareRequest = (request) => { + request = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); + for (const headerName of Object.keys(request.headers)) { + if (constants_1.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { + delete request.headers[headerName]; + } + } + return request; +}; +exports.prepareRequest = prepareRequest; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/suite.fixture.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/suite.fixture.js new file mode 100644 index 0000000000..23d3134584 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/suite.fixture.js @@ -0,0 +1,402 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.requests = exports.signingDate = exports.credentials = exports.service = exports.region = void 0; +exports.region = "us-east-1"; +exports.service = "service"; +exports.credentials = { + accessKeyId: "AKIDEXAMPLE", + secretAccessKey: "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY", +}; +exports.signingDate = new Date("2015-08-30T12:36:00Z"); +exports.requests = [ + { + name: "get-header-key-duplicate", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value2,value2,value1", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=c9d5ea9f3f72853aea855b47ea873832890dbdd183b4468f858259531a5138ea", + }, + { + name: "get-header-value-multiline", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value1,value2,value3", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=ba17b383a53190154eb5fa66a1b836cc297cc0a3d70a5d00705980573d8ff790", + }, + { + name: "get-header-value-order", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value4,value1,value3,value2", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=08c7e5a9acfcfeb3ab6b2185e75ce8b1deb5e634ec47601a50643f830c755c01", + }, + { + name: "get-header-value-trim", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value1", + "my-header2": '"a b c"', + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;my-header2;x-amz-date, Signature=acc3ed3afb60bb290fc8d2dd0098b9911fcaa05412b367055dee359757a9c736", + }, + { + name: "get-unreserved", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=07ef7494c76fa4850883e2b006601f940f8a34d404d0cfa977f52a65bbf5f24f", + }, + { + name: "get-utf8", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/ሴ", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=8318018e0b0f223aa2bbf98705b62bb787dc9c0e678f255a891fd03141be5d85", + }, + { + name: "get-vanilla", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31", + }, + { + name: "get-vanilla-empty-query-key", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: { + Param1: "value1", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=a67d582fa61cc504c4bae71f336f98b97f1ea3c7a6bfe1b6e45aec72011b9aeb", + }, + { + name: "get-vanilla-query", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31", + }, + { + name: "get-vanilla-query-order-key-case", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: { + Param2: "value2", + Param1: "value1", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=b97d918cfa904a5beff61c982a1b6f458b799221646efd99d3219ec94cdf2500", + }, + { + name: "get-vanilla-query-unreserved", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: { + "-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz": "-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=9c3e54bfcdf0b19771a7f523ee5669cdf59bc7cc0884027167c21bb143a40197", + }, + { + name: "get-vanilla-utf8-query", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: { + ሴ: "bar", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=2cdec8eed098649ff3a119c94853b13c643bcf08f8b0a1d91e12c9027818dd04", + }, + { + name: "post-header-key-case", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b", + }, + { + name: "post-header-key-sort", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value1", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=c5410059b04c1ee005303aed430f6e6645f61f4dc9e1461ec8f8916fdf18852c", + }, + { + name: "post-header-value-case", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "VALUE1", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=cdbc9802e29d2942e5e10b5bccfdd67c5f22c7c4e8ae67b53629efa58b974b7d", + }, + { + name: "post-sts-header-after", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b", + }, + { + name: "post-sts-header-before", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + "x-amz-security-token": "AQoDYXdzEPT//////////wEXAMPLEtc764bNrC9SAPBSM22wDOk4x4HIZ8j4FZTwdQWLWsKWHGBuFqwAeMicRXmxfpSPfIeoIYRqTflfKD8YUuwthAx7mSEI/qkPpKPi/kMcGdQrmGdeehM4IC1NtBmUpp2wUE8phUZampKsburEDy0KPkyQDYwT7WZ0wq5VSXDvp75YU9HFvlRd8Tx6q6fE8YQcHNVXAkiY9q6d+xo0rKwT38xVqr7ZD0u0iPPkUL64lIZbqBAz+scqKmlzm8FDrypNC9Yjc8fPOLn9FX9KSYvKTr4rvx3iSIlTJabIQwj2ICCR/oLxBA==", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=85d96828115b5dc0cfc3bd16ad9e210dd772bbebba041836c64533a82be05ead", + }, + { + name: "post-vanilla", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b", + }, + { + name: "post-vanilla-empty-query-value", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: { + Param1: "value1", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=28038455d6de14eafc1f9222cf5aa6f1a96197d7deb8263271d420d138af7f11", + }, + { + name: "post-vanilla-query", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: { + Param1: "value1", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=28038455d6de14eafc1f9222cf5aa6f1a96197d7deb8263271d420d138af7f11", + }, + { + name: "post-vanilla-query-nonunreserved", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: { + "@#$%^": "", + "+": '/,?><`";:\\|][{}', + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=66c82657c86e26fb25238d0e69f011edc4c6df5ae71119d7cb98ed9b87393c1e", + }, + { + name: "post-vanilla-query-space", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: { + p: "", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=e71688addb58a26418614085fb730ba3faa623b461c17f48f2fbdb9361b94a9b", + }, + { + name: "post-x-www-form-urlencoded", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + "content-type": "application/x-www-form-urlencoded", + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + body: "Param1=value1", + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=ff11897932ad3f4e8b18135d722051e5ac45fc38421b1da7b9d196a0fe09473a", + }, + { + name: "post-x-www-form-urlencoded-parameters", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + "content-type": "application/x-www-form-urlencoded; charset=utf8", + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + body: "Param1=value1", + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=1a72ec8f64bd914b0e42e42607c7fbce7fb2c7465f63e3092b3b0d39fa77a6fe", + }, +]; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-cjs/utilDate.js b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/utilDate.js new file mode 100644 index 0000000000..83b0d9434a --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-cjs/utilDate.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toDate = exports.iso8601 = void 0; +const iso8601 = (time) => (0, exports.toDate)(time) + .toISOString() + .replace(/\.\d{3}Z$/, "Z"); +exports.iso8601 = iso8601; +const toDate = (time) => { + if (typeof time === "number") { + return new Date(time * 1000); + } + if (typeof time === "string") { + if (Number(time)) { + return new Date(Number(time) * 1000); + } + return new Date(time); + } + return time; +}; +exports.toDate = toDate; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/SignatureV4.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/SignatureV4.js new file mode 100644 index 0000000000..017e3e0745 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/SignatureV4.js @@ -0,0 +1,171 @@ +import { toHex } from "@aws-sdk/util-hex-encoding"; +import { normalizeProvider } from "@aws-sdk/util-middleware"; +import { toUint8Array } from "@aws-sdk/util-utf8"; +import { ALGORITHM_IDENTIFIER, ALGORITHM_QUERY_PARAM, AMZ_DATE_HEADER, AMZ_DATE_QUERY_PARAM, AUTH_HEADER, CREDENTIAL_QUERY_PARAM, EVENT_ALGORITHM_IDENTIFIER, EXPIRES_QUERY_PARAM, MAX_PRESIGNED_TTL, SHA256_HEADER, SIGNATURE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, TOKEN_HEADER, TOKEN_QUERY_PARAM, } from "./constants"; +import { createScope, getSigningKey } from "./credentialDerivation"; +import { getCanonicalHeaders } from "./getCanonicalHeaders"; +import { getCanonicalQuery } from "./getCanonicalQuery"; +import { getPayloadHash } from "./getPayloadHash"; +import { hasHeader } from "./headerUtil"; +import { moveHeadersToQuery } from "./moveHeadersToQuery"; +import { prepareRequest } from "./prepareRequest"; +import { iso8601 } from "./utilDate"; +export class SignatureV4 { + constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { + this.service = service; + this.sha256 = sha256; + this.uriEscapePath = uriEscapePath; + this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; + this.regionProvider = normalizeProvider(region); + this.credentialProvider = normalizeProvider(credentials); + } + async presign(originalRequest, options = {}) { + const { signingDate = new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, signingRegion, signingService, } = options; + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? (await this.regionProvider()); + const { longDate, shortDate } = formatDate(signingDate); + if (expiresIn > MAX_PRESIGNED_TTL) { + return Promise.reject("Signature version 4 presigned URLs" + " must have an expiration date less than one week in" + " the future"); + } + const scope = createScope(shortDate, region, signingService ?? this.service); + const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders }); + if (credentials.sessionToken) { + request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; + } + request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; + request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; + request.query[AMZ_DATE_QUERY_PARAM] = longDate; + request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); + const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); + request.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); + request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); + return request; + } + async sign(toSign, options) { + if (typeof toSign === "string") { + return this.signString(toSign, options); + } + else if (toSign.headers && toSign.payload) { + return this.signEvent(toSign, options); + } + else { + return this.signRequest(toSign, options); + } + } + async signEvent({ headers, payload }, { signingDate = new Date(), priorSignature, signingRegion, signingService }) { + const region = signingRegion ?? (await this.regionProvider()); + const { shortDate, longDate } = formatDate(signingDate); + const scope = createScope(shortDate, region, signingService ?? this.service); + const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256); + const hash = new this.sha256(); + hash.update(headers); + const hashedHeaders = toHex(await hash.digest()); + const stringToSign = [ + EVENT_ALGORITHM_IDENTIFIER, + longDate, + scope, + priorSignature, + hashedHeaders, + hashedPayload, + ].join("\n"); + return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); + } + async signString(stringToSign, { signingDate = new Date(), signingRegion, signingService } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? (await this.regionProvider()); + const { shortDate } = formatDate(signingDate); + const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); + hash.update(toUint8Array(stringToSign)); + return toHex(await hash.digest()); + } + async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? (await this.regionProvider()); + const request = prepareRequest(requestToSign); + const { longDate, shortDate } = formatDate(signingDate); + const scope = createScope(shortDate, region, signingService ?? this.service); + request.headers[AMZ_DATE_HEADER] = longDate; + if (credentials.sessionToken) { + request.headers[TOKEN_HEADER] = credentials.sessionToken; + } + const payloadHash = await getPayloadHash(request, this.sha256); + if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) { + request.headers[SHA256_HEADER] = payloadHash; + } + const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); + const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); + request.headers[AUTH_HEADER] = + `${ALGORITHM_IDENTIFIER} ` + + `Credential=${credentials.accessKeyId}/${scope}, ` + + `SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, ` + + `Signature=${signature}`; + return request; + } + createCanonicalRequest(request, canonicalHeaders, payloadHash) { + const sortedHeaders = Object.keys(canonicalHeaders).sort(); + return `${request.method} +${this.getCanonicalPath(request)} +${getCanonicalQuery(request)} +${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} + +${sortedHeaders.join(";")} +${payloadHash}`; + } + async createStringToSign(longDate, credentialScope, canonicalRequest) { + const hash = new this.sha256(); + hash.update(toUint8Array(canonicalRequest)); + const hashedRequest = await hash.digest(); + return `${ALGORITHM_IDENTIFIER} +${longDate} +${credentialScope} +${toHex(hashedRequest)}`; + } + getCanonicalPath({ path }) { + if (this.uriEscapePath) { + const normalizedPathSegments = []; + for (const pathSegment of path.split("/")) { + if (pathSegment?.length === 0) + continue; + if (pathSegment === ".") + continue; + if (pathSegment === "..") { + normalizedPathSegments.pop(); + } + else { + normalizedPathSegments.push(pathSegment); + } + } + const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`; + const doubleEncoded = encodeURIComponent(normalizedPath); + return doubleEncoded.replace(/%2F/g, "/"); + } + return path; + } + async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { + const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); + const hash = new this.sha256(await keyPromise); + hash.update(toUint8Array(stringToSign)); + return toHex(await hash.digest()); + } + getSigningKey(credentials, region, shortDate, service) { + return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); + } + validateResolvedCredentials(credentials) { + if (typeof credentials !== "object" || + typeof credentials.accessKeyId !== "string" || + typeof credentials.secretAccessKey !== "string") { + throw new Error("Resolved credential object is not valid"); + } + } +} +const formatDate = (now) => { + const longDate = iso8601(now).replace(/[\-:]/g, ""); + return { + longDate, + shortDate: longDate.slice(0, 8), + }; +}; +const getCanonicalHeaderList = (headers) => Object.keys(headers).sort().join(";"); diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/cloneRequest.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/cloneRequest.js new file mode 100644 index 0000000000..f534646ce6 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/cloneRequest.js @@ -0,0 +1,12 @@ +export const cloneRequest = ({ headers, query, ...rest }) => ({ + ...rest, + headers: { ...headers }, + query: query ? cloneQuery(query) : undefined, +}); +export const cloneQuery = (query) => Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param, + }; +}, {}); diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/constants.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/constants.js new file mode 100644 index 0000000000..602728ad47 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/constants.js @@ -0,0 +1,43 @@ +export const ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; +export const CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; +export const AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; +export const SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; +export const EXPIRES_QUERY_PARAM = "X-Amz-Expires"; +export const SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; +export const TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; +export const REGION_SET_PARAM = "X-Amz-Region-Set"; +export const AUTH_HEADER = "authorization"; +export const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); +export const DATE_HEADER = "date"; +export const GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; +export const SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); +export const SHA256_HEADER = "x-amz-content-sha256"; +export const TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); +export const HOST_HEADER = "host"; +export const ALWAYS_UNSIGNABLE_HEADERS = { + authorization: true, + "cache-control": true, + connection: true, + expect: true, + from: true, + "keep-alive": true, + "max-forwards": true, + pragma: true, + referer: true, + te: true, + trailer: true, + "transfer-encoding": true, + upgrade: true, + "user-agent": true, + "x-amzn-trace-id": true, +}; +export const PROXY_HEADER_PATTERN = /^proxy-/; +export const SEC_HEADER_PATTERN = /^sec-/; +export const UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; +export const ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; +export const ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; +export const EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; +export const UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; +export const MAX_CACHE_SIZE = 50; +export const KEY_TYPE_IDENTIFIER = "aws4_request"; +export const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/credentialDerivation.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/credentialDerivation.js new file mode 100644 index 0000000000..e58231d3e9 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/credentialDerivation.js @@ -0,0 +1,33 @@ +import { toHex } from "@aws-sdk/util-hex-encoding"; +import { toUint8Array } from "@aws-sdk/util-utf8"; +import { KEY_TYPE_IDENTIFIER, MAX_CACHE_SIZE } from "./constants"; +const signingKeyCache = {}; +const cacheQueue = []; +export const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`; +export const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { + const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); + const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`; + if (cacheKey in signingKeyCache) { + return signingKeyCache[cacheKey]; + } + cacheQueue.push(cacheKey); + while (cacheQueue.length > MAX_CACHE_SIZE) { + delete signingKeyCache[cacheQueue.shift()]; + } + let key = `AWS4${credentials.secretAccessKey}`; + for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { + key = await hmac(sha256Constructor, key, signable); + } + return (signingKeyCache[cacheKey] = key); +}; +export const clearCredentialCache = () => { + cacheQueue.length = 0; + Object.keys(signingKeyCache).forEach((cacheKey) => { + delete signingKeyCache[cacheKey]; + }); +}; +const hmac = (ctor, secret, data) => { + const hash = new ctor(secret); + hash.update(toUint8Array(data)); + return hash.digest(); +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/getCanonicalHeaders.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/getCanonicalHeaders.js new file mode 100644 index 0000000000..33211255fd --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/getCanonicalHeaders.js @@ -0,0 +1,20 @@ +import { ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN } from "./constants"; +export const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => { + const canonical = {}; + for (const headerName of Object.keys(headers).sort()) { + if (headers[headerName] == undefined) { + continue; + } + const canonicalHeaderName = headerName.toLowerCase(); + if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || + unsignableHeaders?.has(canonicalHeaderName) || + PROXY_HEADER_PATTERN.test(canonicalHeaderName) || + SEC_HEADER_PATTERN.test(canonicalHeaderName)) { + if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) { + continue; + } + } + canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); + } + return canonical; +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/getCanonicalQuery.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/getCanonicalQuery.js new file mode 100644 index 0000000000..ed28b87f6b --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/getCanonicalQuery.js @@ -0,0 +1,27 @@ +import { escapeUri } from "@aws-sdk/util-uri-escape"; +import { SIGNATURE_HEADER } from "./constants"; +export const getCanonicalQuery = ({ query = {} }) => { + const keys = []; + const serialized = {}; + for (const key of Object.keys(query).sort()) { + if (key.toLowerCase() === SIGNATURE_HEADER) { + continue; + } + keys.push(key); + const value = query[key]; + if (typeof value === "string") { + serialized[key] = `${escapeUri(key)}=${escapeUri(value)}`; + } + else if (Array.isArray(value)) { + serialized[key] = value + .slice(0) + .sort() + .reduce((encoded, value) => encoded.concat([`${escapeUri(key)}=${escapeUri(value)}`]), []) + .join("&"); + } + } + return keys + .map((key) => serialized[key]) + .filter((serialized) => serialized) + .join("&"); +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/getPayloadHash.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/getPayloadHash.js new file mode 100644 index 0000000000..347b557316 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/getPayloadHash.js @@ -0,0 +1,20 @@ +import { isArrayBuffer } from "@aws-sdk/is-array-buffer"; +import { toHex } from "@aws-sdk/util-hex-encoding"; +import { toUint8Array } from "@aws-sdk/util-utf8"; +import { SHA256_HEADER, UNSIGNED_PAYLOAD } from "./constants"; +export const getPayloadHash = async ({ headers, body }, hashConstructor) => { + for (const headerName of Object.keys(headers)) { + if (headerName.toLowerCase() === SHA256_HEADER) { + return headers[headerName]; + } + } + if (body == undefined) { + return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + } + else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer(body)) { + const hashCtor = new hashConstructor(); + hashCtor.update(toUint8Array(body)); + return toHex(await hashCtor.digest()); + } + return UNSIGNED_PAYLOAD; +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/headerUtil.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/headerUtil.js new file mode 100644 index 0000000000..e502cbbcb0 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/headerUtil.js @@ -0,0 +1,26 @@ +export const hasHeader = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; + } + } + return false; +}; +export const getHeaderValue = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return headers[headerName]; + } + } + return undefined; +}; +export const deleteHeader = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + delete headers[headerName]; + } + } +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/index.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/index.js new file mode 100644 index 0000000000..7bb33c23b3 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/index.js @@ -0,0 +1,7 @@ +export * from "./SignatureV4"; +export { getCanonicalHeaders } from "./getCanonicalHeaders"; +export { getCanonicalQuery } from "./getCanonicalQuery"; +export { getPayloadHash } from "./getPayloadHash"; +export { moveHeadersToQuery } from "./moveHeadersToQuery"; +export { prepareRequest } from "./prepareRequest"; +export * from "./credentialDerivation"; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/moveHeadersToQuery.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/moveHeadersToQuery.js new file mode 100644 index 0000000000..29ef4165f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/moveHeadersToQuery.js @@ -0,0 +1,16 @@ +import { cloneRequest } from "./cloneRequest"; +export const moveHeadersToQuery = (request, options = {}) => { + const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : cloneRequest(request); + for (const name of Object.keys(headers)) { + const lname = name.toLowerCase(); + if (lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname)) { + query[name] = headers[name]; + delete headers[name]; + } + } + return { + ...request, + headers, + query, + }; +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/prepareRequest.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/prepareRequest.js new file mode 100644 index 0000000000..a88008e77a --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/prepareRequest.js @@ -0,0 +1,11 @@ +import { cloneRequest } from "./cloneRequest"; +import { GENERATED_HEADERS } from "./constants"; +export const prepareRequest = (request) => { + request = typeof request.clone === "function" ? request.clone() : cloneRequest(request); + for (const headerName of Object.keys(request.headers)) { + if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { + delete request.headers[headerName]; + } + } + return request; +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/suite.fixture.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/suite.fixture.js new file mode 100644 index 0000000000..bb704a9915 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/suite.fixture.js @@ -0,0 +1,399 @@ +export const region = "us-east-1"; +export const service = "service"; +export const credentials = { + accessKeyId: "AKIDEXAMPLE", + secretAccessKey: "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY", +}; +export const signingDate = new Date("2015-08-30T12:36:00Z"); +export const requests = [ + { + name: "get-header-key-duplicate", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value2,value2,value1", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=c9d5ea9f3f72853aea855b47ea873832890dbdd183b4468f858259531a5138ea", + }, + { + name: "get-header-value-multiline", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value1,value2,value3", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=ba17b383a53190154eb5fa66a1b836cc297cc0a3d70a5d00705980573d8ff790", + }, + { + name: "get-header-value-order", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value4,value1,value3,value2", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=08c7e5a9acfcfeb3ab6b2185e75ce8b1deb5e634ec47601a50643f830c755c01", + }, + { + name: "get-header-value-trim", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value1", + "my-header2": '"a b c"', + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;my-header2;x-amz-date, Signature=acc3ed3afb60bb290fc8d2dd0098b9911fcaa05412b367055dee359757a9c736", + }, + { + name: "get-unreserved", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=07ef7494c76fa4850883e2b006601f940f8a34d404d0cfa977f52a65bbf5f24f", + }, + { + name: "get-utf8", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/ሴ", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=8318018e0b0f223aa2bbf98705b62bb787dc9c0e678f255a891fd03141be5d85", + }, + { + name: "get-vanilla", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31", + }, + { + name: "get-vanilla-empty-query-key", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: { + Param1: "value1", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=a67d582fa61cc504c4bae71f336f98b97f1ea3c7a6bfe1b6e45aec72011b9aeb", + }, + { + name: "get-vanilla-query", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31", + }, + { + name: "get-vanilla-query-order-key-case", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: { + Param2: "value2", + Param1: "value1", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=b97d918cfa904a5beff61c982a1b6f458b799221646efd99d3219ec94cdf2500", + }, + { + name: "get-vanilla-query-unreserved", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: { + "-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz": "-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=9c3e54bfcdf0b19771a7f523ee5669cdf59bc7cc0884027167c21bb143a40197", + }, + { + name: "get-vanilla-utf8-query", + request: { + protocol: "https:", + method: "GET", + hostname: "example.amazonaws.com", + query: { + ሴ: "bar", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=2cdec8eed098649ff3a119c94853b13c643bcf08f8b0a1d91e12c9027818dd04", + }, + { + name: "post-header-key-case", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b", + }, + { + name: "post-header-key-sort", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "value1", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=c5410059b04c1ee005303aed430f6e6645f61f4dc9e1461ec8f8916fdf18852c", + }, + { + name: "post-header-value-case", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "my-header1": "VALUE1", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=cdbc9802e29d2942e5e10b5bccfdd67c5f22c7c4e8ae67b53629efa58b974b7d", + }, + { + name: "post-sts-header-after", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b", + }, + { + name: "post-sts-header-before", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + "x-amz-security-token": "AQoDYXdzEPT//////////wEXAMPLEtc764bNrC9SAPBSM22wDOk4x4HIZ8j4FZTwdQWLWsKWHGBuFqwAeMicRXmxfpSPfIeoIYRqTflfKD8YUuwthAx7mSEI/qkPpKPi/kMcGdQrmGdeehM4IC1NtBmUpp2wUE8phUZampKsburEDy0KPkyQDYwT7WZ0wq5VSXDvp75YU9HFvlRd8Tx6q6fE8YQcHNVXAkiY9q6d+xo0rKwT38xVqr7ZD0u0iPPkUL64lIZbqBAz+scqKmlzm8FDrypNC9Yjc8fPOLn9FX9KSYvKTr4rvx3iSIlTJabIQwj2ICCR/oLxBA==", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=85d96828115b5dc0cfc3bd16ad9e210dd772bbebba041836c64533a82be05ead", + }, + { + name: "post-vanilla", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b", + }, + { + name: "post-vanilla-empty-query-value", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: { + Param1: "value1", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=28038455d6de14eafc1f9222cf5aa6f1a96197d7deb8263271d420d138af7f11", + }, + { + name: "post-vanilla-query", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: { + Param1: "value1", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=28038455d6de14eafc1f9222cf5aa6f1a96197d7deb8263271d420d138af7f11", + }, + { + name: "post-vanilla-query-nonunreserved", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: { + "@#$%^": "", + "+": '/,?><`";:\\|][{}', + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=66c82657c86e26fb25238d0e69f011edc4c6df5ae71119d7cb98ed9b87393c1e", + }, + { + name: "post-vanilla-query-space", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: { + p: "", + }, + headers: { + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=e71688addb58a26418614085fb730ba3faa623b461c17f48f2fbdb9361b94a9b", + }, + { + name: "post-x-www-form-urlencoded", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + "content-type": "application/x-www-form-urlencoded", + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + body: "Param1=value1", + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=ff11897932ad3f4e8b18135d722051e5ac45fc38421b1da7b9d196a0fe09473a", + }, + { + name: "post-x-www-form-urlencoded-parameters", + request: { + protocol: "https:", + method: "POST", + hostname: "example.amazonaws.com", + query: {}, + headers: { + "content-type": "application/x-www-form-urlencoded; charset=utf8", + host: "example.amazonaws.com", + "x-amz-date": "20150830T123600Z", + }, + body: "Param1=value1", + path: "/", + }, + authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=1a72ec8f64bd914b0e42e42607c7fbce7fb2c7465f63e3092b3b0d39fa77a6fe", + }, +]; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-es/utilDate.js b/server/node_modules/@aws-sdk/signature-v4/dist-es/utilDate.js new file mode 100644 index 0000000000..4aad623e20 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-es/utilDate.js @@ -0,0 +1,15 @@ +export const iso8601 = (time) => toDate(time) + .toISOString() + .replace(/\.\d{3}Z$/, "Z"); +export const toDate = (time) => { + if (typeof time === "number") { + return new Date(time * 1000); + } + if (typeof time === "string") { + if (Number(time)) { + return new Date(Number(time) * 1000); + } + return new Date(time); + } + return time; +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/SignatureV4.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/SignatureV4.d.ts new file mode 100644 index 0000000000..8b4853e950 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/SignatureV4.d.ts @@ -0,0 +1,64 @@ +import { AwsCredentialIdentity, ChecksumConstructor, EventSigner, EventSigningArguments, FormattedEvent, HashConstructor, HttpRequest, Provider, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments, SigningArguments, StringSigner } from "@aws-sdk/types"; +export interface SignatureV4Init { + /** + * The service signing name. + */ + service: string; + /** + * The region name or a function that returns a promise that will be + * resolved with the region name. + */ + region: string | Provider; + /** + * The credentials with which the request should be signed or a function + * that returns a promise that will be resolved with credentials. + */ + credentials: AwsCredentialIdentity | Provider; + /** + * A constructor function for a hash object that will calculate SHA-256 HMAC + * checksums. + */ + sha256?: ChecksumConstructor | HashConstructor; + /** + * Whether to uri-escape the request URI path as part of computing the + * canonical request string. This is required for every AWS service, except + * Amazon S3, as of late 2017. + * + * @default [true] + */ + uriEscapePath?: boolean; + /** + * Whether to calculate a checksum of the request body and include it as + * either a request header (when signing) or as a query string parameter + * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for + * every other AWS service as of late 2017. + * + * @default [true] + */ + applyChecksum?: boolean; +} +export interface SignatureV4CryptoInit { + sha256: ChecksumConstructor | HashConstructor; +} +export declare class SignatureV4 implements RequestPresigner, RequestSigner, StringSigner, EventSigner { + private readonly service; + private readonly regionProvider; + private readonly credentialProvider; + private readonly sha256; + private readonly uriEscapePath; + private readonly applyChecksum; + constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath, }: SignatureV4Init & SignatureV4CryptoInit); + presign(originalRequest: HttpRequest, options?: RequestPresigningArguments): Promise; + sign(stringToSign: string, options?: SigningArguments): Promise; + sign(event: FormattedEvent, options: EventSigningArguments): Promise; + sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise; + private signEvent; + private signString; + private signRequest; + private createCanonicalRequest; + private createStringToSign; + private getCanonicalPath; + private getSignature; + private getSigningKey; + private validateResolvedCredentials; +} diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/cloneRequest.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/cloneRequest.d.ts new file mode 100644 index 0000000000..58056ca6c4 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/cloneRequest.d.ts @@ -0,0 +1,6 @@ +import { HttpRequest, QueryParameterBag } from "@aws-sdk/types"; +/** + * @internal + */ +export declare const cloneRequest: ({ headers, query, ...rest }: HttpRequest) => HttpRequest; +export declare const cloneQuery: (query: QueryParameterBag) => QueryParameterBag; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/constants.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/constants.d.ts new file mode 100644 index 0000000000..ea1cfb5d84 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/constants.d.ts @@ -0,0 +1,43 @@ +export declare const ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; +export declare const CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; +export declare const AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; +export declare const SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; +export declare const EXPIRES_QUERY_PARAM = "X-Amz-Expires"; +export declare const SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; +export declare const TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; +export declare const REGION_SET_PARAM = "X-Amz-Region-Set"; +export declare const AUTH_HEADER = "authorization"; +export declare const AMZ_DATE_HEADER: string; +export declare const DATE_HEADER = "date"; +export declare const GENERATED_HEADERS: string[]; +export declare const SIGNATURE_HEADER: string; +export declare const SHA256_HEADER = "x-amz-content-sha256"; +export declare const TOKEN_HEADER: string; +export declare const HOST_HEADER = "host"; +export declare const ALWAYS_UNSIGNABLE_HEADERS: { + authorization: boolean; + "cache-control": boolean; + connection: boolean; + expect: boolean; + from: boolean; + "keep-alive": boolean; + "max-forwards": boolean; + pragma: boolean; + referer: boolean; + te: boolean; + trailer: boolean; + "transfer-encoding": boolean; + upgrade: boolean; + "user-agent": boolean; + "x-amzn-trace-id": boolean; +}; +export declare const PROXY_HEADER_PATTERN: RegExp; +export declare const SEC_HEADER_PATTERN: RegExp; +export declare const UNSIGNABLE_PATTERNS: RegExp[]; +export declare const ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; +export declare const ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; +export declare const EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; +export declare const UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; +export declare const MAX_CACHE_SIZE = 50; +export declare const KEY_TYPE_IDENTIFIER = "aws4_request"; +export declare const MAX_PRESIGNED_TTL: number; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/credentialDerivation.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/credentialDerivation.d.ts new file mode 100644 index 0000000000..d9e0f66eb3 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/credentialDerivation.d.ts @@ -0,0 +1,26 @@ +import { AwsCredentialIdentity, ChecksumConstructor, HashConstructor } from "@aws-sdk/types"; +/** + * Create a string describing the scope of credentials used to sign a request. + * + * @param shortDate The current calendar date in the form YYYYMMDD. + * @param region The AWS region in which the service resides. + * @param service The service to which the signed request is being sent. + */ +export declare const createScope: (shortDate: string, region: string, service: string) => string; +/** + * Derive a signing key from its composite parts + * + * @param sha256Constructor A constructor function that can instantiate SHA-256 + * hash objects. + * @param credentials The credentials with which the request will be + * signed. + * @param shortDate The current calendar date in the form YYYYMMDD. + * @param region The AWS region in which the service resides. + * @param service The service to which the signed request is being + * sent. + */ +export declare const getSigningKey: (sha256Constructor: ChecksumConstructor | HashConstructor, credentials: AwsCredentialIdentity, shortDate: string, region: string, service: string) => Promise; +/** + * @internal + */ +export declare const clearCredentialCache: () => void; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/getCanonicalHeaders.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/getCanonicalHeaders.d.ts new file mode 100644 index 0000000000..65f549734f --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/getCanonicalHeaders.d.ts @@ -0,0 +1,5 @@ +import { HeaderBag, HttpRequest } from "@aws-sdk/types"; +/** + * @private + */ +export declare const getCanonicalHeaders: ({ headers }: HttpRequest, unsignableHeaders?: Set | undefined, signableHeaders?: Set | undefined) => HeaderBag; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/getCanonicalQuery.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/getCanonicalQuery.d.ts new file mode 100644 index 0000000000..ab695bb5de --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/getCanonicalQuery.d.ts @@ -0,0 +1,5 @@ +import { HttpRequest } from "@aws-sdk/types"; +/** + * @private + */ +export declare const getCanonicalQuery: ({ query }: HttpRequest) => string; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/getPayloadHash.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/getPayloadHash.d.ts new file mode 100644 index 0000000000..33cbf617d5 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/getPayloadHash.d.ts @@ -0,0 +1,5 @@ +import { ChecksumConstructor, HashConstructor, HttpRequest } from "@aws-sdk/types"; +/** + * @private + */ +export declare const getPayloadHash: ({ headers, body }: HttpRequest, hashConstructor: ChecksumConstructor | HashConstructor) => Promise; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/headerUtil.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/headerUtil.d.ts new file mode 100644 index 0000000000..ba0a0a0bea --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/headerUtil.d.ts @@ -0,0 +1,4 @@ +import { HeaderBag } from "@aws-sdk/types"; +export declare const hasHeader: (soughtHeader: string, headers: HeaderBag) => boolean; +export declare const getHeaderValue: (soughtHeader: string, headers: HeaderBag) => string | undefined; +export declare const deleteHeader: (soughtHeader: string, headers: HeaderBag) => void; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/index.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/index.d.ts new file mode 100644 index 0000000000..7bb33c23b3 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/index.d.ts @@ -0,0 +1,7 @@ +export * from "./SignatureV4"; +export { getCanonicalHeaders } from "./getCanonicalHeaders"; +export { getCanonicalQuery } from "./getCanonicalQuery"; +export { getPayloadHash } from "./getPayloadHash"; +export { moveHeadersToQuery } from "./moveHeadersToQuery"; +export { prepareRequest } from "./prepareRequest"; +export * from "./credentialDerivation"; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/moveHeadersToQuery.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/moveHeadersToQuery.d.ts new file mode 100644 index 0000000000..e0f91e44a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/moveHeadersToQuery.d.ts @@ -0,0 +1,9 @@ +import { HttpRequest, QueryParameterBag } from "@aws-sdk/types"; +/** + * @private + */ +export declare const moveHeadersToQuery: (request: HttpRequest, options?: { + unhoistableHeaders?: Set; +}) => HttpRequest & { + query: QueryParameterBag; +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/prepareRequest.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/prepareRequest.d.ts new file mode 100644 index 0000000000..95d4f8803a --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/prepareRequest.d.ts @@ -0,0 +1,5 @@ +import { HttpRequest } from "@aws-sdk/types"; +/** + * @private + */ +export declare const prepareRequest: (request: HttpRequest) => HttpRequest; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/suite.fixture.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/suite.fixture.d.ts new file mode 100644 index 0000000000..38b93fdb94 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/suite.fixture.d.ts @@ -0,0 +1,14 @@ +import { HttpRequest } from "@aws-sdk/types"; +export interface TestCase { + name: string; + request: HttpRequest; + authorization: string; +} +export declare const region = "us-east-1"; +export declare const service = "service"; +export declare const credentials: { + accessKeyId: string; + secretAccessKey: string; +}; +export declare const signingDate: Date; +export declare const requests: Array; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/SignatureV4.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/SignatureV4.d.ts new file mode 100644 index 0000000000..8b5efb28ae --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/SignatureV4.d.ts @@ -0,0 +1,64 @@ +import { + AwsCredentialIdentity, + ChecksumConstructor, + EventSigner, + EventSigningArguments, + FormattedEvent, + HashConstructor, + HttpRequest, + Provider, + RequestPresigner, + RequestPresigningArguments, + RequestSigner, + RequestSigningArguments, + SigningArguments, + StringSigner, +} from "@aws-sdk/types"; +export interface SignatureV4Init { + service: string; + region: string | Provider; + credentials: AwsCredentialIdentity | Provider; + sha256?: ChecksumConstructor | HashConstructor; + uriEscapePath?: boolean; + applyChecksum?: boolean; +} +export interface SignatureV4CryptoInit { + sha256: ChecksumConstructor | HashConstructor; +} +export declare class SignatureV4 + implements RequestPresigner, RequestSigner, StringSigner, EventSigner +{ + private readonly service; + private readonly regionProvider; + private readonly credentialProvider; + private readonly sha256; + private readonly uriEscapePath; + private readonly applyChecksum; + constructor({ + applyChecksum, + credentials, + region, + service, + sha256, + uriEscapePath, + }: SignatureV4Init & SignatureV4CryptoInit); + presign( + originalRequest: HttpRequest, + options?: RequestPresigningArguments + ): Promise; + sign(stringToSign: string, options?: SigningArguments): Promise; + sign(event: FormattedEvent, options: EventSigningArguments): Promise; + sign( + requestToSign: HttpRequest, + options?: RequestSigningArguments + ): Promise; + private signEvent; + private signString; + private signRequest; + private createCanonicalRequest; + private createStringToSign; + private getCanonicalPath; + private getSignature; + private getSigningKey; + private validateResolvedCredentials; +} diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/cloneRequest.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/cloneRequest.d.ts new file mode 100644 index 0000000000..c7a891ceba --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/cloneRequest.d.ts @@ -0,0 +1,9 @@ +import { HttpRequest, QueryParameterBag } from "@aws-sdk/types"; +export declare const cloneRequest: ({ + headers, + query, + ...rest +}: HttpRequest) => HttpRequest; +export declare const cloneQuery: ( + query: QueryParameterBag +) => QueryParameterBag; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/constants.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/constants.d.ts new file mode 100644 index 0000000000..e33272ecd9 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/constants.d.ts @@ -0,0 +1,43 @@ +export declare const ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; +export declare const CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; +export declare const AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; +export declare const SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; +export declare const EXPIRES_QUERY_PARAM = "X-Amz-Expires"; +export declare const SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; +export declare const TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; +export declare const REGION_SET_PARAM = "X-Amz-Region-Set"; +export declare const AUTH_HEADER = "authorization"; +export declare const AMZ_DATE_HEADER: string; +export declare const DATE_HEADER = "date"; +export declare const GENERATED_HEADERS: string[]; +export declare const SIGNATURE_HEADER: string; +export declare const SHA256_HEADER = "x-amz-content-sha256"; +export declare const TOKEN_HEADER: string; +export declare const HOST_HEADER = "host"; +export declare const ALWAYS_UNSIGNABLE_HEADERS: { + authorization: boolean; + "cache-control": boolean; + connection: boolean; + expect: boolean; + from: boolean; + "keep-alive": boolean; + "max-forwards": boolean; + pragma: boolean; + referer: boolean; + te: boolean; + trailer: boolean; + "transfer-encoding": boolean; + upgrade: boolean; + "user-agent": boolean; + "x-amzn-trace-id": boolean; +}; +export declare const PROXY_HEADER_PATTERN: RegExp; +export declare const SEC_HEADER_PATTERN: RegExp; +export declare const UNSIGNABLE_PATTERNS: RegExp[]; +export declare const ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; +export declare const ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; +export declare const EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; +export declare const UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; +export declare const MAX_CACHE_SIZE = 50; +export declare const KEY_TYPE_IDENTIFIER = "aws4_request"; +export declare const MAX_PRESIGNED_TTL: number; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/credentialDerivation.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/credentialDerivation.d.ts new file mode 100644 index 0000000000..494a02b273 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/credentialDerivation.d.ts @@ -0,0 +1,18 @@ +import { + AwsCredentialIdentity, + ChecksumConstructor, + HashConstructor, +} from "@aws-sdk/types"; +export declare const createScope: ( + shortDate: string, + region: string, + service: string +) => string; +export declare const getSigningKey: ( + sha256Constructor: ChecksumConstructor | HashConstructor, + credentials: AwsCredentialIdentity, + shortDate: string, + region: string, + service: string +) => Promise; +export declare const clearCredentialCache: () => void; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getCanonicalHeaders.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getCanonicalHeaders.d.ts new file mode 100644 index 0000000000..b9461ddf4b --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getCanonicalHeaders.d.ts @@ -0,0 +1,6 @@ +import { HeaderBag, HttpRequest } from "@aws-sdk/types"; +export declare const getCanonicalHeaders: ( + { headers }: HttpRequest, + unsignableHeaders?: Set | undefined, + signableHeaders?: Set | undefined +) => HeaderBag; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getCanonicalQuery.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getCanonicalQuery.d.ts new file mode 100644 index 0000000000..e584f063bc --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getCanonicalQuery.d.ts @@ -0,0 +1,2 @@ +import { HttpRequest } from "@aws-sdk/types"; +export declare const getCanonicalQuery: ({ query }: HttpRequest) => string; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getPayloadHash.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getPayloadHash.d.ts new file mode 100644 index 0000000000..551f78f2c7 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/getPayloadHash.d.ts @@ -0,0 +1,9 @@ +import { + ChecksumConstructor, + HashConstructor, + HttpRequest, +} from "@aws-sdk/types"; +export declare const getPayloadHash: ( + { headers, body }: HttpRequest, + hashConstructor: ChecksumConstructor | HashConstructor +) => Promise; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/headerUtil.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/headerUtil.d.ts new file mode 100644 index 0000000000..00d93fdc90 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/headerUtil.d.ts @@ -0,0 +1,13 @@ +import { HeaderBag } from "@aws-sdk/types"; +export declare const hasHeader: ( + soughtHeader: string, + headers: HeaderBag +) => boolean; +export declare const getHeaderValue: ( + soughtHeader: string, + headers: HeaderBag +) => string | undefined; +export declare const deleteHeader: ( + soughtHeader: string, + headers: HeaderBag +) => void; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..7bb33c23b3 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/index.d.ts @@ -0,0 +1,7 @@ +export * from "./SignatureV4"; +export { getCanonicalHeaders } from "./getCanonicalHeaders"; +export { getCanonicalQuery } from "./getCanonicalQuery"; +export { getPayloadHash } from "./getPayloadHash"; +export { moveHeadersToQuery } from "./moveHeadersToQuery"; +export { prepareRequest } from "./prepareRequest"; +export * from "./credentialDerivation"; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/moveHeadersToQuery.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/moveHeadersToQuery.d.ts new file mode 100644 index 0000000000..67aad7d02d --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/moveHeadersToQuery.d.ts @@ -0,0 +1,9 @@ +import { HttpRequest, QueryParameterBag } from "@aws-sdk/types"; +export declare const moveHeadersToQuery: ( + request: HttpRequest, + options?: { + unhoistableHeaders?: Set; + } +) => HttpRequest & { + query: QueryParameterBag; +}; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/prepareRequest.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/prepareRequest.d.ts new file mode 100644 index 0000000000..d8bd7bba3d --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/prepareRequest.d.ts @@ -0,0 +1,2 @@ +import { HttpRequest } from "@aws-sdk/types"; +export declare const prepareRequest: (request: HttpRequest) => HttpRequest; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/suite.fixture.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/suite.fixture.d.ts new file mode 100644 index 0000000000..488ab9840c --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/suite.fixture.d.ts @@ -0,0 +1,14 @@ +import { HttpRequest } from "@aws-sdk/types"; +export interface TestCase { + name: string; + request: HttpRequest; + authorization: string; +} +export declare const region = "us-east-1"; +export declare const service = "service"; +export declare const credentials: { + accessKeyId: string; + secretAccessKey: string; +}; +export declare const signingDate: Date; +export declare const requests: Array; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/utilDate.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/utilDate.d.ts new file mode 100644 index 0000000000..e8c6a684ed --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/ts3.4/utilDate.d.ts @@ -0,0 +1,2 @@ +export declare const iso8601: (time: number | string | Date) => string; +export declare const toDate: (time: number | string | Date) => Date; diff --git a/server/node_modules/@aws-sdk/signature-v4/dist-types/utilDate.d.ts b/server/node_modules/@aws-sdk/signature-v4/dist-types/utilDate.d.ts new file mode 100644 index 0000000000..e8c6a684ed --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/dist-types/utilDate.d.ts @@ -0,0 +1,2 @@ +export declare const iso8601: (time: number | string | Date) => string; +export declare const toDate: (time: number | string | Date) => Date; diff --git a/server/node_modules/@aws-sdk/signature-v4/package.json b/server/node_modules/@aws-sdk/signature-v4/package.json new file mode 100644 index 0000000000..cf72b88f24 --- /dev/null +++ b/server/node_modules/@aws-sdk/signature-v4/package.json @@ -0,0 +1,62 @@ +{ + "name": "@aws-sdk/signature-v4", + "version": "3.257.0", + "description": "A standalone implementation of the AWS Signature V4 request signing algorithm", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --coverage" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/is-array-buffer": "3.201.0", + "@aws-sdk/types": "3.257.0", + "@aws-sdk/util-hex-encoding": "3.201.0", + "@aws-sdk/util-middleware": "3.257.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/protocol-http": "3.257.0", + "@aws-sdk/util-buffer-from": "3.208.0", + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/signature-v4", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/signature-v4" + } +} diff --git a/server/node_modules/@aws-sdk/smithy-client/LICENSE b/server/node_modules/@aws-sdk/smithy-client/LICENSE new file mode 100644 index 0000000000..e907b58668 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/smithy-client/README.md b/server/node_modules/@aws-sdk/smithy-client/README.md new file mode 100644 index 0000000000..1474914a42 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/smithy-client + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/smithy-client/latest.svg)](https://www.npmjs.com/package/@aws-sdk/smithy-client) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/smithy-client.svg)](https://www.npmjs.com/package/@aws-sdk/smithy-client) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/NoOpLogger.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/NoOpLogger.js new file mode 100644 index 0000000000..7358ad3f08 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/NoOpLogger.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoOpLogger = void 0; +class NoOpLogger { + trace() { } + debug() { } + info() { } + warn() { } + error() { } +} +exports.NoOpLogger = NoOpLogger; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/client.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/client.js new file mode 100644 index 0000000000..744ffee77e --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/client.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Client = void 0; +const middleware_stack_1 = require("@aws-sdk/middleware-stack"); +class Client { + constructor(config) { + this.middlewareStack = (0, middleware_stack_1.constructStack)(); + this.config = config; + } + send(command, optionsOrCb, cb) { + const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined; + const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; + const handler = command.resolveMiddleware(this.middlewareStack, this.config, options); + if (callback) { + handler(command) + .then((result) => callback(null, result.output), (err) => callback(err)) + .catch(() => { }); + } + else { + return handler(command).then((result) => result.output); + } + } + destroy() { + if (this.config.requestHandler.destroy) + this.config.requestHandler.destroy(); + } +} +exports.Client = Client; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/command.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/command.js new file mode 100644 index 0000000000..e5f743ace4 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/command.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Command = void 0; +const middleware_stack_1 = require("@aws-sdk/middleware-stack"); +class Command { + constructor() { + this.middlewareStack = (0, middleware_stack_1.constructStack)(); + } +} +exports.Command = Command; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/constants.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/constants.js new file mode 100644 index 0000000000..914565fd99 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SENSITIVE_STRING = void 0; +exports.SENSITIVE_STRING = "***SensitiveInformation***"; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/date-utils.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/date-utils.js new file mode 100644 index 0000000000..08aaa051c5 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/date-utils.js @@ -0,0 +1,195 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseEpochTimestamp = exports.parseRfc7231DateTime = exports.parseRfc3339DateTimeWithOffset = exports.parseRfc3339DateTime = exports.dateToUtcString = void 0; +const parse_utils_1 = require("./parse-utils"); +const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; +const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; +function dateToUtcString(date) { + const year = date.getUTCFullYear(); + const month = date.getUTCMonth(); + const dayOfWeek = date.getUTCDay(); + const dayOfMonthInt = date.getUTCDate(); + const hoursInt = date.getUTCHours(); + const minutesInt = date.getUTCMinutes(); + const secondsInt = date.getUTCSeconds(); + const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; + const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; + const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; + const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; + return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`; +} +exports.dateToUtcString = dateToUtcString; +const RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); +const parseRfc3339DateTime = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; + const year = (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); +}; +exports.parseRfc3339DateTime = parseRfc3339DateTime; +const RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); +const parseRfc3339DateTimeWithOffset = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339_WITH_OFFSET.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; + const year = (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); + if (offsetStr.toUpperCase() != "Z") { + date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr)); + } + return date; +}; +exports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset; +const IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); +const RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); +const ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/); +const parseRfc7231DateTime = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-7231 date-times must be expressed as strings"); + } + let match = IMF_FIXDATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); + } + match = RFC_850_DATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { + hours, + minutes, + seconds, + fractionalMilliseconds, + })); + } + match = ASC_TIME.exec(value); + if (match) { + const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; + return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); + } + throw new TypeError("Invalid RFC-7231 date-time value"); +}; +exports.parseRfc7231DateTime = parseRfc7231DateTime; +const parseEpochTimestamp = (value) => { + if (value === null || value === undefined) { + return undefined; + } + let valueAsDouble; + if (typeof value === "number") { + valueAsDouble = value; + } + else if (typeof value === "string") { + valueAsDouble = (0, parse_utils_1.strictParseDouble)(value); + } + else { + throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); + } + if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { + throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); + } + return new Date(Math.round(valueAsDouble * 1000)); +}; +exports.parseEpochTimestamp = parseEpochTimestamp; +const buildDate = (year, month, day, time) => { + const adjustedMonth = month - 1; + validateDayOfMonth(year, adjustedMonth, day); + return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds))); +}; +const parseTwoDigitYear = (value) => { + const thisYear = new Date().getUTCFullYear(); + const valueInThisCentury = Math.floor(thisYear / 100) * 100 + (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(value)); + if (valueInThisCentury < thisYear) { + return valueInThisCentury + 100; + } + return valueInThisCentury; +}; +const FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000; +const adjustRfc850Year = (input) => { + if (input.getTime() - new Date().getTime() > FIFTY_YEARS_IN_MILLIS) { + return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds())); + } + return input; +}; +const parseMonthByShortName = (value) => { + const monthIdx = MONTHS.indexOf(value); + if (monthIdx < 0) { + throw new TypeError(`Invalid month: ${value}`); + } + return monthIdx + 1; +}; +const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +const validateDayOfMonth = (year, month, day) => { + let maxDays = DAYS_IN_MONTH[month]; + if (month === 1 && isLeapYear(year)) { + maxDays = 29; + } + if (day > maxDays) { + throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`); + } +}; +const isLeapYear = (year) => { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +}; +const parseDateValue = (value, type, lower, upper) => { + const dateVal = (0, parse_utils_1.strictParseByte)(stripLeadingZeroes(value)); + if (dateVal < lower || dateVal > upper) { + throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); + } + return dateVal; +}; +const parseMilliseconds = (value) => { + if (value === null || value === undefined) { + return 0; + } + return (0, parse_utils_1.strictParseFloat32)("0." + value) * 1000; +}; +const parseOffsetToMilliseconds = (value) => { + const directionStr = value[0]; + let direction = 1; + if (directionStr == "+") { + direction = 1; + } + else if (directionStr == "-") { + direction = -1; + } + else { + throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); + } + const hour = Number(value.substring(1, 3)); + const minute = Number(value.substring(4, 6)); + return direction * (hour * 60 + minute) * 60 * 1000; +}; +const stripLeadingZeroes = (value) => { + let idx = 0; + while (idx < value.length - 1 && value.charAt(idx) === "0") { + idx++; + } + if (idx === 0) { + return value; + } + return value.slice(idx); +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/default-error-handler.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/default-error-handler.js new file mode 100644 index 0000000000..c2930db3cf --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/default-error-handler.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.throwDefaultError = void 0; +const exceptions_1 = require("./exceptions"); +const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; + const response = new exceptionCtor({ + name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknownError", + $fault: "client", + $metadata, + }); + throw (0, exceptions_1.decorateServiceException)(response, parsedBody); +}; +exports.throwDefaultError = throwDefaultError; +const deserializeMetadata = (output) => { + var _a, _b; + return ({ + httpStatusCode: output.statusCode, + requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], + }); +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/defaults-mode.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/defaults-mode.js new file mode 100644 index 0000000000..ac35c3e291 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/defaults-mode.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadConfigsForDefaultMode = void 0; +const loadConfigsForDefaultMode = (mode) => { + switch (mode) { + case "standard": + return { + retryMode: "standard", + connectionTimeout: 3100, + }; + case "in-region": + return { + retryMode: "standard", + connectionTimeout: 1100, + }; + case "cross-region": + return { + retryMode: "standard", + connectionTimeout: 3100, + }; + case "mobile": + return { + retryMode: "standard", + connectionTimeout: 30000, + }; + default: + return {}; + } +}; +exports.loadConfigsForDefaultMode = loadConfigsForDefaultMode; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/emitWarningIfUnsupportedVersion.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/emitWarningIfUnsupportedVersion.js new file mode 100644 index 0000000000..66f632884d --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/emitWarningIfUnsupportedVersion.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.emitWarningIfUnsupportedVersion = void 0; +let warningEmitted = false; +const emitWarningIfUnsupportedVersion = (version) => { + if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 14) { + warningEmitted = true; + } +}; +exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/exceptions.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/exceptions.js new file mode 100644 index 0000000000..f671392bbf --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/exceptions.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decorateServiceException = exports.ServiceException = void 0; +class ServiceException extends Error { + constructor(options) { + super(options.message); + Object.setPrototypeOf(this, ServiceException.prototype); + this.name = options.name; + this.$fault = options.$fault; + this.$metadata = options.$metadata; + } +} +exports.ServiceException = ServiceException; +const decorateServiceException = (exception, additions = {}) => { + Object.entries(additions) + .filter(([, v]) => v !== undefined) + .forEach(([k, v]) => { + if (exception[k] == undefined || exception[k] === "") { + exception[k] = v; + } + }); + const message = exception.message || exception.Message || "UnknownError"; + exception.message = message; + delete exception.Message; + return exception; +}; +exports.decorateServiceException = decorateServiceException; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/extended-encode-uri-component.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/extended-encode-uri-component.js new file mode 100644 index 0000000000..3101af8f00 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/extended-encode-uri-component.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendedEncodeURIComponent = void 0; +function extendedEncodeURIComponent(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} +exports.extendedEncodeURIComponent = extendedEncodeURIComponent; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/get-array-if-single-item.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/get-array-if-single-item.js new file mode 100644 index 0000000000..8a39ba361f --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/get-array-if-single-item.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getArrayIfSingleItem = void 0; +const getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; +exports.getArrayIfSingleItem = getArrayIfSingleItem; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/get-value-from-text-node.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/get-value-from-text-node.js new file mode 100644 index 0000000000..b40ed650d6 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/get-value-from-text-node.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getValueFromTextNode = void 0; +const getValueFromTextNode = (obj) => { + const textNodeName = "#text"; + for (const key in obj) { + if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) { + obj[key] = obj[key][textNodeName]; + } + else if (typeof obj[key] === "object" && obj[key] !== null) { + obj[key] = (0, exports.getValueFromTextNode)(obj[key]); + } + } + return obj; +}; +exports.getValueFromTextNode = getValueFromTextNode; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/index.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/index.js new file mode 100644 index 0000000000..fb96c3709a --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/index.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./NoOpLogger"), exports); +tslib_1.__exportStar(require("./client"), exports); +tslib_1.__exportStar(require("./command"), exports); +tslib_1.__exportStar(require("./constants"), exports); +tslib_1.__exportStar(require("./date-utils"), exports); +tslib_1.__exportStar(require("./default-error-handler"), exports); +tslib_1.__exportStar(require("./defaults-mode"), exports); +tslib_1.__exportStar(require("./emitWarningIfUnsupportedVersion"), exports); +tslib_1.__exportStar(require("./exceptions"), exports); +tslib_1.__exportStar(require("./extended-encode-uri-component"), exports); +tslib_1.__exportStar(require("./get-array-if-single-item"), exports); +tslib_1.__exportStar(require("./get-value-from-text-node"), exports); +tslib_1.__exportStar(require("./lazy-json"), exports); +tslib_1.__exportStar(require("./object-mapping"), exports); +tslib_1.__exportStar(require("./parse-utils"), exports); +tslib_1.__exportStar(require("./resolve-path"), exports); +tslib_1.__exportStar(require("./ser-utils"), exports); +tslib_1.__exportStar(require("./split-every"), exports); diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/lazy-json.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/lazy-json.js new file mode 100644 index 0000000000..6179f93f36 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/lazy-json.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LazyJsonString = exports.StringWrapper = void 0; +const StringWrapper = function () { + const Class = Object.getPrototypeOf(this).constructor; + const Constructor = Function.bind.apply(String, [null, ...arguments]); + const instance = new Constructor(); + Object.setPrototypeOf(instance, Class.prototype); + return instance; +}; +exports.StringWrapper = StringWrapper; +exports.StringWrapper.prototype = Object.create(String.prototype, { + constructor: { + value: exports.StringWrapper, + enumerable: false, + writable: true, + configurable: true, + }, +}); +Object.setPrototypeOf(exports.StringWrapper, String); +class LazyJsonString extends exports.StringWrapper { + deserializeJSON() { + return JSON.parse(super.toString()); + } + toJSON() { + return super.toString(); + } + static fromObject(object) { + if (object instanceof LazyJsonString) { + return object; + } + else if (object instanceof String || typeof object === "string") { + return new LazyJsonString(object); + } + return new LazyJsonString(JSON.stringify(object)); + } +} +exports.LazyJsonString = LazyJsonString; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/object-mapping.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/object-mapping.js new file mode 100644 index 0000000000..fd1ddbf7f5 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/object-mapping.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertMap = exports.map = void 0; +function map(arg0, arg1, arg2) { + let target; + let filter; + let instructions; + if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { + target = {}; + instructions = arg0; + } + else { + target = arg0; + if (typeof arg1 === "function") { + filter = arg1; + instructions = arg2; + return mapWithFilter(target, filter, instructions); + } + else { + instructions = arg1; + } + } + for (const key of Object.keys(instructions)) { + if (!Array.isArray(instructions[key])) { + target[key] = instructions[key]; + continue; + } + let [filter, value] = instructions[key]; + if (typeof value === "function") { + let _value; + const defaultFilterPassed = filter === undefined && (_value = value()) != null; + const customFilterPassed = (typeof filter === "function" && !!filter(void 0)) || (typeof filter !== "function" && !!filter); + if (defaultFilterPassed) { + target[key] = _value; + } + else if (customFilterPassed) { + target[key] = value(); + } + } + else { + const defaultFilterPassed = filter === undefined && value != null; + const customFilterPassed = (typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter); + if (defaultFilterPassed || customFilterPassed) { + target[key] = value; + } + } + } + return target; +} +exports.map = map; +const convertMap = (target) => { + const output = {}; + for (const [k, v] of Object.entries(target || {})) { + output[k] = [, v]; + } + return output; +}; +exports.convertMap = convertMap; +const mapWithFilter = (target, filter, instructions) => { + return map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => { + if (Array.isArray(value)) { + _instructions[key] = value; + } + else { + if (typeof value === "function") { + _instructions[key] = [filter, value()]; + } + else { + _instructions[key] = [filter, value]; + } + } + return _instructions; + }, {})); +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/parse-utils.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/parse-utils.js new file mode 100644 index 0000000000..d4db2e4ddb --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/parse-utils.js @@ -0,0 +1,253 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.logger = exports.strictParseByte = exports.strictParseShort = exports.strictParseInt32 = exports.strictParseInt = exports.strictParseLong = exports.limitedParseFloat32 = exports.limitedParseFloat = exports.handleFloat = exports.limitedParseDouble = exports.strictParseFloat32 = exports.strictParseFloat = exports.strictParseDouble = exports.expectUnion = exports.expectString = exports.expectObject = exports.expectNonNull = exports.expectByte = exports.expectShort = exports.expectInt32 = exports.expectInt = exports.expectLong = exports.expectFloat32 = exports.expectNumber = exports.expectBoolean = exports.parseBoolean = void 0; +const parseBoolean = (value) => { + switch (value) { + case "true": + return true; + case "false": + return false; + default: + throw new Error(`Unable to parse boolean value "${value}"`); + } +}; +exports.parseBoolean = parseBoolean; +const expectBoolean = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "number") { + if (value === 0 || value === 1) { + exports.logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (value === 0) { + return false; + } + if (value === 1) { + return true; + } + } + if (typeof value === "string") { + const lower = value.toLowerCase(); + if (lower === "false" || lower === "true") { + exports.logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (lower === "false") { + return false; + } + if (lower === "true") { + return true; + } + } + if (typeof value === "boolean") { + return value; + } + throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); +}; +exports.expectBoolean = expectBoolean; +const expectNumber = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "string") { + const parsed = parseFloat(value); + if (!Number.isNaN(parsed)) { + if (String(parsed) !== String(value)) { + exports.logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); + } + return parsed; + } + } + if (typeof value === "number") { + return value; + } + throw new TypeError(`Expected number, got ${typeof value}: ${value}`); +}; +exports.expectNumber = expectNumber; +const MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); +const expectFloat32 = (value) => { + const expected = (0, exports.expectNumber)(value); + if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { + if (Math.abs(expected) > MAX_FLOAT) { + throw new TypeError(`Expected 32-bit float, got ${value}`); + } + } + return expected; +}; +exports.expectFloat32 = expectFloat32; +const expectLong = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (Number.isInteger(value) && !Number.isNaN(value)) { + return value; + } + throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); +}; +exports.expectLong = expectLong; +exports.expectInt = exports.expectLong; +const expectInt32 = (value) => expectSizedInt(value, 32); +exports.expectInt32 = expectInt32; +const expectShort = (value) => expectSizedInt(value, 16); +exports.expectShort = expectShort; +const expectByte = (value) => expectSizedInt(value, 8); +exports.expectByte = expectByte; +const expectSizedInt = (value, size) => { + const expected = (0, exports.expectLong)(value); + if (expected !== undefined && castInt(expected, size) !== expected) { + throw new TypeError(`Expected ${size}-bit integer, got ${value}`); + } + return expected; +}; +const castInt = (value, size) => { + switch (size) { + case 32: + return Int32Array.of(value)[0]; + case 16: + return Int16Array.of(value)[0]; + case 8: + return Int8Array.of(value)[0]; + } +}; +const expectNonNull = (value, location) => { + if (value === null || value === undefined) { + if (location) { + throw new TypeError(`Expected a non-null value for ${location}`); + } + throw new TypeError("Expected a non-null value"); + } + return value; +}; +exports.expectNonNull = expectNonNull; +const expectObject = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "object" && !Array.isArray(value)) { + return value; + } + const receivedType = Array.isArray(value) ? "array" : typeof value; + throw new TypeError(`Expected object, got ${receivedType}: ${value}`); +}; +exports.expectObject = expectObject; +const expectString = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "string") { + return value; + } + if (["boolean", "number", "bigint"].includes(typeof value)) { + exports.logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); + return String(value); + } + throw new TypeError(`Expected string, got ${typeof value}: ${value}`); +}; +exports.expectString = expectString; +const expectUnion = (value) => { + if (value === null || value === undefined) { + return undefined; + } + const asObject = (0, exports.expectObject)(value); + const setKeys = Object.entries(asObject) + .filter(([, v]) => v != null) + .map(([k]) => k); + if (setKeys.length === 0) { + throw new TypeError(`Unions must have exactly one non-null member. None were found.`); + } + if (setKeys.length > 1) { + throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); + } + return asObject; +}; +exports.expectUnion = expectUnion; +const strictParseDouble = (value) => { + if (typeof value == "string") { + return (0, exports.expectNumber)(parseNumber(value)); + } + return (0, exports.expectNumber)(value); +}; +exports.strictParseDouble = strictParseDouble; +exports.strictParseFloat = exports.strictParseDouble; +const strictParseFloat32 = (value) => { + if (typeof value == "string") { + return (0, exports.expectFloat32)(parseNumber(value)); + } + return (0, exports.expectFloat32)(value); +}; +exports.strictParseFloat32 = strictParseFloat32; +const NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; +const parseNumber = (value) => { + const matches = value.match(NUMBER_REGEX); + if (matches === null || matches[0].length !== value.length) { + throw new TypeError(`Expected real number, got implicit NaN`); + } + return parseFloat(value); +}; +const limitedParseDouble = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return (0, exports.expectNumber)(value); +}; +exports.limitedParseDouble = limitedParseDouble; +exports.handleFloat = exports.limitedParseDouble; +exports.limitedParseFloat = exports.limitedParseDouble; +const limitedParseFloat32 = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return (0, exports.expectFloat32)(value); +}; +exports.limitedParseFloat32 = limitedParseFloat32; +const parseFloatString = (value) => { + switch (value) { + case "NaN": + return NaN; + case "Infinity": + return Infinity; + case "-Infinity": + return -Infinity; + default: + throw new Error(`Unable to parse float value: ${value}`); + } +}; +const strictParseLong = (value) => { + if (typeof value === "string") { + return (0, exports.expectLong)(parseNumber(value)); + } + return (0, exports.expectLong)(value); +}; +exports.strictParseLong = strictParseLong; +exports.strictParseInt = exports.strictParseLong; +const strictParseInt32 = (value) => { + if (typeof value === "string") { + return (0, exports.expectInt32)(parseNumber(value)); + } + return (0, exports.expectInt32)(value); +}; +exports.strictParseInt32 = strictParseInt32; +const strictParseShort = (value) => { + if (typeof value === "string") { + return (0, exports.expectShort)(parseNumber(value)); + } + return (0, exports.expectShort)(value); +}; +exports.strictParseShort = strictParseShort; +const strictParseByte = (value) => { + if (typeof value === "string") { + return (0, exports.expectByte)(parseNumber(value)); + } + return (0, exports.expectByte)(value); +}; +exports.strictParseByte = strictParseByte; +const stackTraceWarning = (message) => { + return String(new TypeError(message).stack || message) + .split("\n") + .slice(0, 5) + .filter((s) => !s.includes("stackTraceWarning")) + .join("\n"); +}; +exports.logger = { + warn: console.warn, +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/resolve-path.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/resolve-path.js new file mode 100644 index 0000000000..fdd9141cf2 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/resolve-path.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolvedPath = void 0; +const extended_encode_uri_component_1 = require("./extended-encode-uri-component"); +const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { + if (input != null && input[memberName] !== undefined) { + const labelValue = labelValueProvider(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: " + memberName + "."); + } + resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel + ? labelValue + .split("/") + .map((segment) => (0, extended_encode_uri_component_1.extendedEncodeURIComponent)(segment)) + .join("/") + : (0, extended_encode_uri_component_1.extendedEncodeURIComponent)(labelValue)); + } + else { + throw new Error("No value provided for input HTTP label: " + memberName + "."); + } + return resolvedPath; +}; +exports.resolvedPath = resolvedPath; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/ser-utils.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/ser-utils.js new file mode 100644 index 0000000000..0587b781b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/ser-utils.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.serializeFloat = void 0; +const serializeFloat = (value) => { + if (value !== value) { + return "NaN"; + } + switch (value) { + case Infinity: + return "Infinity"; + case -Infinity: + return "-Infinity"; + default: + return value; + } +}; +exports.serializeFloat = serializeFloat; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-cjs/split-every.js b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/split-every.js new file mode 100644 index 0000000000..453529bb02 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-cjs/split-every.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.splitEvery = void 0; +function splitEvery(value, delimiter, numDelimiters) { + if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { + throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); + } + const segments = value.split(delimiter); + if (numDelimiters === 1) { + return segments; + } + const compoundSegments = []; + let currentSegment = ""; + for (let i = 0; i < segments.length; i++) { + if (currentSegment === "") { + currentSegment = segments[i]; + } + else { + currentSegment += delimiter + segments[i]; + } + if ((i + 1) % numDelimiters === 0) { + compoundSegments.push(currentSegment); + currentSegment = ""; + } + } + if (currentSegment !== "") { + compoundSegments.push(currentSegment); + } + return compoundSegments; +} +exports.splitEvery = splitEvery; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/NoOpLogger.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/NoOpLogger.js new file mode 100644 index 0000000000..73cd0764dd --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/NoOpLogger.js @@ -0,0 +1,7 @@ +export class NoOpLogger { + trace() { } + debug() { } + info() { } + warn() { } + error() { } +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/client.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/client.js new file mode 100644 index 0000000000..b8832d121c --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/client.js @@ -0,0 +1,24 @@ +import { constructStack } from "@aws-sdk/middleware-stack"; +export class Client { + constructor(config) { + this.middlewareStack = constructStack(); + this.config = config; + } + send(command, optionsOrCb, cb) { + const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined; + const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; + const handler = command.resolveMiddleware(this.middlewareStack, this.config, options); + if (callback) { + handler(command) + .then((result) => callback(null, result.output), (err) => callback(err)) + .catch(() => { }); + } + else { + return handler(command).then((result) => result.output); + } + } + destroy() { + if (this.config.requestHandler.destroy) + this.config.requestHandler.destroy(); + } +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/command.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/command.js new file mode 100644 index 0000000000..fb5e211829 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/command.js @@ -0,0 +1,6 @@ +import { constructStack } from "@aws-sdk/middleware-stack"; +export class Command { + constructor() { + this.middlewareStack = constructStack(); + } +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/constants.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/constants.js new file mode 100644 index 0000000000..9b193d7859 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/constants.js @@ -0,0 +1 @@ +export const SENSITIVE_STRING = "***SensitiveInformation***"; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/date-utils.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/date-utils.js new file mode 100644 index 0000000000..e3293b2c12 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/date-utils.js @@ -0,0 +1,187 @@ +import { strictParseByte, strictParseDouble, strictParseFloat32, strictParseShort } from "./parse-utils"; +const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; +const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; +export function dateToUtcString(date) { + const year = date.getUTCFullYear(); + const month = date.getUTCMonth(); + const dayOfWeek = date.getUTCDay(); + const dayOfMonthInt = date.getUTCDate(); + const hoursInt = date.getUTCHours(); + const minutesInt = date.getUTCMinutes(); + const secondsInt = date.getUTCSeconds(); + const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; + const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; + const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; + const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; + return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`; +} +const RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); +export const parseRfc3339DateTime = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; + const year = strictParseShort(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); +}; +const RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); +export const parseRfc3339DateTimeWithOffset = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339_WITH_OFFSET.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; + const year = strictParseShort(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); + if (offsetStr.toUpperCase() != "Z") { + date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr)); + } + return date; +}; +const IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); +const RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); +const ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/); +export const parseRfc7231DateTime = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-7231 date-times must be expressed as strings"); + } + let match = IMF_FIXDATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); + } + match = RFC_850_DATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { + hours, + minutes, + seconds, + fractionalMilliseconds, + })); + } + match = ASC_TIME.exec(value); + if (match) { + const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; + return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); + } + throw new TypeError("Invalid RFC-7231 date-time value"); +}; +export const parseEpochTimestamp = (value) => { + if (value === null || value === undefined) { + return undefined; + } + let valueAsDouble; + if (typeof value === "number") { + valueAsDouble = value; + } + else if (typeof value === "string") { + valueAsDouble = strictParseDouble(value); + } + else { + throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); + } + if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { + throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); + } + return new Date(Math.round(valueAsDouble * 1000)); +}; +const buildDate = (year, month, day, time) => { + const adjustedMonth = month - 1; + validateDayOfMonth(year, adjustedMonth, day); + return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds))); +}; +const parseTwoDigitYear = (value) => { + const thisYear = new Date().getUTCFullYear(); + const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); + if (valueInThisCentury < thisYear) { + return valueInThisCentury + 100; + } + return valueInThisCentury; +}; +const FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000; +const adjustRfc850Year = (input) => { + if (input.getTime() - new Date().getTime() > FIFTY_YEARS_IN_MILLIS) { + return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds())); + } + return input; +}; +const parseMonthByShortName = (value) => { + const monthIdx = MONTHS.indexOf(value); + if (monthIdx < 0) { + throw new TypeError(`Invalid month: ${value}`); + } + return monthIdx + 1; +}; +const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +const validateDayOfMonth = (year, month, day) => { + let maxDays = DAYS_IN_MONTH[month]; + if (month === 1 && isLeapYear(year)) { + maxDays = 29; + } + if (day > maxDays) { + throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`); + } +}; +const isLeapYear = (year) => { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +}; +const parseDateValue = (value, type, lower, upper) => { + const dateVal = strictParseByte(stripLeadingZeroes(value)); + if (dateVal < lower || dateVal > upper) { + throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); + } + return dateVal; +}; +const parseMilliseconds = (value) => { + if (value === null || value === undefined) { + return 0; + } + return strictParseFloat32("0." + value) * 1000; +}; +const parseOffsetToMilliseconds = (value) => { + const directionStr = value[0]; + let direction = 1; + if (directionStr == "+") { + direction = 1; + } + else if (directionStr == "-") { + direction = -1; + } + else { + throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); + } + const hour = Number(value.substring(1, 3)); + const minute = Number(value.substring(4, 6)); + return direction * (hour * 60 + minute) * 60 * 1000; +}; +const stripLeadingZeroes = (value) => { + let idx = 0; + while (idx < value.length - 1 && value.charAt(idx) === "0") { + idx++; + } + if (idx === 0) { + return value; + } + return value.slice(idx); +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/default-error-handler.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/default-error-handler.js new file mode 100644 index 0000000000..72bb7a7c4c --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/default-error-handler.js @@ -0,0 +1,17 @@ +import { decorateServiceException } from "./exceptions"; +export const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; + const response = new exceptionCtor({ + name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknownError", + $fault: "client", + $metadata, + }); + throw decorateServiceException(response, parsedBody); +}; +const deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/defaults-mode.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/defaults-mode.js new file mode 100644 index 0000000000..f19079c000 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/defaults-mode.js @@ -0,0 +1,26 @@ +export const loadConfigsForDefaultMode = (mode) => { + switch (mode) { + case "standard": + return { + retryMode: "standard", + connectionTimeout: 3100, + }; + case "in-region": + return { + retryMode: "standard", + connectionTimeout: 1100, + }; + case "cross-region": + return { + retryMode: "standard", + connectionTimeout: 3100, + }; + case "mobile": + return { + retryMode: "standard", + connectionTimeout: 30000, + }; + default: + return {}; + } +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js new file mode 100644 index 0000000000..993b965471 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js @@ -0,0 +1,6 @@ +let warningEmitted = false; +export const emitWarningIfUnsupportedVersion = (version) => { + if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 14) { + warningEmitted = true; + } +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/exceptions.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/exceptions.js new file mode 100644 index 0000000000..e7d3ab4fd0 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/exceptions.js @@ -0,0 +1,22 @@ +export class ServiceException extends Error { + constructor(options) { + super(options.message); + Object.setPrototypeOf(this, ServiceException.prototype); + this.name = options.name; + this.$fault = options.$fault; + this.$metadata = options.$metadata; + } +} +export const decorateServiceException = (exception, additions = {}) => { + Object.entries(additions) + .filter(([, v]) => v !== undefined) + .forEach(([k, v]) => { + if (exception[k] == undefined || exception[k] === "") { + exception[k] = v; + } + }); + const message = exception.message || exception.Message || "UnknownError"; + exception.message = message; + delete exception.Message; + return exception; +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/extended-encode-uri-component.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/extended-encode-uri-component.js new file mode 100644 index 0000000000..5baeaf5634 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/extended-encode-uri-component.js @@ -0,0 +1,5 @@ +export function extendedEncodeURIComponent(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/get-array-if-single-item.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/get-array-if-single-item.js new file mode 100644 index 0000000000..25d9432720 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/get-array-if-single-item.js @@ -0,0 +1 @@ +export const getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/get-value-from-text-node.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/get-value-from-text-node.js new file mode 100644 index 0000000000..aa0f8271a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/get-value-from-text-node.js @@ -0,0 +1,12 @@ +export const getValueFromTextNode = (obj) => { + const textNodeName = "#text"; + for (const key in obj) { + if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) { + obj[key] = obj[key][textNodeName]; + } + else if (typeof obj[key] === "object" && obj[key] !== null) { + obj[key] = getValueFromTextNode(obj[key]); + } + } + return obj; +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/index.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/index.js new file mode 100644 index 0000000000..193fdb0069 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/index.js @@ -0,0 +1,18 @@ +export * from "./NoOpLogger"; +export * from "./client"; +export * from "./command"; +export * from "./constants"; +export * from "./date-utils"; +export * from "./default-error-handler"; +export * from "./defaults-mode"; +export * from "./emitWarningIfUnsupportedVersion"; +export * from "./exceptions"; +export * from "./extended-encode-uri-component"; +export * from "./get-array-if-single-item"; +export * from "./get-value-from-text-node"; +export * from "./lazy-json"; +export * from "./object-mapping"; +export * from "./parse-utils"; +export * from "./resolve-path"; +export * from "./ser-utils"; +export * from "./split-every"; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/lazy-json.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/lazy-json.js new file mode 100644 index 0000000000..cff1a7ebe1 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/lazy-json.js @@ -0,0 +1,33 @@ +export const StringWrapper = function () { + const Class = Object.getPrototypeOf(this).constructor; + const Constructor = Function.bind.apply(String, [null, ...arguments]); + const instance = new Constructor(); + Object.setPrototypeOf(instance, Class.prototype); + return instance; +}; +StringWrapper.prototype = Object.create(String.prototype, { + constructor: { + value: StringWrapper, + enumerable: false, + writable: true, + configurable: true, + }, +}); +Object.setPrototypeOf(StringWrapper, String); +export class LazyJsonString extends StringWrapper { + deserializeJSON() { + return JSON.parse(super.toString()); + } + toJSON() { + return super.toString(); + } + static fromObject(object) { + if (object instanceof LazyJsonString) { + return object; + } + else if (object instanceof String || typeof object === "string") { + return new LazyJsonString(object); + } + return new LazyJsonString(JSON.stringify(object)); + } +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/object-mapping.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/object-mapping.js new file mode 100644 index 0000000000..9cab8691f8 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/object-mapping.js @@ -0,0 +1,69 @@ +export function map(arg0, arg1, arg2) { + let target; + let filter; + let instructions; + if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { + target = {}; + instructions = arg0; + } + else { + target = arg0; + if (typeof arg1 === "function") { + filter = arg1; + instructions = arg2; + return mapWithFilter(target, filter, instructions); + } + else { + instructions = arg1; + } + } + for (const key of Object.keys(instructions)) { + if (!Array.isArray(instructions[key])) { + target[key] = instructions[key]; + continue; + } + let [filter, value] = instructions[key]; + if (typeof value === "function") { + let _value; + const defaultFilterPassed = filter === undefined && (_value = value()) != null; + const customFilterPassed = (typeof filter === "function" && !!filter(void 0)) || (typeof filter !== "function" && !!filter); + if (defaultFilterPassed) { + target[key] = _value; + } + else if (customFilterPassed) { + target[key] = value(); + } + } + else { + const defaultFilterPassed = filter === undefined && value != null; + const customFilterPassed = (typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter); + if (defaultFilterPassed || customFilterPassed) { + target[key] = value; + } + } + } + return target; +} +export const convertMap = (target) => { + const output = {}; + for (const [k, v] of Object.entries(target || {})) { + output[k] = [, v]; + } + return output; +}; +const mapWithFilter = (target, filter, instructions) => { + return map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => { + if (Array.isArray(value)) { + _instructions[key] = value; + } + else { + if (typeof value === "function") { + _instructions[key] = [filter, value()]; + } + else { + _instructions[key] = [filter, value]; + } + } + return _instructions; + }, {})); +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/parse-utils.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/parse-utils.js new file mode 100644 index 0000000000..209db79ad1 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/parse-utils.js @@ -0,0 +1,230 @@ +export const parseBoolean = (value) => { + switch (value) { + case "true": + return true; + case "false": + return false; + default: + throw new Error(`Unable to parse boolean value "${value}"`); + } +}; +export const expectBoolean = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "number") { + if (value === 0 || value === 1) { + logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (value === 0) { + return false; + } + if (value === 1) { + return true; + } + } + if (typeof value === "string") { + const lower = value.toLowerCase(); + if (lower === "false" || lower === "true") { + logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (lower === "false") { + return false; + } + if (lower === "true") { + return true; + } + } + if (typeof value === "boolean") { + return value; + } + throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); +}; +export const expectNumber = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "string") { + const parsed = parseFloat(value); + if (!Number.isNaN(parsed)) { + if (String(parsed) !== String(value)) { + logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); + } + return parsed; + } + } + if (typeof value === "number") { + return value; + } + throw new TypeError(`Expected number, got ${typeof value}: ${value}`); +}; +const MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); +export const expectFloat32 = (value) => { + const expected = expectNumber(value); + if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { + if (Math.abs(expected) > MAX_FLOAT) { + throw new TypeError(`Expected 32-bit float, got ${value}`); + } + } + return expected; +}; +export const expectLong = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (Number.isInteger(value) && !Number.isNaN(value)) { + return value; + } + throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); +}; +export const expectInt = expectLong; +export const expectInt32 = (value) => expectSizedInt(value, 32); +export const expectShort = (value) => expectSizedInt(value, 16); +export const expectByte = (value) => expectSizedInt(value, 8); +const expectSizedInt = (value, size) => { + const expected = expectLong(value); + if (expected !== undefined && castInt(expected, size) !== expected) { + throw new TypeError(`Expected ${size}-bit integer, got ${value}`); + } + return expected; +}; +const castInt = (value, size) => { + switch (size) { + case 32: + return Int32Array.of(value)[0]; + case 16: + return Int16Array.of(value)[0]; + case 8: + return Int8Array.of(value)[0]; + } +}; +export const expectNonNull = (value, location) => { + if (value === null || value === undefined) { + if (location) { + throw new TypeError(`Expected a non-null value for ${location}`); + } + throw new TypeError("Expected a non-null value"); + } + return value; +}; +export const expectObject = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "object" && !Array.isArray(value)) { + return value; + } + const receivedType = Array.isArray(value) ? "array" : typeof value; + throw new TypeError(`Expected object, got ${receivedType}: ${value}`); +}; +export const expectString = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "string") { + return value; + } + if (["boolean", "number", "bigint"].includes(typeof value)) { + logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); + return String(value); + } + throw new TypeError(`Expected string, got ${typeof value}: ${value}`); +}; +export const expectUnion = (value) => { + if (value === null || value === undefined) { + return undefined; + } + const asObject = expectObject(value); + const setKeys = Object.entries(asObject) + .filter(([, v]) => v != null) + .map(([k]) => k); + if (setKeys.length === 0) { + throw new TypeError(`Unions must have exactly one non-null member. None were found.`); + } + if (setKeys.length > 1) { + throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); + } + return asObject; +}; +export const strictParseDouble = (value) => { + if (typeof value == "string") { + return expectNumber(parseNumber(value)); + } + return expectNumber(value); +}; +export const strictParseFloat = strictParseDouble; +export const strictParseFloat32 = (value) => { + if (typeof value == "string") { + return expectFloat32(parseNumber(value)); + } + return expectFloat32(value); +}; +const NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; +const parseNumber = (value) => { + const matches = value.match(NUMBER_REGEX); + if (matches === null || matches[0].length !== value.length) { + throw new TypeError(`Expected real number, got implicit NaN`); + } + return parseFloat(value); +}; +export const limitedParseDouble = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectNumber(value); +}; +export const handleFloat = limitedParseDouble; +export const limitedParseFloat = limitedParseDouble; +export const limitedParseFloat32 = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectFloat32(value); +}; +const parseFloatString = (value) => { + switch (value) { + case "NaN": + return NaN; + case "Infinity": + return Infinity; + case "-Infinity": + return -Infinity; + default: + throw new Error(`Unable to parse float value: ${value}`); + } +}; +export const strictParseLong = (value) => { + if (typeof value === "string") { + return expectLong(parseNumber(value)); + } + return expectLong(value); +}; +export const strictParseInt = strictParseLong; +export const strictParseInt32 = (value) => { + if (typeof value === "string") { + return expectInt32(parseNumber(value)); + } + return expectInt32(value); +}; +export const strictParseShort = (value) => { + if (typeof value === "string") { + return expectShort(parseNumber(value)); + } + return expectShort(value); +}; +export const strictParseByte = (value) => { + if (typeof value === "string") { + return expectByte(parseNumber(value)); + } + return expectByte(value); +}; +const stackTraceWarning = (message) => { + return String(new TypeError(message).stack || message) + .split("\n") + .slice(0, 5) + .filter((s) => !s.includes("stackTraceWarning")) + .join("\n"); +}; +export const logger = { + warn: console.warn, +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/resolve-path.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/resolve-path.js new file mode 100644 index 0000000000..8483e01430 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/resolve-path.js @@ -0,0 +1,19 @@ +import { extendedEncodeURIComponent } from "./extended-encode-uri-component"; +export const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { + if (input != null && input[memberName] !== undefined) { + const labelValue = labelValueProvider(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: " + memberName + "."); + } + resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel + ? labelValue + .split("/") + .map((segment) => extendedEncodeURIComponent(segment)) + .join("/") + : extendedEncodeURIComponent(labelValue)); + } + else { + throw new Error("No value provided for input HTTP label: " + memberName + "."); + } + return resolvedPath; +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/ser-utils.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/ser-utils.js new file mode 100644 index 0000000000..91e5f30ba6 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/ser-utils.js @@ -0,0 +1,13 @@ +export const serializeFloat = (value) => { + if (value !== value) { + return "NaN"; + } + switch (value) { + case Infinity: + return "Infinity"; + case -Infinity: + return "-Infinity"; + default: + return value; + } +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-es/split-every.js b/server/node_modules/@aws-sdk/smithy-client/dist-es/split-every.js new file mode 100644 index 0000000000..1d78dcae3f --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-es/split-every.js @@ -0,0 +1,27 @@ +export function splitEvery(value, delimiter, numDelimiters) { + if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { + throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); + } + const segments = value.split(delimiter); + if (numDelimiters === 1) { + return segments; + } + const compoundSegments = []; + let currentSegment = ""; + for (let i = 0; i < segments.length; i++) { + if (currentSegment === "") { + currentSegment = segments[i]; + } + else { + currentSegment += delimiter + segments[i]; + } + if ((i + 1) % numDelimiters === 0) { + compoundSegments.push(currentSegment); + currentSegment = ""; + } + } + if (currentSegment !== "") { + compoundSegments.push(currentSegment); + } + return compoundSegments; +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/NoOpLogger.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/NoOpLogger.d.ts new file mode 100644 index 0000000000..eb6995613e --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/NoOpLogger.d.ts @@ -0,0 +1,8 @@ +import { Logger } from "@aws-sdk/types"; +export declare class NoOpLogger implements Logger { + trace(): void; + debug(): void; + info(): void; + warn(): void; + error(): void; +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/client.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/client.d.ts new file mode 100644 index 0000000000..5775701360 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/client.d.ts @@ -0,0 +1,20 @@ +import { Client as IClient, Command, MetadataBearer, MiddlewareStack, RequestHandler } from "@aws-sdk/types"; +export interface SmithyConfiguration { + requestHandler: RequestHandler; + /** + * The API version set internally by the SDK, and is + * not planned to be used by customer code. + * @internal + */ + readonly apiVersion: string; +} +export declare type SmithyResolvedConfiguration = SmithyConfiguration; +export declare class Client> implements IClient { + middlewareStack: MiddlewareStack; + readonly config: ResolvedClientConfiguration; + constructor(config: ResolvedClientConfiguration); + send(command: Command>, options?: HandlerOptions): Promise; + send(command: Command>, cb: (err: any, data?: OutputType) => void): void; + send(command: Command>, options: HandlerOptions, cb: (err: any, data?: OutputType) => void): void; + destroy(): void; +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/command.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/command.d.ts new file mode 100644 index 0000000000..bd05ecd140 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/command.d.ts @@ -0,0 +1,6 @@ +import { Command as ICommand, Handler, MetadataBearer, MiddlewareStack as IMiddlewareStack } from "@aws-sdk/types"; +export declare abstract class Command implements ICommand { + abstract input: Input; + readonly middlewareStack: IMiddlewareStack; + abstract resolveMiddleware(stack: IMiddlewareStack, configuration: ResolvedClientConfiguration, options: any): Handler; +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/constants.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/constants.d.ts new file mode 100644 index 0000000000..038717b21a --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/constants.d.ts @@ -0,0 +1 @@ +export declare const SENSITIVE_STRING = "***SensitiveInformation***"; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/date-utils.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/date-utils.d.ts new file mode 100644 index 0000000000..fe0a459aa7 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/date-utils.d.ts @@ -0,0 +1,63 @@ +/** + * Builds a proper UTC HttpDate timestamp from a Date object + * since not all environments will have this as the expected + * format. + * + * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString + * > Prior to ECMAScript 2018, the format of the return value + * > varied according to the platform. The most common return + * > value was an RFC-1123 formatted date stamp, which is a + * > slightly updated version of RFC-822 date stamps. + */ +export declare function dateToUtcString(date: Date): string; +/** + * Parses a value into a Date. Returns undefined if the input is null or + * undefined, throws an error if the input is not a string that can be parsed + * as an RFC 3339 date. + * + * Input strings must conform to RFC3339 section 5.6, and cannot have a UTC + * offset. Fractional precision is supported. + * + * {@see https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14} + * + * @param value the value to parse + * @return a Date or undefined + */ +export declare const parseRfc3339DateTime: (value: unknown) => Date | undefined; +/** + * Parses a value into a Date. Returns undefined if the input is null or + * undefined, throws an error if the input is not a string that can be parsed + * as an RFC 3339 date. + * + * Input strings must conform to RFC3339 section 5.6, and can have a UTC + * offset. Fractional precision is supported. + * + * {@see https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14} + * + * @param value the value to parse + * @return a Date or undefined + */ +export declare const parseRfc3339DateTimeWithOffset: (value: unknown) => Date | undefined; +/** + * Parses a value into a Date. Returns undefined if the input is null or + * undefined, throws an error if the input is not a string that can be parsed + * as an RFC 7231 IMF-fixdate or obs-date. + * + * Input strings must conform to RFC7231 section 7.1.1.1. Fractional seconds are supported. + * + * {@see https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1} + * + * @param value the value to parse + * @return a Date or undefined + */ +export declare const parseRfc7231DateTime: (value: unknown) => Date | undefined; +/** + * Parses a value into a Date. Returns undefined if the input is null or + * undefined, throws an error if the input is not a number or a parseable string. + * + * Input strings must be an integer or floating point number. Fractional seconds are supported. + * + * @param value the value to parse + * @return a Date or undefined + */ +export declare const parseEpochTimestamp: (value: unknown) => Date | undefined; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/default-error-handler.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/default-error-handler.d.ts new file mode 100644 index 0000000000..853d85e822 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/default-error-handler.d.ts @@ -0,0 +1,7 @@ +/** + * Always throws an error with the given {@param exceptionCtor} and other arguments. + * This is only called from an error handling code path. + * @private + * @internal + */ +export declare const throwDefaultError: ({ output, parsedBody, exceptionCtor, errorCode }: any) => never; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/defaults-mode.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/defaults-mode.d.ts new file mode 100644 index 0000000000..73c90bcfba --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/defaults-mode.d.ts @@ -0,0 +1,28 @@ +/** + * @internal + */ +export declare const loadConfigsForDefaultMode: (mode: ResolvedDefaultsMode) => DefaultsModeConfigs; +/** + * Option determining how certain default configuration options are resolved in the SDK. It can be one of the value listed below: + * * `"standard"`:

The STANDARD mode provides the latest recommended default values that should be safe to run in most scenarios

Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK

+ * * `"in-region"`:

The IN_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services from within the same AWS region

Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK

+ * * `"cross-region"`:

The CROSS_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services in a different region

Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK

+ * * `"mobile"`:

The MOBILE mode builds on the standard mode and includes optimization tailored for mobile applications

Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK

+ * * `"auto"`:

The AUTO mode is an experimental mode that builds on the standard mode. The SDK will attempt to discover the execution environment to determine the appropriate settings automatically.

Note that the auto detection is heuristics-based and does not guarantee 100% accuracy. STANDARD mode will be used if the execution environment cannot be determined. The auto detection might query EC2 Instance Metadata service, which might introduce latency. Therefore we recommend choosing an explicit defaults_mode instead if startup latency is critical to your application

+ * * `"legacy"`:

The LEGACY mode provides default settings that vary per SDK and were used prior to establishment of defaults_mode

+ * + * @default "legacy" + */ +export declare type DefaultsMode = "standard" | "in-region" | "cross-region" | "mobile" | "auto" | "legacy"; +/** + * @internal + */ +export declare type ResolvedDefaultsMode = Exclude; +/** + * @internal + */ +export interface DefaultsModeConfigs { + retryMode?: string; + connectionTimeout?: number; + requestTimeout?: number; +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/emitWarningIfUnsupportedVersion.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/emitWarningIfUnsupportedVersion.d.ts new file mode 100644 index 0000000000..99cc9ef256 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/emitWarningIfUnsupportedVersion.d.ts @@ -0,0 +1,6 @@ +/** + * Emits warning if the provided Node.js version string is pending deprecation. + * + * @param {string} version - The Node.js version string. + */ +export declare const emitWarningIfUnsupportedVersion: (version: string) => void; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/exceptions.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/exceptions.d.ts new file mode 100644 index 0000000000..ccda8d710a --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/exceptions.d.ts @@ -0,0 +1,29 @@ +import { HttpResponse, MetadataBearer, ResponseMetadata, RetryableTrait, SmithyException } from "@aws-sdk/types"; +/** + * The type of the exception class constructor parameter. The returned type contains the properties + * in the `ExceptionType` but not in the `BaseExceptionType`. If the `BaseExceptionType` contains + * `$metadata` and `message` properties, it's also included in the returned type. + * @internal + */ +export declare type ExceptionOptionType = Omit>; +export interface ServiceExceptionOptions extends SmithyException, MetadataBearer { + message?: string; +} +/** + * Base exception class for the exceptions from the server-side. + */ +export declare class ServiceException extends Error implements SmithyException, MetadataBearer { + readonly $fault: "client" | "server"; + $response?: HttpResponse; + $retryable?: RetryableTrait; + $metadata: ResponseMetadata; + constructor(options: ServiceExceptionOptions); +} +/** + * This method inject unmodeled member to a deserialized SDK exception, + * and load the error message from different possible keys('message', + * 'Message'). + * + * @internal + */ +export declare const decorateServiceException: (exception: E, additions?: Record) => E; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/extended-encode-uri-component.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/extended-encode-uri-component.d.ts new file mode 100644 index 0000000000..b49dc69fd3 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/extended-encode-uri-component.d.ts @@ -0,0 +1,5 @@ +/** + * Function that wraps encodeURIComponent to encode additional characters + * to fully adhere to RFC 3986. + */ +export declare function extendedEncodeURIComponent(str: string): string; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/get-array-if-single-item.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/get-array-if-single-item.d.ts new file mode 100644 index 0000000000..8728e7ac5b --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/get-array-if-single-item.d.ts @@ -0,0 +1,5 @@ +/** + * The XML parser will set one K:V for a member that could + * return multiple entries but only has one. + */ +export declare const getArrayIfSingleItem: (mayBeArray: T) => T | T[]; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/get-value-from-text-node.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/get-value-from-text-node.d.ts new file mode 100644 index 0000000000..001a196e1f --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/get-value-from-text-node.d.ts @@ -0,0 +1,5 @@ +/** + * Recursively parses object and populates value is node from + * "#text" key if it's available + */ +export declare const getValueFromTextNode: (obj: any) => any; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/index.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/index.d.ts new file mode 100644 index 0000000000..0b7db823a4 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/index.d.ts @@ -0,0 +1,19 @@ +export * from "./NoOpLogger"; +export * from "./client"; +export * from "./command"; +export * from "./constants"; +export * from "./date-utils"; +export * from "./default-error-handler"; +export * from "./defaults-mode"; +export * from "./emitWarningIfUnsupportedVersion"; +export * from "./exceptions"; +export * from "./extended-encode-uri-component"; +export * from "./get-array-if-single-item"; +export * from "./get-value-from-text-node"; +export * from "./lazy-json"; +export * from "./object-mapping"; +export * from "./parse-utils"; +export * from "./resolve-path"; +export * from "./ser-utils"; +export * from "./split-every"; +export type { DocumentType, SdkError, SmithyException } from "@aws-sdk/types"; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/lazy-json.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/lazy-json.d.ts new file mode 100644 index 0000000000..9d8229411a --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/lazy-json.d.ts @@ -0,0 +1,19 @@ +/** + * Lazy String holder for JSON typed contents. + */ +interface StringWrapper { + new (arg: any): String; +} +/** + * Because of https://github.com/microsoft/tslib/issues/95, + * TS 'extends' shim doesn't support extending native types like String. + * So here we create StringWrapper that duplicate everything from String + * class including its prototype chain. So we can extend from here. + */ +export declare const StringWrapper: StringWrapper; +export declare class LazyJsonString extends StringWrapper { + deserializeJSON(): any; + toJSON(): string; + static fromObject(object: any): LazyJsonString; +} +export {}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/object-mapping.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/object-mapping.d.ts new file mode 100644 index 0000000000..0f069317fb --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/object-mapping.d.ts @@ -0,0 +1,104 @@ +/** + * A set of instructions for multiple keys. + * The aim is to provide a concise yet readable way to map and filter values + * onto a target object. + * + * @example + * ```javascript + * const example: ObjectMappingInstructions = { + * lazyValue1: [, () => 1], + * lazyValue2: [, () => 2], + * lazyValue3: [, () => 3], + * lazyConditionalValue1: [() => true, () => 4], + * lazyConditionalValue2: [() => true, () => 5], + * lazyConditionalValue3: [true, () => 6], + * lazyConditionalValue4: [false, () => 44], + * lazyConditionalValue5: [() => false, () => 55], + * lazyConditionalValue6: ["", () => 66], + * simpleValue1: [, 7], + * simpleValue2: [, 8], + * simpleValue3: [, 9], + * conditionalValue1: [() => true, 10], + * conditionalValue2: [() => true, 11], + * conditionalValue3: [{}, 12], + * conditionalValue4: [false, 110], + * conditionalValue5: [() => false, 121], + * conditionalValue6: ["", 132], + * }; + * + * const exampleResult: Record = { + * lazyValue1: 1, + * lazyValue2: 2, + * lazyValue3: 3, + * lazyConditionalValue1: 4, + * lazyConditionalValue2: 5, + * lazyConditionalValue3: 6, + * simpleValue1: 7, + * simpleValue2: 8, + * simpleValue3: 9, + * conditionalValue1: 10, + * conditionalValue2: 11, + * conditionalValue3: 12, + * }; + * ``` + */ +export declare type ObjectMappingInstructions = Record; +/** + * An instruction set for assigning a value to a target object. + */ +export declare type ObjectMappingInstruction = LazyValueInstruction | ConditionalLazyValueInstruction | SimpleValueInstruction | ConditionalValueInstruction | UnfilteredValue; +/** + * non-array + */ +export declare type UnfilteredValue = any; +export declare type LazyValueInstruction = [FilterStatus, ValueSupplier]; +export declare type ConditionalLazyValueInstruction = [FilterStatusSupplier, ValueSupplier]; +export declare type SimpleValueInstruction = [FilterStatus, Value]; +export declare type ConditionalValueInstruction = [ValueFilteringFunction, Value]; +/** + * Filter is considered passed if + * 1. It is a boolean true. + * 2. It is not undefined and is itself truthy. + * 3. It is undefined and the corresponding _value_ is neither null nor undefined. + */ +export declare type FilterStatus = boolean | unknown | void; +/** + * Supplies the filter check but not against any value as input. + */ +export declare type FilterStatusSupplier = () => boolean; +/** + * Filter check with the given value. + */ +export declare type ValueFilteringFunction = (value: any) => boolean; +/** + * Supplies the value for lazy evaluation. + */ +export declare type ValueSupplier = () => any; +/** + * A non-function value. + */ +export declare type Value = any; +/** + * Internal/Private, for codegen use only. + * + * Transfer a set of keys from [instructions] to [target]. + * + * For each instruction in the record, the target key will be the instruction key. + * The target assignment will be conditional on the instruction's filter. + * The target assigned value will be supplied by the instructions as an evaluable function or non-function value. + * + * @see ObjectMappingInstructions for an example. + * @private + * @internal + */ +export declare function map(target: any, filter: (value: any) => boolean, instructions: Record): typeof target; +export declare function map(instructions: Record): any; +export declare function map(target: any, instructions: Record): typeof target; +/** + * Convert a regular object { k: v } to { k: [, v] } mapping instruction set with default + * filter. + * + * @private + * @internal + */ +export declare const convertMap: (target: any) => Record; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/parse-utils.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/parse-utils.d.ts new file mode 100644 index 0000000000..9653cd66f8 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/parse-utils.d.ts @@ -0,0 +1,220 @@ +/** + * Give an input string, strictly parses a boolean value. + * + * @param value The boolean string to parse. + * @returns true for "true", false for "false", otherwise an error is thrown. + */ +export declare const parseBoolean: (value: string) => boolean; +/** + * Asserts a value is a boolean and returns it. + * Casts strings and numbers with a warning if there is evidence that they were + * intended to be booleans. + * + * @param value A value that is expected to be a boolean. + * @returns The value if it's a boolean, undefined if it's null/undefined, + * otherwise an error is thrown. + */ +export declare const expectBoolean: (value: any) => boolean | undefined; +/** + * Asserts a value is a number and returns it. + * Casts strings with a warning if the string is a parseable number. + * This is to unblock slight API definition/implementation inconsistencies. + * + * @param value A value that is expected to be a number. + * @returns The value if it's a number, undefined if it's null/undefined, + * otherwise an error is thrown. + */ +export declare const expectNumber: (value: any) => number | undefined; +/** + * Asserts a value is a 32-bit float and returns it. + * + * @param value A value that is expected to be a 32-bit float. + * @returns The value if it's a float, undefined if it's null/undefined, + * otherwise an error is thrown. + */ +export declare const expectFloat32: (value: any) => number | undefined; +/** + * Asserts a value is an integer and returns it. + * + * @param value A value that is expected to be an integer. + * @returns The value if it's an integer, undefined if it's null/undefined, + * otherwise an error is thrown. + */ +export declare const expectLong: (value: any) => number | undefined; +/** + * @deprecated Use expectLong + */ +export declare const expectInt: (value: any) => number | undefined; +/** + * Asserts a value is a 32-bit integer and returns it. + * + * @param value A value that is expected to be an integer. + * @returns The value if it's an integer, undefined if it's null/undefined, + * otherwise an error is thrown. + */ +export declare const expectInt32: (value: any) => number | undefined; +/** + * Asserts a value is a 16-bit integer and returns it. + * + * @param value A value that is expected to be an integer. + * @returns The value if it's an integer, undefined if it's null/undefined, + * otherwise an error is thrown. + */ +export declare const expectShort: (value: any) => number | undefined; +/** + * Asserts a value is an 8-bit integer and returns it. + * + * @param value A value that is expected to be an integer. + * @returns The value if it's an integer, undefined if it's null/undefined, + * otherwise an error is thrown. + */ +export declare const expectByte: (value: any) => number | undefined; +/** + * Asserts a value is not null or undefined and returns it, or throws an error. + * + * @param value A value that is expected to be defined + * @param location The location where we're expecting to find a defined object (optional) + * @returns The value if it's not undefined, otherwise throws an error + */ +export declare const expectNonNull: (value: T | null | undefined, location?: string | undefined) => T; +/** + * Asserts a value is an JSON-like object and returns it. This is expected to be used + * with values parsed from JSON (arrays, objects, numbers, strings, booleans). + * + * @param value A value that is expected to be an object + * @returns The value if it's an object, undefined if it's null/undefined, + * otherwise an error is thrown. + */ +export declare const expectObject: (value: any) => Record | undefined; +/** + * Asserts a value is a string and returns it. + * Numbers and boolean will be cast to strings with a warning. + * + * @param value A value that is expected to be a string. + * @returns The value if it's a string, undefined if it's null/undefined, + * otherwise an error is thrown. + */ +export declare const expectString: (value: any) => string | undefined; +/** + * Asserts a value is a JSON-like object with only one non-null/non-undefined key and + * returns it. + * + * @param value A value that is expected to be an object with exactly one non-null, + * non-undefined key. + * @return the value if it's a union, undefined if it's null/undefined, otherwise + * an error is thrown. + */ +export declare const expectUnion: (value: unknown) => Record | undefined; +/** + * Parses a value into a double. If the value is null or undefined, undefined + * will be returned. If the value is a string, it will be parsed by the standard + * parseFloat with one exception: NaN may only be explicitly set as the string + * "NaN", any implicit Nan values will result in an error being thrown. If any + * other type is provided, an exception will be thrown. + * + * @param value A number or string representation of a double. + * @returns The value as a number, or undefined if it's null/undefined. + */ +export declare const strictParseDouble: (value: string | number) => number | undefined; +/** + * @deprecated Use strictParseDouble + */ +export declare const strictParseFloat: (value: string | number) => number | undefined; +/** + * Parses a value into a float. If the value is null or undefined, undefined + * will be returned. If the value is a string, it will be parsed by the standard + * parseFloat with one exception: NaN may only be explicitly set as the string + * "NaN", any implicit Nan values will result in an error being thrown. If any + * other type is provided, an exception will be thrown. + * + * @param value A number or string representation of a float. + * @returns The value as a number, or undefined if it's null/undefined. + */ +export declare const strictParseFloat32: (value: string | number) => number | undefined; +/** + * Asserts a value is a number and returns it. If the value is a string + * representation of a non-numeric number type (NaN, Infinity, -Infinity), + * the value will be parsed. Any other string value will result in an exception + * being thrown. Null or undefined will be returned as undefined. Any other + * type will result in an exception being thrown. + * + * @param value A number or string representation of a non-numeric float. + * @returns The value as a number, or undefined if it's null/undefined. + */ +export declare const limitedParseDouble: (value: string | number) => number | undefined; +/** + * @deprecated Use limitedParseDouble + */ +export declare const handleFloat: (value: string | number) => number | undefined; +/** + * @deprecated Use limitedParseDouble + */ +export declare const limitedParseFloat: (value: string | number) => number | undefined; +/** + * Asserts a value is a 32-bit float and returns it. If the value is a string + * representation of a non-numeric number type (NaN, Infinity, -Infinity), + * the value will be parsed. Any other string value will result in an exception + * being thrown. Null or undefined will be returned as undefined. Any other + * type will result in an exception being thrown. + * + * @param value A number or string representation of a non-numeric float. + * @returns The value as a number, or undefined if it's null/undefined. + */ +export declare const limitedParseFloat32: (value: string | number) => number | undefined; +/** + * Parses a value into an integer. If the value is null or undefined, undefined + * will be returned. If the value is a string, it will be parsed by parseFloat + * and the result will be asserted to be an integer. If the parsed value is not + * an integer, or the raw value is any type other than a string or number, an + * exception will be thrown. + * + * @param value A number or string representation of an integer. + * @returns The value as a number, or undefined if it's null/undefined. + */ +export declare const strictParseLong: (value: string | number) => number | undefined; +/** + * @deprecated Use strictParseLong + */ +export declare const strictParseInt: (value: string | number) => number | undefined; +/** + * Parses a value into a 32-bit integer. If the value is null or undefined, undefined + * will be returned. If the value is a string, it will be parsed by parseFloat + * and the result will be asserted to be an integer. If the parsed value is not + * an integer, or the raw value is any type other than a string or number, an + * exception will be thrown. + * + * @param value A number or string representation of a 32-bit integer. + * @returns The value as a number, or undefined if it's null/undefined. + */ +export declare const strictParseInt32: (value: string | number) => number | undefined; +/** + * Parses a value into a 16-bit integer. If the value is null or undefined, undefined + * will be returned. If the value is a string, it will be parsed by parseFloat + * and the result will be asserted to be an integer. If the parsed value is not + * an integer, or the raw value is any type other than a string or number, an + * exception will be thrown. + * + * @param value A number or string representation of a 16-bit integer. + * @returns The value as a number, or undefined if it's null/undefined. + */ +export declare const strictParseShort: (value: string | number) => number | undefined; +/** + * Parses a value into an 8-bit integer. If the value is null or undefined, undefined + * will be returned. If the value is a string, it will be parsed by parseFloat + * and the result will be asserted to be an integer. If the parsed value is not + * an integer, or the raw value is any type other than a string or number, an + * exception will be thrown. + * + * @param value A number or string representation of an 8-bit integer. + * @returns The value as a number, or undefined if it's null/undefined. + */ +export declare const strictParseByte: (value: string | number) => number | undefined; +/** + * @private + */ +export declare const logger: { + warn: { + (...data: any[]): void; + (message?: any, ...optionalParams: any[]): void; + }; +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/resolve-path.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/resolve-path.d.ts new file mode 100644 index 0000000000..f37f65ebd9 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/resolve-path.d.ts @@ -0,0 +1 @@ +export declare const resolvedPath: (resolvedPath: string, input: unknown, memberName: string, labelValueProvider: () => string | undefined, uriLabel: string, isGreedyLabel: boolean) => string; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ser-utils.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ser-utils.d.ts new file mode 100644 index 0000000000..38fe0c0795 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ser-utils.d.ts @@ -0,0 +1,7 @@ +/** + * Serializes a number, turning non-numeric values into strings. + * + * @param value The number to serialize. + * @returns A number, or a string if the given number was non-numeric. + */ +export declare const serializeFloat: (value: number) => string | number; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/split-every.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/split-every.d.ts new file mode 100644 index 0000000000..eeca0ca887 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/split-every.d.ts @@ -0,0 +1,9 @@ +/** + * Given an input string, splits based on the delimiter after a given + * number of delimiters has been encountered. + * + * @param value The input string to split. + * @param delimiter The delimiter to split on. + * @param numDelimiters The number of delimiters to have encountered to split. + */ +export declare function splitEvery(value: string, delimiter: string, numDelimiters: number): Array; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/NoOpLogger.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/NoOpLogger.d.ts new file mode 100644 index 0000000000..1533e8d767 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/NoOpLogger.d.ts @@ -0,0 +1,8 @@ +import { Logger } from "@aws-sdk/types"; +export declare class NoOpLogger implements Logger { + trace(): void; + debug(): void; + info(): void; + warn(): void; + error(): void; +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/client.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/client.d.ts new file mode 100644 index 0000000000..67b1f02ac6 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/client.d.ts @@ -0,0 +1,56 @@ +import { + Client as IClient, + Command, + MetadataBearer, + MiddlewareStack, + RequestHandler, +} from "@aws-sdk/types"; +export interface SmithyConfiguration { + requestHandler: RequestHandler; + readonly apiVersion: string; +} +export declare type SmithyResolvedConfiguration = + SmithyConfiguration; +export declare class Client< + HandlerOptions, + ClientInput extends object, + ClientOutput extends MetadataBearer, + ResolvedClientConfiguration extends SmithyResolvedConfiguration +> implements IClient +{ + middlewareStack: MiddlewareStack; + readonly config: ResolvedClientConfiguration; + constructor(config: ResolvedClientConfiguration); + send( + command: Command< + ClientInput, + InputType, + ClientOutput, + OutputType, + SmithyResolvedConfiguration + >, + options?: HandlerOptions + ): Promise; + send( + command: Command< + ClientInput, + InputType, + ClientOutput, + OutputType, + SmithyResolvedConfiguration + >, + cb: (err: any, data?: OutputType) => void + ): void; + send( + command: Command< + ClientInput, + InputType, + ClientOutput, + OutputType, + SmithyResolvedConfiguration + >, + options: HandlerOptions, + cb: (err: any, data?: OutputType) => void + ): void; + destroy(): void; +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/command.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/command.d.ts new file mode 100644 index 0000000000..2fc7554ae9 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/command.d.ts @@ -0,0 +1,29 @@ +import { + Command as ICommand, + Handler, + MetadataBearer, + MiddlewareStack as IMiddlewareStack, +} from "@aws-sdk/types"; +export declare abstract class Command< + Input extends ClientInput, + Output extends ClientOutput, + ResolvedClientConfiguration, + ClientInput extends object = any, + ClientOutput extends MetadataBearer = any +> implements + ICommand< + ClientInput, + Input, + ClientOutput, + Output, + ResolvedClientConfiguration + > +{ + abstract input: Input; + readonly middlewareStack: IMiddlewareStack; + abstract resolveMiddleware( + stack: IMiddlewareStack, + configuration: ResolvedClientConfiguration, + options: any + ): Handler; +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/constants.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/constants.d.ts new file mode 100644 index 0000000000..038717b21a --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/constants.d.ts @@ -0,0 +1 @@ +export declare const SENSITIVE_STRING = "***SensitiveInformation***"; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/date-utils.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/date-utils.d.ts new file mode 100644 index 0000000000..6df0230dd4 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/date-utils.d.ts @@ -0,0 +1,7 @@ +export declare function dateToUtcString(date: Date): string; +export declare const parseRfc3339DateTime: (value: unknown) => Date | undefined; +export declare const parseRfc3339DateTimeWithOffset: ( + value: unknown +) => Date | undefined; +export declare const parseRfc7231DateTime: (value: unknown) => Date | undefined; +export declare const parseEpochTimestamp: (value: unknown) => Date | undefined; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/default-error-handler.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/default-error-handler.d.ts new file mode 100644 index 0000000000..dada7bce57 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/default-error-handler.d.ts @@ -0,0 +1,6 @@ +export declare const throwDefaultError: ({ + output, + parsedBody, + exceptionCtor, + errorCode, +}: any) => never; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/defaults-mode.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/defaults-mode.d.ts new file mode 100644 index 0000000000..edaf000fa4 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/defaults-mode.d.ts @@ -0,0 +1,16 @@ +export declare const loadConfigsForDefaultMode: ( + mode: ResolvedDefaultsMode +) => DefaultsModeConfigs; +export declare type DefaultsMode = + | "standard" + | "in-region" + | "cross-region" + | "mobile" + | "auto" + | "legacy"; +export declare type ResolvedDefaultsMode = Exclude; +export interface DefaultsModeConfigs { + retryMode?: string; + connectionTimeout?: number; + requestTimeout?: number; +} diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/emitWarningIfUnsupportedVersion.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/emitWarningIfUnsupportedVersion.d.ts new file mode 100644 index 0000000000..b9cb3ac1a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/emitWarningIfUnsupportedVersion.d.ts @@ -0,0 +1 @@ +export declare const emitWarningIfUnsupportedVersion: (version: string) => void; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/exceptions.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/exceptions.d.ts new file mode 100644 index 0000000000..dd5854731a --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/exceptions.d.ts @@ -0,0 +1,36 @@ +import { + HttpResponse, + MetadataBearer, + ResponseMetadata, + RetryableTrait, + SmithyException, +} from "@aws-sdk/types"; +export declare type ExceptionOptionType< + ExceptionType extends Error, + BaseExceptionType extends Error +> = Pick< + ExceptionType, + Exclude< + keyof ExceptionType, + Exclude + > +>; +export interface ServiceExceptionOptions + extends SmithyException, + MetadataBearer { + message?: string; +} +export declare class ServiceException + extends Error + implements SmithyException, MetadataBearer +{ + readonly $fault: "client" | "server"; + $response?: HttpResponse; + $retryable?: RetryableTrait; + $metadata: ResponseMetadata; + constructor(options: ServiceExceptionOptions); +} +export declare const decorateServiceException: ( + exception: E, + additions?: Record +) => E; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/extended-encode-uri-component.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/extended-encode-uri-component.d.ts new file mode 100644 index 0000000000..7713de99e5 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/extended-encode-uri-component.d.ts @@ -0,0 +1 @@ +export declare function extendedEncodeURIComponent(str: string): string; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/get-array-if-single-item.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/get-array-if-single-item.d.ts new file mode 100644 index 0000000000..4416d3bbeb --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/get-array-if-single-item.d.ts @@ -0,0 +1 @@ +export declare const getArrayIfSingleItem: (mayBeArray: T) => T | T[]; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/get-value-from-text-node.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/get-value-from-text-node.d.ts new file mode 100644 index 0000000000..79160dce82 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/get-value-from-text-node.d.ts @@ -0,0 +1 @@ +export declare const getValueFromTextNode: (obj: any) => any; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..7bc39c3e77 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/index.d.ts @@ -0,0 +1,19 @@ +export * from "./NoOpLogger"; +export * from "./client"; +export * from "./command"; +export * from "./constants"; +export * from "./date-utils"; +export * from "./default-error-handler"; +export * from "./defaults-mode"; +export * from "./emitWarningIfUnsupportedVersion"; +export * from "./exceptions"; +export * from "./extended-encode-uri-component"; +export * from "./get-array-if-single-item"; +export * from "./get-value-from-text-node"; +export * from "./lazy-json"; +export * from "./object-mapping"; +export * from "./parse-utils"; +export * from "./resolve-path"; +export * from "./ser-utils"; +export * from "./split-every"; +export { DocumentType, SdkError, SmithyException } from "@aws-sdk/types"; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/lazy-json.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/lazy-json.d.ts new file mode 100644 index 0000000000..2b3c96d5fd --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/lazy-json.d.ts @@ -0,0 +1,10 @@ +interface StringWrapper { + new (arg: any): String; +} +export declare const StringWrapper: StringWrapper; +export declare class LazyJsonString extends StringWrapper { + deserializeJSON(): any; + toJSON(): string; + static fromObject(object: any): LazyJsonString; +} +export {}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/object-mapping.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/object-mapping.d.ts new file mode 100644 index 0000000000..f85f90ceae --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/object-mapping.d.ts @@ -0,0 +1,39 @@ +export declare type ObjectMappingInstructions = Record< + string, + ObjectMappingInstruction +>; +export declare type ObjectMappingInstruction = + | LazyValueInstruction + | ConditionalLazyValueInstruction + | SimpleValueInstruction + | ConditionalValueInstruction + | UnfilteredValue; +export declare type UnfilteredValue = any; +export declare type LazyValueInstruction = [FilterStatus, ValueSupplier]; +export declare type ConditionalLazyValueInstruction = [ + FilterStatusSupplier, + ValueSupplier +]; +export declare type SimpleValueInstruction = [FilterStatus, Value]; +export declare type ConditionalValueInstruction = [ + ValueFilteringFunction, + Value +]; +export declare type FilterStatus = boolean | unknown | void; +export declare type FilterStatusSupplier = () => boolean; +export declare type ValueFilteringFunction = (value: any) => boolean; +export declare type ValueSupplier = () => any; +export declare type Value = any; +export declare function map( + target: any, + filter: (value: any) => boolean, + instructions: Record +): typeof target; +export declare function map( + instructions: Record +): any; +export declare function map( + target: any, + instructions: Record +): typeof target; +export declare const convertMap: (target: any) => Record; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/parse-utils.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/parse-utils.d.ts new file mode 100644 index 0000000000..07f8fd40f9 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/parse-utils.d.ts @@ -0,0 +1,62 @@ +export declare const parseBoolean: (value: string) => boolean; +export declare const expectBoolean: (value: any) => boolean | undefined; +export declare const expectNumber: (value: any) => number | undefined; +export declare const expectFloat32: (value: any) => number | undefined; +export declare const expectLong: (value: any) => number | undefined; +export declare const expectInt: (value: any) => number | undefined; +export declare const expectInt32: (value: any) => number | undefined; +export declare const expectShort: (value: any) => number | undefined; +export declare const expectByte: (value: any) => number | undefined; +export declare const expectNonNull: ( + value: T | null | undefined, + location?: string | undefined +) => T; +export declare const expectObject: ( + value: any +) => Record | undefined; +export declare const expectString: (value: any) => string | undefined; +export declare const expectUnion: ( + value: unknown +) => Record | undefined; +export declare const strictParseDouble: ( + value: string | number +) => number | undefined; +export declare const strictParseFloat: ( + value: string | number +) => number | undefined; +export declare const strictParseFloat32: ( + value: string | number +) => number | undefined; +export declare const limitedParseDouble: ( + value: string | number +) => number | undefined; +export declare const handleFloat: ( + value: string | number +) => number | undefined; +export declare const limitedParseFloat: ( + value: string | number +) => number | undefined; +export declare const limitedParseFloat32: ( + value: string | number +) => number | undefined; +export declare const strictParseLong: ( + value: string | number +) => number | undefined; +export declare const strictParseInt: ( + value: string | number +) => number | undefined; +export declare const strictParseInt32: ( + value: string | number +) => number | undefined; +export declare const strictParseShort: ( + value: string | number +) => number | undefined; +export declare const strictParseByte: ( + value: string | number +) => number | undefined; +export declare const logger: { + warn: { + (...data: any[]): void; + (message?: any, ...optionalParams: any[]): void; + }; +}; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/resolve-path.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/resolve-path.d.ts new file mode 100644 index 0000000000..32abfc42de --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/resolve-path.d.ts @@ -0,0 +1,8 @@ +export declare const resolvedPath: ( + resolvedPath: string, + input: unknown, + memberName: string, + labelValueProvider: () => string | undefined, + uriLabel: string, + isGreedyLabel: boolean +) => string; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/ser-utils.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/ser-utils.d.ts new file mode 100644 index 0000000000..6981907dd4 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/ser-utils.d.ts @@ -0,0 +1 @@ +export declare const serializeFloat: (value: number) => string | number; diff --git a/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/split-every.d.ts b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/split-every.d.ts new file mode 100644 index 0000000000..c54166b458 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/dist-types/ts3.4/split-every.d.ts @@ -0,0 +1,5 @@ +export declare function splitEvery( + value: string, + delimiter: string, + numDelimiters: number +): Array; diff --git a/server/node_modules/@aws-sdk/smithy-client/package.json b/server/node_modules/@aws-sdk/smithy-client/package.json new file mode 100644 index 0000000000..ff2a6c3344 --- /dev/null +++ b/server/node_modules/@aws-sdk/smithy-client/package.json @@ -0,0 +1,55 @@ +{ + "name": "@aws-sdk/smithy-client", + "version": "3.261.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --passWithNoTests" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-stack": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/smithy-client", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/smithy-client" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/token-providers/LICENSE b/server/node_modules/@aws-sdk/token-providers/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/token-providers/README.md b/server/node_modules/@aws-sdk/token-providers/README.md new file mode 100644 index 0000000000..986776c39c --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/README.md @@ -0,0 +1,39 @@ +# @aws-sdk/token-providers + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/token-providers/latest.svg)](https://www.npmjs.com/package/@aws-sdk/token-providers) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/token-providers.svg)](https://www.npmjs.com/package/@aws-sdk/token-providers) + +A collection of all token providers. The token providers should be used when the authorization +type is going to be token based. For example, the `bearer` authorization type set using +[httpBearerAuth trait][http-bearer-auth-trait] in Smithy. + +## Static Token Provider + +```ts +import { fromStatic } from "@aws-sdk/token-providers" + +const token = { token: "TOKEN" }; +const staticTokenProvider = fromStatic(token); + +cont staticToken = await staticTokenProvider(); // returns { token: "TOKEN" } +``` + +## SSO Token Provider + +```ts +import { fromSso } from "@aws-sdk/token-providers" + +// returns token from SSO token cache or ssoOidc.createToken() call. +cont ssoToken = await fromSso(); +``` + +## Token Provider Chain + +```ts +import { nodeProvider } from "@aws-sdk/token-providers" + +// returns token from default providers. +cont token = await nodeProvider(); +``` + +[http-bearer-auth-trait]: https://smithy.io/2.0/spec/authentication-traits.html#smithy-api-httpbearerauth-trait diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/constants.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/constants.js new file mode 100644 index 0000000000..135f8b550d --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/constants.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.REFRESH_MESSAGE = exports.EXPIRE_WINDOW_MS = void 0; +exports.EXPIRE_WINDOW_MS = 5 * 60 * 1000; +exports.REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/fromSso.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/fromSso.js new file mode 100644 index 0000000000..e8a3e2ef13 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/fromSso.js @@ -0,0 +1,82 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromSso = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader"); +const constants_1 = require("./constants"); +const getNewSsoOidcToken_1 = require("./getNewSsoOidcToken"); +const validateTokenExpiry_1 = require("./validateTokenExpiry"); +const validateTokenKey_1 = require("./validateTokenKey"); +const writeSSOTokenToFile_1 = require("./writeSSOTokenToFile"); +const lastRefreshAttemptTime = new Date(0); +const fromSso = (init = {}) => async () => { + const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); + const profileName = (0, shared_ini_file_loader_1.getProfileName)(init); + const profile = profiles[profileName]; + if (!profile) { + throw new property_provider_1.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); + } + else if (!profile["sso_session"]) { + throw new property_provider_1.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); + } + const ssoSessionName = profile["sso_session"]; + const ssoSessions = await (0, shared_ini_file_loader_1.loadSsoSessionData)(init); + const ssoSession = ssoSessions[ssoSessionName]; + if (!ssoSession) { + throw new property_provider_1.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false); + } + for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) { + if (!ssoSession[ssoSessionRequiredKey]) { + throw new property_provider_1.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false); + } + } + const ssoStartUrl = ssoSession["sso_start_url"]; + const ssoRegion = ssoSession["sso_region"]; + let ssoToken; + try { + ssoToken = await (0, shared_ini_file_loader_1.getSSOTokenFromFile)(ssoSessionName); + } + catch (e) { + throw new property_provider_1.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${constants_1.REFRESH_MESSAGE}`, false); + } + (0, validateTokenKey_1.validateTokenKey)("accessToken", ssoToken.accessToken); + (0, validateTokenKey_1.validateTokenKey)("expiresAt", ssoToken.expiresAt); + const { accessToken, expiresAt } = ssoToken; + const existingToken = { token: accessToken, expiration: new Date(expiresAt) }; + if (existingToken.expiration.getTime() - Date.now() > constants_1.EXPIRE_WINDOW_MS) { + return existingToken; + } + if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) { + (0, validateTokenExpiry_1.validateTokenExpiry)(existingToken); + return existingToken; + } + (0, validateTokenKey_1.validateTokenKey)("clientId", ssoToken.clientId, true); + (0, validateTokenKey_1.validateTokenKey)("clientSecret", ssoToken.clientSecret, true); + (0, validateTokenKey_1.validateTokenKey)("refreshToken", ssoToken.refreshToken, true); + try { + lastRefreshAttemptTime.setTime(Date.now()); + const newSsoOidcToken = await (0, getNewSsoOidcToken_1.getNewSsoOidcToken)(ssoToken, ssoRegion); + (0, validateTokenKey_1.validateTokenKey)("accessToken", newSsoOidcToken.accessToken); + (0, validateTokenKey_1.validateTokenKey)("expiresIn", newSsoOidcToken.expiresIn); + const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000); + try { + await (0, writeSSOTokenToFile_1.writeSSOTokenToFile)(ssoSessionName, { + ...ssoToken, + accessToken: newSsoOidcToken.accessToken, + expiresAt: newTokenExpiration.toISOString(), + refreshToken: newSsoOidcToken.refreshToken, + }); + } + catch (error) { + } + return { + token: newSsoOidcToken.accessToken, + expiration: newTokenExpiration, + }; + } + catch (error) { + (0, validateTokenExpiry_1.validateTokenExpiry)(existingToken); + return existingToken; + } +}; +exports.fromSso = fromSso; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/fromStatic.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/fromStatic.js new file mode 100644 index 0000000000..636f64812c --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/fromStatic.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromStatic = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const fromStatic = ({ token }) => async () => { + if (!token || !token.token) { + throw new property_provider_1.TokenProviderError(`Please pass a valid token to fromStatic`, false); + } + return token; +}; +exports.fromStatic = fromStatic; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/getNewSsoOidcToken.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/getNewSsoOidcToken.js new file mode 100644 index 0000000000..0cd3ca8b25 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/getNewSsoOidcToken.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getNewSsoOidcToken = void 0; +const client_sso_oidc_1 = require("@aws-sdk/client-sso-oidc"); +const getSsoOidcClient_1 = require("./getSsoOidcClient"); +const getNewSsoOidcToken = (ssoToken, ssoRegion) => { + const ssoOidcClient = (0, getSsoOidcClient_1.getSsoOidcClient)(ssoRegion); + return ssoOidcClient.send(new client_sso_oidc_1.CreateTokenCommand({ + clientId: ssoToken.clientId, + clientSecret: ssoToken.clientSecret, + refreshToken: ssoToken.refreshToken, + grantType: "refresh_token", + })); +}; +exports.getNewSsoOidcToken = getNewSsoOidcToken; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/getSsoOidcClient.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/getSsoOidcClient.js new file mode 100644 index 0000000000..7f4a3ed35c --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/getSsoOidcClient.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSsoOidcClient = void 0; +const client_sso_oidc_1 = require("@aws-sdk/client-sso-oidc"); +const ssoOidcClientsHash = {}; +const getSsoOidcClient = (ssoRegion) => { + if (ssoOidcClientsHash[ssoRegion]) { + return ssoOidcClientsHash[ssoRegion]; + } + const ssoOidcClient = new client_sso_oidc_1.SSOOIDCClient({ region: ssoRegion }); + ssoOidcClientsHash[ssoRegion] = ssoOidcClient; + return ssoOidcClient; +}; +exports.getSsoOidcClient = getSsoOidcClient; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/index.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/index.js new file mode 100644 index 0000000000..3a45b493ac --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromSso"), exports); +tslib_1.__exportStar(require("./fromStatic"), exports); +tslib_1.__exportStar(require("./nodeProvider"), exports); diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/nodeProvider.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/nodeProvider.js new file mode 100644 index 0000000000..8f808ef8f6 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/nodeProvider.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.nodeProvider = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const fromSso_1 = require("./fromSso"); +const nodeProvider = (init = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)((0, fromSso_1.fromSso)(init), async () => { + throw new property_provider_1.TokenProviderError("Could not load token from any providers", false); +}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined); +exports.nodeProvider = nodeProvider; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/validateTokenExpiry.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/validateTokenExpiry.js new file mode 100644 index 0000000000..e9a4dadebf --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/validateTokenExpiry.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateTokenExpiry = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const constants_1 = require("./constants"); +const validateTokenExpiry = (token) => { + if (token.expiration && token.expiration.getTime() < Date.now()) { + throw new property_provider_1.TokenProviderError(`Token is expired. ${constants_1.REFRESH_MESSAGE}`, false); + } +}; +exports.validateTokenExpiry = validateTokenExpiry; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/validateTokenKey.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/validateTokenKey.js new file mode 100644 index 0000000000..7d93765688 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/validateTokenKey.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateTokenKey = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const constants_1 = require("./constants"); +const validateTokenKey = (key, value, forRefresh = false) => { + if (typeof value === "undefined") { + throw new property_provider_1.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${constants_1.REFRESH_MESSAGE}`, false); + } +}; +exports.validateTokenKey = validateTokenKey; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-cjs/writeSSOTokenToFile.js b/server/node_modules/@aws-sdk/token-providers/dist-cjs/writeSSOTokenToFile.js new file mode 100644 index 0000000000..40d6f7f3d0 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-cjs/writeSSOTokenToFile.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeSSOTokenToFile = void 0; +const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader"); +const fs_1 = require("fs"); +const { writeFile } = fs_1.promises; +const writeSSOTokenToFile = (id, ssoToken) => { + const tokenFilepath = (0, shared_ini_file_loader_1.getSSOTokenFilepath)(id); + const tokenString = JSON.stringify(ssoToken, null, 2); + return writeFile(tokenFilepath, tokenString); +}; +exports.writeSSOTokenToFile = writeSSOTokenToFile; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/constants.js b/server/node_modules/@aws-sdk/token-providers/dist-es/constants.js new file mode 100644 index 0000000000..b84a126782 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/constants.js @@ -0,0 +1,2 @@ +export const EXPIRE_WINDOW_MS = 5 * 60 * 1000; +export const REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js b/server/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js new file mode 100644 index 0000000000..b7339ab9bb --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js @@ -0,0 +1,78 @@ +import { TokenProviderError } from "@aws-sdk/property-provider"; +import { getProfileName, getSSOTokenFromFile, loadSsoSessionData, parseKnownFiles, } from "@aws-sdk/shared-ini-file-loader"; +import { EXPIRE_WINDOW_MS, REFRESH_MESSAGE } from "./constants"; +import { getNewSsoOidcToken } from "./getNewSsoOidcToken"; +import { validateTokenExpiry } from "./validateTokenExpiry"; +import { validateTokenKey } from "./validateTokenKey"; +import { writeSSOTokenToFile } from "./writeSSOTokenToFile"; +const lastRefreshAttemptTime = new Date(0); +export const fromSso = (init = {}) => async () => { + const profiles = await parseKnownFiles(init); + const profileName = getProfileName(init); + const profile = profiles[profileName]; + if (!profile) { + throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); + } + else if (!profile["sso_session"]) { + throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); + } + const ssoSessionName = profile["sso_session"]; + const ssoSessions = await loadSsoSessionData(init); + const ssoSession = ssoSessions[ssoSessionName]; + if (!ssoSession) { + throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false); + } + for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) { + if (!ssoSession[ssoSessionRequiredKey]) { + throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false); + } + } + const ssoStartUrl = ssoSession["sso_start_url"]; + const ssoRegion = ssoSession["sso_region"]; + let ssoToken; + try { + ssoToken = await getSSOTokenFromFile(ssoSessionName); + } + catch (e) { + throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false); + } + validateTokenKey("accessToken", ssoToken.accessToken); + validateTokenKey("expiresAt", ssoToken.expiresAt); + const { accessToken, expiresAt } = ssoToken; + const existingToken = { token: accessToken, expiration: new Date(expiresAt) }; + if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) { + return existingToken; + } + if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) { + validateTokenExpiry(existingToken); + return existingToken; + } + validateTokenKey("clientId", ssoToken.clientId, true); + validateTokenKey("clientSecret", ssoToken.clientSecret, true); + validateTokenKey("refreshToken", ssoToken.refreshToken, true); + try { + lastRefreshAttemptTime.setTime(Date.now()); + const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion); + validateTokenKey("accessToken", newSsoOidcToken.accessToken); + validateTokenKey("expiresIn", newSsoOidcToken.expiresIn); + const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000); + try { + await writeSSOTokenToFile(ssoSessionName, { + ...ssoToken, + accessToken: newSsoOidcToken.accessToken, + expiresAt: newTokenExpiration.toISOString(), + refreshToken: newSsoOidcToken.refreshToken, + }); + } + catch (error) { + } + return { + token: newSsoOidcToken.accessToken, + expiration: newTokenExpiration, + }; + } + catch (error) { + validateTokenExpiry(existingToken); + return existingToken; + } +}; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js b/server/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js new file mode 100644 index 0000000000..3f1eb0f312 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js @@ -0,0 +1,7 @@ +import { TokenProviderError } from "@aws-sdk/property-provider"; +export const fromStatic = ({ token }) => async () => { + if (!token || !token.token) { + throw new TokenProviderError(`Please pass a valid token to fromStatic`, false); + } + return token; +}; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js b/server/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js new file mode 100644 index 0000000000..4b2126b99c --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js @@ -0,0 +1,11 @@ +import { CreateTokenCommand } from "@aws-sdk/client-sso-oidc"; +import { getSsoOidcClient } from "./getSsoOidcClient"; +export const getNewSsoOidcToken = (ssoToken, ssoRegion) => { + const ssoOidcClient = getSsoOidcClient(ssoRegion); + return ssoOidcClient.send(new CreateTokenCommand({ + clientId: ssoToken.clientId, + clientSecret: ssoToken.clientSecret, + refreshToken: ssoToken.refreshToken, + grantType: "refresh_token", + })); +}; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js b/server/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js new file mode 100644 index 0000000000..249d726104 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js @@ -0,0 +1,10 @@ +import { SSOOIDCClient } from "@aws-sdk/client-sso-oidc"; +const ssoOidcClientsHash = {}; +export const getSsoOidcClient = (ssoRegion) => { + if (ssoOidcClientsHash[ssoRegion]) { + return ssoOidcClientsHash[ssoRegion]; + } + const ssoOidcClient = new SSOOIDCClient({ region: ssoRegion }); + ssoOidcClientsHash[ssoRegion] = ssoOidcClient; + return ssoOidcClient; +}; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/index.js b/server/node_modules/@aws-sdk/token-providers/dist-es/index.js new file mode 100644 index 0000000000..a0b176b4f2 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/index.js @@ -0,0 +1,3 @@ +export * from "./fromSso"; +export * from "./fromStatic"; +export * from "./nodeProvider"; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js b/server/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js new file mode 100644 index 0000000000..2b245677c4 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js @@ -0,0 +1,5 @@ +import { chain, memoize, TokenProviderError } from "@aws-sdk/property-provider"; +import { fromSso } from "./fromSso"; +export const nodeProvider = (init = {}) => memoize(chain(fromSso(init), async () => { + throw new TokenProviderError("Could not load token from any providers", false); +}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined); diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js b/server/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js new file mode 100644 index 0000000000..49c5226e5d --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js @@ -0,0 +1,7 @@ +import { TokenProviderError } from "@aws-sdk/property-provider"; +import { REFRESH_MESSAGE } from "./constants"; +export const validateTokenExpiry = (token) => { + if (token.expiration && token.expiration.getTime() < Date.now()) { + throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false); + } +}; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js b/server/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js new file mode 100644 index 0000000000..cefa1ad1fe --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js @@ -0,0 +1,7 @@ +import { TokenProviderError } from "@aws-sdk/property-provider"; +import { REFRESH_MESSAGE } from "./constants"; +export const validateTokenKey = (key, value, forRefresh = false) => { + if (typeof value === "undefined") { + throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false); + } +}; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js b/server/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js new file mode 100644 index 0000000000..ccc5bd3a53 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js @@ -0,0 +1,8 @@ +import { getSSOTokenFilepath } from "@aws-sdk/shared-ini-file-loader"; +import { promises as fsPromises } from "fs"; +const { writeFile } = fsPromises; +export const writeSSOTokenToFile = (id, ssoToken) => { + const tokenFilepath = getSSOTokenFilepath(id); + const tokenString = JSON.stringify(ssoToken, null, 2); + return writeFile(tokenFilepath, tokenString); +}; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts new file mode 100644 index 0000000000..de28cde96b --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts @@ -0,0 +1,8 @@ +/** + * The time window (5 mins) that SDK will treat the SSO token expires in before the defined expiration date in token. + * This is needed because server side may have invalidated the token before the defined expiration date. + * + * @internal + */ +export declare const EXPIRE_WINDOW_MS: number; +export declare const REFRESH_MESSAGE = "To refresh this SSO session run 'aws sso login' with the corresponding profile."; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts new file mode 100644 index 0000000000..93010d8e4b --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts @@ -0,0 +1,8 @@ +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { TokenIdentityProvider } from "@aws-sdk/types"; +export interface FromSsoInit extends SourceProfileInit { +} +/** + * Creates a token provider that will read from SSO token cache or ssoOidc.createToken() call. + */ +export declare const fromSso: (init?: FromSsoInit) => TokenIdentityProvider; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts new file mode 100644 index 0000000000..97967ebdc0 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts @@ -0,0 +1,8 @@ +import { TokenIdentity, TokenIdentityProvider } from "@aws-sdk/types"; +export interface FromStaticInit { + token?: TokenIdentity; +} +/** + * Creates a token provider that will read from static token. + */ +export declare const fromStatic: ({ token }: FromStaticInit) => TokenIdentityProvider; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts new file mode 100644 index 0000000000..14c2621985 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts @@ -0,0 +1,5 @@ +import { SSOToken } from "@aws-sdk/shared-ini-file-loader"; +/** + * Returns a new SSO OIDC token from ssoOids.createToken() API call. + */ +export declare const getNewSsoOidcToken: (ssoToken: SSOToken, ssoRegion: string) => Promise; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts new file mode 100644 index 0000000000..e93664d165 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts @@ -0,0 +1,6 @@ +import { SSOOIDCClient } from "@aws-sdk/client-sso-oidc"; +/** + * Returns a SSOOIDC client for the given region. If the client has already been created, + * it will be returned from the hash. + */ +export declare const getSsoOidcClient: (ssoRegion: string) => SSOOIDCClient; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts new file mode 100644 index 0000000000..a0b176b4f2 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts @@ -0,0 +1,3 @@ +export * from "./fromSso"; +export * from "./fromStatic"; +export * from "./nodeProvider"; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts new file mode 100644 index 0000000000..e4846ec588 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts @@ -0,0 +1,18 @@ +import { TokenIdentityProvider } from "@aws-sdk/types"; +import { FromSsoInit } from "./fromSso"; +/** + * Creates a token provider that will attempt to find token from the + * following sources (listed in order of precedence): + * * SSO token from SSO cache or ssoOidc.createToken() call + * + * The default token provider is designed to invoke one provider at a time and only + * continue to the next if no token has been located. It currently has only SSO + * Token Provider in the chain. + * + * @param init Configuration that is passed to each individual + * provider + * + * @see fromSso The function used to source credentials from + * SSO cache or ssoOidc.createToken() call + */ +export declare const nodeProvider: (init?: FromSsoInit) => TokenIdentityProvider; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts new file mode 100644 index 0000000000..d7e75772fb --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts @@ -0,0 +1,3 @@ +export declare const EXPIRE_WINDOW_MS: number; +export declare const REFRESH_MESSAGE = + "To refresh this SSO session run 'aws sso login' with the corresponding profile."; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts new file mode 100644 index 0000000000..8cc360333b --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts @@ -0,0 +1,4 @@ +import { SourceProfileInit } from "@aws-sdk/shared-ini-file-loader"; +import { TokenIdentityProvider } from "@aws-sdk/types"; +export interface FromSsoInit extends SourceProfileInit {} +export declare const fromSso: (init?: FromSsoInit) => TokenIdentityProvider; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts new file mode 100644 index 0000000000..7c338b9d37 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts @@ -0,0 +1,7 @@ +import { TokenIdentity, TokenIdentityProvider } from "@aws-sdk/types"; +export interface FromStaticInit { + token?: TokenIdentity; +} +export declare const fromStatic: ({ + token, +}: FromStaticInit) => TokenIdentityProvider; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts new file mode 100644 index 0000000000..a6bcdb32c6 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts @@ -0,0 +1,5 @@ +import { SSOToken } from "@aws-sdk/shared-ini-file-loader"; +export declare const getNewSsoOidcToken: ( + ssoToken: SSOToken, + ssoRegion: string +) => Promise; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts new file mode 100644 index 0000000000..538fca4c27 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts @@ -0,0 +1,2 @@ +import { SSOOIDCClient } from "@aws-sdk/client-sso-oidc"; +export declare const getSsoOidcClient: (ssoRegion: string) => SSOOIDCClient; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..a0b176b4f2 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts @@ -0,0 +1,3 @@ +export * from "./fromSso"; +export * from "./fromStatic"; +export * from "./nodeProvider"; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts new file mode 100644 index 0000000000..11a9bd43de --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts @@ -0,0 +1,5 @@ +import { TokenIdentityProvider } from "@aws-sdk/types"; +import { FromSsoInit } from "./fromSso"; +export declare const nodeProvider: ( + init?: FromSsoInit +) => TokenIdentityProvider; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts new file mode 100644 index 0000000000..90036052bf --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts @@ -0,0 +1,2 @@ +import { TokenIdentity } from "@aws-sdk/types"; +export declare const validateTokenExpiry: (token: TokenIdentity) => void; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts new file mode 100644 index 0000000000..105b2b4fca --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts @@ -0,0 +1,5 @@ +export declare const validateTokenKey: ( + key: string, + value: unknown, + forRefresh?: boolean +) => void; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts new file mode 100644 index 0000000000..f768786657 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts @@ -0,0 +1,5 @@ +import { SSOToken } from "@aws-sdk/shared-ini-file-loader"; +export declare const writeSSOTokenToFile: ( + id: string, + ssoToken: SSOToken +) => Promise; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts new file mode 100644 index 0000000000..1253784af5 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts @@ -0,0 +1,5 @@ +import { TokenIdentity } from "@aws-sdk/types"; +/** + * Throws TokenProviderError is token is expired. + */ +export declare const validateTokenExpiry: (token: TokenIdentity) => void; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts new file mode 100644 index 0000000000..a9618fd847 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts @@ -0,0 +1,4 @@ +/** + * Throws TokenProviderError if value is undefined for key. + */ +export declare const validateTokenKey: (key: string, value: unknown, forRefresh?: boolean) => void; diff --git a/server/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts b/server/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts new file mode 100644 index 0000000000..8f1edf9349 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts @@ -0,0 +1,5 @@ +import { SSOToken } from "@aws-sdk/shared-ini-file-loader"; +/** + * Writes SSO token to file based on filepath computed from ssoStartUrl or session name. + */ +export declare const writeSSOTokenToFile: (id: string, ssoToken: SSOToken) => Promise; diff --git a/server/node_modules/@aws-sdk/token-providers/package.json b/server/node_modules/@aws-sdk/token-providers/package.json new file mode 100644 index 0000000000..84f0e541f4 --- /dev/null +++ b/server/node_modules/@aws-sdk/token-providers/package.json @@ -0,0 +1,63 @@ +{ + "name": "@aws-sdk/token-providers", + "version": "3.264.0", + "description": "A collection of token providers", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "sideEffects": false, + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "token" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso-oidc": "3.264.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/shared-ini-file-loader": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/token-providers", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/token-providers" + } +} diff --git a/server/node_modules/@aws-sdk/types/LICENSE b/server/node_modules/@aws-sdk/types/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/types/README.md b/server/node_modules/@aws-sdk/types/README.md new file mode 100644 index 0000000000..a5658db809 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/types + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/types/latest.svg)](https://www.npmjs.com/package/@aws-sdk/types) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/types.svg)](https://www.npmjs.com/package/@aws-sdk/types) diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/abort.js b/server/node_modules/@aws-sdk/types/dist-cjs/abort.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/abort.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/auth.js b/server/node_modules/@aws-sdk/types/dist-cjs/auth.js new file mode 100644 index 0000000000..8a3118e83c --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/auth.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HttpAuthLocation = void 0; +var HttpAuthLocation; +(function (HttpAuthLocation) { + HttpAuthLocation["HEADER"] = "header"; + HttpAuthLocation["QUERY"] = "query"; +})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/checksum.js b/server/node_modules/@aws-sdk/types/dist-cjs/checksum.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/checksum.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/client.js b/server/node_modules/@aws-sdk/types/dist-cjs/client.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/client.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/command.js b/server/node_modules/@aws-sdk/types/dist-cjs/command.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/command.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/credentials.js b/server/node_modules/@aws-sdk/types/dist-cjs/credentials.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/credentials.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/crypto.js b/server/node_modules/@aws-sdk/types/dist-cjs/crypto.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/crypto.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/endpoint.js b/server/node_modules/@aws-sdk/types/dist-cjs/endpoint.js new file mode 100644 index 0000000000..e34bd2c6d6 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/endpoint.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EndpointURLScheme = void 0; +var EndpointURLScheme; +(function (EndpointURLScheme) { + EndpointURLScheme["HTTP"] = "http"; + EndpointURLScheme["HTTPS"] = "https"; +})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/eventStream.js b/server/node_modules/@aws-sdk/types/dist-cjs/eventStream.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/eventStream.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/http.js b/server/node_modules/@aws-sdk/types/dist-cjs/http.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/http.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/identity/AnonymousIdentity.js b/server/node_modules/@aws-sdk/types/dist-cjs/identity/AnonymousIdentity.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/identity/AnonymousIdentity.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/identity/AwsCredentialIdentity.js b/server/node_modules/@aws-sdk/types/dist-cjs/identity/AwsCredentialIdentity.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/identity/AwsCredentialIdentity.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/identity/Identity.js b/server/node_modules/@aws-sdk/types/dist-cjs/identity/Identity.js new file mode 100644 index 0000000000..04363ad2b8 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/identity/Identity.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +; diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/identity/LoginIdentity.js b/server/node_modules/@aws-sdk/types/dist-cjs/identity/LoginIdentity.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/identity/LoginIdentity.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/identity/TokenIdentity.js b/server/node_modules/@aws-sdk/types/dist-cjs/identity/TokenIdentity.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/identity/TokenIdentity.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/identity/index.js b/server/node_modules/@aws-sdk/types/dist-cjs/identity/index.js new file mode 100644 index 0000000000..9e9c97d935 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/identity/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./AnonymousIdentity"), exports); +tslib_1.__exportStar(require("./AwsCredentialIdentity"), exports); +tslib_1.__exportStar(require("./Identity"), exports); +tslib_1.__exportStar(require("./LoginIdentity"), exports); +tslib_1.__exportStar(require("./TokenIdentity"), exports); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/index.js b/server/node_modules/@aws-sdk/types/dist-cjs/index.js new file mode 100644 index 0000000000..79127fcf3a --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/index.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./abort"), exports); +tslib_1.__exportStar(require("./auth"), exports); +tslib_1.__exportStar(require("./checksum"), exports); +tslib_1.__exportStar(require("./client"), exports); +tslib_1.__exportStar(require("./command"), exports); +tslib_1.__exportStar(require("./credentials"), exports); +tslib_1.__exportStar(require("./crypto"), exports); +tslib_1.__exportStar(require("./endpoint"), exports); +tslib_1.__exportStar(require("./eventStream"), exports); +tslib_1.__exportStar(require("./http"), exports); +tslib_1.__exportStar(require("./identity"), exports); +tslib_1.__exportStar(require("./logger"), exports); +tslib_1.__exportStar(require("./middleware"), exports); +tslib_1.__exportStar(require("./pagination"), exports); +tslib_1.__exportStar(require("./profile"), exports); +tslib_1.__exportStar(require("./response"), exports); +tslib_1.__exportStar(require("./retry"), exports); +tslib_1.__exportStar(require("./serde"), exports); +tslib_1.__exportStar(require("./shapes"), exports); +tslib_1.__exportStar(require("./signature"), exports); +tslib_1.__exportStar(require("./stream"), exports); +tslib_1.__exportStar(require("./token"), exports); +tslib_1.__exportStar(require("./transfer"), exports); +tslib_1.__exportStar(require("./util"), exports); +tslib_1.__exportStar(require("./waiter"), exports); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/logger.js b/server/node_modules/@aws-sdk/types/dist-cjs/logger.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/logger.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/middleware.js b/server/node_modules/@aws-sdk/types/dist-cjs/middleware.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/middleware.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/pagination.js b/server/node_modules/@aws-sdk/types/dist-cjs/pagination.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/pagination.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/profile.js b/server/node_modules/@aws-sdk/types/dist-cjs/profile.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/profile.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/response.js b/server/node_modules/@aws-sdk/types/dist-cjs/response.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/response.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/retry.js b/server/node_modules/@aws-sdk/types/dist-cjs/retry.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/retry.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/serde.js b/server/node_modules/@aws-sdk/types/dist-cjs/serde.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/serde.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/shapes.js b/server/node_modules/@aws-sdk/types/dist-cjs/shapes.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/shapes.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/signature.js b/server/node_modules/@aws-sdk/types/dist-cjs/signature.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/signature.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/stream.js b/server/node_modules/@aws-sdk/types/dist-cjs/stream.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/stream.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/token.js b/server/node_modules/@aws-sdk/types/dist-cjs/token.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/token.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/transfer.js b/server/node_modules/@aws-sdk/types/dist-cjs/transfer.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/transfer.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/util.js b/server/node_modules/@aws-sdk/types/dist-cjs/util.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/util.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-cjs/waiter.js b/server/node_modules/@aws-sdk/types/dist-cjs/waiter.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-cjs/waiter.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/types/dist-es/abort.js b/server/node_modules/@aws-sdk/types/dist-es/abort.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/abort.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/auth.js b/server/node_modules/@aws-sdk/types/dist-es/auth.js new file mode 100644 index 0000000000..bd3b2df8e1 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/auth.js @@ -0,0 +1,5 @@ +export var HttpAuthLocation; +(function (HttpAuthLocation) { + HttpAuthLocation["HEADER"] = "header"; + HttpAuthLocation["QUERY"] = "query"; +})(HttpAuthLocation || (HttpAuthLocation = {})); diff --git a/server/node_modules/@aws-sdk/types/dist-es/checksum.js b/server/node_modules/@aws-sdk/types/dist-es/checksum.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/checksum.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/client.js b/server/node_modules/@aws-sdk/types/dist-es/client.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/client.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/command.js b/server/node_modules/@aws-sdk/types/dist-es/command.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/command.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/credentials.js b/server/node_modules/@aws-sdk/types/dist-es/credentials.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/credentials.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/crypto.js b/server/node_modules/@aws-sdk/types/dist-es/crypto.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/crypto.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/endpoint.js b/server/node_modules/@aws-sdk/types/dist-es/endpoint.js new file mode 100644 index 0000000000..4ae601ffd3 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/endpoint.js @@ -0,0 +1,5 @@ +export var EndpointURLScheme; +(function (EndpointURLScheme) { + EndpointURLScheme["HTTP"] = "http"; + EndpointURLScheme["HTTPS"] = "https"; +})(EndpointURLScheme || (EndpointURLScheme = {})); diff --git a/server/node_modules/@aws-sdk/types/dist-es/eventStream.js b/server/node_modules/@aws-sdk/types/dist-es/eventStream.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/eventStream.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/http.js b/server/node_modules/@aws-sdk/types/dist-es/http.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/http.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/identity/AnonymousIdentity.js b/server/node_modules/@aws-sdk/types/dist-es/identity/AnonymousIdentity.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/identity/AnonymousIdentity.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/identity/AwsCredentialIdentity.js b/server/node_modules/@aws-sdk/types/dist-es/identity/AwsCredentialIdentity.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/identity/AwsCredentialIdentity.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/identity/Identity.js b/server/node_modules/@aws-sdk/types/dist-es/identity/Identity.js new file mode 100644 index 0000000000..95da36c2f3 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/identity/Identity.js @@ -0,0 +1,2 @@ +; +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/identity/LoginIdentity.js b/server/node_modules/@aws-sdk/types/dist-es/identity/LoginIdentity.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/identity/LoginIdentity.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/identity/TokenIdentity.js b/server/node_modules/@aws-sdk/types/dist-es/identity/TokenIdentity.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/identity/TokenIdentity.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/identity/index.js b/server/node_modules/@aws-sdk/types/dist-es/identity/index.js new file mode 100644 index 0000000000..863e78e802 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/identity/index.js @@ -0,0 +1,5 @@ +export * from "./AnonymousIdentity"; +export * from "./AwsCredentialIdentity"; +export * from "./Identity"; +export * from "./LoginIdentity"; +export * from "./TokenIdentity"; diff --git a/server/node_modules/@aws-sdk/types/dist-es/index.js b/server/node_modules/@aws-sdk/types/dist-es/index.js new file mode 100644 index 0000000000..94228ab744 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/index.js @@ -0,0 +1,25 @@ +export * from "./abort"; +export * from "./auth"; +export * from "./checksum"; +export * from "./client"; +export * from "./command"; +export * from "./credentials"; +export * from "./crypto"; +export * from "./endpoint"; +export * from "./eventStream"; +export * from "./http"; +export * from "./identity"; +export * from "./logger"; +export * from "./middleware"; +export * from "./pagination"; +export * from "./profile"; +export * from "./response"; +export * from "./retry"; +export * from "./serde"; +export * from "./shapes"; +export * from "./signature"; +export * from "./stream"; +export * from "./token"; +export * from "./transfer"; +export * from "./util"; +export * from "./waiter"; diff --git a/server/node_modules/@aws-sdk/types/dist-es/logger.js b/server/node_modules/@aws-sdk/types/dist-es/logger.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/logger.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/middleware.js b/server/node_modules/@aws-sdk/types/dist-es/middleware.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/middleware.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/pagination.js b/server/node_modules/@aws-sdk/types/dist-es/pagination.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/pagination.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/profile.js b/server/node_modules/@aws-sdk/types/dist-es/profile.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/profile.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/response.js b/server/node_modules/@aws-sdk/types/dist-es/response.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/response.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/retry.js b/server/node_modules/@aws-sdk/types/dist-es/retry.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/retry.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/serde.js b/server/node_modules/@aws-sdk/types/dist-es/serde.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/serde.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/shapes.js b/server/node_modules/@aws-sdk/types/dist-es/shapes.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/shapes.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/signature.js b/server/node_modules/@aws-sdk/types/dist-es/signature.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/signature.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/stream.js b/server/node_modules/@aws-sdk/types/dist-es/stream.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/stream.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/token.js b/server/node_modules/@aws-sdk/types/dist-es/token.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/token.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/transfer.js b/server/node_modules/@aws-sdk/types/dist-es/transfer.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/transfer.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/util.js b/server/node_modules/@aws-sdk/types/dist-es/util.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/util.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-es/waiter.js b/server/node_modules/@aws-sdk/types/dist-es/waiter.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-es/waiter.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-types/abort.d.ts b/server/node_modules/@aws-sdk/types/dist-types/abort.d.ts new file mode 100644 index 0000000000..00396a137f --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/abort.d.ts @@ -0,0 +1,42 @@ +export interface AbortHandler { + (this: AbortSignal, ev: any): any; +} +/** + * Holders of an AbortSignal object may query if the associated operation has + * been aborted and register an onabort handler. + * + * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal + */ +export interface AbortSignal { + /** + * Whether the action represented by this signal has been cancelled. + */ + readonly aborted: boolean; + /** + * A function to be invoked when the action represented by this signal has + * been cancelled. + */ + onabort: AbortHandler | null; +} +/** + * The AWS SDK uses a Controller/Signal model to allow for cooperative + * cancellation of asynchronous operations. When initiating such an operation, + * the caller can create an AbortController and then provide linked signal to + * subtasks. This allows a single source to communicate to multiple consumers + * that an action has been aborted without dictating how that cancellation + * should be handled. + * + * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortController + */ +export interface AbortController { + /** + * An object that reports whether the action associated with this + * {AbortController} has been cancelled. + */ + readonly signal: AbortSignal; + /** + * Declares the operation associated with this AbortController to have been + * cancelled. + */ + abort(): void; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/auth.d.ts b/server/node_modules/@aws-sdk/types/dist-types/auth.d.ts new file mode 100644 index 0000000000..6fc77cfe7f --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/auth.d.ts @@ -0,0 +1,47 @@ +/** + * Authentication schemes represent a way that the service will authenticate the customer’s identity. + */ +export interface AuthScheme { + /** + * @example "sigv4a" or "sigv4" + */ + name: "sigv4" | "sigv4a" | string; + /** + * @example "s3" + */ + signingName: string; + /** + * @example "us-east-1" + */ + signingRegion: string; + /** + * @example ["*"] + * @exammple ["us-west-2", "us-east-1"] + */ + signingRegionSet?: string[]; + /** + * @deprecated this field was renamed to signingRegion. + */ + signingScope?: never; + properties: Record; +} +export interface HttpAuthDefinition { + /** + * Defines the location of where the Auth is serialized. + */ + in: HttpAuthLocation; + /** + * Defines the name of the HTTP header or query string parameter + * that contains the Auth. + */ + name: string; + /** + * Defines the security scheme to use on the `Authorization` header value. + * This can only be set if the "in" property is set to {@link HttpAuthLocation.HEADER}. + */ + scheme?: string; +} +export declare enum HttpAuthLocation { + HEADER = "header", + QUERY = "query" +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/checksum.d.ts b/server/node_modules/@aws-sdk/types/dist-types/checksum.d.ts new file mode 100644 index 0000000000..7ba2712ae1 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/checksum.d.ts @@ -0,0 +1,59 @@ +import { SourceData } from "./crypto"; +/** + * An object that provides a checksum of data provided in chunks to `update`. + * The checksum may be performed incrementally as chunks are received or all + * at once when the checksum is finalized, depending on the underlying + * implementation. + * + * It's recommended to compute checksum incrementally to avoid reading the + * entire payload in memory. + * + * A class that implements this interface may accept an optional secret key in its + * constructor while computing checksum value, when using HMAC. If provided, + * this secret key would be used when computing checksum. + */ +export interface Checksum { + /** + * Constant length of the digest created by the algorithm in bytes. + */ + digestLength?: number; + /** + * Creates a new checksum object that contains a deep copy of the internal + * state of the current `Checksum` object. + */ + copy?(): Checksum; + /** + * Returns the digest of all of the data passed. + */ + digest(): Promise; + /** + * Allows marking a checksum for checksums that support the ability + * to mark and reset. + * + * @param {number} readLimit - The maximum limit of bytes that can be read + * before the mark position becomes invalid. + */ + mark?(readLimit: number): void; + /** + * Resets the checksum to its initial value. + */ + reset(): void; + /** + * Adds a chunk of data for which checksum needs to be computed. + * This can be called many times with new data as it is streamed. + * + * Implementations may override this method which passes second param + * which makes Checksum object stateless. + * + * @param {Uint8Array} chunk - The buffer to update checksum with. + */ + update(chunk: Uint8Array): void; +} +/** + * A constructor for a Checksum that may be used to calculate an HMAC. Implementing + * classes should not directly hold the provided key in memory beyond the + * lexical scope of the constructor. + */ +export interface ChecksumConstructor { + new (secret?: SourceData): Checksum; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/client.d.ts b/server/node_modules/@aws-sdk/types/dist-types/client.d.ts new file mode 100644 index 0000000000..84754dddc1 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/client.d.ts @@ -0,0 +1,23 @@ +import { Command } from "./command"; +import { MiddlewareStack } from "./middleware"; +import { MetadataBearer } from "./response"; +/** + * function definition for different overrides of client's 'send' function. + */ +interface InvokeFunction { + (command: Command, options?: any): Promise; + (command: Command, options: any, cb: (err: any, data?: OutputType) => void): void; + (command: Command, options?: any, cb?: (err: any, data?: OutputType) => void): Promise | void; +} +/** + * A general interface for service clients, idempotent to browser or node clients + * This type corresponds to SmithyClient(https://github.com/aws/aws-sdk-js-v3/blob/main/packages/smithy-client/src/client.ts). + * It's provided for using without importing the SmithyClient class. + */ +export interface Client { + readonly config: ResolvedClientConfiguration; + middlewareStack: MiddlewareStack; + send: InvokeFunction; + destroy: () => void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-types/command.d.ts b/server/node_modules/@aws-sdk/types/dist-types/command.d.ts new file mode 100644 index 0000000000..687d070116 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/command.d.ts @@ -0,0 +1,7 @@ +import { Handler, MiddlewareStack } from "./middleware"; +import { MetadataBearer } from "./response"; +export interface Command { + readonly input: InputType; + readonly middlewareStack: MiddlewareStack; + resolveMiddleware(stack: MiddlewareStack, configuration: ResolvedConfiguration, options: any): Handler; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/credentials.d.ts b/server/node_modules/@aws-sdk/types/dist-types/credentials.d.ts new file mode 100644 index 0000000000..cc47018205 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/credentials.d.ts @@ -0,0 +1,13 @@ +import { AwsCredentialIdentity } from "./identity"; +import { Provider } from "./util"; +/** + * An object representing temporary or permanent AWS credentials. + * + * @deprecated Use {@AwsCredentialIdentity} + */ +export interface Credentials extends AwsCredentialIdentity { +} +/** + * @deprecated Use {@AwsCredentialIdentityProvider} + */ +export declare type CredentialProvider = Provider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/crypto.d.ts b/server/node_modules/@aws-sdk/types/dist-types/crypto.d.ts new file mode 100644 index 0000000000..4de490a176 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/crypto.d.ts @@ -0,0 +1,49 @@ +export declare type SourceData = string | ArrayBuffer | ArrayBufferView; +/** + * An object that provides a hash of data provided in chunks to `update`. The + * hash may be performed incrementally as chunks are received or all at once + * when the hash is finalized, depending on the underlying implementation. + * + * @deprecated use {@link Checksum} + */ +export interface Hash { + /** + * Adds a chunk of data to the hash. If a buffer is provided, the `encoding` + * argument will be ignored. If a string is provided without a specified + * encoding, implementations must assume UTF-8 encoding. + * + * Not all encodings are supported on all platforms, though all must support + * UTF-8. + */ + update(toHash: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void; + /** + * Finalizes the hash and provides a promise that will be fulfilled with the + * raw bytes of the calculated hash. + */ + digest(): Promise; +} +/** + * A constructor for a hash that may be used to calculate an HMAC. Implementing + * classes should not directly hold the provided key in memory beyond the + * lexical scope of the constructor. + * + * @deprecated use {@link ChecksumConstructor} + */ +export interface HashConstructor { + new (secret?: SourceData): Hash; +} +/** + * A function that calculates the hash of a data stream. Determining the hash + * will consume the stream, so only replayable streams should be provided to an + * implementation of this interface. + */ +export interface StreamHasher { + (hashCtor: HashConstructor, stream: StreamType): Promise; +} +/** + * A function that returns a promise fulfilled with bytes from a + * cryptographically secure pseudorandom number generator. + */ +export interface randomValues { + (byteLength: number): Promise; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/endpoint.d.ts b/server/node_modules/@aws-sdk/types/dist-types/endpoint.d.ts new file mode 100644 index 0000000000..32668f4d9a --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/endpoint.d.ts @@ -0,0 +1,56 @@ +import { AuthScheme } from "./auth"; +export interface EndpointPartition { + name: string; + dnsSuffix: string; + dualStackDnsSuffix: string; + supportsFIPS: boolean; + supportsDualStack: boolean; +} +export interface EndpointARN { + partition: string; + service: string; + region: string; + accountId: string; + resourceId: Array; +} +export declare enum EndpointURLScheme { + HTTP = "http", + HTTPS = "https" +} +export interface EndpointURL { + /** + * The URL scheme such as http or https. + */ + scheme: EndpointURLScheme; + /** + * The authority is the host and optional port component of the URL. + */ + authority: string; + /** + * The parsed path segment of the URL. + * This value is as-is as provided by the user. + */ + path: string; + /** + * The parsed path segment of the URL. + * This value is guranteed to start and end with a "/". + */ + normalizedPath: string; + /** + * A boolean indicating whether the authority is an IP address. + */ + isIp: boolean; +} +export declare type EndpointObjectProperty = string | boolean | { + [key: string]: EndpointObjectProperty; +} | EndpointObjectProperty[]; +export interface EndpointV2 { + url: URL; + properties?: { + authSchemes?: AuthScheme[]; + } & Record; + headers?: Record; +} +export declare type EndpointParameters = { + [name: string]: undefined | string | boolean; +}; diff --git a/server/node_modules/@aws-sdk/types/dist-types/eventStream.d.ts b/server/node_modules/@aws-sdk/types/dist-types/eventStream.d.ts new file mode 100644 index 0000000000..babaede92b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/eventStream.d.ts @@ -0,0 +1,96 @@ +import { HttpRequest } from "./http"; +import { FinalizeHandler, FinalizeHandlerArguments, FinalizeHandlerOutput, HandlerExecutionContext } from "./middleware"; +import { MetadataBearer } from "./response"; +/** + * An event stream message. The headers and body properties will always be + * defined, with empty headers represented as an object with no keys and an + * empty body represented as a zero-length Uint8Array. + */ +export interface Message { + headers: MessageHeaders; + body: Uint8Array; +} +export declare type MessageHeaders = Record; +export interface BooleanHeaderValue { + type: "boolean"; + value: boolean; +} +export interface ByteHeaderValue { + type: "byte"; + value: number; +} +export interface ShortHeaderValue { + type: "short"; + value: number; +} +export interface IntegerHeaderValue { + type: "integer"; + value: number; +} +export interface LongHeaderValue { + type: "long"; + value: Int64; +} +export interface BinaryHeaderValue { + type: "binary"; + value: Uint8Array; +} +export interface StringHeaderValue { + type: "string"; + value: string; +} +export interface TimestampHeaderValue { + type: "timestamp"; + value: Date; +} +export interface UuidHeaderValue { + type: "uuid"; + value: string; +} +export declare type MessageHeaderValue = BooleanHeaderValue | ByteHeaderValue | ShortHeaderValue | IntegerHeaderValue | LongHeaderValue | BinaryHeaderValue | StringHeaderValue | TimestampHeaderValue | UuidHeaderValue; +export interface Int64 { + readonly bytes: Uint8Array; + valueOf: () => number; + toString: () => string; +} +/** + * Util functions for serializing or deserializing event stream + */ +export interface EventStreamSerdeContext { + eventStreamMarshaller: EventStreamMarshaller; +} +/** + * A function which deserializes binary event stream message into modeled shape. + */ +export interface EventStreamMarshallerDeserFn { + (body: StreamType, deserializer: (input: Record) => Promise): AsyncIterable; +} +/** + * A function that serializes modeled shape into binary stream message. + */ +export interface EventStreamMarshallerSerFn { + (input: AsyncIterable, serializer: (event: T) => Message): StreamType; +} +/** + * An interface which provides functions for serializing and deserializing binary event stream + * to/from corresponsing modeled shape. + */ +export interface EventStreamMarshaller { + deserialize: EventStreamMarshallerDeserFn; + serialize: EventStreamMarshallerSerFn; +} +export interface EventStreamRequestSigner { + sign(request: HttpRequest): Promise; +} +export interface EventStreamPayloadHandler { + handle: (next: FinalizeHandler, args: FinalizeHandlerArguments, context?: HandlerExecutionContext) => Promise>; +} +export interface EventStreamPayloadHandlerProvider { + (options: any): EventStreamPayloadHandler; +} +export interface EventStreamSerdeProvider { + (options: any): EventStreamMarshaller; +} +export interface EventStreamSignerProvider { + (options: any): EventStreamRequestSigner; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/http.d.ts b/server/node_modules/@aws-sdk/types/dist-types/http.d.ts new file mode 100644 index 0000000000..6f23ea169b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/http.d.ts @@ -0,0 +1,91 @@ +import { AbortSignal } from "./abort"; +/** + * A collection of key/value pairs with case-insensitive keys. + */ +export interface Headers extends Map { + /** + * Returns a new instance of Headers with the specified header set to the + * provided value. Does not modify the original Headers instance. + * + * @param headerName The name of the header to add or overwrite + * @param headerValue The value to which the header should be set + */ + withHeader(headerName: string, headerValue: string): Headers; + /** + * Returns a new instance of Headers without the specified header. Does not + * modify the original Headers instance. + * + * @param headerName The name of the header to remove + */ + withoutHeader(headerName: string): Headers; +} +/** + * A mapping of header names to string values. Multiple values for the same + * header should be represented as a single string with values separated by + * `, `. + * + * Keys should be considered case insensitive, even if this is not enforced by a + * particular implementation. For example, given the following HeaderBag, where + * keys differ only in case: + * + * { + * 'x-amz-date': '2000-01-01T00:00:00Z', + * 'X-Amz-Date': '2001-01-01T00:00:00Z' + * } + * + * The SDK may at any point during processing remove one of the object + * properties in favor of the other. The headers may or may not be combined, and + * the SDK will not deterministically select which header candidate to use. + */ +export declare type HeaderBag = Record; +/** + * Represents an HTTP message with headers and an optional static or streaming + * body. bode: ArrayBuffer | ArrayBufferView | string | Uint8Array | Readable | ReadableStream; + */ +export interface HttpMessage { + headers: HeaderBag; + body?: any; +} +/** + * A mapping of query parameter names to strings or arrays of strings, with the + * second being used when a parameter contains a list of values. Value can be set + * to null when query is not in key-value pairs shape + */ +export declare type QueryParameterBag = Record | null>; +/** + * @deprecated use EndpointV2 from @aws-sdk/types. + */ +export interface Endpoint { + protocol: string; + hostname: string; + port?: number; + path: string; + query?: QueryParameterBag; +} +/** + * Interface an HTTP request class. Contains + * addressing information in addition to standard message properties. + */ +export interface HttpRequest extends HttpMessage, Endpoint { + method: string; +} +/** + * Represents an HTTP message as received in reply to a request. Contains a + * numeric status code in addition to standard message properties. + */ +export interface HttpResponse extends HttpMessage { + statusCode: number; +} +/** + * Represents HTTP message whose body has been resolved to a string. This is + * used in parsing http message. + */ +export interface ResolvedHttpResponse extends HttpResponse { + body: string; +} +/** + * Represents the options that may be passed to an Http Handler. + */ +export interface HttpHandlerOptions { + abortSignal?: AbortSignal; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/identity/AnonymousIdentity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/identity/AnonymousIdentity.d.ts new file mode 100644 index 0000000000..a71e10df43 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/identity/AnonymousIdentity.d.ts @@ -0,0 +1,3 @@ +import { Identity } from "./Identity"; +export interface AnonymousIdentity extends Identity { +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/identity/AwsCredentialIdentity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/identity/AwsCredentialIdentity.d.ts new file mode 100644 index 0000000000..a08e6fabf3 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/identity/AwsCredentialIdentity.d.ts @@ -0,0 +1,17 @@ +import { Identity, IdentityProvider } from "./Identity"; +export interface AwsCredentialIdentity extends Identity { + /** + * AWS access key ID + */ + readonly accessKeyId: string; + /** + * AWS secret access key + */ + readonly secretAccessKey: string; + /** + * A security or session token to use with these credentials. Usually + * present for temporary credentials. + */ + readonly sessionToken?: string; +} +export declare type AwsCredentialIdentityProvider = IdentityProvider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/identity/Identity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/identity/Identity.d.ts new file mode 100644 index 0000000000..feeb27183c --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/identity/Identity.d.ts @@ -0,0 +1,9 @@ +export interface Identity { + /** + * A {Date} when the identity or credential will no longer be accepted. + */ + readonly expiration?: Date; +} +export interface IdentityProvider { + (identityProperties?: Record): Promise; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/identity/LoginIdentity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/identity/LoginIdentity.d.ts new file mode 100644 index 0000000000..f75a61a6ab --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/identity/LoginIdentity.d.ts @@ -0,0 +1,12 @@ +import { Identity, IdentityProvider } from "./Identity"; +export interface LoginIdentity extends Identity { + /** + * Identity username + */ + readonly username: string; + /** + * Identity password + */ + readonly password: string; +} +export declare type LoginIdentityProvider = IdentityProvider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/identity/TokenIdentity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/identity/TokenIdentity.d.ts new file mode 100644 index 0000000000..974d10975e --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/identity/TokenIdentity.d.ts @@ -0,0 +1,8 @@ +import { Identity, IdentityProvider } from "./Identity"; +export interface TokenIdentity extends Identity { + /** + * The literal token string + */ + readonly token: string; +} +export declare type TokenIdentityProvider = IdentityProvider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/identity/index.d.ts b/server/node_modules/@aws-sdk/types/dist-types/identity/index.d.ts new file mode 100644 index 0000000000..863e78e802 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/identity/index.d.ts @@ -0,0 +1,5 @@ +export * from "./AnonymousIdentity"; +export * from "./AwsCredentialIdentity"; +export * from "./Identity"; +export * from "./LoginIdentity"; +export * from "./TokenIdentity"; diff --git a/server/node_modules/@aws-sdk/types/dist-types/index.d.ts b/server/node_modules/@aws-sdk/types/dist-types/index.d.ts new file mode 100644 index 0000000000..94228ab744 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/index.d.ts @@ -0,0 +1,25 @@ +export * from "./abort"; +export * from "./auth"; +export * from "./checksum"; +export * from "./client"; +export * from "./command"; +export * from "./credentials"; +export * from "./crypto"; +export * from "./endpoint"; +export * from "./eventStream"; +export * from "./http"; +export * from "./identity"; +export * from "./logger"; +export * from "./middleware"; +export * from "./pagination"; +export * from "./profile"; +export * from "./response"; +export * from "./retry"; +export * from "./serde"; +export * from "./shapes"; +export * from "./signature"; +export * from "./stream"; +export * from "./token"; +export * from "./transfer"; +export * from "./util"; +export * from "./waiter"; diff --git a/server/node_modules/@aws-sdk/types/dist-types/logger.d.ts b/server/node_modules/@aws-sdk/types/dist-types/logger.d.ts new file mode 100644 index 0000000000..2d65a88c15 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/logger.d.ts @@ -0,0 +1,27 @@ +/** + * A list of logger's log level. These levels are sorted in + * order of increasing severity. Each log level includes itself and all + * the levels behind itself. + * + * @example new Logger({logLevel: 'warn'}) will print all the warn and error + * message. + */ +export declare type LogLevel = "all" | "trace" | "debug" | "log" | "info" | "warn" | "error" | "off"; +/** + * An object consumed by Logger constructor to initiate a logger object. + */ +export interface LoggerOptions { + logger?: Logger; + logLevel?: LogLevel; +} +/** + * Represents a logger object that is available in HandlerExecutionContext + * throughout the middleware stack. + */ +export interface Logger { + trace?: (...content: any[]) => void; + debug: (...content: any[]) => void; + info: (...content: any[]) => void; + warn: (...content: any[]) => void; + error: (...content: any[]) => void; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/middleware.d.ts b/server/node_modules/@aws-sdk/types/dist-types/middleware.d.ts new file mode 100644 index 0000000000..d0b3488e77 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/middleware.d.ts @@ -0,0 +1,367 @@ +import { AuthScheme, HttpAuthDefinition } from "./auth"; +import { EndpointV2 } from "./endpoint"; +import { Logger } from "./logger"; +import { UserAgent } from "./util"; +export interface InitializeHandlerArguments { + /** + * User input to a command. Reflects the userland representation of the + * union of data types the command can effectively handle. + */ + input: Input; +} +export interface InitializeHandlerOutput extends DeserializeHandlerOutput { + output: Output; +} +export interface SerializeHandlerArguments extends InitializeHandlerArguments { + /** + * The user input serialized as a request object. The request object is unknown, + * so you cannot modify it directly. When work with request, you need to guard its + * type to e.g. HttpRequest with 'instanceof' operand + * + * During the build phase of the execution of a middleware stack, a built + * request may or may not be available. + */ + request?: unknown; +} +export interface SerializeHandlerOutput extends InitializeHandlerOutput { +} +export interface BuildHandlerArguments extends FinalizeHandlerArguments { +} +export interface BuildHandlerOutput extends InitializeHandlerOutput { +} +export interface FinalizeHandlerArguments extends SerializeHandlerArguments { + /** + * The user input serialized as a request. + */ + request: unknown; +} +export interface FinalizeHandlerOutput extends InitializeHandlerOutput { +} +export interface DeserializeHandlerArguments extends FinalizeHandlerArguments { +} +export interface DeserializeHandlerOutput { + /** + * The raw response object from runtime is deserialized to structured output object. + * The response object is unknown so you cannot modify it directly. When work with + * response, you need to guard its type to e.g. HttpResponse with 'instanceof' operand. + * + * During the deserialize phase of the execution of a middleware stack, a deserialized + * response may or may not be available + */ + response: unknown; + output?: Output; +} +export interface InitializeHandler { + /** + * Asynchronously converts an input object into an output object. + * + * @param args An object containing a input to the command as well as any + * associated or previously generated execution artifacts. + */ + (args: InitializeHandlerArguments): Promise>; +} +export declare type Handler = InitializeHandler; +export interface SerializeHandler { + /** + * Asynchronously converts an input object into an output object. + * + * @param args An object containing a input to the command as well as any + * associated or previously generated execution artifacts. + */ + (args: SerializeHandlerArguments): Promise>; +} +export interface FinalizeHandler { + /** + * Asynchronously converts an input object into an output object. + * + * @param args An object containing a input to the command as well as any + * associated or previously generated execution artifacts. + */ + (args: FinalizeHandlerArguments): Promise>; +} +export interface BuildHandler { + (args: BuildHandlerArguments): Promise>; +} +export interface DeserializeHandler { + (args: DeserializeHandlerArguments): Promise>; +} +/** + * A factory function that creates functions implementing the {Handler} + * interface. + */ +export interface InitializeMiddleware { + /** + * @param next The handler to invoke after this middleware has operated on + * the user input and before this middleware operates on the output. + * + * @param context Invariant data and functions for use by the handler. + */ + (next: InitializeHandler, context: HandlerExecutionContext): InitializeHandler; +} +/** + * A factory function that creates functions implementing the {BuildHandler} + * interface. + */ +export interface SerializeMiddleware { + /** + * @param next The handler to invoke after this middleware has operated on + * the user input and before this middleware operates on the output. + * + * @param context Invariant data and functions for use by the handler. + */ + (next: SerializeHandler, context: HandlerExecutionContext): SerializeHandler; +} +/** + * A factory function that creates functions implementing the {FinalizeHandler} + * interface. + */ +export interface FinalizeRequestMiddleware { + /** + * @param next The handler to invoke after this middleware has operated on + * the user input and before this middleware operates on the output. + * + * @param context Invariant data and functions for use by the handler. + */ + (next: FinalizeHandler, context: HandlerExecutionContext): FinalizeHandler; +} +export interface BuildMiddleware { + (next: BuildHandler, context: HandlerExecutionContext): BuildHandler; +} +export interface DeserializeMiddleware { + (next: DeserializeHandler, context: HandlerExecutionContext): DeserializeHandler; +} +export declare type MiddlewareType = InitializeMiddleware | SerializeMiddleware | BuildMiddleware | FinalizeRequestMiddleware | DeserializeMiddleware; +/** + * A factory function that creates the terminal handler atop which a middleware + * stack sits. + */ +export interface Terminalware { + (context: HandlerExecutionContext): DeserializeHandler; +} +export declare type Step = "initialize" | "serialize" | "build" | "finalizeRequest" | "deserialize"; +export declare type Priority = "high" | "normal" | "low"; +export interface HandlerOptions { + /** + * Handlers are ordered using a "step" that describes the stage of command + * execution at which the handler will be executed. The available steps are: + * + * - initialize: The input is being prepared. Examples of typical + * initialization tasks include injecting default options computing + * derived parameters. + * - serialize: The input is complete and ready to be serialized. Examples + * of typical serialization tasks include input validation and building + * an HTTP request from user input. + * - build: The input has been serialized into an HTTP request, but that + * request may require further modification. Any request alterations + * will be applied to all retries. Examples of typical build tasks + * include injecting HTTP headers that describe a stable aspect of the + * request, such as `Content-Length` or a body checksum. + * - finalizeRequest: The request is being prepared to be sent over the wire. The + * request in this stage should already be semantically complete and + * should therefore only be altered as match the recipient's + * expectations. Examples of typical finalization tasks include request + * signing and injecting hop-by-hop headers. + * - deserialize: The response has arrived, the middleware here will deserialize + * the raw response object to structured response + * + * Unlike initialization and build handlers, which are executed once + * per operation execution, finalization and deserialize handlers will be + * executed foreach HTTP request sent. + * + * @default 'initialize' + */ + step?: Step; + /** + * A list of strings to any that identify the general purpose or important + * characteristics of a given handler. + */ + tags?: Array; + /** + * A unique name to refer to a middleware + */ + name?: string; + /** + * A flag to override the existing middleware with the same name. Without + * setting it, adding middleware with duplicated name will throw an exception. + * @internal + */ + override?: boolean; +} +export interface AbsoluteLocation { + /** + * By default middleware will be added to individual step in un-guaranteed order. + * In the case that + * + * @default 'normal' + */ + priority?: Priority; +} +export declare type Relation = "before" | "after"; +export interface RelativeLocation { + /** + * Specify the relation to be before or after a know middleware. + */ + relation: Relation; + /** + * A known middleware name to indicate inserting middleware's location. + */ + toMiddleware: string; +} +export declare type RelativeMiddlewareOptions = RelativeLocation & Omit; +export interface InitializeHandlerOptions extends HandlerOptions { + step?: "initialize"; +} +export interface SerializeHandlerOptions extends HandlerOptions { + step: "serialize"; +} +export interface BuildHandlerOptions extends HandlerOptions { + step: "build"; +} +export interface FinalizeRequestHandlerOptions extends HandlerOptions { + step: "finalizeRequest"; +} +export interface DeserializeHandlerOptions extends HandlerOptions { + step: "deserialize"; +} +/** + * A stack storing middleware. It can be resolved into a handler. It supports 2 + * approaches for adding middleware: + * 1. Adding middleware to specific step with `add()`. The order of middleware + * added into same step is determined by order of adding them. If one middleware + * needs to be executed at the front of the step or at the end of step, set + * `priority` options to `high` or `low`. + * 2. Adding middleware to location relative to known middleware with `addRelativeTo()`. + * This is useful when given middleware must be executed before or after specific + * middleware(`toMiddleware`). You can add a middleware relatively to another + * middleware which also added relatively. But eventually, this relative middleware + * chain **must** be 'anchored' by a middleware that added using `add()` API + * with absolute `step` and `priority`. This mothod will throw if specified + * `toMiddleware` is not found. + */ +export interface MiddlewareStack extends Pluggable { + /** + * Add middleware to the stack to be executed during the "initialize" step, + * optionally specifying a priority, tags and name + */ + add(middleware: InitializeMiddleware, options?: InitializeHandlerOptions & AbsoluteLocation): void; + /** + * Add middleware to the stack to be executed during the "serialize" step, + * optionally specifying a priority, tags and name + */ + add(middleware: SerializeMiddleware, options: SerializeHandlerOptions & AbsoluteLocation): void; + /** + * Add middleware to the stack to be executed during the "build" step, + * optionally specifying a priority, tags and name + */ + add(middleware: BuildMiddleware, options: BuildHandlerOptions & AbsoluteLocation): void; + /** + * Add middleware to the stack to be executed during the "finalizeRequest" step, + * optionally specifying a priority, tags and name + */ + add(middleware: FinalizeRequestMiddleware, options: FinalizeRequestHandlerOptions & AbsoluteLocation): void; + /** + * Add middleware to the stack to be executed during the "deserialize" step, + * optionally specifying a priority, tags and name + */ + add(middleware: DeserializeMiddleware, options: DeserializeHandlerOptions & AbsoluteLocation): void; + /** + * Add middleware to a stack position before or after a known middleware,optionally + * specifying name and tags. + */ + addRelativeTo(middleware: MiddlewareType, options: RelativeMiddlewareOptions): void; + /** + * Apply a customization function to mutate the middleware stack, often + * used for customizations that requires mutating multiple middleware. + */ + use(pluggable: Pluggable): void; + /** + * Create a shallow clone of this stack. Step bindings and handler priorities + * and tags are preserved in the copy. + */ + clone(): MiddlewareStack; + /** + * Removes middleware from the stack. + * + * If a string is provided, it will be treated as middleware name. If a middleware + * is inserted with the given name, it will be removed. + * + * If a middleware class is provided, all usages thereof will be removed. + */ + remove(toRemove: MiddlewareType | string): boolean; + /** + * Removes middleware that contains given tag + * + * Multiple middleware will potentially be removed + */ + removeByTag(toRemove: string): boolean; + /** + * Create a stack containing the middlewares in this stack as well as the + * middlewares in the `from` stack. Neither source is modified, and step + * bindings and handler priorities and tags are preserved in the copy. + */ + concat(from: MiddlewareStack): MiddlewareStack; + /** + * Returns a list of the current order of middleware in the stack. + * This does not execute the middleware functions, nor does it + * provide a reference to the stack itself. + */ + identify(): string[]; + /** + * Builds a single handler function from zero or more middleware classes and + * a core handler. The core handler is meant to send command objects to AWS + * services and return promises that will resolve with the operation result + * or be rejected with an error. + * + * When a composed handler is invoked, the arguments will pass through all + * middleware in a defined order, and the return from the innermost handler + * will pass through all middleware in the reverse of that order. + */ + resolve(handler: DeserializeHandler, context: HandlerExecutionContext): InitializeHandler; +} +/** + * Data and helper objects that are not expected to change from one execution of + * a composed handler to another. + */ +export interface HandlerExecutionContext { + /** + * A logger that may be invoked by any handler during execution of an + * operation. + */ + logger?: Logger; + /** + * Additional user agent that inferred by middleware. It can be used to save + * the internal user agent sections without overriding the `customUserAgent` + * config in clients. + */ + userAgent?: UserAgent; + /** + * Resolved by the endpointMiddleware function of @aws-sdk/middleware-endpoint + * in the serialization stage. + */ + endpointV2?: EndpointV2; + /** + * Set at the same time as endpointV2. + */ + authSchemes?: AuthScheme[]; + /** + * The current auth configuration that has been set by any auth middleware and + * that will prevent from being set more than once. + */ + currentAuthConfig?: HttpAuthDefinition; + /** + * Used by DynamoDbDocumentClient. + */ + dynamoDbDocumentClientOptions?: Partial<{ + overrideInputFilterSensitiveLog(...args: any[]): string | void; + overrideOutputFilterSensitiveLog(...args: any[]): string | void; + }>; + [key: string]: any; +} +export interface Pluggable { + /** + * A function that mutate the passed in middleware stack. Functions implementing + * this interface can add, remove, modify existing middleware stack from clients + * or commands + */ + applyToStack: (stack: MiddlewareStack) => void; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/pagination.d.ts b/server/node_modules/@aws-sdk/types/dist-types/pagination.d.ts new file mode 100644 index 0000000000..95b95776de --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/pagination.d.ts @@ -0,0 +1,22 @@ +import { Client } from "./client"; +/** + * Expected type definition of a paginator. + */ +export declare type Paginator = AsyncGenerator; +/** + * Expected paginator configuration passed to an operation. Services will extend + * this interface definition and may type client further. + */ +export interface PaginationConfiguration { + client: Client; + pageSize?: number; + startingToken?: any; + /** + * For some APIs, such as CloudWatchLogs events, the next page token will always + * be present. + * + * When true, this config field will have the paginator stop when the token doesn't change + * instead of when it is not present. + */ + stopOnSameToken?: boolean; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/profile.d.ts b/server/node_modules/@aws-sdk/types/dist-types/profile.d.ts new file mode 100644 index 0000000000..2bfc882568 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/profile.d.ts @@ -0,0 +1,11 @@ +export declare type IniSection = Record; +/** + * @deprecated: Please use IniSection + */ +export interface Profile extends IniSection { +} +export declare type ParsedIniData = Record; +export interface SharedConfigFiles { + credentialsFile: ParsedIniData; + configFile: ParsedIniData; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/response.d.ts b/server/node_modules/@aws-sdk/types/dist-types/response.d.ts new file mode 100644 index 0000000000..85d9b9b680 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/response.d.ts @@ -0,0 +1,34 @@ +export interface ResponseMetadata { + /** + * The status code of the last HTTP response received for this operation. + */ + httpStatusCode?: number; + /** + * A unique identifier for the last request sent for this operation. Often + * requested by AWS service teams to aid in debugging. + */ + requestId?: string; + /** + * A secondary identifier for the last request sent. Used for debugging. + */ + extendedRequestId?: string; + /** + * A tertiary identifier for the last request sent. Used for debugging. + */ + cfId?: string; + /** + * The number of times this operation was attempted. + */ + attempts?: number; + /** + * The total amount of time (in milliseconds) that was spent waiting between + * retry attempts. + */ + totalRetryDelay?: number; +} +export interface MetadataBearer { + /** + * Metadata pertaining to this request. + */ + $metadata: ResponseMetadata; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/retry.d.ts b/server/node_modules/@aws-sdk/types/dist-types/retry.d.ts new file mode 100644 index 0000000000..2e53215f17 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/retry.d.ts @@ -0,0 +1,112 @@ +export declare type RetryErrorType = +/** + * This is a connection level error such as a socket timeout, socket connect + * error, tls negotiation timeout etc... + * Typically these should never be applied for non-idempotent request types + * since in this scenario, it's impossible to know whether the operation had + * a side effect on the server. + */ +"TRANSIENT" +/** + * This is an error where the server explicitly told the client to back off, + * such as a 429 or 503 Http error. + */ + | "THROTTLING" +/** + * This is a server error that isn't explicitly throttling but is considered + * by the client to be something that should be retried. + */ + | "SERVER_ERROR" +/** + * Doesn't count against any budgets. This could be something like a 401 + * challenge in Http. + */ + | "CLIENT_ERROR"; +export interface RetryErrorInfo { + errorType: RetryErrorType; + /** + * Protocol hint. This could come from Http's 'retry-after' header or + * something from MQTT or any other protocol that has the ability to convey + * retry info from a peer. + * + * @returns the Date after which a retry should be attempted. + */ + retryAfterHint?: Date; +} +export interface RetryBackoffStrategy { + /** + * @returns the number of milliseconds to wait before retrying an action. + */ + computeNextBackoffDelay(retryAttempt: number): number; +} +export interface StandardRetryBackoffStrategy extends RetryBackoffStrategy { + /** + * Sets the delayBase used to compute backoff delays. + * @param delayBase + */ + setDelayBase(delayBase: number): void; +} +export interface RetryStrategyOptions { + backoffStrategy: RetryBackoffStrategy; + maxRetriesBase: number; +} +export interface RetryToken { + /** + * @returns the current count of retry. + */ + getRetryCount(): number; + /** + * @returns the number of milliseconds to wait before retrying an action. + */ + getRetryDelay(): number; +} +export interface StandardRetryToken extends RetryToken { + /** + * @returns wheather token has remaining tokens. + */ + hasRetryTokens(errorType: RetryErrorType): boolean; + /** + * @returns the number of available tokens. + */ + getRetryTokenCount(errorInfo: RetryErrorInfo): number; + /** + * @returns the cost of the last retry attemp. + */ + getLastRetryCost(): number | undefined; + /** + * Releases a number of tokens. + * + * @param amount of tokens to release. + */ + releaseRetryTokens(amount?: number): void; +} +export interface RetryStrategyV2 { + /** + * Called before any retries (for the first call to the operation). It either + * returns a retry token or an error upon the failure to acquire a token prior. + * + * tokenScope is arbitrary and out of scope for this component. However, + * adding it here offers us a lot of future flexibility for outage detection. + * For example, it could be "us-east-1" on a shared retry strategy, or + * "us-west-2-c:dynamodb". + */ + acquireInitialRetryToken(retryTokenScope: string): Promise; + /** + * After a failed operation call, this function is invoked to refresh the + * retryToken returned by acquireInitialRetryToken(). This function can + * either choose to allow another retry and send a new or updated token, + * or reject the retry attempt and report the error either in an exception + * or returning an error. + */ + refreshRetryTokenForRetry(tokenToRenew: RetryToken, errorInfo: RetryErrorInfo): Promise; + /** + * Upon successful completion of the operation, a user calls this function + * to record that the operation was successful. + */ + recordSuccess(token: RetryToken): void; +} +export declare type ExponentialBackoffJitterType = "DEFAULT" | "NONE" | "FULL" | "DECORRELATED"; +export interface ExponentialBackoffStrategyOptions { + jitterType: ExponentialBackoffJitterType; + backoffScaleValue?: number; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/serde.d.ts b/server/node_modules/@aws-sdk/types/dist-types/serde.d.ts new file mode 100644 index 0000000000..c43c6e31f4 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/serde.d.ts @@ -0,0 +1,100 @@ +import { Endpoint } from "./http"; +import { RequestHandler } from "./transfer"; +import { Decoder, Encoder, Provider } from "./util"; +/** + * Interface for object requires an Endpoint set. + */ +export interface EndpointBearer { + endpoint: Provider; +} +export interface StreamCollector { + /** + * A function that converts a stream into an array of bytes. + * + * @param stream The low-level native stream from browser or Nodejs runtime + */ + (stream: any): Promise; +} +/** + * Request and Response serde util functions and settings for AWS services + */ +export interface SerdeContext extends EndpointBearer { + base64Encoder: Encoder; + base64Decoder: Decoder; + utf8Encoder: Encoder; + utf8Decoder: Decoder; + streamCollector: StreamCollector; + requestHandler: RequestHandler; + disableHostPrefix: boolean; +} +export interface RequestSerializer { + /** + * Converts the provided `input` into a request object + * + * @param input The user input to serialize. + * + * @param context Context containing runtime-specific util functions. + */ + (input: any, context: Context): Promise; +} +export interface ResponseDeserializer { + /** + * Converts the output of an operation into JavaScript types. + * + * @param output The HTTP response received from the service + * + * @param context context containing runtime-specific util functions. + */ + (output: ResponseType, context: Context): Promise; +} +/** + * Declare ReadableStream in case dom.d.ts is not added to the tsconfig lib causing + * ReadableStream interface is not defined. For developers with dom.d.ts added, + * the ReadableStream interface will be merged correctly. + * + * This is also required for any clients with streaming interface where ReadableStream + * type is also referred. The type is only declared here once since this @aws-sdk/types + * is depended by all @aws-sdk packages. + */ +declare global { + export interface ReadableStream { + } +} +/** + * The interface contains mix-in utility functions to transfer the runtime-specific + * stream implementation to specified format. Each stream can ONLY be transformed + * once. + */ +export interface SdkStreamMixin { + transformToByteArray: () => Promise; + transformToString: (encoding?: string) => Promise; + transformToWebStream: () => ReadableStream; +} +/** + * The type describing a runtime-specific stream implementation with mix-in + * utility functions. + */ +export declare type SdkStream = BaseStream & SdkStreamMixin; +/** + * Indicates that the member of type T with + * key StreamKey have been extended + * with the SdkStreamMixin helper methods. + */ +export declare type WithSdkStreamMixin = { + [key in keyof T]: key extends StreamKey ? SdkStream : T[key]; +}; +/** + * Interface for internal function to inject stream utility functions + * implementation + * + * @internal + */ +export interface SdkStreamMixinInjector { + (stream: unknown): SdkStreamMixin; +} +/** + * @internal + */ +export interface SdkStreamSerdeContext { + sdkStreamMixin: SdkStreamMixinInjector; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/shapes.d.ts b/server/node_modules/@aws-sdk/types/dist-types/shapes.d.ts new file mode 100644 index 0000000000..d9ffee5936 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/shapes.d.ts @@ -0,0 +1,54 @@ +import { HttpResponse } from "./http"; +import { MetadataBearer } from "./response"; +/** + * A document type represents an untyped JSON-like value. + * + * Not all protocols support document types, and the serialization format of a + * document type is protocol specific. All JSON protocols SHOULD support + * document types and they SHOULD serialize document types inline as normal + * JSON values. + */ +export declare type DocumentType = null | boolean | number | string | DocumentType[] | { + [prop: string]: DocumentType; +}; +/** + * A structure shape with the error trait. + * https://smithy.io/2.0/spec/behavior-traits.html#smithy-api-retryable-trait + */ +export interface RetryableTrait { + /** + * Indicates that the error is a retryable throttling error. + */ + readonly throttling?: boolean; +} +/** + * Type that is implemented by all Smithy shapes marked with the + * error trait. + * @deprecated + */ +export interface SmithyException { + /** + * The shape ID name of the exception. + */ + readonly name: string; + /** + * Whether the client or server are at fault. + */ + readonly $fault: "client" | "server"; + /** + * The service that encountered the exception. + */ + readonly $service?: string; + /** + * Indicates that an error MAY be retried by the client. + */ + readonly $retryable?: RetryableTrait; + /** + * Reference to low-level HTTP response object. + */ + readonly $response?: HttpResponse; +} +/** + * @deprecated + */ +export declare type SdkError = Error & Partial & Partial; diff --git a/server/node_modules/@aws-sdk/types/dist-types/signature.d.ts b/server/node_modules/@aws-sdk/types/dist-types/signature.d.ts new file mode 100644 index 0000000000..689c9728fe --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/signature.d.ts @@ -0,0 +1,100 @@ +import { HttpRequest } from "./http"; +/** + * A {Date} object, a unix (epoch) timestamp in seconds, or a string that can be + * understood by the JavaScript {Date} constructor. + */ +export declare type DateInput = number | string | Date; +export interface SigningArguments { + /** + * The date and time to be used as signature metadata. This value should be + * a Date object, a unix (epoch) timestamp, or a string that can be + * understood by the JavaScript `Date` constructor.If not supplied, the + * value returned by `new Date()` will be used. + */ + signingDate?: DateInput; + /** + * The service signing name. It will override the service name of the signer + * in current invocation + */ + signingService?: string; + /** + * The region name to sign the request. It will override the signing region of the + * signer in current invocation + */ + signingRegion?: string; +} +export interface RequestSigningArguments extends SigningArguments { + /** + * A set of strings whose members represents headers that cannot be signed. + * All headers in the provided request will have their names converted to + * lower case and then checked for existence in the unsignableHeaders set. + */ + unsignableHeaders?: Set; + /** + * A set of strings whose members represents headers that should be signed. + * Any values passed here will override those provided via unsignableHeaders, + * allowing them to be signed. + * + * All headers in the provided request will have their names converted to + * lower case before signing. + */ + signableHeaders?: Set; +} +export interface RequestPresigningArguments extends RequestSigningArguments { + /** + * The number of seconds before the presigned URL expires + */ + expiresIn?: number; + /** + * A set of strings whose representing headers that should not be hoisted + * to presigned request's query string. If not supplied, the presigner + * moves all the AWS-specific headers (starting with `x-amz-`) to the request + * query string. If supplied, these headers remain in the presigned request's + * header. + * All headers in the provided request will have their names converted to + * lower case and then checked for existence in the unhoistableHeaders set. + */ + unhoistableHeaders?: Set; +} +export interface EventSigningArguments extends SigningArguments { + priorSignature: string; +} +export interface RequestPresigner { + /** + * Signs a request for future use. + * + * The request will be valid until either the provided `expiration` time has + * passed or the underlying credentials have expired. + * + * @param requestToSign The request that should be signed. + * @param options Additional signing options. + */ + presign(requestToSign: HttpRequest, options?: RequestPresigningArguments): Promise; +} +/** + * An object that signs request objects with AWS credentials using one of the + * AWS authentication protocols. + */ +export interface RequestSigner { + /** + * Sign the provided request for immediate dispatch. + */ + sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise; +} +export interface StringSigner { + /** + * Sign the provided `stringToSign` for use outside of the context of + * request signing. Typical uses include signed policy generation. + */ + sign(stringToSign: string, options?: SigningArguments): Promise; +} +export interface FormattedEvent { + headers: Uint8Array; + payload: Uint8Array; +} +export interface EventSigner { + /** + * Sign the individual event of the event stream. + */ + sign(event: FormattedEvent, options: EventSigningArguments): Promise; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/stream.d.ts b/server/node_modules/@aws-sdk/types/dist-types/stream.d.ts new file mode 100644 index 0000000000..114877a71b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/stream.d.ts @@ -0,0 +1,17 @@ +import { ChecksumConstructor } from "./checksum"; +import { HashConstructor, StreamHasher } from "./crypto"; +import { BodyLengthCalculator, Encoder } from "./util"; +export interface GetAwsChunkedEncodingStreamOptions { + base64Encoder?: Encoder; + bodyLengthChecker: BodyLengthCalculator; + checksumAlgorithmFn?: ChecksumConstructor | HashConstructor; + checksumLocationName?: string; + streamHasher?: StreamHasher; +} +/** + * A function that returns Readable Stream which follows aws-chunked encoding stream. + * It optionally adds checksum if options are provided. + */ +export interface GetAwsChunkedEncodingStream { + (readableStream: StreamType, options: GetAwsChunkedEncodingStreamOptions): StreamType; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/token.d.ts b/server/node_modules/@aws-sdk/types/dist-types/token.d.ts new file mode 100644 index 0000000000..b3e43b0a39 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/token.d.ts @@ -0,0 +1,13 @@ +import { TokenIdentity } from "./identity"; +import { Provider } from "./util"; +/** + * An object representing temporary or permanent AWS token. + * + * @deprecated Use {@TokenIdentity} + */ +export interface Token extends TokenIdentity { +} +/** + * @deprecated Use {@TokenIdentityProvider} + */ +export declare type TokenProvider = Provider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/transfer.d.ts b/server/node_modules/@aws-sdk/types/dist-types/transfer.d.ts new file mode 100644 index 0000000000..a399edca94 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/transfer.d.ts @@ -0,0 +1,16 @@ +export declare type RequestHandlerOutput = { + response: ResponseType; +}; +export interface RequestHandler { + /** + * metadata contains information of a handler. For example + * 'h2' refers this handler is for handling HTTP/2 requests, + * whereas 'h1' refers handling HTTP1 requests + */ + metadata?: RequestHandlerMetadata; + destroy?: () => void; + handle: (request: RequestType, handlerOptions?: HandlerOptions) => Promise>; +} +export interface RequestHandlerMetadata { + handlerProtocol: string; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/abort.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/abort.d.ts new file mode 100644 index 0000000000..856bfccd08 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/abort.d.ts @@ -0,0 +1,11 @@ +export interface AbortHandler { + (this: AbortSignal, ev: any): any; +} +export interface AbortSignal { + readonly aborted: boolean; + onabort: AbortHandler | null; +} +export interface AbortController { + readonly signal: AbortSignal; + abort(): void; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/auth.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/auth.d.ts new file mode 100644 index 0000000000..e7e876f43b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/auth.d.ts @@ -0,0 +1,17 @@ +export interface AuthScheme { + name: "sigv4" | "sigv4a" | string; + signingName: string; + signingRegion: string; + signingRegionSet?: string[]; + signingScope?: never; + properties: Record; +} +export interface HttpAuthDefinition { + in: HttpAuthLocation; + name: string; + scheme?: string; +} +export declare enum HttpAuthLocation { + HEADER = "header", + QUERY = "query", +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/checksum.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/checksum.d.ts new file mode 100644 index 0000000000..3da212219c --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/checksum.d.ts @@ -0,0 +1,12 @@ +import { SourceData } from "./crypto"; +export interface Checksum { + digestLength?: number; + copy?(): Checksum; + digest(): Promise; + mark?(readLimit: number): void; + reset(): void; + update(chunk: Uint8Array): void; +} +export interface ChecksumConstructor { + new (secret?: SourceData): Checksum; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/client.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/client.d.ts new file mode 100644 index 0000000000..20ffafc234 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/client.d.ts @@ -0,0 +1,52 @@ +import { Command } from "./command"; +import { MiddlewareStack } from "./middleware"; +import { MetadataBearer } from "./response"; +interface InvokeFunction< + InputTypes extends object, + OutputTypes extends MetadataBearer, + ResolvedClientConfiguration +> { + ( + command: Command< + InputTypes, + InputType, + OutputTypes, + OutputType, + ResolvedClientConfiguration + >, + options?: any + ): Promise; + ( + command: Command< + InputTypes, + InputType, + OutputTypes, + OutputType, + ResolvedClientConfiguration + >, + options: any, + cb: (err: any, data?: OutputType) => void + ): void; + ( + command: Command< + InputTypes, + InputType, + OutputTypes, + OutputType, + ResolvedClientConfiguration + >, + options?: any, + cb?: (err: any, data?: OutputType) => void + ): Promise | void; +} +export interface Client< + Input extends object, + Output extends MetadataBearer, + ResolvedClientConfiguration +> { + readonly config: ResolvedClientConfiguration; + middlewareStack: MiddlewareStack; + send: InvokeFunction; + destroy: () => void; +} +export {}; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/command.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/command.d.ts new file mode 100644 index 0000000000..67a2a68798 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/command.d.ts @@ -0,0 +1,17 @@ +import { Handler, MiddlewareStack } from "./middleware"; +import { MetadataBearer } from "./response"; +export interface Command< + ClientInput extends object, + InputType extends ClientInput, + ClientOutput extends MetadataBearer, + OutputType extends ClientOutput, + ResolvedConfiguration +> { + readonly input: InputType; + readonly middlewareStack: MiddlewareStack; + resolveMiddleware( + stack: MiddlewareStack, + configuration: ResolvedConfiguration, + options: any + ): Handler; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/credentials.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/credentials.d.ts new file mode 100644 index 0000000000..6ef1cfb29a --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/credentials.d.ts @@ -0,0 +1,4 @@ +import { AwsCredentialIdentity } from "./identity"; +import { Provider } from "./util"; +export interface Credentials extends AwsCredentialIdentity {} +export declare type CredentialProvider = Provider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/crypto.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/crypto.d.ts new file mode 100644 index 0000000000..a66bb5a664 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/crypto.d.ts @@ -0,0 +1,14 @@ +export declare type SourceData = string | ArrayBuffer | ArrayBufferView; +export interface Hash { + update(toHash: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void; + digest(): Promise; +} +export interface HashConstructor { + new (secret?: SourceData): Hash; +} +export interface StreamHasher { + (hashCtor: HashConstructor, stream: StreamType): Promise; +} +export interface randomValues { + (byteLength: number): Promise; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/endpoint.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/endpoint.d.ts new file mode 100644 index 0000000000..a29a9c84d2 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/endpoint.d.ts @@ -0,0 +1,43 @@ +import { AuthScheme } from "./auth"; +export interface EndpointPartition { + name: string; + dnsSuffix: string; + dualStackDnsSuffix: string; + supportsFIPS: boolean; + supportsDualStack: boolean; +} +export interface EndpointARN { + partition: string; + service: string; + region: string; + accountId: string; + resourceId: Array; +} +export declare enum EndpointURLScheme { + HTTP = "http", + HTTPS = "https", +} +export interface EndpointURL { + scheme: EndpointURLScheme; + authority: string; + path: string; + normalizedPath: string; + isIp: boolean; +} +export declare type EndpointObjectProperty = + | string + | boolean + | { + [key: string]: EndpointObjectProperty; + } + | EndpointObjectProperty[]; +export interface EndpointV2 { + url: URL; + properties?: { + authSchemes?: AuthScheme[]; + } & Record; + headers?: Record; +} +export declare type EndpointParameters = { + [name: string]: undefined | string | boolean; +}; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/eventStream.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/eventStream.d.ts new file mode 100644 index 0000000000..3f839fa0c5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/eventStream.d.ts @@ -0,0 +1,99 @@ +import { HttpRequest } from "./http"; +import { + FinalizeHandler, + FinalizeHandlerArguments, + FinalizeHandlerOutput, + HandlerExecutionContext, +} from "./middleware"; +import { MetadataBearer } from "./response"; +export interface Message { + headers: MessageHeaders; + body: Uint8Array; +} +export declare type MessageHeaders = Record; +export interface BooleanHeaderValue { + type: "boolean"; + value: boolean; +} +export interface ByteHeaderValue { + type: "byte"; + value: number; +} +export interface ShortHeaderValue { + type: "short"; + value: number; +} +export interface IntegerHeaderValue { + type: "integer"; + value: number; +} +export interface LongHeaderValue { + type: "long"; + value: Int64; +} +export interface BinaryHeaderValue { + type: "binary"; + value: Uint8Array; +} +export interface StringHeaderValue { + type: "string"; + value: string; +} +export interface TimestampHeaderValue { + type: "timestamp"; + value: Date; +} +export interface UuidHeaderValue { + type: "uuid"; + value: string; +} +export declare type MessageHeaderValue = + | BooleanHeaderValue + | ByteHeaderValue + | ShortHeaderValue + | IntegerHeaderValue + | LongHeaderValue + | BinaryHeaderValue + | StringHeaderValue + | TimestampHeaderValue + | UuidHeaderValue; +export interface Int64 { + readonly bytes: Uint8Array; + valueOf: () => number; + toString: () => string; +} +export interface EventStreamSerdeContext { + eventStreamMarshaller: EventStreamMarshaller; +} +export interface EventStreamMarshallerDeserFn { + ( + body: StreamType, + deserializer: (input: Record) => Promise + ): AsyncIterable; +} +export interface EventStreamMarshallerSerFn { + (input: AsyncIterable, serializer: (event: T) => Message): StreamType; +} +export interface EventStreamMarshaller { + deserialize: EventStreamMarshallerDeserFn; + serialize: EventStreamMarshallerSerFn; +} +export interface EventStreamRequestSigner { + sign(request: HttpRequest): Promise; +} +export interface EventStreamPayloadHandler { + handle: ( + next: FinalizeHandler, + args: FinalizeHandlerArguments, + context?: HandlerExecutionContext + ) => Promise>; +} +export interface EventStreamPayloadHandlerProvider { + (options: any): EventStreamPayloadHandler; +} +export interface EventStreamSerdeProvider { + (options: any): EventStreamMarshaller; +} +export interface EventStreamSignerProvider { + (options: any): EventStreamRequestSigner; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/http.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/http.d.ts new file mode 100644 index 0000000000..caa18f732d --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/http.d.ts @@ -0,0 +1,33 @@ +import { AbortSignal } from "./abort"; +export interface Headers extends Map { + withHeader(headerName: string, headerValue: string): Headers; + withoutHeader(headerName: string): Headers; +} +export declare type HeaderBag = Record; +export interface HttpMessage { + headers: HeaderBag; + body?: any; +} +export declare type QueryParameterBag = Record< + string, + string | Array | null +>; +export interface Endpoint { + protocol: string; + hostname: string; + port?: number; + path: string; + query?: QueryParameterBag; +} +export interface HttpRequest extends HttpMessage, Endpoint { + method: string; +} +export interface HttpResponse extends HttpMessage { + statusCode: number; +} +export interface ResolvedHttpResponse extends HttpResponse { + body: string; +} +export interface HttpHandlerOptions { + abortSignal?: AbortSignal; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AnonymousIdentity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AnonymousIdentity.d.ts new file mode 100644 index 0000000000..5b175f60c5 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AnonymousIdentity.d.ts @@ -0,0 +1,2 @@ +import { Identity } from "./Identity"; +export interface AnonymousIdentity extends Identity {} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AwsCredentialIdentity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AwsCredentialIdentity.d.ts new file mode 100644 index 0000000000..8dc69bb77f --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AwsCredentialIdentity.d.ts @@ -0,0 +1,8 @@ +import { Identity, IdentityProvider } from "./Identity"; +export interface AwsCredentialIdentity extends Identity { + readonly accessKeyId: string; + readonly secretAccessKey: string; + readonly sessionToken?: string; +} +export declare type AwsCredentialIdentityProvider = + IdentityProvider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/Identity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/Identity.d.ts new file mode 100644 index 0000000000..becc0fe841 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/Identity.d.ts @@ -0,0 +1,6 @@ +export interface Identity { + readonly expiration?: Date; +} +export interface IdentityProvider { + (identityProperties?: Record): Promise; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/LoginIdentity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/LoginIdentity.d.ts new file mode 100644 index 0000000000..b9f7175c21 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/LoginIdentity.d.ts @@ -0,0 +1,6 @@ +import { Identity, IdentityProvider } from "./Identity"; +export interface LoginIdentity extends Identity { + readonly username: string; + readonly password: string; +} +export declare type LoginIdentityProvider = IdentityProvider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/TokenIdentity.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/TokenIdentity.d.ts new file mode 100644 index 0000000000..d382bcf0c3 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/TokenIdentity.d.ts @@ -0,0 +1,5 @@ +import { Identity, IdentityProvider } from "./Identity"; +export interface TokenIdentity extends Identity { + readonly token: string; +} +export declare type TokenIdentityProvider = IdentityProvider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/index.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/index.d.ts new file mode 100644 index 0000000000..863e78e802 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/index.d.ts @@ -0,0 +1,5 @@ +export * from "./AnonymousIdentity"; +export * from "./AwsCredentialIdentity"; +export * from "./Identity"; +export * from "./LoginIdentity"; +export * from "./TokenIdentity"; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..94228ab744 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/index.d.ts @@ -0,0 +1,25 @@ +export * from "./abort"; +export * from "./auth"; +export * from "./checksum"; +export * from "./client"; +export * from "./command"; +export * from "./credentials"; +export * from "./crypto"; +export * from "./endpoint"; +export * from "./eventStream"; +export * from "./http"; +export * from "./identity"; +export * from "./logger"; +export * from "./middleware"; +export * from "./pagination"; +export * from "./profile"; +export * from "./response"; +export * from "./retry"; +export * from "./serde"; +export * from "./shapes"; +export * from "./signature"; +export * from "./stream"; +export * from "./token"; +export * from "./transfer"; +export * from "./util"; +export * from "./waiter"; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/logger.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/logger.d.ts new file mode 100644 index 0000000000..c4b1ab6c70 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/logger.d.ts @@ -0,0 +1,20 @@ +export declare type LogLevel = + | "all" + | "trace" + | "debug" + | "log" + | "info" + | "warn" + | "error" + | "off"; +export interface LoggerOptions { + logger?: Logger; + logLevel?: LogLevel; +} +export interface Logger { + trace?: (...content: any[]) => void; + debug: (...content: any[]) => void; + info: (...content: any[]) => void; + warn: (...content: any[]) => void; + error: (...content: any[]) => void; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/middleware.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/middleware.d.ts new file mode 100644 index 0000000000..c03b550b11 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/middleware.d.ts @@ -0,0 +1,214 @@ +import { AuthScheme, HttpAuthDefinition } from "./auth"; +import { EndpointV2 } from "./endpoint"; +import { Logger } from "./logger"; +import { UserAgent } from "./util"; +export interface InitializeHandlerArguments { + input: Input; +} +export interface InitializeHandlerOutput + extends DeserializeHandlerOutput { + output: Output; +} +export interface SerializeHandlerArguments + extends InitializeHandlerArguments { + request?: unknown; +} +export interface SerializeHandlerOutput + extends InitializeHandlerOutput {} +export interface BuildHandlerArguments + extends FinalizeHandlerArguments {} +export interface BuildHandlerOutput + extends InitializeHandlerOutput {} +export interface FinalizeHandlerArguments + extends SerializeHandlerArguments { + request: unknown; +} +export interface FinalizeHandlerOutput + extends InitializeHandlerOutput {} +export interface DeserializeHandlerArguments + extends FinalizeHandlerArguments {} +export interface DeserializeHandlerOutput { + response: unknown; + output?: Output; +} +export interface InitializeHandler< + Input extends object, + Output extends object +> { + (args: InitializeHandlerArguments): Promise< + InitializeHandlerOutput + >; +} +export declare type Handler< + Input extends object, + Output extends object +> = InitializeHandler; +export interface SerializeHandler { + (args: SerializeHandlerArguments): Promise< + SerializeHandlerOutput + >; +} +export interface FinalizeHandler { + (args: FinalizeHandlerArguments): Promise< + FinalizeHandlerOutput + >; +} +export interface BuildHandler { + (args: BuildHandlerArguments): Promise>; +} +export interface DeserializeHandler< + Input extends object, + Output extends object +> { + (args: DeserializeHandlerArguments): Promise< + DeserializeHandlerOutput + >; +} +export interface InitializeMiddleware< + Input extends object, + Output extends object +> { + ( + next: InitializeHandler, + context: HandlerExecutionContext + ): InitializeHandler; +} +export interface SerializeMiddleware< + Input extends object, + Output extends object +> { + ( + next: SerializeHandler, + context: HandlerExecutionContext + ): SerializeHandler; +} +export interface FinalizeRequestMiddleware< + Input extends object, + Output extends object +> { + ( + next: FinalizeHandler, + context: HandlerExecutionContext + ): FinalizeHandler; +} +export interface BuildMiddleware { + ( + next: BuildHandler, + context: HandlerExecutionContext + ): BuildHandler; +} +export interface DeserializeMiddleware< + Input extends object, + Output extends object +> { + ( + next: DeserializeHandler, + context: HandlerExecutionContext + ): DeserializeHandler; +} +export declare type MiddlewareType< + Input extends object, + Output extends object +> = + | InitializeMiddleware + | SerializeMiddleware + | BuildMiddleware + | FinalizeRequestMiddleware + | DeserializeMiddleware; +export interface Terminalware { + ( + context: HandlerExecutionContext + ): DeserializeHandler; +} +export declare type Step = + | "initialize" + | "serialize" + | "build" + | "finalizeRequest" + | "deserialize"; +export declare type Priority = "high" | "normal" | "low"; +export interface HandlerOptions { + step?: Step; + tags?: Array; + name?: string; + override?: boolean; +} +export interface AbsoluteLocation { + priority?: Priority; +} +export declare type Relation = "before" | "after"; +export interface RelativeLocation { + relation: Relation; + toMiddleware: string; +} +export declare type RelativeMiddlewareOptions = RelativeLocation & + Pick>; +export interface InitializeHandlerOptions extends HandlerOptions { + step?: "initialize"; +} +export interface SerializeHandlerOptions extends HandlerOptions { + step: "serialize"; +} +export interface BuildHandlerOptions extends HandlerOptions { + step: "build"; +} +export interface FinalizeRequestHandlerOptions extends HandlerOptions { + step: "finalizeRequest"; +} +export interface DeserializeHandlerOptions extends HandlerOptions { + step: "deserialize"; +} +export interface MiddlewareStack + extends Pluggable { + add( + middleware: InitializeMiddleware, + options?: InitializeHandlerOptions & AbsoluteLocation + ): void; + add( + middleware: SerializeMiddleware, + options: SerializeHandlerOptions & AbsoluteLocation + ): void; + add( + middleware: BuildMiddleware, + options: BuildHandlerOptions & AbsoluteLocation + ): void; + add( + middleware: FinalizeRequestMiddleware, + options: FinalizeRequestHandlerOptions & AbsoluteLocation + ): void; + add( + middleware: DeserializeMiddleware, + options: DeserializeHandlerOptions & AbsoluteLocation + ): void; + addRelativeTo( + middleware: MiddlewareType, + options: RelativeMiddlewareOptions + ): void; + use(pluggable: Pluggable): void; + clone(): MiddlewareStack; + remove(toRemove: MiddlewareType | string): boolean; + removeByTag(toRemove: string): boolean; + concat( + from: MiddlewareStack + ): MiddlewareStack; + identify(): string[]; + resolve( + handler: DeserializeHandler, + context: HandlerExecutionContext + ): InitializeHandler; +} +export interface HandlerExecutionContext { + logger?: Logger; + userAgent?: UserAgent; + endpointV2?: EndpointV2; + authSchemes?: AuthScheme[]; + currentAuthConfig?: HttpAuthDefinition; + dynamoDbDocumentClientOptions?: Partial<{ + overrideInputFilterSensitiveLog(...args: any[]): string | void; + overrideOutputFilterSensitiveLog(...args: any[]): string | void; + }>; + [key: string]: any; +} +export interface Pluggable { + applyToStack: (stack: MiddlewareStack) => void; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/pagination.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/pagination.d.ts new file mode 100644 index 0000000000..b3a7925ef1 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/pagination.d.ts @@ -0,0 +1,8 @@ +import { Client } from "./client"; +export declare type Paginator = AsyncGenerator; +export interface PaginationConfiguration { + client: Client; + pageSize?: number; + startingToken?: any; + stopOnSameToken?: boolean; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/profile.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/profile.d.ts new file mode 100644 index 0000000000..9746c42122 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/profile.d.ts @@ -0,0 +1,7 @@ +export declare type IniSection = Record; +export interface Profile extends IniSection {} +export declare type ParsedIniData = Record; +export interface SharedConfigFiles { + credentialsFile: ParsedIniData; + configFile: ParsedIniData; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/response.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/response.d.ts new file mode 100644 index 0000000000..a7a6c9f0e6 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/response.d.ts @@ -0,0 +1,11 @@ +export interface ResponseMetadata { + httpStatusCode?: number; + requestId?: string; + extendedRequestId?: string; + cfId?: string; + attempts?: number; + totalRetryDelay?: number; +} +export interface MetadataBearer { + $metadata: ResponseMetadata; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/retry.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/retry.d.ts new file mode 100644 index 0000000000..ee61139b05 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/retry.d.ts @@ -0,0 +1,46 @@ +export declare type RetryErrorType = + | "TRANSIENT" + | "THROTTLING" + | "SERVER_ERROR" + | "CLIENT_ERROR"; +export interface RetryErrorInfo { + errorType: RetryErrorType; + retryAfterHint?: Date; +} +export interface RetryBackoffStrategy { + computeNextBackoffDelay(retryAttempt: number): number; +} +export interface StandardRetryBackoffStrategy extends RetryBackoffStrategy { + setDelayBase(delayBase: number): void; +} +export interface RetryStrategyOptions { + backoffStrategy: RetryBackoffStrategy; + maxRetriesBase: number; +} +export interface RetryToken { + getRetryCount(): number; + getRetryDelay(): number; +} +export interface StandardRetryToken extends RetryToken { + hasRetryTokens(errorType: RetryErrorType): boolean; + getRetryTokenCount(errorInfo: RetryErrorInfo): number; + getLastRetryCost(): number | undefined; + releaseRetryTokens(amount?: number): void; +} +export interface RetryStrategyV2 { + acquireInitialRetryToken(retryTokenScope: string): Promise; + refreshRetryTokenForRetry( + tokenToRenew: RetryToken, + errorInfo: RetryErrorInfo + ): Promise; + recordSuccess(token: RetryToken): void; +} +export declare type ExponentialBackoffJitterType = + | "DEFAULT" + | "NONE" + | "FULL" + | "DECORRELATED"; +export interface ExponentialBackoffStrategyOptions { + jitterType: ExponentialBackoffJitterType; + backoffScaleValue?: number; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/serde.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/serde.d.ts new file mode 100644 index 0000000000..ff4189e4fb --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/serde.d.ts @@ -0,0 +1,49 @@ +import { Endpoint } from "./http"; +import { RequestHandler } from "./transfer"; +import { Decoder, Encoder, Provider } from "./util"; +export interface EndpointBearer { + endpoint: Provider; +} +export interface StreamCollector { + (stream: any): Promise; +} +export interface SerdeContext extends EndpointBearer { + base64Encoder: Encoder; + base64Decoder: Decoder; + utf8Encoder: Encoder; + utf8Decoder: Decoder; + streamCollector: StreamCollector; + requestHandler: RequestHandler; + disableHostPrefix: boolean; +} +export interface RequestSerializer< + Request, + Context extends EndpointBearer = any +> { + (input: any, context: Context): Promise; +} +export interface ResponseDeserializer< + OutputType, + ResponseType = any, + Context = any +> { + (output: ResponseType, context: Context): Promise; +} +declare global { + export interface ReadableStream {} +} +export interface SdkStreamMixin { + transformToByteArray: () => Promise; + transformToString: (encoding?: string) => Promise; + transformToWebStream: () => ReadableStream; +} +export declare type SdkStream = BaseStream & SdkStreamMixin; +export declare type WithSdkStreamMixin = { + [key in keyof T]: key extends StreamKey ? SdkStream : T[key]; +}; +export interface SdkStreamMixinInjector { + (stream: unknown): SdkStreamMixin; +} +export interface SdkStreamSerdeContext { + sdkStreamMixin: SdkStreamMixinInjector; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/shapes.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/shapes.d.ts new file mode 100644 index 0000000000..2982af009a --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/shapes.d.ts @@ -0,0 +1,24 @@ +import { HttpResponse } from "./http"; +import { MetadataBearer } from "./response"; +export declare type DocumentType = + | null + | boolean + | number + | string + | DocumentType[] + | { + [prop: string]: DocumentType; + }; +export interface RetryableTrait { + readonly throttling?: boolean; +} +export interface SmithyException { + readonly name: string; + readonly $fault: "client" | "server"; + readonly $service?: string; + readonly $retryable?: RetryableTrait; + readonly $response?: HttpResponse; +} +export declare type SdkError = Error & + Partial & + Partial; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/signature.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/signature.d.ts new file mode 100644 index 0000000000..67d833aec3 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/signature.d.ts @@ -0,0 +1,40 @@ +import { HttpRequest } from "./http"; +export declare type DateInput = number | string | Date; +export interface SigningArguments { + signingDate?: DateInput; + signingService?: string; + signingRegion?: string; +} +export interface RequestSigningArguments extends SigningArguments { + unsignableHeaders?: Set; + signableHeaders?: Set; +} +export interface RequestPresigningArguments extends RequestSigningArguments { + expiresIn?: number; + unhoistableHeaders?: Set; +} +export interface EventSigningArguments extends SigningArguments { + priorSignature: string; +} +export interface RequestPresigner { + presign( + requestToSign: HttpRequest, + options?: RequestPresigningArguments + ): Promise; +} +export interface RequestSigner { + sign( + requestToSign: HttpRequest, + options?: RequestSigningArguments + ): Promise; +} +export interface StringSigner { + sign(stringToSign: string, options?: SigningArguments): Promise; +} +export interface FormattedEvent { + headers: Uint8Array; + payload: Uint8Array; +} +export interface EventSigner { + sign(event: FormattedEvent, options: EventSigningArguments): Promise; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/stream.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/stream.d.ts new file mode 100644 index 0000000000..cb5539b541 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/stream.d.ts @@ -0,0 +1,16 @@ +import { ChecksumConstructor } from "./checksum"; +import { HashConstructor, StreamHasher } from "./crypto"; +import { BodyLengthCalculator, Encoder } from "./util"; +export interface GetAwsChunkedEncodingStreamOptions { + base64Encoder?: Encoder; + bodyLengthChecker: BodyLengthCalculator; + checksumAlgorithmFn?: ChecksumConstructor | HashConstructor; + checksumLocationName?: string; + streamHasher?: StreamHasher; +} +export interface GetAwsChunkedEncodingStream { + ( + readableStream: StreamType, + options: GetAwsChunkedEncodingStreamOptions + ): StreamType; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/token.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/token.d.ts new file mode 100644 index 0000000000..44f03a493d --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/token.d.ts @@ -0,0 +1,4 @@ +import { TokenIdentity } from "./identity"; +import { Provider } from "./util"; +export interface Token extends TokenIdentity {} +export declare type TokenProvider = Provider; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/transfer.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/transfer.d.ts new file mode 100644 index 0000000000..11eb9b2b2b --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/transfer.d.ts @@ -0,0 +1,18 @@ +export declare type RequestHandlerOutput = { + response: ResponseType; +}; +export interface RequestHandler< + RequestType, + ResponseType, + HandlerOptions = {} +> { + metadata?: RequestHandlerMetadata; + destroy?: () => void; + handle: ( + request: RequestType, + handlerOptions?: HandlerOptions + ) => Promise>; +} +export interface RequestHandlerMetadata { + handlerProtocol: string; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/util.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/util.d.ts new file mode 100644 index 0000000000..5b0cc8b6a6 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/util.d.ts @@ -0,0 +1,50 @@ +import { Endpoint } from "./http"; +import { + FinalizeHandler, + FinalizeHandlerArguments, + FinalizeHandlerOutput, +} from "./middleware"; +import { MetadataBearer } from "./response"; +export interface Encoder { + (input: Uint8Array): string; +} +export interface Decoder { + (input: string): Uint8Array; +} +export interface Provider { + (): Promise; +} +export interface MemoizedProvider { + (options?: { forceRefresh?: boolean }): Promise; +} +export interface BodyLengthCalculator { + (body: any): number | undefined; +} +export interface RetryStrategy { + mode?: string; + retry: ( + next: FinalizeHandler, + args: FinalizeHandlerArguments + ) => Promise>; +} +export interface UrlParser { + (url: string | URL): Endpoint; +} +export interface RegionInfo { + hostname: string; + partition: string; + path?: string; + signingService?: string; + signingRegion?: string; +} +export interface RegionInfoProviderOptions { + useDualstackEndpoint: boolean; + useFipsEndpoint: boolean; +} +export interface RegionInfoProvider { + (region: string, options?: RegionInfoProviderOptions): Promise< + RegionInfo | undefined + >; +} +export declare type UserAgentPair = [string, string]; +export declare type UserAgent = UserAgentPair[]; diff --git a/server/node_modules/@aws-sdk/types/dist-types/ts3.4/waiter.d.ts b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/waiter.d.ts new file mode 100644 index 0000000000..4ee4a69207 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/ts3.4/waiter.d.ts @@ -0,0 +1,9 @@ +import { AbortController } from "./abort"; +export interface WaiterConfiguration { + client: Client; + maxWaitTime: number; + abortController?: AbortController; + abortSignal?: AbortController["signal"]; + minDelay?: number; + maxDelay?: number; +} diff --git a/server/node_modules/@aws-sdk/types/dist-types/util.d.ts b/server/node_modules/@aws-sdk/types/dist-types/util.d.ts new file mode 100644 index 0000000000..77498b85d2 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/util.d.ts @@ -0,0 +1,131 @@ +import { Endpoint } from "./http"; +import { FinalizeHandler, FinalizeHandlerArguments, FinalizeHandlerOutput } from "./middleware"; +import { MetadataBearer } from "./response"; +/** + * A function that, given a TypedArray of bytes, can produce a string + * representation thereof. + * + * @example An encoder function that converts bytes to hexadecimal + * representation would return `'deadbeef'` when given `new + * Uint8Array([0xde, 0xad, 0xbe, 0xef])`. + */ +export interface Encoder { + (input: Uint8Array): string; +} +/** + * A function that, given a string, can derive the bytes represented by that + * string. + * + * @example A decoder function that converts bytes to hexadecimal + * representation would return `new Uint8Array([0xde, 0xad, 0xbe, 0xef])` when + * given the string `'deadbeef'`. + */ +export interface Decoder { + (input: string): Uint8Array; +} +/** + * A function that, when invoked, returns a promise that will be fulfilled with + * a value of type T. + * + * @example A function that reads credentials from shared SDK configuration + * files, assuming roles and collecting MFA tokens as necessary. + */ +export interface Provider { + (): Promise; +} +/** + * A function that, when invoked, returns a promise that will be fulfilled with + * a value of type T. It memoizes the result from the previous invocation + * instead of calling the underlying resources every time. + * + * You can force the provider to refresh the memoized value by invoke the + * function with optional parameter hash with `forceRefresh` boolean key and + * value `true`. + * + * @example A function that reads credentials from IMDS service that could + * return expired credentials. The SDK will keep using the expired credentials + * until an unretryable service error requiring a force refresh of the + * credentials. + */ +export interface MemoizedProvider { + (options?: { + forceRefresh?: boolean; + }): Promise; +} +/** + * A function that, given a request body, determines the + * length of the body. This is used to determine the Content-Length + * that should be sent with a request. + * + * @example A function that reads a file stream and calculates + * the size of the file. + */ +export interface BodyLengthCalculator { + (body: any): number | undefined; +} +/** + * Interface that specifies the retry behavior + */ +export interface RetryStrategy { + /** + * The retry mode describing how the retry strategy control the traffic flow. + */ + mode?: string; + /** + * the retry behavior the will invoke the next handler and handle the retry accordingly. + * This function should also update the $metadata from the response accordingly. + * @see {@link ResponseMetadata} + */ + retry: (next: FinalizeHandler, args: FinalizeHandlerArguments) => Promise>; +} +/** + * Parses a URL in string form into an Endpoint object. + */ +export interface UrlParser { + (url: string | URL): Endpoint; +} +/** + * Object containing regionalization information of + * AWS services. + */ +export interface RegionInfo { + hostname: string; + partition: string; + path?: string; + signingService?: string; + signingRegion?: string; +} +/** + * Options to pass when calling {@link RegionInfoProvider} + */ +export interface RegionInfoProviderOptions { + /** + * Enables IPv6/IPv4 dualstack endpoint. + * @default false + */ + useDualstackEndpoint: boolean; + /** + * Enables FIPS compatible endpoints. + * @default false + */ + useFipsEndpoint: boolean; +} +/** + * Function returns designated service's regionalization + * information from given region. Each service client + * comes with its regionalization provider. it serves + * to provide the default values of related configurations + */ +export interface RegionInfoProvider { + (region: string, options?: RegionInfoProviderOptions): Promise; +} +/** + * A tuple that represents an API name and optional version + * of a library built using the AWS SDK. + */ +export declare type UserAgentPair = [name: string, version?: string]; +/** + * User agent data that to be put into the request's user + * agent. + */ +export declare type UserAgent = UserAgentPair[]; diff --git a/server/node_modules/@aws-sdk/types/dist-types/waiter.d.ts b/server/node_modules/@aws-sdk/types/dist-types/waiter.d.ts new file mode 100644 index 0000000000..fe1f471e66 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/dist-types/waiter.d.ts @@ -0,0 +1,32 @@ +import { AbortController } from "./abort"; +export interface WaiterConfiguration { + /** + * Required service client + */ + client: Client; + /** + * The amount of time in seconds a user is willing to wait for a waiter to complete. + */ + maxWaitTime: number; + /** + * @deprecated Use abortSignal + * Abort controller. Used for ending the waiter early. + */ + abortController?: AbortController; + /** + * Abort Signal. Used for ending the waiter early. + */ + abortSignal?: AbortController["signal"]; + /** + * The minimum amount of time to delay between retries in seconds. This is the + * floor of the exponential backoff. This value defaults to service default + * if not specified. This value MUST be less than or equal to maxDelay and greater than 0. + */ + minDelay?: number; + /** + * The maximum amount of time to delay between retries in seconds. This is the + * ceiling of the exponential backoff. This value defaults to service default + * if not specified. If specified, this value MUST be greater than or equal to 1. + */ + maxDelay?: number; +} diff --git a/server/node_modules/@aws-sdk/types/package.json b/server/node_modules/@aws-sdk/types/package.json new file mode 100755 index 0000000000..6f7f066ed6 --- /dev/null +++ b/server/node_modules/@aws-sdk/types/package.json @@ -0,0 +1,53 @@ +{ + "name": "@aws-sdk/types", + "version": "3.257.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "description": "Types for the AWS SDK", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "exit 0" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/types", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/types" + }, + "dependencies": { + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/url-parser/LICENSE b/server/node_modules/@aws-sdk/url-parser/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/url-parser/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/url-parser/README.md b/server/node_modules/@aws-sdk/url-parser/README.md new file mode 100644 index 0000000000..bb78a4ebc0 --- /dev/null +++ b/server/node_modules/@aws-sdk/url-parser/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/url-parser + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/url-parser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/url-parser) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/url-parser.svg)](https://www.npmjs.com/package/@aws-sdk/url-parser) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/url-parser/dist-cjs/index.js b/server/node_modules/@aws-sdk/url-parser/dist-cjs/index.js new file mode 100644 index 0000000000..47472cc428 --- /dev/null +++ b/server/node_modules/@aws-sdk/url-parser/dist-cjs/index.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseUrl = void 0; +const querystring_parser_1 = require("@aws-sdk/querystring-parser"); +const parseUrl = (url) => { + if (typeof url === "string") { + return (0, exports.parseUrl)(new URL(url)); + } + const { hostname, pathname, port, protocol, search } = url; + let query; + if (search) { + query = (0, querystring_parser_1.parseQueryString)(search); + } + return { + hostname, + port: port ? parseInt(port) : undefined, + protocol, + path: pathname, + query, + }; +}; +exports.parseUrl = parseUrl; diff --git a/server/node_modules/@aws-sdk/url-parser/dist-es/index.js b/server/node_modules/@aws-sdk/url-parser/dist-es/index.js new file mode 100644 index 0000000000..7056a593cd --- /dev/null +++ b/server/node_modules/@aws-sdk/url-parser/dist-es/index.js @@ -0,0 +1,18 @@ +import { parseQueryString } from "@aws-sdk/querystring-parser"; +export const parseUrl = (url) => { + if (typeof url === "string") { + return parseUrl(new URL(url)); + } + const { hostname, pathname, port, protocol, search } = url; + let query; + if (search) { + query = parseQueryString(search); + } + return { + hostname, + port: port ? parseInt(port) : undefined, + protocol, + path: pathname, + query, + }; +}; diff --git a/server/node_modules/@aws-sdk/url-parser/dist-types/index.d.ts b/server/node_modules/@aws-sdk/url-parser/dist-types/index.d.ts new file mode 100644 index 0000000000..5148a6126e --- /dev/null +++ b/server/node_modules/@aws-sdk/url-parser/dist-types/index.d.ts @@ -0,0 +1,2 @@ +import { UrlParser } from "@aws-sdk/types"; +export declare const parseUrl: UrlParser; diff --git a/server/node_modules/@aws-sdk/url-parser/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/url-parser/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..5148a6126e --- /dev/null +++ b/server/node_modules/@aws-sdk/url-parser/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +import { UrlParser } from "@aws-sdk/types"; +export declare const parseUrl: UrlParser; diff --git a/server/node_modules/@aws-sdk/url-parser/package.json b/server/node_modules/@aws-sdk/url-parser/package.json new file mode 100644 index 0000000000..f154c10b6d --- /dev/null +++ b/server/node_modules/@aws-sdk/url-parser/package.json @@ -0,0 +1,51 @@ +{ + "name": "@aws-sdk/url-parser", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/querystring-parser": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/url-parser", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/url-parser" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/util-base64/LICENSE b/server/node_modules/@aws-sdk/util-base64/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-base64/README.md b/server/node_modules/@aws-sdk/util-base64/README.md new file mode 100644 index 0000000000..fbe59e4bed --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/util-base64 + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-base64/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-base64) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-base64.svg)](https://www.npmjs.com/package/@aws-sdk/util-base64) diff --git a/server/node_modules/@aws-sdk/util-base64/dist-cjs/constants.browser.js b/server/node_modules/@aws-sdk/util-base64/dist-cjs/constants.browser.js new file mode 100644 index 0000000000..d35d09fdfd --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-cjs/constants.browser.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.maxLetterValue = exports.bitsPerByte = exports.bitsPerLetter = exports.alphabetByValue = exports.alphabetByEncoding = void 0; +const alphabetByEncoding = {}; +exports.alphabetByEncoding = alphabetByEncoding; +const alphabetByValue = new Array(64); +exports.alphabetByValue = alphabetByValue; +for (let i = 0, start = "A".charCodeAt(0), limit = "Z".charCodeAt(0); i + start <= limit; i++) { + const char = String.fromCharCode(i + start); + alphabetByEncoding[char] = i; + alphabetByValue[i] = char; +} +for (let i = 0, start = "a".charCodeAt(0), limit = "z".charCodeAt(0); i + start <= limit; i++) { + const char = String.fromCharCode(i + start); + const index = i + 26; + alphabetByEncoding[char] = index; + alphabetByValue[index] = char; +} +for (let i = 0; i < 10; i++) { + alphabetByEncoding[i.toString(10)] = i + 52; + const char = i.toString(10); + const index = i + 52; + alphabetByEncoding[char] = index; + alphabetByValue[index] = char; +} +alphabetByEncoding["+"] = 62; +alphabetByValue[62] = "+"; +alphabetByEncoding["/"] = 63; +alphabetByValue[63] = "/"; +const bitsPerLetter = 6; +exports.bitsPerLetter = bitsPerLetter; +const bitsPerByte = 8; +exports.bitsPerByte = bitsPerByte; +const maxLetterValue = 0b111111; +exports.maxLetterValue = maxLetterValue; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-cjs/fromBase64.browser.js b/server/node_modules/@aws-sdk/util-base64/dist-cjs/fromBase64.browser.js new file mode 100644 index 0000000000..a5baffd08f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-cjs/fromBase64.browser.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromBase64 = void 0; +const constants_browser_1 = require("./constants.browser"); +const fromBase64 = (input) => { + let totalByteLength = (input.length / 4) * 3; + if (input.slice(-2) === "==") { + totalByteLength -= 2; + } + else if (input.slice(-1) === "=") { + totalByteLength--; + } + const out = new ArrayBuffer(totalByteLength); + const dataView = new DataView(out); + for (let i = 0; i < input.length; i += 4) { + let bits = 0; + let bitLength = 0; + for (let j = i, limit = i + 3; j <= limit; j++) { + if (input[j] !== "=") { + if (!(input[j] in constants_browser_1.alphabetByEncoding)) { + throw new TypeError(`Invalid character ${input[j]} in base64 string.`); + } + bits |= constants_browser_1.alphabetByEncoding[input[j]] << ((limit - j) * constants_browser_1.bitsPerLetter); + bitLength += constants_browser_1.bitsPerLetter; + } + else { + bits >>= constants_browser_1.bitsPerLetter; + } + } + const chunkOffset = (i / 4) * 3; + bits >>= bitLength % constants_browser_1.bitsPerByte; + const byteLength = Math.floor(bitLength / constants_browser_1.bitsPerByte); + for (let k = 0; k < byteLength; k++) { + const offset = (byteLength - k - 1) * constants_browser_1.bitsPerByte; + dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset); + } + } + return new Uint8Array(out); +}; +exports.fromBase64 = fromBase64; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-cjs/fromBase64.js b/server/node_modules/@aws-sdk/util-base64/dist-cjs/fromBase64.js new file mode 100644 index 0000000000..8eb08b5bf1 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-cjs/fromBase64.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromBase64 = void 0; +const util_buffer_from_1 = require("@aws-sdk/util-buffer-from"); +const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; +const fromBase64 = (input) => { + if ((input.length * 3) % 4 !== 0) { + throw new TypeError(`Incorrect padding on base64 string.`); + } + if (!BASE64_REGEX.exec(input)) { + throw new TypeError(`Invalid base64 string.`); + } + const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); +}; +exports.fromBase64 = fromBase64; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-base64/dist-cjs/index.js new file mode 100644 index 0000000000..ec2617ba6b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-cjs/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromBase64"), exports); +tslib_1.__exportStar(require("./toBase64"), exports); diff --git a/server/node_modules/@aws-sdk/util-base64/dist-cjs/toBase64.browser.js b/server/node_modules/@aws-sdk/util-base64/dist-cjs/toBase64.browser.js new file mode 100644 index 0000000000..78d95b75ea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-cjs/toBase64.browser.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toBase64 = void 0; +const constants_browser_1 = require("./constants.browser"); +function toBase64(input) { + let str = ""; + for (let i = 0; i < input.length; i += 3) { + let bits = 0; + let bitLength = 0; + for (let j = i, limit = Math.min(i + 3, input.length); j < limit; j++) { + bits |= input[j] << ((limit - j - 1) * constants_browser_1.bitsPerByte); + bitLength += constants_browser_1.bitsPerByte; + } + const bitClusterCount = Math.ceil(bitLength / constants_browser_1.bitsPerLetter); + bits <<= bitClusterCount * constants_browser_1.bitsPerLetter - bitLength; + for (let k = 1; k <= bitClusterCount; k++) { + const offset = (bitClusterCount - k) * constants_browser_1.bitsPerLetter; + str += constants_browser_1.alphabetByValue[(bits & (constants_browser_1.maxLetterValue << offset)) >> offset]; + } + str += "==".slice(0, 4 - bitClusterCount); + } + return str; +} +exports.toBase64 = toBase64; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-cjs/toBase64.js b/server/node_modules/@aws-sdk/util-base64/dist-cjs/toBase64.js new file mode 100644 index 0000000000..32af04304a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-cjs/toBase64.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toBase64 = void 0; +const util_buffer_from_1 = require("@aws-sdk/util-buffer-from"); +const toBase64 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); +exports.toBase64 = toBase64; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-es/constants.browser.js b/server/node_modules/@aws-sdk/util-base64/dist-es/constants.browser.js new file mode 100644 index 0000000000..fd4df4dc9e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-es/constants.browser.js @@ -0,0 +1,28 @@ +const alphabetByEncoding = {}; +const alphabetByValue = new Array(64); +for (let i = 0, start = "A".charCodeAt(0), limit = "Z".charCodeAt(0); i + start <= limit; i++) { + const char = String.fromCharCode(i + start); + alphabetByEncoding[char] = i; + alphabetByValue[i] = char; +} +for (let i = 0, start = "a".charCodeAt(0), limit = "z".charCodeAt(0); i + start <= limit; i++) { + const char = String.fromCharCode(i + start); + const index = i + 26; + alphabetByEncoding[char] = index; + alphabetByValue[index] = char; +} +for (let i = 0; i < 10; i++) { + alphabetByEncoding[i.toString(10)] = i + 52; + const char = i.toString(10); + const index = i + 52; + alphabetByEncoding[char] = index; + alphabetByValue[index] = char; +} +alphabetByEncoding["+"] = 62; +alphabetByValue[62] = "+"; +alphabetByEncoding["/"] = 63; +alphabetByValue[63] = "/"; +const bitsPerLetter = 6; +const bitsPerByte = 8; +const maxLetterValue = 0b111111; +export { alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue }; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-es/fromBase64.browser.js b/server/node_modules/@aws-sdk/util-base64/dist-es/fromBase64.browser.js new file mode 100644 index 0000000000..c2c6a66db7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-es/fromBase64.browser.js @@ -0,0 +1,36 @@ +import { alphabetByEncoding, bitsPerByte, bitsPerLetter } from "./constants.browser"; +export const fromBase64 = (input) => { + let totalByteLength = (input.length / 4) * 3; + if (input.slice(-2) === "==") { + totalByteLength -= 2; + } + else if (input.slice(-1) === "=") { + totalByteLength--; + } + const out = new ArrayBuffer(totalByteLength); + const dataView = new DataView(out); + for (let i = 0; i < input.length; i += 4) { + let bits = 0; + let bitLength = 0; + for (let j = i, limit = i + 3; j <= limit; j++) { + if (input[j] !== "=") { + if (!(input[j] in alphabetByEncoding)) { + throw new TypeError(`Invalid character ${input[j]} in base64 string.`); + } + bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter); + bitLength += bitsPerLetter; + } + else { + bits >>= bitsPerLetter; + } + } + const chunkOffset = (i / 4) * 3; + bits >>= bitLength % bitsPerByte; + const byteLength = Math.floor(bitLength / bitsPerByte); + for (let k = 0; k < byteLength; k++) { + const offset = (byteLength - k - 1) * bitsPerByte; + dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset); + } + } + return new Uint8Array(out); +}; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-es/fromBase64.js b/server/node_modules/@aws-sdk/util-base64/dist-es/fromBase64.js new file mode 100644 index 0000000000..8d1c036f08 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-es/fromBase64.js @@ -0,0 +1,12 @@ +import { fromString } from "@aws-sdk/util-buffer-from"; +const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; +export const fromBase64 = (input) => { + if ((input.length * 3) % 4 !== 0) { + throw new TypeError(`Incorrect padding on base64 string.`); + } + if (!BASE64_REGEX.exec(input)) { + throw new TypeError(`Invalid base64 string.`); + } + const buffer = fromString(input, "base64"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); +}; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-es/index.js b/server/node_modules/@aws-sdk/util-base64/dist-es/index.js new file mode 100644 index 0000000000..594bd43506 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-es/index.js @@ -0,0 +1,2 @@ +export * from "./fromBase64"; +export * from "./toBase64"; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-es/toBase64.browser.js b/server/node_modules/@aws-sdk/util-base64/dist-es/toBase64.browser.js new file mode 100644 index 0000000000..e7320eded1 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-es/toBase64.browser.js @@ -0,0 +1,20 @@ +import { alphabetByValue, bitsPerByte, bitsPerLetter, maxLetterValue } from "./constants.browser"; +export function toBase64(input) { + let str = ""; + for (let i = 0; i < input.length; i += 3) { + let bits = 0; + let bitLength = 0; + for (let j = i, limit = Math.min(i + 3, input.length); j < limit; j++) { + bits |= input[j] << ((limit - j - 1) * bitsPerByte); + bitLength += bitsPerByte; + } + const bitClusterCount = Math.ceil(bitLength / bitsPerLetter); + bits <<= bitClusterCount * bitsPerLetter - bitLength; + for (let k = 1; k <= bitClusterCount; k++) { + const offset = (bitClusterCount - k) * bitsPerLetter; + str += alphabetByValue[(bits & (maxLetterValue << offset)) >> offset]; + } + str += "==".slice(0, 4 - bitClusterCount); + } + return str; +} diff --git a/server/node_modules/@aws-sdk/util-base64/dist-es/toBase64.js b/server/node_modules/@aws-sdk/util-base64/dist-es/toBase64.js new file mode 100644 index 0000000000..90b19b5d9a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-es/toBase64.js @@ -0,0 +1,2 @@ +import { fromArrayBuffer } from "@aws-sdk/util-buffer-from"; +export const toBase64 = (input) => fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64"); diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/constants.browser.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/constants.browser.d.ts new file mode 100644 index 0000000000..eb750ea182 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/constants.browser.d.ts @@ -0,0 +1,6 @@ +declare const alphabetByEncoding: Record; +declare const alphabetByValue: Array; +declare const bitsPerLetter = 6; +declare const bitsPerByte = 8; +declare const maxLetterValue = 63; +export { alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue }; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/fromBase64.browser.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/fromBase64.browser.d.ts new file mode 100644 index 0000000000..6a640f1404 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/fromBase64.browser.d.ts @@ -0,0 +1,8 @@ +/** + * Converts a base-64 encoded string to a Uint8Array of bytes. + * + * @param input The base-64 encoded string + * + * @see https://tools.ietf.org/html/rfc4648#section-4 + */ +export declare const fromBase64: (input: string) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/fromBase64.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/fromBase64.d.ts new file mode 100644 index 0000000000..1878a8914f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/fromBase64.d.ts @@ -0,0 +1,7 @@ +/** + * Converts a base-64 encoded string to a Uint8Array of bytes using Node.JS's + * `buffer` module. + * + * @param input The base-64 encoded string + */ +export declare const fromBase64: (input: string) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/index.d.ts new file mode 100644 index 0000000000..594bd43506 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/index.d.ts @@ -0,0 +1,2 @@ +export * from "./fromBase64"; +export * from "./toBase64"; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/toBase64.browser.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/toBase64.browser.d.ts new file mode 100644 index 0000000000..221822ccd7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/toBase64.browser.d.ts @@ -0,0 +1,8 @@ +/** + * Converts a Uint8Array of binary data to a base-64 encoded string. + * + * @param input The binary data to encode + * + * @see https://tools.ietf.org/html/rfc4648#section-4 + */ +export declare function toBase64(input: Uint8Array): string; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/toBase64.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/toBase64.d.ts new file mode 100644 index 0000000000..363f063727 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/toBase64.d.ts @@ -0,0 +1,7 @@ +/** + * Converts a Uint8Array of binary data to a base-64 encoded string using + * Node.JS's `buffer` module. + * + * @param input The binary data to encode + */ +export declare const toBase64: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/constants.browser.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/constants.browser.d.ts new file mode 100644 index 0000000000..28b0d10fe7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/constants.browser.d.ts @@ -0,0 +1,12 @@ +declare const alphabetByEncoding: Record; +declare const alphabetByValue: Array; +declare const bitsPerLetter = 6; +declare const bitsPerByte = 8; +declare const maxLetterValue = 63; +export { + alphabetByEncoding, + alphabetByValue, + bitsPerLetter, + bitsPerByte, + maxLetterValue, +}; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/fromBase64.browser.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/fromBase64.browser.d.ts new file mode 100644 index 0000000000..2b3a801e70 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/fromBase64.browser.d.ts @@ -0,0 +1 @@ +export declare const fromBase64: (input: string) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/fromBase64.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/fromBase64.d.ts new file mode 100644 index 0000000000..2b3a801e70 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/fromBase64.d.ts @@ -0,0 +1 @@ +export declare const fromBase64: (input: string) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..594bd43506 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export * from "./fromBase64"; +export * from "./toBase64"; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/toBase64.browser.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/toBase64.browser.d.ts new file mode 100644 index 0000000000..5f9303292a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/toBase64.browser.d.ts @@ -0,0 +1 @@ +export declare function toBase64(input: Uint8Array): string; diff --git a/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/toBase64.d.ts b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/toBase64.d.ts new file mode 100644 index 0000000000..3d442e7cf3 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/dist-types/ts3.4/toBase64.d.ts @@ -0,0 +1 @@ +export declare const toBase64: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-base64/package.json b/server/node_modules/@aws-sdk/util-base64/package.json new file mode 100644 index 0000000000..865cef2f46 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-base64/package.json @@ -0,0 +1,63 @@ +{ + "name": "@aws-sdk/util-base64", + "version": "3.208.0", + "description": "A Base64 <-> UInt8Array converter", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "browser": { + "./dist-es/fromBase64": "./dist-es/fromBase64.browser", + "./dist-es/toBase64": "./dist-es/toBase64.browser" + }, + "react-native": { + "./dist-es/fromBase64": "./dist-es/fromBase64.browser", + "./dist-es/toBase64": "./dist-es/toBase64.browser" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-base64", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-base64" + } +} diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/CHANGELOG.md b/server/node_modules/@aws-sdk/util-body-length-browser/CHANGELOG.md new file mode 100644 index 0000000000..d7c90535a4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/CHANGELOG.md @@ -0,0 +1,681 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.170.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.169.0...v3.170.0) (2022-09-13) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.168.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.167.0...v3.168.0) (2022-09-09) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.154.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.153.0...v3.154.0) (2022-08-19) + + +### Bug Fixes + +* **util-body-length-browser:** handle trail surrogate character ([#3866](https://github.com/aws/aws-sdk-js-v3/issues/3866)) ([62657b1](https://github.com/aws/aws-sdk-js-v3/commit/62657b13af635928bf2c5ee8f449be711a379dd9)) + + + + + +# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.54.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.53.1...v3.54.0) (2022-03-11) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.52.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.51.0...v3.52.0) (2022-02-18) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.49.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.48.0...v3.49.0) (2022-01-29) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +## [3.47.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.47.0-release-test-1...v3.47.1) (2022-01-20) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.47.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.46.0...v3.47.0) (2022-01-15) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.46.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.45.0...v3.46.0) (2022-01-07) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.37.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.36.1...v3.37.0) (2021-10-15) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.36.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.35.0...v3.36.0) (2021-10-08) + + +### Features + +* publish files in dist-* only ([#2873](https://github.com/aws/aws-sdk-js-v3/issues/2873)) ([53b4243](https://github.com/aws/aws-sdk-js-v3/commit/53b4243b066f25ff2412d5f0dea1036054b2df32)) + + + + + +# [3.35.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.34.0...v3.35.0) (2021-10-04) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.34.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.33.0...v3.34.0) (2021-09-24) + + +### Features + +* **non-clients:** remove comments from transpiled JS files ([#2813](https://github.com/aws/aws-sdk-js-v3/issues/2813)) ([e6fc7f3](https://github.com/aws/aws-sdk-js-v3/commit/e6fc7f3e0fa74785590ac19e7ed143c916bb9b6e)) + + + + + +# [3.32.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.31.0...v3.32.0) (2021-09-17) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.29.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.28.0...v3.29.0) (2021-09-02) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.23.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.22.0...v3.23.0) (2021-07-23) + + +### Bug Fixes + +* bump up tslib to 2.3.0 ([#2601](https://github.com/aws/aws-sdk-js-v3/issues/2601)) ([7040faa](https://github.com/aws/aws-sdk-js-v3/commit/7040faac07976c1dcfd5240675b82a2f275b2a55)) + + + + + +# [3.22.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.21.0...v3.22.0) (2021-07-16) + + +### Bug Fixes + +* **clients:** prefix `dist/` for typesVersions TS<4 ([#2580](https://github.com/aws/aws-sdk-js-v3/issues/2580)) ([dff5cd4](https://github.com/aws/aws-sdk-js-v3/commit/dff5cd4b6fa00453e938ce8f238c1542ee7ba3d6)) + + + + + +# [3.20.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.19.0...v3.20.0) (2021-07-02) + + +### Bug Fixes + +* replace prepublishOnly script with downlevel-dts ([#2537](https://github.com/aws/aws-sdk-js-v3/issues/2537)) ([63818a1](https://github.com/aws/aws-sdk-js-v3/commit/63818a1e47b08af56f092031a01bbbff0a9af590)) + + + + + +# [3.18.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.17.0...v3.18.0) (2021-06-04) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +## [3.13.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.13.0...v3.13.1) (2021-04-22) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.12.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.11.0...v3.12.0) (2021-04-09) + + +### Bug Fixes + +* run downlevel-dts in prepublishOnly ([#2218](https://github.com/aws/aws-sdk-js-v3/issues/2218)) ([0745502](https://github.com/aws/aws-sdk-js-v3/commit/0745502dcf819460ee1d81362470859674c757a7)) + + + + + +# [3.10.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.9.0...v3.10.0) (2021-03-26) + + +### Features + +* use ts-jest for running jest tests ([#2088](https://github.com/aws/aws-sdk-js-v3/issues/2088)) ([456002c](https://github.com/aws/aws-sdk-js-v3/commit/456002cf7fa16864b72c3c279b094886a42abddb)) + + + + + +## [3.6.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.6.0...v3.6.1) (2021-02-22) + + +### Bug Fixes + +* update references of default branch from master to main ([#2057](https://github.com/aws/aws-sdk-js-v3/issues/2057)) ([59b8b58](https://github.com/aws/aws-sdk-js-v3/commit/59b8b58c3a8c057b36abfaa59bae3a6ffb068cf1)) + + + + + +## [3.4.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.4.0...v3.4.1) (2021-01-29) + + +### Bug Fixes + +* **clients:** use TS 3.4 compatible types for TS 3.9 ([#1978](https://github.com/aws/aws-sdk-js-v3/issues/1978)) ([8bced5c](https://github.com/aws/aws-sdk-js-v3/commit/8bced5c32b9dbc68f1065054d796cb0b8b87bcc4)) + + + + + +# [3.4.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.3.0...v3.4.0) (2021-01-28) + + +### Features + +* use downlevel-dts to generate TS 3.4 compatible types ([#1943](https://github.com/aws/aws-sdk-js-v3/issues/1943)) ([63ad215](https://github.com/aws/aws-sdk-js-v3/commit/63ad2151c8bb7be32ea8838a9b0974806ed3906b)) + + + + + +# [3.1.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.0.0...v3.1.0) (2020-12-23) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [3.0.0](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.10...v3.0.0) (2020-12-15) + + +### Features + +* bump version to 3.0.0 ([#1793](https://github.com/aws/aws-sdk-js-v3/issues/1793)) ([d8475f8](https://github.com/aws/aws-sdk-js-v3/commit/d8475f8d972d28fbc15cd7e23abfe18f9eab0644)) + + + + + +# [1.0.0-rc.8](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.7...v1.0.0-rc.8) (2020-12-05) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [1.0.0-rc.3](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2020-10-27) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [1.0.0-rc.2](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.1...v1.0.0-rc.2) (2020-10-22) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [1.0.0-rc.1](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-gamma.11...v1.0.0-rc.1) (2020-10-19) + + +### Features + +* ready for release candidate ([#1578](https://github.com/aws/aws-sdk-js-v3/issues/1578)) ([519f66c](https://github.com/aws/aws-sdk-js-v3/commit/519f66c6388b91d0bd750a511e6d1af56196835e)) + + + + + +# [1.0.0-gamma.7](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@1.0.0-gamma.6...@aws-sdk/util-body-length-browser@1.0.0-gamma.7) (2020-10-07) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [1.0.0-gamma.6](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@1.0.0-gamma.5...@aws-sdk/util-body-length-browser@1.0.0-gamma.6) (2020-08-25) + +**Note:** Version bump only for package @aws-sdk/util-body-length-browser + + + + + +# [1.0.0-gamma.5](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@1.0.0-gamma.4...@aws-sdk/util-body-length-browser@1.0.0-gamma.5) (2020-08-04) + + +### Features + +* build command ([#1407](https://github.com/aws/aws-sdk-js-v3/issues/1407)) ([81b2e87](https://github.com/aws/aws-sdk-js-v3/commit/81b2e87067642a8cea8649cbdb2c342ca9fb6ac6)) + + + + + +# [1.0.0-gamma.4](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@1.0.0-gamma.3...@aws-sdk/util-body-length-browser@1.0.0-gamma.4) (2020-07-21) + + +### Bug Fixes + +* remove `Blob` usage ([#1384](https://github.com/aws/aws-sdk-js-v3/issues/1384)) ([bcb5503](https://github.com/aws/aws-sdk-js-v3/commit/bcb5503c85b8d95c6ae47b553dab01d20851dbf8)) + + + + + +# [1.0.0-gamma.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@1.0.0-gamma.2...@aws-sdk/util-body-length-browser@1.0.0-gamma.3) (2020-07-13) + + +### Features + +* add code linting and prettify ([#1350](https://github.com/aws/aws-sdk-js-v3/issues/1350)) ([47770fa](https://github.com/aws/aws-sdk-js-v3/commit/47770fa493c3405f193069cd18319882529ff484)) + + + + + +# [1.0.0-gamma.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@0.1.0-preview.1...@aws-sdk/util-body-length-browser@1.0.0-gamma.2) (2020-07-08) + + +### Features + +* use a common tsconfig for the monorepo ([#1297](https://github.com/aws/aws-sdk-js-v3/issues/1297)) ([16aea66](https://github.com/aws/aws-sdk-js-v3/commit/16aea66d1fc5386680d3e6da9b7dcde78e178bd3)) + + + +# 1.0.0-gamma.1 (2020-05-21) + + +### Bug Fixes + +* **util-body-length-browser:** multi-byte body lengths for browser ([#1101](https://github.com/aws/aws-sdk-js-v3/issues/1101)) ([65a3658](https://github.com/aws/aws-sdk-js-v3/commit/65a36581db0279a6044fd815201f91bcab4dcf90)) + + +### Features + +* bump up to gamma version ([#1192](https://github.com/aws/aws-sdk-js-v3/issues/1192)) ([a609075](https://github.com/aws/aws-sdk-js-v3/commit/a6090754f2a6c21e5b70bf0c8782cc0fbe59ee12)) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-gamma.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@0.1.0-preview.1...@aws-sdk/util-body-length-browser@1.0.0-gamma.1) (2020-05-21) + + +### Bug Fixes + +* **util-body-length-browser:** multi-byte body lengths for browser ([#1101](https://github.com/aws/aws-sdk-js-v3/issues/1101)) ([65a3658](https://github.com/aws/aws-sdk-js-v3/commit/65a36581db0279a6044fd815201f91bcab4dcf90)) + + +### Features + +* bump up to gamma version ([#1192](https://github.com/aws/aws-sdk-js-v3/issues/1192)) ([a609075](https://github.com/aws/aws-sdk-js-v3/commit/a6090754f2a6c21e5b70bf0c8782cc0fbe59ee12)) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@0.1.0-preview.1...@aws-sdk/util-body-length-browser@1.0.0-beta.2) (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@0.1.0-preview.1...@aws-sdk/util-body-length-browser@1.0.0-beta.1) (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-alpha.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@0.1.0-preview.1...@aws-sdk/util-body-length-browser@1.0.0-alpha.3) (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-alpha.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@0.1.0-preview.1...@aws-sdk/util-body-length-browser@1.0.0-alpha.2) (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [1.0.0-alpha.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@0.1.0-preview.1...@aws-sdk/util-body-length-browser@1.0.0-alpha.1) (2020-01-08) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [0.1.0-preview.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@0.1.0-preview.1...@aws-sdk/util-body-length-browser@0.1.0-preview.3) (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [0.1.0-preview.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-body-length-browser@0.1.0-preview.1...@aws-sdk/util-body-length-browser@0.1.0-preview.2) (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/LICENSE b/server/node_modules/@aws-sdk/util-body-length-browser/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/README.md b/server/node_modules/@aws-sdk/util-body-length-browser/README.md new file mode 100644 index 0000000000..e8769a05b7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/README.md @@ -0,0 +1,12 @@ +# @aws-sdk/util-body-length-browser + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-body-length-browser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-body-length-browser) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-body-length-browser.svg)](https://www.npmjs.com/package/@aws-sdk/util-body-length-browser) + +Determines the length of a request body in browsers + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/dist-cjs/calculateBodyLength.js b/server/node_modules/@aws-sdk/util-body-length-browser/dist-cjs/calculateBodyLength.js new file mode 100644 index 0000000000..8e956f672e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/dist-cjs/calculateBodyLength.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateBodyLength = void 0; +const calculateBodyLength = (body) => { + if (typeof body === "string") { + let len = body.length; + for (let i = len - 1; i >= 0; i--) { + const code = body.charCodeAt(i); + if (code > 0x7f && code <= 0x7ff) + len++; + else if (code > 0x7ff && code <= 0xffff) + len += 2; + if (code >= 0xdc00 && code <= 0xdfff) + i--; + } + return len; + } + else if (typeof body.byteLength === "number") { + return body.byteLength; + } + else if (typeof body.size === "number") { + return body.size; + } + throw new Error(`Body Length computation failed for ${body}`); +}; +exports.calculateBodyLength = calculateBodyLength; diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-body-length-browser/dist-cjs/index.js new file mode 100644 index 0000000000..01a35e38b2 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./calculateBodyLength"), exports); diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/dist-es/calculateBodyLength.js b/server/node_modules/@aws-sdk/util-body-length-browser/dist-es/calculateBodyLength.js new file mode 100644 index 0000000000..6c9072b989 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/dist-es/calculateBodyLength.js @@ -0,0 +1,22 @@ +export const calculateBodyLength = (body) => { + if (typeof body === "string") { + let len = body.length; + for (let i = len - 1; i >= 0; i--) { + const code = body.charCodeAt(i); + if (code > 0x7f && code <= 0x7ff) + len++; + else if (code > 0x7ff && code <= 0xffff) + len += 2; + if (code >= 0xdc00 && code <= 0xdfff) + i--; + } + return len; + } + else if (typeof body.byteLength === "number") { + return body.byteLength; + } + else if (typeof body.size === "number") { + return body.size; + } + throw new Error(`Body Length computation failed for ${body}`); +}; diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/dist-es/index.js b/server/node_modules/@aws-sdk/util-body-length-browser/dist-es/index.js new file mode 100644 index 0000000000..16ba478e27 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/dist-es/index.js @@ -0,0 +1 @@ +export * from "./calculateBodyLength"; diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/calculateBodyLength.d.ts b/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/calculateBodyLength.d.ts new file mode 100644 index 0000000000..fbef65f36b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/calculateBodyLength.d.ts @@ -0,0 +1 @@ +export declare const calculateBodyLength: (body: any) => number | undefined; diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/index.d.ts new file mode 100644 index 0000000000..16ba478e27 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./calculateBodyLength"; diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/ts3.4/calculateBodyLength.d.ts b/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/ts3.4/calculateBodyLength.d.ts new file mode 100644 index 0000000000..fbef65f36b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/ts3.4/calculateBodyLength.d.ts @@ -0,0 +1 @@ +export declare const calculateBodyLength: (body: any) => number | undefined; diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..16ba478e27 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./calculateBodyLength"; diff --git a/server/node_modules/@aws-sdk/util-body-length-browser/package.json b/server/node_modules/@aws-sdk/util-body-length-browser/package.json new file mode 100644 index 0000000000..812b0b3246 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-browser/package.json @@ -0,0 +1,50 @@ +{ + "name": "@aws-sdk/util-body-length-browser", + "description": "Determines the length of a request body in browsers", + "version": "3.188.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.3.1" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-body-length-browser", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-body-length-browser" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/util-body-length-node/LICENSE b/server/node_modules/@aws-sdk/util-body-length-node/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-body-length-node/README.md b/server/node_modules/@aws-sdk/util-body-length-node/README.md new file mode 100644 index 0000000000..79a6d37933 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/README.md @@ -0,0 +1,12 @@ +# @aws-sdk/util-body-length-node + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-body-length-node/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-body-length-node) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-body-length-node.svg)](https://www.npmjs.com/package/@aws-sdk/util-body-length-node) + +Determines the length of a request body in node.js + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-body-length-node/dist-cjs/calculateBodyLength.js b/server/node_modules/@aws-sdk/util-body-length-node/dist-cjs/calculateBodyLength.js new file mode 100644 index 0000000000..a43cea1c86 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/dist-cjs/calculateBodyLength.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateBodyLength = void 0; +const fs_1 = require("fs"); +const calculateBodyLength = (body) => { + if (!body) { + return 0; + } + if (typeof body === "string") { + return Buffer.from(body).length; + } + else if (typeof body.byteLength === "number") { + return body.byteLength; + } + else if (typeof body.size === "number") { + return body.size; + } + else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { + return (0, fs_1.lstatSync)(body.path).size; + } + else if (typeof body.fd === "number") { + return (0, fs_1.fstatSync)(body.fd).size; + } + throw new Error(`Body Length computation failed for ${body}`); +}; +exports.calculateBodyLength = calculateBodyLength; diff --git a/server/node_modules/@aws-sdk/util-body-length-node/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-body-length-node/dist-cjs/index.js new file mode 100644 index 0000000000..01a35e38b2 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./calculateBodyLength"), exports); diff --git a/server/node_modules/@aws-sdk/util-body-length-node/dist-es/calculateBodyLength.js b/server/node_modules/@aws-sdk/util-body-length-node/dist-es/calculateBodyLength.js new file mode 100644 index 0000000000..ff30a2fb34 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/dist-es/calculateBodyLength.js @@ -0,0 +1,22 @@ +import { fstatSync, lstatSync } from "fs"; +export const calculateBodyLength = (body) => { + if (!body) { + return 0; + } + if (typeof body === "string") { + return Buffer.from(body).length; + } + else if (typeof body.byteLength === "number") { + return body.byteLength; + } + else if (typeof body.size === "number") { + return body.size; + } + else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { + return lstatSync(body.path).size; + } + else if (typeof body.fd === "number") { + return fstatSync(body.fd).size; + } + throw new Error(`Body Length computation failed for ${body}`); +}; diff --git a/server/node_modules/@aws-sdk/util-body-length-node/dist-es/index.js b/server/node_modules/@aws-sdk/util-body-length-node/dist-es/index.js new file mode 100644 index 0000000000..16ba478e27 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/dist-es/index.js @@ -0,0 +1 @@ +export * from "./calculateBodyLength"; diff --git a/server/node_modules/@aws-sdk/util-body-length-node/dist-types/calculateBodyLength.d.ts b/server/node_modules/@aws-sdk/util-body-length-node/dist-types/calculateBodyLength.d.ts new file mode 100644 index 0000000000..fbef65f36b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/dist-types/calculateBodyLength.d.ts @@ -0,0 +1 @@ +export declare const calculateBodyLength: (body: any) => number | undefined; diff --git a/server/node_modules/@aws-sdk/util-body-length-node/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-body-length-node/dist-types/index.d.ts new file mode 100644 index 0000000000..16ba478e27 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./calculateBodyLength"; diff --git a/server/node_modules/@aws-sdk/util-body-length-node/dist-types/ts3.4/calculateBodyLength.d.ts b/server/node_modules/@aws-sdk/util-body-length-node/dist-types/ts3.4/calculateBodyLength.d.ts new file mode 100644 index 0000000000..fbef65f36b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/dist-types/ts3.4/calculateBodyLength.d.ts @@ -0,0 +1 @@ +export declare const calculateBodyLength: (body: any) => number | undefined; diff --git a/server/node_modules/@aws-sdk/util-body-length-node/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-body-length-node/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..16ba478e27 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./calculateBodyLength"; diff --git a/server/node_modules/@aws-sdk/util-body-length-node/package.json b/server/node_modules/@aws-sdk/util-body-length-node/package.json new file mode 100644 index 0000000000..6dfb528954 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-body-length-node/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/util-body-length-node", + "description": "Determines the length of a request body in node.js", + "version": "3.208.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-body-length-node", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-body-length-node" + } +} diff --git a/server/node_modules/@aws-sdk/util-buffer-from/LICENSE b/server/node_modules/@aws-sdk/util-buffer-from/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-buffer-from/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-buffer-from/README.md b/server/node_modules/@aws-sdk/util-buffer-from/README.md new file mode 100644 index 0000000000..bded4c3fed --- /dev/null +++ b/server/node_modules/@aws-sdk/util-buffer-from/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/util-buffer-from + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-buffer-from/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-buffer-from) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-buffer-from.svg)](https://www.npmjs.com/package/@aws-sdk/util-buffer-from) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-buffer-from/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-buffer-from/dist-cjs/index.js new file mode 100644 index 0000000000..f9621ed491 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-buffer-from/dist-cjs/index.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromString = exports.fromArrayBuffer = void 0; +const is_array_buffer_1 = require("@aws-sdk/is-array-buffer"); +const buffer_1 = require("buffer"); +const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { + if (!(0, is_array_buffer_1.isArrayBuffer)(input)) { + throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); + } + return buffer_1.Buffer.from(input, offset, length); +}; +exports.fromArrayBuffer = fromArrayBuffer; +const fromString = (input, encoding) => { + if (typeof input !== "string") { + throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); + } + return encoding ? buffer_1.Buffer.from(input, encoding) : buffer_1.Buffer.from(input); +}; +exports.fromString = fromString; diff --git a/server/node_modules/@aws-sdk/util-buffer-from/dist-es/index.js b/server/node_modules/@aws-sdk/util-buffer-from/dist-es/index.js new file mode 100644 index 0000000000..a793a1eac7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-buffer-from/dist-es/index.js @@ -0,0 +1,14 @@ +import { isArrayBuffer } from "@aws-sdk/is-array-buffer"; +import { Buffer } from "buffer"; +export const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { + if (!isArrayBuffer(input)) { + throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); + } + return Buffer.from(input, offset, length); +}; +export const fromString = (input, encoding) => { + if (typeof input !== "string") { + throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); + } + return encoding ? Buffer.from(input, encoding) : Buffer.from(input); +}; diff --git a/server/node_modules/@aws-sdk/util-buffer-from/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-buffer-from/dist-types/index.d.ts new file mode 100644 index 0000000000..ad3116191e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-buffer-from/dist-types/index.d.ts @@ -0,0 +1,4 @@ +import { Buffer } from "buffer"; +export declare const fromArrayBuffer: (input: ArrayBuffer, offset?: number, length?: number) => Buffer; +export declare type StringEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex"; +export declare const fromString: (input: string, encoding?: StringEncoding | undefined) => Buffer; diff --git a/server/node_modules/@aws-sdk/util-buffer-from/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-buffer-from/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..058a0928e5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-buffer-from/dist-types/ts3.4/index.d.ts @@ -0,0 +1,19 @@ +import { Buffer } from "buffer"; +export declare const fromArrayBuffer: ( + input: ArrayBuffer, + offset?: number, + length?: number +) => Buffer; +export declare type StringEncoding = + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "base64" + | "latin1" + | "binary" + | "hex"; +export declare const fromString: ( + input: string, + encoding?: StringEncoding | undefined +) => Buffer; diff --git a/server/node_modules/@aws-sdk/util-buffer-from/package.json b/server/node_modules/@aws-sdk/util-buffer-from/package.json new file mode 100644 index 0000000000..665aa8c6fc --- /dev/null +++ b/server/node_modules/@aws-sdk/util-buffer-from/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/util-buffer-from", + "version": "3.208.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/is-array-buffer": "3.201.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-buffer-from", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-buffer-from" + } +} diff --git a/server/node_modules/@aws-sdk/util-config-provider/LICENSE b/server/node_modules/@aws-sdk/util-config-provider/LICENSE new file mode 100644 index 0000000000..74d4e5c31f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-config-provider/README.md b/server/node_modules/@aws-sdk/util-config-provider/README.md new file mode 100644 index 0000000000..6e25d37173 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/util-config-provider + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-config-provider/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-config-provider) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-config-provider.svg)](https://www.npmjs.com/package/@aws-sdk/util-config-provider) diff --git a/server/node_modules/@aws-sdk/util-config-provider/dist-cjs/booleanSelector.js b/server/node_modules/@aws-sdk/util-config-provider/dist-cjs/booleanSelector.js new file mode 100644 index 0000000000..cfd8025b8b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/dist-cjs/booleanSelector.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.booleanSelector = exports.SelectorType = void 0; +var SelectorType; +(function (SelectorType) { + SelectorType["ENV"] = "env"; + SelectorType["CONFIG"] = "shared config entry"; +})(SelectorType = exports.SelectorType || (exports.SelectorType = {})); +const booleanSelector = (obj, key, type) => { + if (!(key in obj)) + return undefined; + if (obj[key] === "true") + return true; + if (obj[key] === "false") + return false; + throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); +}; +exports.booleanSelector = booleanSelector; diff --git a/server/node_modules/@aws-sdk/util-config-provider/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-config-provider/dist-cjs/index.js new file mode 100644 index 0000000000..69b30c54f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./booleanSelector"), exports); diff --git a/server/node_modules/@aws-sdk/util-config-provider/dist-es/booleanSelector.js b/server/node_modules/@aws-sdk/util-config-provider/dist-es/booleanSelector.js new file mode 100644 index 0000000000..940d5b374f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/dist-es/booleanSelector.js @@ -0,0 +1,14 @@ +export var SelectorType; +(function (SelectorType) { + SelectorType["ENV"] = "env"; + SelectorType["CONFIG"] = "shared config entry"; +})(SelectorType || (SelectorType = {})); +export const booleanSelector = (obj, key, type) => { + if (!(key in obj)) + return undefined; + if (obj[key] === "true") + return true; + if (obj[key] === "false") + return false; + throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); +}; diff --git a/server/node_modules/@aws-sdk/util-config-provider/dist-es/index.js b/server/node_modules/@aws-sdk/util-config-provider/dist-es/index.js new file mode 100644 index 0000000000..838aa50561 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/dist-es/index.js @@ -0,0 +1 @@ +export * from "./booleanSelector"; diff --git a/server/node_modules/@aws-sdk/util-config-provider/dist-types/booleanSelector.d.ts b/server/node_modules/@aws-sdk/util-config-provider/dist-types/booleanSelector.d.ts new file mode 100644 index 0000000000..c9b7d5d3b1 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/dist-types/booleanSelector.d.ts @@ -0,0 +1,13 @@ +export declare enum SelectorType { + ENV = "env", + CONFIG = "shared config entry" +} +/** + * Returns boolean value true/false for string value "true"/"false", + * if the string is defined in obj[key] + * Returns undefined, if obj[key] is not defined. + * Throws error for all other cases. + * + * @internal + */ +export declare const booleanSelector: (obj: Record, key: string, type: SelectorType) => boolean | undefined; diff --git a/server/node_modules/@aws-sdk/util-config-provider/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-config-provider/dist-types/index.d.ts new file mode 100644 index 0000000000..838aa50561 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./booleanSelector"; diff --git a/server/node_modules/@aws-sdk/util-config-provider/dist-types/ts3.4/booleanSelector.d.ts b/server/node_modules/@aws-sdk/util-config-provider/dist-types/ts3.4/booleanSelector.d.ts new file mode 100644 index 0000000000..ec93ba51a2 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/dist-types/ts3.4/booleanSelector.d.ts @@ -0,0 +1,9 @@ +export declare enum SelectorType { + ENV = "env", + CONFIG = "shared config entry", +} +export declare const booleanSelector: ( + obj: Record, + key: string, + type: SelectorType +) => boolean | undefined; diff --git a/server/node_modules/@aws-sdk/util-config-provider/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-config-provider/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..838aa50561 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./booleanSelector"; diff --git a/server/node_modules/@aws-sdk/util-config-provider/package.json b/server/node_modules/@aws-sdk/util-config-provider/package.json new file mode 100644 index 0000000000..fbf987fdae --- /dev/null +++ b/server/node_modules/@aws-sdk/util-config-provider/package.json @@ -0,0 +1,55 @@ +{ + "name": "@aws-sdk/util-config-provider", + "version": "3.208.0", + "description": "Utilities package for configuration providers", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest --passWithNoTests" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "email": "", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "dependencies": { + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-config-provider", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-config-provider" + } +} diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/LICENSE b/server/node_modules/@aws-sdk/util-defaults-mode-browser/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/README.md b/server/node_modules/@aws-sdk/util-defaults-mode-browser/README.md new file mode 100644 index 0000000000..37004aacf0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/util-defaults-mode-browser + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-defaults-mode-browser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-defaults-mode-browser) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-defaults-mode-browser.svg)](https://www.npmjs.com/package/@aws-sdk/util-defaults-mode-browser) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/constants.js b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/constants.js new file mode 100644 index 0000000000..373350623f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULTS_MODE_OPTIONS = void 0; +exports.DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/index.js new file mode 100644 index 0000000000..fff2fcd3e3 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./resolveDefaultsModeConfig"), exports); diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js new file mode 100644 index 0000000000..127640a36a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveDefaultsModeConfig = void 0; +const tslib_1 = require("tslib"); +const property_provider_1 = require("@aws-sdk/property-provider"); +const bowser_1 = tslib_1.__importDefault(require("bowser")); +const constants_1 = require("./constants"); +const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => (0, property_provider_1.memoize)(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode === null || mode === void 0 ? void 0 : mode.toLowerCase()) { + case "auto": + return Promise.resolve(isMobileBrowser() ? "mobile" : "standard"); + case "mobile": + case "in-region": + case "cross-region": + case "standard": + case "legacy": + return Promise.resolve(mode === null || mode === void 0 ? void 0 : mode.toLocaleLowerCase()); + case undefined: + return Promise.resolve("legacy"); + default: + throw new Error(`Invalid parameter for "defaultsMode", expect ${constants_1.DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); + } +}); +exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; +const isMobileBrowser = () => { + var _a, _b; + const parsedUA = typeof window !== "undefined" && ((_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) + ? bowser_1.default.parse(window.navigator.userAgent) + : undefined; + const platform = (_b = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.platform) === null || _b === void 0 ? void 0 : _b.type; + return platform === "tablet" || platform === "mobile"; +}; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.native.js b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.native.js new file mode 100644 index 0000000000..8bf20d196e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.native.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveDefaultsModeConfig = void 0; +const property_provider_1 = require("@aws-sdk/property-provider"); +const constants_1 = require("./constants"); +const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => (0, property_provider_1.memoize)(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode === null || mode === void 0 ? void 0 : mode.toLowerCase()) { + case "auto": + return Promise.resolve("mobile"); + case "mobile": + case "in-region": + case "cross-region": + case "standard": + case "legacy": + return Promise.resolve(mode === null || mode === void 0 ? void 0 : mode.toLocaleLowerCase()); + case undefined: + return Promise.resolve("legacy"); + default: + throw new Error(`Invalid parameter for "defaultsMode", expect ${constants_1.DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); + } +}); +exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/constants.js b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/constants.js new file mode 100644 index 0000000000..d58e11f4fc --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/constants.js @@ -0,0 +1 @@ +export const DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/index.js b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/index.js new file mode 100644 index 0000000000..05aa8183ea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/index.js @@ -0,0 +1 @@ +export * from "./resolveDefaultsModeConfig"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js new file mode 100644 index 0000000000..4170f82349 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js @@ -0,0 +1,27 @@ +import { memoize } from "@aws-sdk/property-provider"; +import bowser from "bowser"; +import { DEFAULTS_MODE_OPTIONS } from "./constants"; +export const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => memoize(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode?.toLowerCase()) { + case "auto": + return Promise.resolve(isMobileBrowser() ? "mobile" : "standard"); + case "mobile": + case "in-region": + case "cross-region": + case "standard": + case "legacy": + return Promise.resolve(mode?.toLocaleLowerCase()); + case undefined: + return Promise.resolve("legacy"); + default: + throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); + } +}); +const isMobileBrowser = () => { + const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent + ? bowser.parse(window.navigator.userAgent) + : undefined; + const platform = parsedUA?.platform?.type; + return platform === "tablet" || platform === "mobile"; +}; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.native.js b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.native.js new file mode 100644 index 0000000000..62fb6c1c93 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.native.js @@ -0,0 +1,19 @@ +import { memoize } from "@aws-sdk/property-provider"; +import { DEFAULTS_MODE_OPTIONS } from "./constants"; +export const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => memoize(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode?.toLowerCase()) { + case "auto": + return Promise.resolve("mobile"); + case "mobile": + case "in-region": + case "cross-region": + case "standard": + case "legacy": + return Promise.resolve(mode?.toLocaleLowerCase()); + case undefined: + return Promise.resolve("legacy"); + default: + throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); + } +}); diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/constants.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/constants.d.ts new file mode 100644 index 0000000000..93b40f8c8d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/constants.d.ts @@ -0,0 +1,9 @@ +import type { DefaultsMode } from "@aws-sdk/smithy-client"; +import type { Provider } from "@aws-sdk/types"; +export declare const DEFAULTS_MODE_OPTIONS: string[]; +/** + * @internal + */ +export interface ResolveDefaultsModeConfigOptions { + defaultsMode?: DefaultsMode | Provider; +} diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/index.d.ts new file mode 100644 index 0000000000..05aa8183ea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./resolveDefaultsModeConfig"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/resolveDefaultsModeConfig.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/resolveDefaultsModeConfig.d.ts new file mode 100644 index 0000000000..1288221aa6 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/resolveDefaultsModeConfig.d.ts @@ -0,0 +1,17 @@ +import type { DefaultsMode, ResolvedDefaultsMode } from "@aws-sdk/smithy-client"; +import type { Provider } from "@aws-sdk/types"; +/** + * @internal + */ +export interface ResolveDefaultsModeConfigOptions { + defaultsMode?: DefaultsMode | Provider; +} +/** + * Validate the defaultsMode configuration. If the value is set to "auto", it + * resolves the value to "mobile" if the app is running in a mobile browser, + * otherwise it resolves to "standard". + * + * @default "legacy" + * @internal + */ +export declare const resolveDefaultsModeConfig: ({ defaultsMode, }?: ResolveDefaultsModeConfigOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/resolveDefaultsModeConfig.native.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/resolveDefaultsModeConfig.native.d.ts new file mode 100644 index 0000000000..10829fd0bd --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/resolveDefaultsModeConfig.native.d.ts @@ -0,0 +1,16 @@ +import type { DefaultsMode, ResolvedDefaultsMode } from "@aws-sdk/smithy-client"; +import type { Provider } from "@aws-sdk/types"; +/** + * @internal + */ +export interface ResolveDefaultsModeConfigOptions { + defaultsMode?: DefaultsMode | Provider; +} +/** + * Validate the defaultsMode configuration. If the value is set to "auto", it + * resolves the value to "mobile". + * + * @default "legacy" + * @internal + */ +export declare const resolveDefaultsModeConfig: ({ defaultsMode, }?: ResolveDefaultsModeConfigOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/constants.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/constants.d.ts new file mode 100644 index 0000000000..eb4a67bee6 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/constants.d.ts @@ -0,0 +1,6 @@ +import { DefaultsMode } from "@aws-sdk/smithy-client"; +import { Provider } from "@aws-sdk/types"; +export declare const DEFAULTS_MODE_OPTIONS: string[]; +export interface ResolveDefaultsModeConfigOptions { + defaultsMode?: DefaultsMode | Provider; +} diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..05aa8183ea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./resolveDefaultsModeConfig"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/resolveDefaultsModeConfig.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/resolveDefaultsModeConfig.d.ts new file mode 100644 index 0000000000..253d304b5a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/resolveDefaultsModeConfig.d.ts @@ -0,0 +1,8 @@ +import { DefaultsMode, ResolvedDefaultsMode } from "@aws-sdk/smithy-client"; +import { Provider } from "@aws-sdk/types"; +export interface ResolveDefaultsModeConfigOptions { + defaultsMode?: DefaultsMode | Provider; +} +export declare const resolveDefaultsModeConfig: ({ + defaultsMode, +}?: ResolveDefaultsModeConfigOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/resolveDefaultsModeConfig.native.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/resolveDefaultsModeConfig.native.d.ts new file mode 100644 index 0000000000..253d304b5a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/dist-types/ts3.4/resolveDefaultsModeConfig.native.d.ts @@ -0,0 +1,8 @@ +import { DefaultsMode, ResolvedDefaultsMode } from "@aws-sdk/smithy-client"; +import { Provider } from "@aws-sdk/types"; +export interface ResolveDefaultsModeConfigOptions { + defaultsMode?: DefaultsMode | Provider; +} +export declare const resolveDefaultsModeConfig: ({ + defaultsMode, +}?: ResolveDefaultsModeConfigOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-browser/package.json b/server/node_modules/@aws-sdk/util-defaults-mode-browser/package.json new file mode 100644 index 0000000000..9eb1d0d589 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-browser/package.json @@ -0,0 +1,59 @@ +{ + "name": "@aws-sdk/util-defaults-mode-browser", + "version": "3.261.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/smithy-client": "3.261.0", + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">= 10.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "react-native": { + "./dist-es/resolveDefaultsModeConfig": "./dist-es/resolveDefaultsModeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-defaults-mode-node", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-defaults-mode-node" + } +} diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/LICENSE b/server/node_modules/@aws-sdk/util-defaults-mode-node/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/README.md b/server/node_modules/@aws-sdk/util-defaults-mode-node/README.md new file mode 100644 index 0000000000..2ec4075fb8 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/util-defaults-mode-node + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-defaults-mode-node/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-defaults-mode-node) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-defaults-mode-node.svg)](https://www.npmjs.com/package/@aws-sdk/util-defaults-mode-node) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/constants.js b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/constants.js new file mode 100644 index 0000000000..43e206224c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/constants.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IMDS_REGION_PATH = exports.DEFAULTS_MODE_OPTIONS = exports.ENV_IMDS_DISABLED = exports.AWS_DEFAULT_REGION_ENV = exports.AWS_REGION_ENV = exports.AWS_EXECUTION_ENV = void 0; +exports.AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; +exports.AWS_REGION_ENV = "AWS_REGION"; +exports.AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; +exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +exports.DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; +exports.IMDS_REGION_PATH = "/latest/meta-data/placement/region"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/defaultsModeConfig.js b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/defaultsModeConfig.js new file mode 100644 index 0000000000..be32c0959e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/defaultsModeConfig.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = void 0; +const AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; +const AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; +exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + return env[AWS_DEFAULTS_MODE_ENV]; + }, + configFileSelector: (profile) => { + return profile[AWS_DEFAULTS_MODE_CONFIG]; + }, + default: "legacy", +}; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/index.js new file mode 100644 index 0000000000..fff2fcd3e3 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./resolveDefaultsModeConfig"), exports); diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/resolveDefaultsModeConfig.js b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/resolveDefaultsModeConfig.js new file mode 100644 index 0000000000..97418f7855 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-cjs/resolveDefaultsModeConfig.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveDefaultsModeConfig = void 0; +const config_resolver_1 = require("@aws-sdk/config-resolver"); +const credential_provider_imds_1 = require("@aws-sdk/credential-provider-imds"); +const node_config_provider_1 = require("@aws-sdk/node-config-provider"); +const property_provider_1 = require("@aws-sdk/property-provider"); +const constants_1 = require("./constants"); +const defaultsModeConfig_1 = require("./defaultsModeConfig"); +const resolveDefaultsModeConfig = ({ region = (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS), defaultsMode = (0, node_config_provider_1.loadConfig)(defaultsModeConfig_1.NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => (0, property_provider_1.memoize)(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode === null || mode === void 0 ? void 0 : mode.toLowerCase()) { + case "auto": + return resolveNodeDefaultsModeAuto(region); + case "in-region": + case "cross-region": + case "mobile": + case "standard": + case "legacy": + return Promise.resolve(mode === null || mode === void 0 ? void 0 : mode.toLocaleLowerCase()); + case undefined: + return Promise.resolve("legacy"); + default: + throw new Error(`Invalid parameter for "defaultsMode", expect ${constants_1.DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); + } +}); +exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; +const resolveNodeDefaultsModeAuto = async (clientRegion) => { + if (clientRegion) { + const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; + const inferredRegion = await inferPhysicalRegion(); + if (!inferredRegion) { + return "standard"; + } + if (resolvedRegion === inferredRegion) { + return "in-region"; + } + else { + return "cross-region"; + } + } + return "standard"; +}; +const inferPhysicalRegion = async () => { + var _a; + if (process.env[constants_1.AWS_EXECUTION_ENV] && (process.env[constants_1.AWS_REGION_ENV] || process.env[constants_1.AWS_DEFAULT_REGION_ENV])) { + return (_a = process.env[constants_1.AWS_REGION_ENV]) !== null && _a !== void 0 ? _a : process.env[constants_1.AWS_DEFAULT_REGION_ENV]; + } + if (!process.env[constants_1.ENV_IMDS_DISABLED]) { + try { + const endpoint = await (0, credential_provider_imds_1.getInstanceMetadataEndpoint)(); + return (await (0, credential_provider_imds_1.httpRequest)({ ...endpoint, path: constants_1.IMDS_REGION_PATH })).toString(); + } + catch (e) { + } + } +}; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/constants.js b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/constants.js new file mode 100644 index 0000000000..69361a3fe8 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/constants.js @@ -0,0 +1,6 @@ +export const AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; +export const AWS_REGION_ENV = "AWS_REGION"; +export const AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; +export const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +export const DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; +export const IMDS_REGION_PATH = "/latest/meta-data/placement/region"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/defaultsModeConfig.js b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/defaultsModeConfig.js new file mode 100644 index 0000000000..f43b5708fa --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/defaultsModeConfig.js @@ -0,0 +1,11 @@ +const AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; +const AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; +export const NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + return env[AWS_DEFAULTS_MODE_ENV]; + }, + configFileSelector: (profile) => { + return profile[AWS_DEFAULTS_MODE_CONFIG]; + }, + default: "legacy", +}; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/index.js b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/index.js new file mode 100644 index 0000000000..05aa8183ea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/index.js @@ -0,0 +1 @@ +export * from "./resolveDefaultsModeConfig"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js new file mode 100644 index 0000000000..0af78c6892 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js @@ -0,0 +1,52 @@ +import { NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { getInstanceMetadataEndpoint, httpRequest } from "@aws-sdk/credential-provider-imds"; +import { loadConfig } from "@aws-sdk/node-config-provider"; +import { memoize } from "@aws-sdk/property-provider"; +import { AWS_DEFAULT_REGION_ENV, AWS_EXECUTION_ENV, AWS_REGION_ENV, DEFAULTS_MODE_OPTIONS, ENV_IMDS_DISABLED, IMDS_REGION_PATH, } from "./constants"; +import { NODE_DEFAULTS_MODE_CONFIG_OPTIONS } from "./defaultsModeConfig"; +export const resolveDefaultsModeConfig = ({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => memoize(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode?.toLowerCase()) { + case "auto": + return resolveNodeDefaultsModeAuto(region); + case "in-region": + case "cross-region": + case "mobile": + case "standard": + case "legacy": + return Promise.resolve(mode?.toLocaleLowerCase()); + case undefined: + return Promise.resolve("legacy"); + default: + throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); + } +}); +const resolveNodeDefaultsModeAuto = async (clientRegion) => { + if (clientRegion) { + const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; + const inferredRegion = await inferPhysicalRegion(); + if (!inferredRegion) { + return "standard"; + } + if (resolvedRegion === inferredRegion) { + return "in-region"; + } + else { + return "cross-region"; + } + } + return "standard"; +}; +const inferPhysicalRegion = async () => { + if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) { + return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV]; + } + if (!process.env[ENV_IMDS_DISABLED]) { + try { + const endpoint = await getInstanceMetadataEndpoint(); + return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString(); + } + catch (e) { + } + } +}; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/constants.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/constants.d.ts new file mode 100644 index 0000000000..3ddd400cf4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/constants.d.ts @@ -0,0 +1,6 @@ +export declare const AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; +export declare const AWS_REGION_ENV = "AWS_REGION"; +export declare const AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; +export declare const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +export declare const DEFAULTS_MODE_OPTIONS: string[]; +export declare const IMDS_REGION_PATH = "/latest/meta-data/placement/region"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/defaultsModeConfig.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/defaultsModeConfig.d.ts new file mode 100644 index 0000000000..4885fb6f1f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/defaultsModeConfig.d.ts @@ -0,0 +1,3 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +import type { DefaultsMode } from "@aws-sdk/smithy-client"; +export declare const NODE_DEFAULTS_MODE_CONFIG_OPTIONS: LoadedConfigSelectors; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/index.d.ts new file mode 100644 index 0000000000..05aa8183ea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./resolveDefaultsModeConfig"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/resolveDefaultsModeConfig.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/resolveDefaultsModeConfig.d.ts new file mode 100644 index 0000000000..bce060b809 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/resolveDefaultsModeConfig.d.ts @@ -0,0 +1,17 @@ +import type { DefaultsMode, ResolvedDefaultsMode } from "@aws-sdk/smithy-client"; +import type { Provider } from "@aws-sdk/types"; +/** + * @internal + */ +export interface ResolveDefaultsModeConfigOptions { + defaultsMode?: DefaultsMode | Provider; + region?: string | Provider; +} +/** + * Validate the defaultsMode configuration. If the value is set to "auto", it + * resolves the value to "in-region", "cross-region", or "standard". + * + * @default "legacy" + * @internal + */ +export declare const resolveDefaultsModeConfig: ({ region, defaultsMode, }?: ResolveDefaultsModeConfigOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/constants.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/constants.d.ts new file mode 100644 index 0000000000..3ddd400cf4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/constants.d.ts @@ -0,0 +1,6 @@ +export declare const AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; +export declare const AWS_REGION_ENV = "AWS_REGION"; +export declare const AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; +export declare const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +export declare const DEFAULTS_MODE_OPTIONS: string[]; +export declare const IMDS_REGION_PATH = "/latest/meta-data/placement/region"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/defaultsModeConfig.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/defaultsModeConfig.d.ts new file mode 100644 index 0000000000..2bf17e21b9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/defaultsModeConfig.d.ts @@ -0,0 +1,3 @@ +import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider"; +import { DefaultsMode } from "@aws-sdk/smithy-client"; +export declare const NODE_DEFAULTS_MODE_CONFIG_OPTIONS: LoadedConfigSelectors; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..05aa8183ea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./resolveDefaultsModeConfig"; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/resolveDefaultsModeConfig.d.ts b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/resolveDefaultsModeConfig.d.ts new file mode 100644 index 0000000000..4b89bcebfb --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/dist-types/ts3.4/resolveDefaultsModeConfig.d.ts @@ -0,0 +1,10 @@ +import { DefaultsMode, ResolvedDefaultsMode } from "@aws-sdk/smithy-client"; +import { Provider } from "@aws-sdk/types"; +export interface ResolveDefaultsModeConfigOptions { + defaultsMode?: DefaultsMode | Provider; + region?: string | Provider; +} +export declare const resolveDefaultsModeConfig: ({ + region, + defaultsMode, +}?: ResolveDefaultsModeConfigOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-defaults-mode-node/package.json b/server/node_modules/@aws-sdk/util-defaults-mode-node/package.json new file mode 100644 index 0000000000..89eb7197e7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-defaults-mode-node/package.json @@ -0,0 +1,58 @@ +{ + "name": "@aws-sdk/util-defaults-mode-node", + "version": "3.261.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/config-resolver": "3.259.0", + "@aws-sdk/credential-provider-imds": "3.259.0", + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/property-provider": "3.257.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/smithy-client": "3.261.0", + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "engines": { + "node": ">= 10.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-defaults-mode-node", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-defaults-mode-node" + } +} diff --git a/server/node_modules/@aws-sdk/util-endpoints/LICENSE b/server/node_modules/@aws-sdk/util-endpoints/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-endpoints/README.md b/server/node_modules/@aws-sdk/util-endpoints/README.md new file mode 100644 index 0000000000..641f54a2cb --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/README.md @@ -0,0 +1,6 @@ +# @aws-sdk/util-endpoints + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-endpoints/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-endpoints) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-endpoints.svg)](https://www.npmjs.com/package/@aws-sdk/util-endpoints) + +> An internal package diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/debugId.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/debugId.js new file mode 100644 index 0000000000..abbd314e6c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/debugId.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.debugId = void 0; +exports.debugId = "endpoints"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/index.js new file mode 100644 index 0000000000..894b0261a4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./debugId"), exports); +tslib_1.__exportStar(require("./toDebugString"), exports); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/toDebugString.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/toDebugString.js new file mode 100644 index 0000000000..5881730560 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/debug/toDebugString.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toDebugString = void 0; +function toDebugString(input) { + if (typeof input !== "object" || input == null) { + return input; + } + if ("ref" in input) { + return `$${toDebugString(input.ref)}`; + } + if ("fn" in input) { + return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; + } + return JSON.stringify(input, null, 2); +} +exports.toDebugString = toDebugString; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js new file mode 100644 index 0000000000..cd3a49a451 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./lib/aws/partition"), exports); +tslib_1.__exportStar(require("./resolveEndpoint"), exports); +tslib_1.__exportStar(require("./types"), exports); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/index.js new file mode 100644 index 0000000000..9da97e0b4c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./isVirtualHostableS3Bucket"), exports); +tslib_1.__exportStar(require("./parseArn"), exports); +tslib_1.__exportStar(require("./partition"), exports); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/isVirtualHostableS3Bucket.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/isVirtualHostableS3Bucket.js new file mode 100644 index 0000000000..e7d2342620 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/isVirtualHostableS3Bucket.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isVirtualHostableS3Bucket = void 0; +const isIpAddress_1 = require("../isIpAddress"); +const isValidHostLabel_1 = require("../isValidHostLabel"); +const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!(0, exports.isVirtualHostableS3Bucket)(label)) { + return false; + } + } + return true; + } + if (!(0, isValidHostLabel_1.isValidHostLabel)(value)) { + return false; + } + if (value.length < 3 || value.length > 63) { + return false; + } + if (value !== value.toLowerCase()) { + return false; + } + if ((0, isIpAddress_1.isIpAddress)(value)) { + return false; + } + return true; +}; +exports.isVirtualHostableS3Bucket = isVirtualHostableS3Bucket; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/parseArn.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/parseArn.js new file mode 100644 index 0000000000..9925939f61 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/parseArn.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseArn = void 0; +const parseArn = (value) => { + const segments = value.split(":"); + if (segments.length < 6) + return null; + const [arn, partition, service, region, accountId, ...resourceId] = segments; + if (arn !== "arn" || partition === "" || service === "" || resourceId[0] === "") + return null; + return { + partition, + service, + region, + accountId, + resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId, + }; +}; +exports.parseArn = parseArn; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partition.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partition.js new file mode 100644 index 0000000000..58cafb4565 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partition.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.partition = void 0; +const tslib_1 = require("tslib"); +const partitions_json_1 = tslib_1.__importDefault(require("./partitions.json")); +const { partitions } = partitions_json_1.default; +const DEFAULT_PARTITION = partitions.find((partition) => partition.id === "aws"); +const partition = (value) => { + for (const partition of partitions) { + const { regions, outputs } = partition; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData, + }; + } + } + } + for (const partition of partitions) { + const { regionRegex, outputs } = partition; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs, + }; + } + } + if (!DEFAULT_PARTITION) { + throw new Error("Provided region was not found in the partition array or regex," + + " and default partition with id 'aws' doesn't exist."); + } + return { + ...DEFAULT_PARTITION.outputs, + }; +}; +exports.partition = partition; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json new file mode 100644 index 0000000000..a9f7055c88 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json @@ -0,0 +1,181 @@ +{ + "partitions": [{ + "id": "aws", + "outputs": { + "dnsSuffix": "amazonaws.com", + "dualStackDnsSuffix": "api.aws", + "name": "aws", + "supportsDualStack": true, + "supportsFIPS": true + }, + "regionRegex": "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$", + "regions": { + "af-south-1": { + "description": "Africa (Cape Town)" + }, + "ap-east-1": { + "description": "Asia Pacific (Hong Kong)" + }, + "ap-northeast-1": { + "description": "Asia Pacific (Tokyo)" + }, + "ap-northeast-2": { + "description": "Asia Pacific (Seoul)" + }, + "ap-northeast-3": { + "description": "Asia Pacific (Osaka)" + }, + "ap-south-1": { + "description": "Asia Pacific (Mumbai)" + }, + "ap-south-2": { + "description": "Asia Pacific (Hyderabad)" + }, + "ap-southeast-1": { + "description": "Asia Pacific (Singapore)" + }, + "ap-southeast-2": { + "description": "Asia Pacific (Sydney)" + }, + "ap-southeast-3": { + "description": "Asia Pacific (Jakarta)" + }, + "ap-southeast-4": { + "description": "Asia Pacific (Melbourne)" + }, + "aws-global": { + "description": "AWS Standard global region" + }, + "ca-central-1": { + "description": "Canada (Central)" + }, + "eu-central-1": { + "description": "Europe (Frankfurt)" + }, + "eu-central-2": { + "description": "Europe (Zurich)" + }, + "eu-north-1": { + "description": "Europe (Stockholm)" + }, + "eu-south-1": { + "description": "Europe (Milan)" + }, + "eu-south-2": { + "description": "Europe (Spain)" + }, + "eu-west-1": { + "description": "Europe (Ireland)" + }, + "eu-west-2": { + "description": "Europe (London)" + }, + "eu-west-3": { + "description": "Europe (Paris)" + }, + "me-central-1": { + "description": "Middle East (UAE)" + }, + "me-south-1": { + "description": "Middle East (Bahrain)" + }, + "sa-east-1": { + "description": "South America (Sao Paulo)" + }, + "us-east-1": { + "description": "US East (N. Virginia)" + }, + "us-east-2": { + "description": "US East (Ohio)" + }, + "us-west-1": { + "description": "US West (N. California)" + }, + "us-west-2": { + "description": "US West (Oregon)" + } + } + }, { + "id": "aws-cn", + "outputs": { + "dnsSuffix": "amazonaws.com.cn", + "dualStackDnsSuffix": "api.amazonwebservices.com.cn", + "name": "aws-cn", + "supportsDualStack": true, + "supportsFIPS": true + }, + "regionRegex": "^cn\\-\\w+\\-\\d+$", + "regions": { + "aws-cn-global": { + "description": "AWS China global region" + }, + "cn-north-1": { + "description": "China (Beijing)" + }, + "cn-northwest-1": { + "description": "China (Ningxia)" + } + } + }, { + "id": "aws-us-gov", + "outputs": { + "dnsSuffix": "amazonaws.com", + "dualStackDnsSuffix": "api.aws", + "name": "aws-us-gov", + "supportsDualStack": true, + "supportsFIPS": true + }, + "regionRegex": "^us\\-gov\\-\\w+\\-\\d+$", + "regions": { + "aws-us-gov-global": { + "description": "AWS GovCloud (US) global region" + }, + "us-gov-east-1": { + "description": "AWS GovCloud (US-East)" + }, + "us-gov-west-1": { + "description": "AWS GovCloud (US-West)" + } + } + }, { + "id": "aws-iso", + "outputs": { + "dnsSuffix": "c2s.ic.gov", + "dualStackDnsSuffix": "c2s.ic.gov", + "name": "aws-iso", + "supportsDualStack": false, + "supportsFIPS": true + }, + "regionRegex": "^us\\-iso\\-\\w+\\-\\d+$", + "regions": { + "aws-iso-global": { + "description": "AWS ISO (US) global region" + }, + "us-iso-east-1": { + "description": "US ISO East" + }, + "us-iso-west-1": { + "description": "US ISO WEST" + } + } + }, { + "id": "aws-iso-b", + "outputs": { + "dnsSuffix": "sc2s.sgov.gov", + "dualStackDnsSuffix": "sc2s.sgov.gov", + "name": "aws-iso-b", + "supportsDualStack": false, + "supportsFIPS": true + }, + "regionRegex": "^us\\-isob\\-\\w+\\-\\d+$", + "regions": { + "aws-iso-b-global": { + "description": "AWS ISOB (US) global region" + }, + "us-isob-east-1": { + "description": "US ISOB East (Ohio)" + } + } + }], + "version": "1.1" +} diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/booleanEquals.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/booleanEquals.js new file mode 100644 index 0000000000..acce55d86f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/booleanEquals.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.booleanEquals = void 0; +const booleanEquals = (value1, value2) => value1 === value2; +exports.booleanEquals = booleanEquals; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/getAttr.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/getAttr.js new file mode 100644 index 0000000000..4f7671bb23 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/getAttr.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getAttr = void 0; +const types_1 = require("../types"); +const getAttrPathList_1 = require("./getAttrPathList"); +const getAttr = (value, path) => (0, getAttrPathList_1.getAttrPathList)(path).reduce((acc, index) => { + if (typeof acc !== "object") { + throw new types_1.EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`); + } + else if (Array.isArray(acc)) { + return acc[parseInt(index)]; + } + return acc[index]; +}, value); +exports.getAttr = getAttr; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/getAttrPathList.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/getAttrPathList.js new file mode 100644 index 0000000000..e4d43aaff6 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/getAttrPathList.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getAttrPathList = void 0; +const types_1 = require("../types"); +const getAttrPathList = (path) => { + const parts = path.split("."); + const pathList = []; + for (const part of parts) { + const squareBracketIndex = part.indexOf("["); + if (squareBracketIndex !== -1) { + if (part.indexOf("]") !== part.length - 1) { + throw new types_1.EndpointError(`Path: '${path}' does not end with ']'`); + } + const arrayIndex = part.slice(squareBracketIndex + 1, -1); + if (Number.isNaN(parseInt(arrayIndex))) { + throw new types_1.EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); + } + if (squareBracketIndex !== 0) { + pathList.push(part.slice(0, squareBracketIndex)); + } + pathList.push(arrayIndex); + } + else { + pathList.push(part); + } + } + return pathList; +}; +exports.getAttrPathList = getAttrPathList; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/index.js new file mode 100644 index 0000000000..6cca71cd11 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/index.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.aws = void 0; +const tslib_1 = require("tslib"); +exports.aws = tslib_1.__importStar(require("./aws")); +tslib_1.__exportStar(require("./booleanEquals"), exports); +tslib_1.__exportStar(require("./getAttr"), exports); +tslib_1.__exportStar(require("./isSet"), exports); +tslib_1.__exportStar(require("./isValidHostLabel"), exports); +tslib_1.__exportStar(require("./not"), exports); +tslib_1.__exportStar(require("./parseURL"), exports); +tslib_1.__exportStar(require("./stringEquals"), exports); +tslib_1.__exportStar(require("./substring"), exports); +tslib_1.__exportStar(require("./uriEncode"), exports); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isIpAddress.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isIpAddress.js new file mode 100644 index 0000000000..e4db4c3f79 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isIpAddress.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isIpAddress = void 0; +const IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); +const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]")); +exports.isIpAddress = isIpAddress; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isSet.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isSet.js new file mode 100644 index 0000000000..94325e7c81 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isSet.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSet = void 0; +const isSet = (value) => value != null; +exports.isSet = isSet; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isValidHostLabel.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isValidHostLabel.js new file mode 100644 index 0000000000..3a7dbb73b6 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/isValidHostLabel.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isValidHostLabel = void 0; +const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); +const isValidHostLabel = (value, allowSubDomains = false) => { + if (!allowSubDomains) { + return VALID_HOST_LABEL_REGEX.test(value); + } + const labels = value.split("."); + for (const label of labels) { + if (!(0, exports.isValidHostLabel)(label)) { + return false; + } + } + return true; +}; +exports.isValidHostLabel = isValidHostLabel; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/not.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/not.js new file mode 100644 index 0000000000..88aef3b2e8 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/not.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.not = void 0; +const not = (value) => !value; +exports.not = not; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/parseURL.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/parseURL.js new file mode 100644 index 0000000000..692fd031ed --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/parseURL.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseURL = void 0; +const types_1 = require("@aws-sdk/types"); +const isIpAddress_1 = require("./isIpAddress"); +const DEFAULT_PORTS = { + [types_1.EndpointURLScheme.HTTP]: 80, + [types_1.EndpointURLScheme.HTTPS]: 443, +}; +const parseURL = (value) => { + const whatwgURL = (() => { + try { + if (value instanceof URL) { + return value; + } + if (typeof value === "object" && "hostname" in value) { + const { hostname, port, protocol = "", path = "", query = {} } = value; + const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : ""}${path}`); + url.search = Object.entries(query) + .map(([k, v]) => `${k}=${v}`) + .join("&"); + return url; + } + return new URL(value); + } + catch (error) { + return null; + } + })(); + if (!whatwgURL) { + console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); + return null; + } + const urlString = whatwgURL.href; + const { host, hostname, pathname, protocol, search } = whatwgURL; + if (search) { + return null; + } + const scheme = protocol.slice(0, -1); + if (!Object.values(types_1.EndpointURLScheme).includes(scheme)) { + return null; + } + const isIp = (0, isIpAddress_1.isIpAddress)(hostname); + const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || + (typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`)); + const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; + return { + scheme, + authority, + path: pathname, + normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, + isIp, + }; +}; +exports.parseURL = parseURL; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/stringEquals.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/stringEquals.js new file mode 100644 index 0000000000..c1cae473de --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/stringEquals.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stringEquals = void 0; +const stringEquals = (value1, value2) => value1 === value2; +exports.stringEquals = stringEquals; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/substring.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/substring.js new file mode 100644 index 0000000000..6f0477db66 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/substring.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.substring = void 0; +const substring = (input, start, stop, reverse) => { + if (start >= stop || input.length < stop) { + return null; + } + if (!reverse) { + return input.substring(start, stop); + } + return input.substring(input.length - stop, input.length - start); +}; +exports.substring = substring; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/uriEncode.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/uriEncode.js new file mode 100644 index 0000000000..36ef467971 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/uriEncode.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.uriEncode = void 0; +const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); +exports.uriEncode = uriEncode; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/resolveEndpoint.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/resolveEndpoint.js new file mode 100644 index 0000000000..5f02b1a75f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/resolveEndpoint.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveEndpoint = void 0; +const debug_1 = require("./debug"); +const types_1 = require("./types"); +const utils_1 = require("./utils"); +const resolveEndpoint = (ruleSetObject, options) => { + var _a, _b, _c, _d, _e, _f; + const { endpointParams, logger } = options; + const { parameters, rules } = ruleSetObject; + (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `Initial EndpointParams: ${(0, debug_1.toDebugString)(endpointParams)}`); + const paramsWithDefault = Object.entries(parameters) + .filter(([, v]) => v.default != null) + .map(([k, v]) => [k, v.default]); + if (paramsWithDefault.length > 0) { + for (const [paramKey, paramDefaultValue] of paramsWithDefault) { + endpointParams[paramKey] = (_c = endpointParams[paramKey]) !== null && _c !== void 0 ? _c : paramDefaultValue; + } + } + const requiredParams = Object.entries(parameters) + .filter(([, v]) => v.required) + .map(([k]) => k); + for (const requiredParam of requiredParams) { + if (endpointParams[requiredParam] == null) { + throw new types_1.EndpointError(`Missing required parameter: '${requiredParam}'`); + } + } + const endpoint = (0, utils_1.evaluateRules)(rules, { endpointParams, logger, referenceRecord: {} }); + if ((_d = options.endpointParams) === null || _d === void 0 ? void 0 : _d.Endpoint) { + try { + const givenEndpoint = new URL(options.endpointParams.Endpoint); + const { protocol, port } = givenEndpoint; + endpoint.url.protocol = protocol; + endpoint.url.port = port; + } + catch (e) { + } + } + (_f = (_e = options.logger) === null || _e === void 0 ? void 0 : _e.debug) === null || _f === void 0 ? void 0 : _f.call(_e, debug_1.debugId, `Resolved endpoint: ${(0, debug_1.toDebugString)(endpoint)}`); + return endpoint; +}; +exports.resolveEndpoint = resolveEndpoint; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/EndpointError.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/EndpointError.js new file mode 100644 index 0000000000..fffb7620a9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/EndpointError.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EndpointError = void 0; +class EndpointError extends Error { + constructor(message) { + super(message); + this.name = "EndpointError"; + } +} +exports.EndpointError = EndpointError; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/EndpointRuleObject.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/EndpointRuleObject.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/EndpointRuleObject.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/ErrorRuleObject.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/ErrorRuleObject.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/ErrorRuleObject.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/RuleSetObject.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/RuleSetObject.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/RuleSetObject.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/TreeRuleObject.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/TreeRuleObject.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/TreeRuleObject.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/index.js new file mode 100644 index 0000000000..fe0ed9db0d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./EndpointError"), exports); +tslib_1.__exportStar(require("./EndpointRuleObject"), exports); +tslib_1.__exportStar(require("./ErrorRuleObject"), exports); +tslib_1.__exportStar(require("./RuleSetObject"), exports); +tslib_1.__exportStar(require("./TreeRuleObject"), exports); +tslib_1.__exportStar(require("./shared"), exports); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/shared.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/shared.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/types/shared.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/callFunction.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/callFunction.js new file mode 100644 index 0000000000..077849ca2a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/callFunction.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callFunction = void 0; +const tslib_1 = require("tslib"); +const lib = tslib_1.__importStar(require("../lib")); +const evaluateExpression_1 = require("./evaluateExpression"); +const callFunction = ({ fn, argv }, options) => { + const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : (0, evaluateExpression_1.evaluateExpression)(arg, "arg", options)); + return fn.split(".").reduce((acc, key) => acc[key], lib)(...evaluatedArgs); +}; +exports.callFunction = callFunction; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateCondition.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateCondition.js new file mode 100644 index 0000000000..8389a284a0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateCondition.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.evaluateCondition = void 0; +const debug_1 = require("../debug"); +const types_1 = require("../types"); +const callFunction_1 = require("./callFunction"); +const evaluateCondition = ({ assign, ...fnArgs }, options) => { + var _a, _b; + if (assign && assign in options.referenceRecord) { + throw new types_1.EndpointError(`'${assign}' is already defined in Reference Record.`); + } + const value = (0, callFunction_1.callFunction)(fnArgs, options); + (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `evaluateCondition: ${(0, debug_1.toDebugString)(fnArgs)} = ${(0, debug_1.toDebugString)(value)}`); + return { + result: value === "" ? true : !!value, + ...(assign != null && { toAssign: { name: assign, value } }), + }; +}; +exports.evaluateCondition = evaluateCondition; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateConditions.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateConditions.js new file mode 100644 index 0000000000..1ef69deb9c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateConditions.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.evaluateConditions = void 0; +const debug_1 = require("../debug"); +const evaluateCondition_1 = require("./evaluateCondition"); +const evaluateConditions = (conditions = [], options) => { + var _a, _b; + const conditionsReferenceRecord = {}; + for (const condition of conditions) { + const { result, toAssign } = (0, evaluateCondition_1.evaluateCondition)(condition, { + ...options, + referenceRecord: { + ...options.referenceRecord, + ...conditionsReferenceRecord, + }, + }); + if (!result) { + return { result }; + } + if (toAssign) { + conditionsReferenceRecord[toAssign.name] = toAssign.value; + (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `assign: ${toAssign.name} := ${(0, debug_1.toDebugString)(toAssign.value)}`); + } + } + return { result: true, referenceRecord: conditionsReferenceRecord }; +}; +exports.evaluateConditions = evaluateConditions; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateEndpointRule.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateEndpointRule.js new file mode 100644 index 0000000000..86ef24dce9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateEndpointRule.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.evaluateEndpointRule = void 0; +const debug_1 = require("../debug"); +const evaluateConditions_1 = require("./evaluateConditions"); +const getEndpointHeaders_1 = require("./getEndpointHeaders"); +const getEndpointProperties_1 = require("./getEndpointProperties"); +const getEndpointUrl_1 = require("./getEndpointUrl"); +const evaluateEndpointRule = (endpointRule, options) => { + var _a, _b; + const { conditions, endpoint } = endpointRule; + const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); + if (!result) { + return; + } + const endpointRuleOptions = { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + }; + const { url, properties, headers } = endpoint; + (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `Resolving endpoint from template: ${(0, debug_1.toDebugString)(endpoint)}`); + return { + ...(headers != undefined && { + headers: (0, getEndpointHeaders_1.getEndpointHeaders)(headers, endpointRuleOptions), + }), + ...(properties != undefined && { + properties: (0, getEndpointProperties_1.getEndpointProperties)(properties, endpointRuleOptions), + }), + url: (0, getEndpointUrl_1.getEndpointUrl)(url, endpointRuleOptions), + }; +}; +exports.evaluateEndpointRule = evaluateEndpointRule; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateErrorRule.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateErrorRule.js new file mode 100644 index 0000000000..c7718528cc --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateErrorRule.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.evaluateErrorRule = void 0; +const types_1 = require("../types"); +const evaluateConditions_1 = require("./evaluateConditions"); +const evaluateExpression_1 = require("./evaluateExpression"); +const evaluateErrorRule = (errorRule, options) => { + const { conditions, error } = errorRule; + const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); + if (!result) { + return; + } + throw new types_1.EndpointError((0, evaluateExpression_1.evaluateExpression)(error, "Error", { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + })); +}; +exports.evaluateErrorRule = evaluateErrorRule; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateExpression.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateExpression.js new file mode 100644 index 0000000000..709b02e3d7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateExpression.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.evaluateExpression = void 0; +const types_1 = require("../types"); +const callFunction_1 = require("./callFunction"); +const evaluateTemplate_1 = require("./evaluateTemplate"); +const getReferenceValue_1 = require("./getReferenceValue"); +const evaluateExpression = (obj, keyName, options) => { + if (typeof obj === "string") { + return (0, evaluateTemplate_1.evaluateTemplate)(obj, options); + } + else if (obj["fn"]) { + return (0, callFunction_1.callFunction)(obj, options); + } + else if (obj["ref"]) { + return (0, getReferenceValue_1.getReferenceValue)(obj, options); + } + throw new types_1.EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); +}; +exports.evaluateExpression = evaluateExpression; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateRules.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateRules.js new file mode 100644 index 0000000000..c4d7b35cd7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateRules.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.evaluateRules = void 0; +const types_1 = require("../types"); +const evaluateEndpointRule_1 = require("./evaluateEndpointRule"); +const evaluateErrorRule_1 = require("./evaluateErrorRule"); +const evaluateTreeRule_1 = require("./evaluateTreeRule"); +const evaluateRules = (rules, options) => { + for (const rule of rules) { + if (rule.type === "endpoint") { + const endpointOrUndefined = (0, evaluateEndpointRule_1.evaluateEndpointRule)(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } + else if (rule.type === "error") { + (0, evaluateErrorRule_1.evaluateErrorRule)(rule, options); + } + else if (rule.type === "tree") { + const endpointOrUndefined = (0, evaluateTreeRule_1.evaluateTreeRule)(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } + else { + throw new types_1.EndpointError(`Unknown endpoint rule: ${rule}`); + } + } + throw new types_1.EndpointError(`Rules evaluation failed`); +}; +exports.evaluateRules = evaluateRules; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTemplate.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTemplate.js new file mode 100644 index 0000000000..de29c17259 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTemplate.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.evaluateTemplate = void 0; +const lib_1 = require("../lib"); +const evaluateTemplate = (template, options) => { + const evaluatedTemplateArr = []; + const templateContext = { + ...options.endpointParams, + ...options.referenceRecord, + }; + let currentIndex = 0; + while (currentIndex < template.length) { + const openingBraceIndex = template.indexOf("{", currentIndex); + if (openingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(currentIndex)); + break; + } + evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); + const closingBraceIndex = template.indexOf("}", openingBraceIndex); + if (closingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(openingBraceIndex)); + break; + } + if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { + evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); + currentIndex = closingBraceIndex + 2; + } + const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); + if (parameterName.includes("#")) { + const [refName, attrName] = parameterName.split("#"); + evaluatedTemplateArr.push((0, lib_1.getAttr)(templateContext[refName], attrName)); + } + else { + evaluatedTemplateArr.push(templateContext[parameterName]); + } + currentIndex = closingBraceIndex + 1; + } + return evaluatedTemplateArr.join(""); +}; +exports.evaluateTemplate = evaluateTemplate; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTreeRule.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTreeRule.js new file mode 100644 index 0000000000..94401d853f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTreeRule.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.evaluateTreeRule = void 0; +const evaluateConditions_1 = require("./evaluateConditions"); +const evaluateRules_1 = require("./evaluateRules"); +const evaluateTreeRule = (treeRule, options) => { + const { conditions, rules } = treeRule; + const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); + if (!result) { + return; + } + return (0, evaluateRules_1.evaluateRules)(rules, { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + }); +}; +exports.evaluateTreeRule = evaluateTreeRule; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointHeaders.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointHeaders.js new file mode 100644 index 0000000000..e356549b70 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointHeaders.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEndpointHeaders = void 0; +const types_1 = require("../types"); +const evaluateExpression_1 = require("./evaluateExpression"); +const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ + ...acc, + [headerKey]: headerVal.map((headerValEntry) => { + const processedExpr = (0, evaluateExpression_1.evaluateExpression)(headerValEntry, "Header value entry", options); + if (typeof processedExpr !== "string") { + throw new types_1.EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); + } + return processedExpr; + }), +}), {}); +exports.getEndpointHeaders = getEndpointHeaders; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointProperties.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointProperties.js new file mode 100644 index 0000000000..ec8b506ac4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointProperties.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEndpointProperties = void 0; +const getEndpointProperty_1 = require("./getEndpointProperty"); +const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ + ...acc, + [propertyKey]: (0, getEndpointProperty_1.getEndpointProperty)(propertyVal, options), +}), {}); +exports.getEndpointProperties = getEndpointProperties; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointProperty.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointProperty.js new file mode 100644 index 0000000000..b2eb7afa4e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointProperty.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEndpointProperty = void 0; +const types_1 = require("../types"); +const evaluateTemplate_1 = require("./evaluateTemplate"); +const getEndpointProperties_1 = require("./getEndpointProperties"); +const getEndpointProperty = (property, options) => { + if (Array.isArray(property)) { + return property.map((propertyEntry) => (0, exports.getEndpointProperty)(propertyEntry, options)); + } + switch (typeof property) { + case "string": + return (0, evaluateTemplate_1.evaluateTemplate)(property, options); + case "object": + if (property === null) { + throw new types_1.EndpointError(`Unexpected endpoint property: ${property}`); + } + return (0, getEndpointProperties_1.getEndpointProperties)(property, options); + case "boolean": + return property; + default: + throw new types_1.EndpointError(`Unexpected endpoint property type: ${typeof property}`); + } +}; +exports.getEndpointProperty = getEndpointProperty; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointUrl.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointUrl.js new file mode 100644 index 0000000000..7800dd4758 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointUrl.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEndpointUrl = void 0; +const types_1 = require("../types"); +const evaluateExpression_1 = require("./evaluateExpression"); +const getEndpointUrl = (endpointUrl, options) => { + const expression = (0, evaluateExpression_1.evaluateExpression)(endpointUrl, "Endpoint URL", options); + if (typeof expression === "string") { + try { + return new URL(expression); + } + catch (error) { + console.error(`Failed to construct URL with ${expression}`, error); + throw error; + } + } + throw new types_1.EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); +}; +exports.getEndpointUrl = getEndpointUrl; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getReferenceValue.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getReferenceValue.js new file mode 100644 index 0000000000..ea71e114b8 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getReferenceValue.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getReferenceValue = void 0; +const getReferenceValue = ({ ref }, options) => { + const referenceRecord = { + ...options.endpointParams, + ...options.referenceRecord, + }; + return referenceRecord[ref]; +}; +exports.getReferenceValue = getReferenceValue; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/index.js new file mode 100644 index 0000000000..ec47e0ecb3 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./evaluateRules"), exports); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/debugId.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/debugId.js new file mode 100644 index 0000000000..0d4e27e03b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/debugId.js @@ -0,0 +1 @@ +export const debugId = "endpoints"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/index.js new file mode 100644 index 0000000000..70d3b15c36 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/index.js @@ -0,0 +1,2 @@ +export * from "./debugId"; +export * from "./toDebugString"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/toDebugString.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/toDebugString.js new file mode 100644 index 0000000000..33c8fcbb47 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/debug/toDebugString.js @@ -0,0 +1,12 @@ +export function toDebugString(input) { + if (typeof input !== "object" || input == null) { + return input; + } + if ("ref" in input) { + return `$${toDebugString(input.ref)}`; + } + if ("fn" in input) { + return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; + } + return JSON.stringify(input, null, 2); +} diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/index.js new file mode 100644 index 0000000000..17868ec89b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/index.js @@ -0,0 +1,3 @@ +export * from "./lib/aws/partition"; +export * from "./resolveEndpoint"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js new file mode 100644 index 0000000000..03be049d13 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js @@ -0,0 +1,3 @@ +export * from "./isVirtualHostableS3Bucket"; +export * from "./parseArn"; +export * from "./partition"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js new file mode 100644 index 0000000000..ace5f22477 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js @@ -0,0 +1,25 @@ +import { isIpAddress } from "../isIpAddress"; +import { isValidHostLabel } from "../isValidHostLabel"; +export const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!isVirtualHostableS3Bucket(label)) { + return false; + } + } + return true; + } + if (!isValidHostLabel(value)) { + return false; + } + if (value.length < 3 || value.length > 63) { + return false; + } + if (value !== value.toLowerCase()) { + return false; + } + if (isIpAddress(value)) { + return false; + } + return true; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js new file mode 100644 index 0000000000..25cc4287d1 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js @@ -0,0 +1,15 @@ +export const parseArn = (value) => { + const segments = value.split(":"); + if (segments.length < 6) + return null; + const [arn, partition, service, region, accountId, ...resourceId] = segments; + if (arn !== "arn" || partition === "" || service === "" || resourceId[0] === "") + return null; + return { + partition, + service, + region, + accountId, + resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId, + }; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js new file mode 100644 index 0000000000..2eb639752c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js @@ -0,0 +1,31 @@ +import partitionsInfo from "./partitions.json"; +const { partitions } = partitionsInfo; +const DEFAULT_PARTITION = partitions.find((partition) => partition.id === "aws"); +export const partition = (value) => { + for (const partition of partitions) { + const { regions, outputs } = partition; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData, + }; + } + } + } + for (const partition of partitions) { + const { regionRegex, outputs } = partition; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs, + }; + } + } + if (!DEFAULT_PARTITION) { + throw new Error("Provided region was not found in the partition array or regex," + + " and default partition with id 'aws' doesn't exist."); + } + return { + ...DEFAULT_PARTITION.outputs, + }; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json new file mode 100644 index 0000000000..a9f7055c88 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json @@ -0,0 +1,181 @@ +{ + "partitions": [{ + "id": "aws", + "outputs": { + "dnsSuffix": "amazonaws.com", + "dualStackDnsSuffix": "api.aws", + "name": "aws", + "supportsDualStack": true, + "supportsFIPS": true + }, + "regionRegex": "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$", + "regions": { + "af-south-1": { + "description": "Africa (Cape Town)" + }, + "ap-east-1": { + "description": "Asia Pacific (Hong Kong)" + }, + "ap-northeast-1": { + "description": "Asia Pacific (Tokyo)" + }, + "ap-northeast-2": { + "description": "Asia Pacific (Seoul)" + }, + "ap-northeast-3": { + "description": "Asia Pacific (Osaka)" + }, + "ap-south-1": { + "description": "Asia Pacific (Mumbai)" + }, + "ap-south-2": { + "description": "Asia Pacific (Hyderabad)" + }, + "ap-southeast-1": { + "description": "Asia Pacific (Singapore)" + }, + "ap-southeast-2": { + "description": "Asia Pacific (Sydney)" + }, + "ap-southeast-3": { + "description": "Asia Pacific (Jakarta)" + }, + "ap-southeast-4": { + "description": "Asia Pacific (Melbourne)" + }, + "aws-global": { + "description": "AWS Standard global region" + }, + "ca-central-1": { + "description": "Canada (Central)" + }, + "eu-central-1": { + "description": "Europe (Frankfurt)" + }, + "eu-central-2": { + "description": "Europe (Zurich)" + }, + "eu-north-1": { + "description": "Europe (Stockholm)" + }, + "eu-south-1": { + "description": "Europe (Milan)" + }, + "eu-south-2": { + "description": "Europe (Spain)" + }, + "eu-west-1": { + "description": "Europe (Ireland)" + }, + "eu-west-2": { + "description": "Europe (London)" + }, + "eu-west-3": { + "description": "Europe (Paris)" + }, + "me-central-1": { + "description": "Middle East (UAE)" + }, + "me-south-1": { + "description": "Middle East (Bahrain)" + }, + "sa-east-1": { + "description": "South America (Sao Paulo)" + }, + "us-east-1": { + "description": "US East (N. Virginia)" + }, + "us-east-2": { + "description": "US East (Ohio)" + }, + "us-west-1": { + "description": "US West (N. California)" + }, + "us-west-2": { + "description": "US West (Oregon)" + } + } + }, { + "id": "aws-cn", + "outputs": { + "dnsSuffix": "amazonaws.com.cn", + "dualStackDnsSuffix": "api.amazonwebservices.com.cn", + "name": "aws-cn", + "supportsDualStack": true, + "supportsFIPS": true + }, + "regionRegex": "^cn\\-\\w+\\-\\d+$", + "regions": { + "aws-cn-global": { + "description": "AWS China global region" + }, + "cn-north-1": { + "description": "China (Beijing)" + }, + "cn-northwest-1": { + "description": "China (Ningxia)" + } + } + }, { + "id": "aws-us-gov", + "outputs": { + "dnsSuffix": "amazonaws.com", + "dualStackDnsSuffix": "api.aws", + "name": "aws-us-gov", + "supportsDualStack": true, + "supportsFIPS": true + }, + "regionRegex": "^us\\-gov\\-\\w+\\-\\d+$", + "regions": { + "aws-us-gov-global": { + "description": "AWS GovCloud (US) global region" + }, + "us-gov-east-1": { + "description": "AWS GovCloud (US-East)" + }, + "us-gov-west-1": { + "description": "AWS GovCloud (US-West)" + } + } + }, { + "id": "aws-iso", + "outputs": { + "dnsSuffix": "c2s.ic.gov", + "dualStackDnsSuffix": "c2s.ic.gov", + "name": "aws-iso", + "supportsDualStack": false, + "supportsFIPS": true + }, + "regionRegex": "^us\\-iso\\-\\w+\\-\\d+$", + "regions": { + "aws-iso-global": { + "description": "AWS ISO (US) global region" + }, + "us-iso-east-1": { + "description": "US ISO East" + }, + "us-iso-west-1": { + "description": "US ISO WEST" + } + } + }, { + "id": "aws-iso-b", + "outputs": { + "dnsSuffix": "sc2s.sgov.gov", + "dualStackDnsSuffix": "sc2s.sgov.gov", + "name": "aws-iso-b", + "supportsDualStack": false, + "supportsFIPS": true + }, + "regionRegex": "^us\\-isob\\-\\w+\\-\\d+$", + "regions": { + "aws-iso-b-global": { + "description": "AWS ISOB (US) global region" + }, + "us-isob-east-1": { + "description": "US ISOB East (Ohio)" + } + } + }], + "version": "1.1" +} diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/booleanEquals.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/booleanEquals.js new file mode 100644 index 0000000000..730cbd3bde --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/booleanEquals.js @@ -0,0 +1 @@ +export const booleanEquals = (value1, value2) => value1 === value2; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/getAttr.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/getAttr.js new file mode 100644 index 0000000000..d77f1657fc --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/getAttr.js @@ -0,0 +1,11 @@ +import { EndpointError } from "../types"; +import { getAttrPathList } from "./getAttrPathList"; +export const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => { + if (typeof acc !== "object") { + throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`); + } + else if (Array.isArray(acc)) { + return acc[parseInt(index)]; + } + return acc[index]; +}, value); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/getAttrPathList.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/getAttrPathList.js new file mode 100644 index 0000000000..5817a2de69 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/getAttrPathList.js @@ -0,0 +1,25 @@ +import { EndpointError } from "../types"; +export const getAttrPathList = (path) => { + const parts = path.split("."); + const pathList = []; + for (const part of parts) { + const squareBracketIndex = part.indexOf("["); + if (squareBracketIndex !== -1) { + if (part.indexOf("]") !== part.length - 1) { + throw new EndpointError(`Path: '${path}' does not end with ']'`); + } + const arrayIndex = part.slice(squareBracketIndex + 1, -1); + if (Number.isNaN(parseInt(arrayIndex))) { + throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); + } + if (squareBracketIndex !== 0) { + pathList.push(part.slice(0, squareBracketIndex)); + } + pathList.push(arrayIndex); + } + else { + pathList.push(part); + } + } + return pathList; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/index.js new file mode 100644 index 0000000000..b05a4031ea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/index.js @@ -0,0 +1,10 @@ +export * as aws from "./aws"; +export * from "./booleanEquals"; +export * from "./getAttr"; +export * from "./isSet"; +export * from "./isValidHostLabel"; +export * from "./not"; +export * from "./parseURL"; +export * from "./stringEquals"; +export * from "./substring"; +export * from "./uriEncode"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js new file mode 100644 index 0000000000..20be5a3e3b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js @@ -0,0 +1,2 @@ +const IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); +export const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]")); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isSet.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isSet.js new file mode 100644 index 0000000000..83ccc7a56b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isSet.js @@ -0,0 +1 @@ +export const isSet = (value) => value != null; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isValidHostLabel.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isValidHostLabel.js new file mode 100644 index 0000000000..785859867c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isValidHostLabel.js @@ -0,0 +1,13 @@ +const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); +export const isValidHostLabel = (value, allowSubDomains = false) => { + if (!allowSubDomains) { + return VALID_HOST_LABEL_REGEX.test(value); + } + const labels = value.split("."); + for (const label of labels) { + if (!isValidHostLabel(label)) { + return false; + } + } + return true; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/not.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/not.js new file mode 100644 index 0000000000..180e5dd3ae --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/not.js @@ -0,0 +1 @@ +export const not = (value) => !value; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/parseURL.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/parseURL.js new file mode 100644 index 0000000000..f8f3f08c6c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/parseURL.js @@ -0,0 +1,51 @@ +import { EndpointURLScheme } from "@aws-sdk/types"; +import { isIpAddress } from "./isIpAddress"; +const DEFAULT_PORTS = { + [EndpointURLScheme.HTTP]: 80, + [EndpointURLScheme.HTTPS]: 443, +}; +export const parseURL = (value) => { + const whatwgURL = (() => { + try { + if (value instanceof URL) { + return value; + } + if (typeof value === "object" && "hostname" in value) { + const { hostname, port, protocol = "", path = "", query = {} } = value; + const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : ""}${path}`); + url.search = Object.entries(query) + .map(([k, v]) => `${k}=${v}`) + .join("&"); + return url; + } + return new URL(value); + } + catch (error) { + return null; + } + })(); + if (!whatwgURL) { + console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); + return null; + } + const urlString = whatwgURL.href; + const { host, hostname, pathname, protocol, search } = whatwgURL; + if (search) { + return null; + } + const scheme = protocol.slice(0, -1); + if (!Object.values(EndpointURLScheme).includes(scheme)) { + return null; + } + const isIp = isIpAddress(hostname); + const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || + (typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`)); + const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; + return { + scheme, + authority, + path: pathname, + normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, + isIp, + }; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/stringEquals.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/stringEquals.js new file mode 100644 index 0000000000..ee414269de --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/stringEquals.js @@ -0,0 +1 @@ +export const stringEquals = (value1, value2) => value1 === value2; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/substring.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/substring.js new file mode 100644 index 0000000000..942dde4d18 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/substring.js @@ -0,0 +1,9 @@ +export const substring = (input, start, stop, reverse) => { + if (start >= stop || input.length < stop) { + return null; + } + if (!reverse) { + return input.substring(start, stop); + } + return input.substring(input.length - stop, input.length - start); +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/uriEncode.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/uriEncode.js new file mode 100644 index 0000000000..ae226dc7ab --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/lib/uriEncode.js @@ -0,0 +1 @@ +export const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js new file mode 100644 index 0000000000..85ea18b863 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js @@ -0,0 +1,37 @@ +import { debugId, toDebugString } from "./debug"; +import { EndpointError } from "./types"; +import { evaluateRules } from "./utils"; +export const resolveEndpoint = (ruleSetObject, options) => { + const { endpointParams, logger } = options; + const { parameters, rules } = ruleSetObject; + options.logger?.debug?.(debugId, `Initial EndpointParams: ${toDebugString(endpointParams)}`); + const paramsWithDefault = Object.entries(parameters) + .filter(([, v]) => v.default != null) + .map(([k, v]) => [k, v.default]); + if (paramsWithDefault.length > 0) { + for (const [paramKey, paramDefaultValue] of paramsWithDefault) { + endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue; + } + } + const requiredParams = Object.entries(parameters) + .filter(([, v]) => v.required) + .map(([k]) => k); + for (const requiredParam of requiredParams) { + if (endpointParams[requiredParam] == null) { + throw new EndpointError(`Missing required parameter: '${requiredParam}'`); + } + } + const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} }); + if (options.endpointParams?.Endpoint) { + try { + const givenEndpoint = new URL(options.endpointParams.Endpoint); + const { protocol, port } = givenEndpoint; + endpoint.url.protocol = protocol; + endpoint.url.port = port; + } + catch (e) { + } + } + options.logger?.debug?.(debugId, `Resolved endpoint: ${toDebugString(endpoint)}`); + return endpoint; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js new file mode 100644 index 0000000000..1ce597d7ee --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js @@ -0,0 +1,6 @@ +export class EndpointError extends Error { + constructor(message) { + super(message); + this.name = "EndpointError"; + } +} diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js new file mode 100644 index 0000000000..daba501982 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js @@ -0,0 +1,6 @@ +export * from "./EndpointError"; +export * from "./EndpointRuleObject"; +export * from "./ErrorRuleObject"; +export * from "./RuleSetObject"; +export * from "./TreeRuleObject"; +export * from "./shared"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/callFunction.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/callFunction.js new file mode 100644 index 0000000000..58da6a22c2 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/callFunction.js @@ -0,0 +1,6 @@ +import * as lib from "../lib"; +import { evaluateExpression } from "./evaluateExpression"; +export const callFunction = ({ fn, argv }, options) => { + const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : evaluateExpression(arg, "arg", options)); + return fn.split(".").reduce((acc, key) => acc[key], lib)(...evaluatedArgs); +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateCondition.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateCondition.js new file mode 100644 index 0000000000..279d0adf5f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateCondition.js @@ -0,0 +1,14 @@ +import { debugId, toDebugString } from "../debug"; +import { EndpointError } from "../types"; +import { callFunction } from "./callFunction"; +export const evaluateCondition = ({ assign, ...fnArgs }, options) => { + if (assign && assign in options.referenceRecord) { + throw new EndpointError(`'${assign}' is already defined in Reference Record.`); + } + const value = callFunction(fnArgs, options); + options.logger?.debug?.(debugId, `evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); + return { + result: value === "" ? true : !!value, + ...(assign != null && { toAssign: { name: assign, value } }), + }; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateConditions.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateConditions.js new file mode 100644 index 0000000000..2890d4a968 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateConditions.js @@ -0,0 +1,22 @@ +import { debugId, toDebugString } from "../debug"; +import { evaluateCondition } from "./evaluateCondition"; +export const evaluateConditions = (conditions = [], options) => { + const conditionsReferenceRecord = {}; + for (const condition of conditions) { + const { result, toAssign } = evaluateCondition(condition, { + ...options, + referenceRecord: { + ...options.referenceRecord, + ...conditionsReferenceRecord, + }, + }); + if (!result) { + return { result }; + } + if (toAssign) { + conditionsReferenceRecord[toAssign.name] = toAssign.value; + options.logger?.debug?.(debugId, `assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); + } + } + return { result: true, referenceRecord: conditionsReferenceRecord }; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateEndpointRule.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateEndpointRule.js new file mode 100644 index 0000000000..56744295ae --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateEndpointRule.js @@ -0,0 +1,27 @@ +import { debugId, toDebugString } from "../debug"; +import { evaluateConditions } from "./evaluateConditions"; +import { getEndpointHeaders } from "./getEndpointHeaders"; +import { getEndpointProperties } from "./getEndpointProperties"; +import { getEndpointUrl } from "./getEndpointUrl"; +export const evaluateEndpointRule = (endpointRule, options) => { + const { conditions, endpoint } = endpointRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; + } + const endpointRuleOptions = { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + }; + const { url, properties, headers } = endpoint; + options.logger?.debug?.(debugId, `Resolving endpoint from template: ${toDebugString(endpoint)}`); + return { + ...(headers != undefined && { + headers: getEndpointHeaders(headers, endpointRuleOptions), + }), + ...(properties != undefined && { + properties: getEndpointProperties(properties, endpointRuleOptions), + }), + url: getEndpointUrl(url, endpointRuleOptions), + }; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateErrorRule.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateErrorRule.js new file mode 100644 index 0000000000..1a578604d9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateErrorRule.js @@ -0,0 +1,14 @@ +import { EndpointError } from "../types"; +import { evaluateConditions } from "./evaluateConditions"; +import { evaluateExpression } from "./evaluateExpression"; +export const evaluateErrorRule = (errorRule, options) => { + const { conditions, error } = errorRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; + } + throw new EndpointError(evaluateExpression(error, "Error", { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + })); +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateExpression.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateExpression.js new file mode 100644 index 0000000000..7f69658e6f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateExpression.js @@ -0,0 +1,16 @@ +import { EndpointError } from "../types"; +import { callFunction } from "./callFunction"; +import { evaluateTemplate } from "./evaluateTemplate"; +import { getReferenceValue } from "./getReferenceValue"; +export const evaluateExpression = (obj, keyName, options) => { + if (typeof obj === "string") { + return evaluateTemplate(obj, options); + } + else if (obj["fn"]) { + return callFunction(obj, options); + } + else if (obj["ref"]) { + return getReferenceValue(obj, options); + } + throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateRules.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateRules.js new file mode 100644 index 0000000000..58a40a08c6 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateRules.js @@ -0,0 +1,27 @@ +import { EndpointError } from "../types"; +import { evaluateEndpointRule } from "./evaluateEndpointRule"; +import { evaluateErrorRule } from "./evaluateErrorRule"; +import { evaluateTreeRule } from "./evaluateTreeRule"; +export const evaluateRules = (rules, options) => { + for (const rule of rules) { + if (rule.type === "endpoint") { + const endpointOrUndefined = evaluateEndpointRule(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } + else if (rule.type === "error") { + evaluateErrorRule(rule, options); + } + else if (rule.type === "tree") { + const endpointOrUndefined = evaluateTreeRule(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } + else { + throw new EndpointError(`Unknown endpoint rule: ${rule}`); + } + } + throw new EndpointError(`Rules evaluation failed`); +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateTemplate.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateTemplate.js new file mode 100644 index 0000000000..7005809157 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateTemplate.js @@ -0,0 +1,36 @@ +import { getAttr } from "../lib"; +export const evaluateTemplate = (template, options) => { + const evaluatedTemplateArr = []; + const templateContext = { + ...options.endpointParams, + ...options.referenceRecord, + }; + let currentIndex = 0; + while (currentIndex < template.length) { + const openingBraceIndex = template.indexOf("{", currentIndex); + if (openingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(currentIndex)); + break; + } + evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); + const closingBraceIndex = template.indexOf("}", openingBraceIndex); + if (closingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(openingBraceIndex)); + break; + } + if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { + evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); + currentIndex = closingBraceIndex + 2; + } + const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); + if (parameterName.includes("#")) { + const [refName, attrName] = parameterName.split("#"); + evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName)); + } + else { + evaluatedTemplateArr.push(templateContext[parameterName]); + } + currentIndex = closingBraceIndex + 1; + } + return evaluatedTemplateArr.join(""); +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateTreeRule.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateTreeRule.js new file mode 100644 index 0000000000..427c1fa91a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/evaluateTreeRule.js @@ -0,0 +1,13 @@ +import { evaluateConditions } from "./evaluateConditions"; +import { evaluateRules } from "./evaluateRules"; +export const evaluateTreeRule = (treeRule, options) => { + const { conditions, rules } = treeRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; + } + return evaluateRules(rules, { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + }); +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointHeaders.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointHeaders.js new file mode 100644 index 0000000000..f94cf55359 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointHeaders.js @@ -0,0 +1,12 @@ +import { EndpointError } from "../types"; +import { evaluateExpression } from "./evaluateExpression"; +export const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ + ...acc, + [headerKey]: headerVal.map((headerValEntry) => { + const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options); + if (typeof processedExpr !== "string") { + throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); + } + return processedExpr; + }), +}), {}); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointProperties.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointProperties.js new file mode 100644 index 0000000000..e7afe888e5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointProperties.js @@ -0,0 +1,5 @@ +import { getEndpointProperty } from "./getEndpointProperty"; +export const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ + ...acc, + [propertyKey]: getEndpointProperty(propertyVal, options), +}), {}); diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointProperty.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointProperty.js new file mode 100644 index 0000000000..0600969958 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointProperty.js @@ -0,0 +1,21 @@ +import { EndpointError } from "../types"; +import { evaluateTemplate } from "./evaluateTemplate"; +import { getEndpointProperties } from "./getEndpointProperties"; +export const getEndpointProperty = (property, options) => { + if (Array.isArray(property)) { + return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options)); + } + switch (typeof property) { + case "string": + return evaluateTemplate(property, options); + case "object": + if (property === null) { + throw new EndpointError(`Unexpected endpoint property: ${property}`); + } + return getEndpointProperties(property, options); + case "boolean": + return property; + default: + throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); + } +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointUrl.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointUrl.js new file mode 100644 index 0000000000..8f1301e259 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getEndpointUrl.js @@ -0,0 +1,15 @@ +import { EndpointError } from "../types"; +import { evaluateExpression } from "./evaluateExpression"; +export const getEndpointUrl = (endpointUrl, options) => { + const expression = evaluateExpression(endpointUrl, "Endpoint URL", options); + if (typeof expression === "string") { + try { + return new URL(expression); + } + catch (error) { + console.error(`Failed to construct URL with ${expression}`, error); + throw error; + } + } + throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getReferenceValue.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getReferenceValue.js new file mode 100644 index 0000000000..759f4d40bf --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/getReferenceValue.js @@ -0,0 +1,7 @@ +export const getReferenceValue = ({ ref }, options) => { + const referenceRecord = { + ...options.endpointParams, + ...options.referenceRecord, + }; + return referenceRecord[ref]; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/index.js b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/index.js new file mode 100644 index 0000000000..37478990d7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-es/utils/index.js @@ -0,0 +1 @@ +export * from "./evaluateRules"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/debugId.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/debugId.d.ts new file mode 100644 index 0000000000..d39f408f0e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/debugId.d.ts @@ -0,0 +1 @@ +export declare const debugId = "endpoints"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/index.d.ts new file mode 100644 index 0000000000..70d3b15c36 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/index.d.ts @@ -0,0 +1,2 @@ +export * from "./debugId"; +export * from "./toDebugString"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/toDebugString.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/toDebugString.d.ts new file mode 100644 index 0000000000..070a165693 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/debug/toDebugString.d.ts @@ -0,0 +1,9 @@ +import { EndpointParameters, EndpointV2 } from "@aws-sdk/types"; +import { GetAttrValue } from "../lib"; +import { EndpointObject, FunctionObject, FunctionReturn } from "../types"; +export declare function toDebugString(input: EndpointParameters): string; +export declare function toDebugString(input: EndpointV2): string; +export declare function toDebugString(input: GetAttrValue): string; +export declare function toDebugString(input: FunctionObject): string; +export declare function toDebugString(input: FunctionReturn): string; +export declare function toDebugString(input: EndpointObject): string; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts new file mode 100644 index 0000000000..17868ec89b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts @@ -0,0 +1,3 @@ +export * from "./lib/aws/partition"; +export * from "./resolveEndpoint"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/index.d.ts new file mode 100644 index 0000000000..03be049d13 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/index.d.ts @@ -0,0 +1,3 @@ +export * from "./isVirtualHostableS3Bucket"; +export * from "./parseArn"; +export * from "./partition"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/isVirtualHostableS3Bucket.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/isVirtualHostableS3Bucket.d.ts new file mode 100644 index 0000000000..25d46e4ba3 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/isVirtualHostableS3Bucket.d.ts @@ -0,0 +1,5 @@ +/** + * Evaluates whether a string is a DNS compatible bucket name and can be used with + * virtual hosted style addressing. + */ +export declare const isVirtualHostableS3Bucket: (value: string, allowSubDomains?: boolean) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/parseArn.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/parseArn.d.ts new file mode 100644 index 0000000000..9acfcea372 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/parseArn.d.ts @@ -0,0 +1,7 @@ +import { EndpointARN } from "@aws-sdk/types"; +/** + * Evaluates a single string argument value, and returns an object containing + * details about the parsed ARN. + * If the input was not a valid ARN, the function returns null. + */ +export declare const parseArn: (value: string) => EndpointARN | null; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/partition.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/partition.d.ts new file mode 100644 index 0000000000..5341d36af7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/partition.d.ts @@ -0,0 +1,8 @@ +import { EndpointPartition } from "@aws-sdk/types"; +/** + * Evaluates a single string argument value as a region, and matches the + * string value to an AWS partition. + * The matcher MUST always return a successful object describing the partition + * that the region has been determined to be a part of. + */ +export declare const partition: (value: string) => EndpointPartition; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/booleanEquals.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/booleanEquals.d.ts new file mode 100644 index 0000000000..7eac5613ca --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/booleanEquals.d.ts @@ -0,0 +1,5 @@ +/** + * Evaluates two boolean values value1 and value2 for equality and returns + * true if both values match. + */ +export declare const booleanEquals: (value1: boolean, value2: boolean) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/getAttr.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/getAttr.d.ts new file mode 100644 index 0000000000..9105e97608 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/getAttr.d.ts @@ -0,0 +1,7 @@ +export declare type GetAttrValue = string | boolean | { + [key: string]: GetAttrValue; +} | Array; +/** + * Returns value corresponding to pathing string for an array or object. + */ +export declare const getAttr: (value: GetAttrValue, path: string) => GetAttrValue; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/getAttrPathList.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/getAttrPathList.d.ts new file mode 100644 index 0000000000..e6c497971e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/getAttrPathList.d.ts @@ -0,0 +1,4 @@ +/** + * Parses path as a getAttr expression, returning a list of strings. + */ +export declare const getAttrPathList: (path: string) => Array; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/index.d.ts new file mode 100644 index 0000000000..b05a4031ea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/index.d.ts @@ -0,0 +1,10 @@ +export * as aws from "./aws"; +export * from "./booleanEquals"; +export * from "./getAttr"; +export * from "./isSet"; +export * from "./isValidHostLabel"; +export * from "./not"; +export * from "./parseURL"; +export * from "./stringEquals"; +export * from "./substring"; +export * from "./uriEncode"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isIpAddress.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isIpAddress.d.ts new file mode 100644 index 0000000000..28aba976a2 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isIpAddress.d.ts @@ -0,0 +1,4 @@ +/** + * Validates if the provided value is an IP address. + */ +export declare const isIpAddress: (value: string) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isSet.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isSet.d.ts new file mode 100644 index 0000000000..7c74ec5359 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isSet.d.ts @@ -0,0 +1,5 @@ +/** + * Evaluates whether a value is set (aka not null or undefined). + * Returns true if the value is set, otherwise returns false. + */ +export declare const isSet: (value: unknown) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isValidHostLabel.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isValidHostLabel.d.ts new file mode 100644 index 0000000000..c05f9e9821 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isValidHostLabel.d.ts @@ -0,0 +1,7 @@ +/** + * Evaluates whether one or more string values are valid host labels per RFC 1123. + * + * If allowSubDomains is true, then the provided value may be zero or more dotted + * subdomains which are each validated per RFC 1123. + */ +export declare const isValidHostLabel: (value: string, allowSubDomains?: boolean) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/not.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/not.d.ts new file mode 100644 index 0000000000..1e8e728410 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/not.d.ts @@ -0,0 +1,5 @@ +/** + * Performs logical negation on the provided boolean value, + * returning the negated value. + */ +export declare const not: (value: boolean) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/parseURL.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/parseURL.d.ts new file mode 100644 index 0000000000..a1e0f257b4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/parseURL.d.ts @@ -0,0 +1,5 @@ +import { Endpoint, EndpointURL } from "@aws-sdk/types"; +/** + * Parses a string, URL, or Endpoint into it’s Endpoint URL components. + */ +export declare const parseURL: (value: string | URL | Endpoint) => EndpointURL | null; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/stringEquals.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/stringEquals.d.ts new file mode 100644 index 0000000000..bdfc98de01 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/stringEquals.d.ts @@ -0,0 +1,5 @@ +/** + * Evaluates two string values value1 and value2 for equality and returns + * true if both values match. + */ +export declare const stringEquals: (value1: string, value2: string) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/substring.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/substring.d.ts new file mode 100644 index 0000000000..5d7003555f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/substring.d.ts @@ -0,0 +1,7 @@ +/** + * Computes the substring of a given string, conditionally indexing from the end of the string. + * When the string is long enough to fully include the substring, return the substring. + * Otherwise, return None. The start index is inclusive and the stop index is exclusive. + * The length of the returned string will always be stop-start. + */ +export declare const substring: (input: string, start: number, stop: number, reverse: boolean) => string | null; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/uriEncode.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/uriEncode.d.ts new file mode 100644 index 0000000000..c2a720c79d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/lib/uriEncode.d.ts @@ -0,0 +1,4 @@ +/** + * Performs percent-encoding per RFC3986 section 2.1 + */ +export declare const uriEncode: (value: string) => string; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/resolveEndpoint.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/resolveEndpoint.d.ts new file mode 100644 index 0000000000..deb79ddf73 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/resolveEndpoint.d.ts @@ -0,0 +1,6 @@ +import { EndpointV2 } from "@aws-sdk/types"; +import { EndpointResolverOptions, RuleSetObject } from "./types"; +/** + * Resolves an endpoint URL by processing the endpoints ruleset and options. + */ +export declare const resolveEndpoint: (ruleSetObject: RuleSetObject, options: EndpointResolverOptions) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/debugId.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/debugId.d.ts new file mode 100644 index 0000000000..d39f408f0e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/debugId.d.ts @@ -0,0 +1 @@ +export declare const debugId = "endpoints"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/index.d.ts new file mode 100644 index 0000000000..70d3b15c36 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/index.d.ts @@ -0,0 +1,2 @@ +export * from "./debugId"; +export * from "./toDebugString"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/toDebugString.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/toDebugString.d.ts new file mode 100644 index 0000000000..070a165693 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/debug/toDebugString.d.ts @@ -0,0 +1,9 @@ +import { EndpointParameters, EndpointV2 } from "@aws-sdk/types"; +import { GetAttrValue } from "../lib"; +import { EndpointObject, FunctionObject, FunctionReturn } from "../types"; +export declare function toDebugString(input: EndpointParameters): string; +export declare function toDebugString(input: EndpointV2): string; +export declare function toDebugString(input: GetAttrValue): string; +export declare function toDebugString(input: FunctionObject): string; +export declare function toDebugString(input: FunctionReturn): string; +export declare function toDebugString(input: EndpointObject): string; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..17868ec89b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts @@ -0,0 +1,3 @@ +export * from "./lib/aws/partition"; +export * from "./resolveEndpoint"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/index.d.ts new file mode 100644 index 0000000000..03be049d13 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/index.d.ts @@ -0,0 +1,3 @@ +export * from "./isVirtualHostableS3Bucket"; +export * from "./parseArn"; +export * from "./partition"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/isVirtualHostableS3Bucket.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/isVirtualHostableS3Bucket.d.ts new file mode 100644 index 0000000000..5ef329636d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/isVirtualHostableS3Bucket.d.ts @@ -0,0 +1,4 @@ +export declare const isVirtualHostableS3Bucket: ( + value: string, + allowSubDomains?: boolean +) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/parseArn.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/parseArn.d.ts new file mode 100644 index 0000000000..27505990ae --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/parseArn.d.ts @@ -0,0 +1,2 @@ +import { EndpointARN } from "@aws-sdk/types"; +export declare const parseArn: (value: string) => EndpointARN | null; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/partition.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/partition.d.ts new file mode 100644 index 0000000000..96a860da0a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/partition.d.ts @@ -0,0 +1,2 @@ +import { EndpointPartition } from "@aws-sdk/types"; +export declare const partition: (value: string) => EndpointPartition; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/booleanEquals.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/booleanEquals.d.ts new file mode 100644 index 0000000000..205f587a37 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/booleanEquals.d.ts @@ -0,0 +1,4 @@ +export declare const booleanEquals: ( + value1: boolean, + value2: boolean +) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/getAttr.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/getAttr.d.ts new file mode 100644 index 0000000000..b16cd101fe --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/getAttr.d.ts @@ -0,0 +1,11 @@ +export declare type GetAttrValue = + | string + | boolean + | { + [key: string]: GetAttrValue; + } + | Array; +export declare const getAttr: ( + value: GetAttrValue, + path: string +) => GetAttrValue; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/getAttrPathList.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/getAttrPathList.d.ts new file mode 100644 index 0000000000..62f70d3aff --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/getAttrPathList.d.ts @@ -0,0 +1 @@ +export declare const getAttrPathList: (path: string) => Array; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/index.d.ts new file mode 100644 index 0000000000..24948e49be --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/index.d.ts @@ -0,0 +1,11 @@ +import * as aws_1 from "./aws"; +export { aws_1 as aws }; +export * from "./booleanEquals"; +export * from "./getAttr"; +export * from "./isSet"; +export * from "./isValidHostLabel"; +export * from "./not"; +export * from "./parseURL"; +export * from "./stringEquals"; +export * from "./substring"; +export * from "./uriEncode"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isIpAddress.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isIpAddress.d.ts new file mode 100644 index 0000000000..9f7ce398eb --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isIpAddress.d.ts @@ -0,0 +1 @@ +export declare const isIpAddress: (value: string) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isSet.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isSet.d.ts new file mode 100644 index 0000000000..ae5515165a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isSet.d.ts @@ -0,0 +1 @@ +export declare const isSet: (value: unknown) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isValidHostLabel.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isValidHostLabel.d.ts new file mode 100644 index 0000000000..9f6355462b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isValidHostLabel.d.ts @@ -0,0 +1,4 @@ +export declare const isValidHostLabel: ( + value: string, + allowSubDomains?: boolean +) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/not.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/not.d.ts new file mode 100644 index 0000000000..37fbc7e185 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/not.d.ts @@ -0,0 +1 @@ +export declare const not: (value: boolean) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/parseURL.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/parseURL.d.ts new file mode 100644 index 0000000000..81c4409c22 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/parseURL.d.ts @@ -0,0 +1,4 @@ +import { Endpoint, EndpointURL } from "@aws-sdk/types"; +export declare const parseURL: ( + value: string | URL | Endpoint +) => EndpointURL | null; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/stringEquals.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/stringEquals.d.ts new file mode 100644 index 0000000000..9e4d4e5861 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/stringEquals.d.ts @@ -0,0 +1 @@ +export declare const stringEquals: (value1: string, value2: string) => boolean; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/substring.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/substring.d.ts new file mode 100644 index 0000000000..ae190c7ac3 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/substring.d.ts @@ -0,0 +1,6 @@ +export declare const substring: ( + input: string, + start: number, + stop: number, + reverse: boolean +) => string | null; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/uriEncode.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/uriEncode.d.ts new file mode 100644 index 0000000000..940f2f7032 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/uriEncode.d.ts @@ -0,0 +1 @@ +export declare const uriEncode: (value: string) => string; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/resolveEndpoint.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/resolveEndpoint.d.ts new file mode 100644 index 0000000000..dcd8dcffbf --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/resolveEndpoint.d.ts @@ -0,0 +1,6 @@ +import { EndpointV2 } from "@aws-sdk/types"; +import { EndpointResolverOptions, RuleSetObject } from "./types"; +export declare const resolveEndpoint: ( + ruleSetObject: RuleSetObject, + options: EndpointResolverOptions +) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointError.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointError.d.ts new file mode 100644 index 0000000000..7e17c6853a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointError.d.ts @@ -0,0 +1,3 @@ +export declare class EndpointError extends Error { + constructor(message: string); +} diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointRuleObject.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointRuleObject.d.ts new file mode 100644 index 0000000000..9d85056dad --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointRuleObject.d.ts @@ -0,0 +1,18 @@ +import { EndpointObjectProperty } from "@aws-sdk/types"; +import { ConditionObject, Expression } from "./shared"; +export declare type EndpointObjectProperties = Record< + string, + EndpointObjectProperty +>; +export declare type EndpointObjectHeaders = Record; +export declare type EndpointObject = { + url: Expression; + properties?: EndpointObjectProperties; + headers?: EndpointObjectHeaders; +}; +export declare type EndpointRuleObject = { + type: "endpoint"; + conditions?: ConditionObject[]; + endpoint: EndpointObject; + documentation?: string; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/ErrorRuleObject.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/ErrorRuleObject.d.ts new file mode 100644 index 0000000000..64a26d978c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/ErrorRuleObject.d.ts @@ -0,0 +1,7 @@ +import { ConditionObject, Expression } from "./shared"; +export declare type ErrorRuleObject = { + type: "error"; + conditions?: ConditionObject[]; + error: Expression; + documentation?: string; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/RuleSetObject.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/RuleSetObject.d.ts new file mode 100644 index 0000000000..c4297afa63 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/RuleSetObject.d.ts @@ -0,0 +1,19 @@ +import { RuleSetRules } from "./TreeRuleObject"; +export declare type DeprecatedObject = { + message?: string; + since?: string; +}; +export declare type ParameterObject = { + type: "String" | "Boolean"; + default?: string | boolean; + required?: boolean; + documentation?: string; + builtIn?: string; + deprecated?: DeprecatedObject; +}; +export declare type RuleSetObject = { + version: string; + serviceId?: string; + parameters: Record; + rules: RuleSetRules; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/TreeRuleObject.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/TreeRuleObject.d.ts new file mode 100644 index 0000000000..1c7c9a6dfa --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/TreeRuleObject.d.ts @@ -0,0 +1,12 @@ +import { EndpointRuleObject } from "./EndpointRuleObject"; +import { ErrorRuleObject } from "./ErrorRuleObject"; +import { ConditionObject } from "./shared"; +export declare type RuleSetRules = Array< + EndpointRuleObject | ErrorRuleObject | TreeRuleObject +>; +export declare type TreeRuleObject = { + type: "tree"; + conditions?: ConditionObject[]; + rules: RuleSetRules; + documentation?: string; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/index.d.ts new file mode 100644 index 0000000000..daba501982 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/index.d.ts @@ -0,0 +1,6 @@ +export * from "./EndpointError"; +export * from "./EndpointRuleObject"; +export * from "./ErrorRuleObject"; +export * from "./RuleSetObject"; +export * from "./TreeRuleObject"; +export * from "./shared"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/shared.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/shared.d.ts new file mode 100644 index 0000000000..d3463e7c8f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/shared.d.ts @@ -0,0 +1,29 @@ +import { Logger } from "@aws-sdk/types"; +export declare type ReferenceObject = { + ref: string; +}; +export declare type FunctionObject = { + fn: string; + argv: FunctionArgv; +}; +export declare type FunctionArgv = Array; +export declare type FunctionReturn = + | string + | boolean + | number + | { + [key: string]: FunctionReturn; + }; +export declare type ConditionObject = FunctionObject & { + assign?: string; +}; +export declare type Expression = string | ReferenceObject | FunctionObject; +export declare type EndpointParams = Record; +export declare type EndpointResolverOptions = { + endpointParams: EndpointParams; + logger?: Logger; +}; +export declare type ReferenceRecord = Record; +export declare type EvaluateOptions = EndpointResolverOptions & { + referenceRecord: ReferenceRecord; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/callFunction.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/callFunction.d.ts new file mode 100644 index 0000000000..18d56d3497 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/callFunction.d.ts @@ -0,0 +1,5 @@ +import { EvaluateOptions, FunctionObject, FunctionReturn } from "../types"; +export declare const callFunction: ( + { fn, argv }: FunctionObject, + options: EvaluateOptions +) => FunctionReturn; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateCondition.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateCondition.d.ts new file mode 100644 index 0000000000..d4ebdcd0ba --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateCondition.d.ts @@ -0,0 +1,13 @@ +import { ConditionObject, EvaluateOptions } from "../types"; +export declare const evaluateCondition: ( + { assign, ...fnArgs }: ConditionObject, + options: EvaluateOptions +) => { + toAssign?: + | { + name: string; + value: import("../types").FunctionReturn; + } + | undefined; + result: boolean; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateConditions.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateConditions.d.ts new file mode 100644 index 0000000000..2f72a06e72 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateConditions.d.ts @@ -0,0 +1,13 @@ +import { ConditionObject, EvaluateOptions, FunctionReturn } from "../types"; +export declare const evaluateConditions: ( + conditions: ConditionObject[] | undefined, + options: EvaluateOptions +) => + | { + result: false; + referenceRecord?: undefined; + } + | { + result: boolean; + referenceRecord: Record; + }; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateEndpointRule.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateEndpointRule.d.ts new file mode 100644 index 0000000000..f15aa38d2d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateEndpointRule.d.ts @@ -0,0 +1,6 @@ +import { EndpointV2 } from "@aws-sdk/types"; +import { EndpointRuleObject, EvaluateOptions } from "../types"; +export declare const evaluateEndpointRule: ( + endpointRule: EndpointRuleObject, + options: EvaluateOptions +) => EndpointV2 | undefined; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateErrorRule.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateErrorRule.d.ts new file mode 100644 index 0000000000..4640379e88 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateErrorRule.d.ts @@ -0,0 +1,5 @@ +import { ErrorRuleObject, EvaluateOptions } from "../types"; +export declare const evaluateErrorRule: ( + errorRule: ErrorRuleObject, + options: EvaluateOptions +) => void; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateExpression.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateExpression.d.ts new file mode 100644 index 0000000000..a7f930a0f1 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateExpression.d.ts @@ -0,0 +1,6 @@ +import { EvaluateOptions, Expression } from "../types"; +export declare const evaluateExpression: ( + obj: Expression, + keyName: string, + options: EvaluateOptions +) => import("../types").FunctionReturn; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateRules.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateRules.d.ts new file mode 100644 index 0000000000..8fa5cba0ba --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateRules.d.ts @@ -0,0 +1,6 @@ +import { EndpointV2 } from "@aws-sdk/types"; +import { EvaluateOptions, RuleSetRules } from "../types"; +export declare const evaluateRules: ( + rules: RuleSetRules, + options: EvaluateOptions +) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateTemplate.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateTemplate.d.ts new file mode 100644 index 0000000000..b89d042885 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateTemplate.d.ts @@ -0,0 +1,5 @@ +import { EvaluateOptions } from "../types"; +export declare const evaluateTemplate: ( + template: string, + options: EvaluateOptions +) => string; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateTreeRule.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateTreeRule.d.ts new file mode 100644 index 0000000000..463d14896c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/evaluateTreeRule.d.ts @@ -0,0 +1,6 @@ +import { EndpointV2 } from "@aws-sdk/types"; +import { EvaluateOptions, TreeRuleObject } from "../types"; +export declare const evaluateTreeRule: ( + treeRule: TreeRuleObject, + options: EvaluateOptions +) => EndpointV2 | undefined; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointHeaders.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointHeaders.d.ts new file mode 100644 index 0000000000..ad2a004ce1 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointHeaders.d.ts @@ -0,0 +1,5 @@ +import { EndpointObjectHeaders, EvaluateOptions } from "../types"; +export declare const getEndpointHeaders: ( + headers: EndpointObjectHeaders, + options: EvaluateOptions +) => {}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointProperties.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointProperties.d.ts new file mode 100644 index 0000000000..26a9d0b414 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointProperties.d.ts @@ -0,0 +1,5 @@ +import { EndpointObjectProperties, EvaluateOptions } from "../types"; +export declare const getEndpointProperties: ( + properties: EndpointObjectProperties, + options: EvaluateOptions +) => {}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointProperty.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointProperty.d.ts new file mode 100644 index 0000000000..9d48439987 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointProperty.d.ts @@ -0,0 +1,6 @@ +import { EndpointObjectProperty } from "@aws-sdk/types"; +import { EvaluateOptions } from "../types"; +export declare const getEndpointProperty: ( + property: EndpointObjectProperty, + options: EvaluateOptions +) => EndpointObjectProperty; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointUrl.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointUrl.d.ts new file mode 100644 index 0000000000..2d668c09ef --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getEndpointUrl.d.ts @@ -0,0 +1,5 @@ +import { EvaluateOptions, Expression } from "../types"; +export declare const getEndpointUrl: ( + endpointUrl: Expression, + options: EvaluateOptions +) => URL; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getReferenceValue.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getReferenceValue.d.ts new file mode 100644 index 0000000000..098e2574f4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/getReferenceValue.d.ts @@ -0,0 +1,5 @@ +import { EvaluateOptions, ReferenceObject } from "../types"; +export declare const getReferenceValue: ( + { ref }: ReferenceObject, + options: EvaluateOptions +) => import("../types").FunctionReturn; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/index.d.ts new file mode 100644 index 0000000000..37478990d7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/utils/index.d.ts @@ -0,0 +1 @@ +export * from "./evaluateRules"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointError.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointError.d.ts new file mode 100644 index 0000000000..89132f216a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointError.d.ts @@ -0,0 +1,3 @@ +export declare class EndpointError extends Error { + constructor(message: string); +} diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointRuleObject.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointRuleObject.d.ts new file mode 100644 index 0000000000..17c1b0078d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointRuleObject.d.ts @@ -0,0 +1,15 @@ +import { EndpointObjectProperty } from "@aws-sdk/types"; +import { ConditionObject, Expression } from "./shared"; +export declare type EndpointObjectProperties = Record; +export declare type EndpointObjectHeaders = Record; +export declare type EndpointObject = { + url: Expression; + properties?: EndpointObjectProperties; + headers?: EndpointObjectHeaders; +}; +export declare type EndpointRuleObject = { + type: "endpoint"; + conditions?: ConditionObject[]; + endpoint: EndpointObject; + documentation?: string; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/ErrorRuleObject.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/ErrorRuleObject.d.ts new file mode 100644 index 0000000000..f6e6458895 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/ErrorRuleObject.d.ts @@ -0,0 +1,7 @@ +import { ConditionObject, Expression } from "./shared"; +export declare type ErrorRuleObject = { + type: "error"; + conditions?: ConditionObject[]; + error: Expression; + documentation?: string; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/RuleSetObject.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/RuleSetObject.d.ts new file mode 100644 index 0000000000..e7197c9c05 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/RuleSetObject.d.ts @@ -0,0 +1,19 @@ +import { RuleSetRules } from "./TreeRuleObject"; +export declare type DeprecatedObject = { + message?: string; + since?: string; +}; +export declare type ParameterObject = { + type: "String" | "Boolean"; + default?: string | boolean; + required?: boolean; + documentation?: string; + builtIn?: string; + deprecated?: DeprecatedObject; +}; +export declare type RuleSetObject = { + version: string; + serviceId?: string; + parameters: Record; + rules: RuleSetRules; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/TreeRuleObject.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/TreeRuleObject.d.ts new file mode 100644 index 0000000000..0bbbc857ba --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/TreeRuleObject.d.ts @@ -0,0 +1,10 @@ +import { EndpointRuleObject } from "./EndpointRuleObject"; +import { ErrorRuleObject } from "./ErrorRuleObject"; +import { ConditionObject } from "./shared"; +export declare type RuleSetRules = Array; +export declare type TreeRuleObject = { + type: "tree"; + conditions?: ConditionObject[]; + rules: RuleSetRules; + documentation?: string; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/index.d.ts new file mode 100644 index 0000000000..daba501982 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/index.d.ts @@ -0,0 +1,6 @@ +export * from "./EndpointError"; +export * from "./EndpointRuleObject"; +export * from "./ErrorRuleObject"; +export * from "./RuleSetObject"; +export * from "./TreeRuleObject"; +export * from "./shared"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/shared.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/shared.d.ts new file mode 100644 index 0000000000..edf64f17da --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/types/shared.d.ts @@ -0,0 +1,25 @@ +import { Logger } from "@aws-sdk/types"; +export declare type ReferenceObject = { + ref: string; +}; +export declare type FunctionObject = { + fn: string; + argv: FunctionArgv; +}; +export declare type FunctionArgv = Array; +export declare type FunctionReturn = string | boolean | number | { + [key: string]: FunctionReturn; +}; +export declare type ConditionObject = FunctionObject & { + assign?: string; +}; +export declare type Expression = string | ReferenceObject | FunctionObject; +export declare type EndpointParams = Record; +export declare type EndpointResolverOptions = { + endpointParams: EndpointParams; + logger?: Logger; +}; +export declare type ReferenceRecord = Record; +export declare type EvaluateOptions = EndpointResolverOptions & { + referenceRecord: ReferenceRecord; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/callFunction.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/callFunction.d.ts new file mode 100644 index 0000000000..729a206b46 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/callFunction.d.ts @@ -0,0 +1,2 @@ +import { EvaluateOptions, FunctionObject, FunctionReturn } from "../types"; +export declare const callFunction: ({ fn, argv }: FunctionObject, options: EvaluateOptions) => FunctionReturn; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateCondition.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateCondition.d.ts new file mode 100644 index 0000000000..5fbe59f565 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateCondition.d.ts @@ -0,0 +1,8 @@ +import { ConditionObject, EvaluateOptions } from "../types"; +export declare const evaluateCondition: ({ assign, ...fnArgs }: ConditionObject, options: EvaluateOptions) => { + toAssign?: { + name: string; + value: import("../types").FunctionReturn; + } | undefined; + result: boolean; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateConditions.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateConditions.d.ts new file mode 100644 index 0000000000..4131beba69 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateConditions.d.ts @@ -0,0 +1,8 @@ +import { ConditionObject, EvaluateOptions, FunctionReturn } from "../types"; +export declare const evaluateConditions: (conditions: ConditionObject[] | undefined, options: EvaluateOptions) => { + result: false; + referenceRecord?: undefined; +} | { + result: boolean; + referenceRecord: Record; +}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateEndpointRule.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateEndpointRule.d.ts new file mode 100644 index 0000000000..9367f0ac08 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateEndpointRule.d.ts @@ -0,0 +1,3 @@ +import { EndpointV2 } from "@aws-sdk/types"; +import { EndpointRuleObject, EvaluateOptions } from "../types"; +export declare const evaluateEndpointRule: (endpointRule: EndpointRuleObject, options: EvaluateOptions) => EndpointV2 | undefined; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateErrorRule.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateErrorRule.d.ts new file mode 100644 index 0000000000..df4973da07 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateErrorRule.d.ts @@ -0,0 +1,2 @@ +import { ErrorRuleObject, EvaluateOptions } from "../types"; +export declare const evaluateErrorRule: (errorRule: ErrorRuleObject, options: EvaluateOptions) => void; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateExpression.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateExpression.d.ts new file mode 100644 index 0000000000..25419605fe --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateExpression.d.ts @@ -0,0 +1,2 @@ +import { EvaluateOptions, Expression } from "../types"; +export declare const evaluateExpression: (obj: Expression, keyName: string, options: EvaluateOptions) => import("../types").FunctionReturn; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateRules.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateRules.d.ts new file mode 100644 index 0000000000..b430adc3f0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateRules.d.ts @@ -0,0 +1,3 @@ +import { EndpointV2 } from "@aws-sdk/types"; +import { EvaluateOptions, RuleSetRules } from "../types"; +export declare const evaluateRules: (rules: RuleSetRules, options: EvaluateOptions) => EndpointV2; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateTemplate.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateTemplate.d.ts new file mode 100644 index 0000000000..9b0b9ad504 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateTemplate.d.ts @@ -0,0 +1,2 @@ +import { EvaluateOptions } from "../types"; +export declare const evaluateTemplate: (template: string, options: EvaluateOptions) => string; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateTreeRule.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateTreeRule.d.ts new file mode 100644 index 0000000000..64bf8d7290 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/evaluateTreeRule.d.ts @@ -0,0 +1,3 @@ +import { EndpointV2 } from "@aws-sdk/types"; +import { EvaluateOptions, TreeRuleObject } from "../types"; +export declare const evaluateTreeRule: (treeRule: TreeRuleObject, options: EvaluateOptions) => EndpointV2 | undefined; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointHeaders.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointHeaders.d.ts new file mode 100644 index 0000000000..a80256578b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointHeaders.d.ts @@ -0,0 +1,2 @@ +import { EndpointObjectHeaders, EvaluateOptions } from "../types"; +export declare const getEndpointHeaders: (headers: EndpointObjectHeaders, options: EvaluateOptions) => {}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointProperties.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointProperties.d.ts new file mode 100644 index 0000000000..9c83bb0cf9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointProperties.d.ts @@ -0,0 +1,2 @@ +import { EndpointObjectProperties, EvaluateOptions } from "../types"; +export declare const getEndpointProperties: (properties: EndpointObjectProperties, options: EvaluateOptions) => {}; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointProperty.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointProperty.d.ts new file mode 100644 index 0000000000..b338f48dbe --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointProperty.d.ts @@ -0,0 +1,3 @@ +import { EndpointObjectProperty } from "@aws-sdk/types"; +import { EvaluateOptions } from "../types"; +export declare const getEndpointProperty: (property: EndpointObjectProperty, options: EvaluateOptions) => EndpointObjectProperty; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointUrl.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointUrl.d.ts new file mode 100644 index 0000000000..4ab228956e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getEndpointUrl.d.ts @@ -0,0 +1,2 @@ +import { EvaluateOptions, Expression } from "../types"; +export declare const getEndpointUrl: (endpointUrl: Expression, options: EvaluateOptions) => URL; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getReferenceValue.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getReferenceValue.d.ts new file mode 100644 index 0000000000..3699ec1d53 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/getReferenceValue.d.ts @@ -0,0 +1,2 @@ +import { EvaluateOptions, ReferenceObject } from "../types"; +export declare const getReferenceValue: ({ ref }: ReferenceObject, options: EvaluateOptions) => import("../types").FunctionReturn; diff --git a/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/index.d.ts b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/index.d.ts new file mode 100644 index 0000000000..37478990d7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/dist-types/utils/index.d.ts @@ -0,0 +1 @@ +export * from "./evaluateRules"; diff --git a/server/node_modules/@aws-sdk/util-endpoints/package.json b/server/node_modules/@aws-sdk/util-endpoints/package.json new file mode 100644 index 0000000000..794105e24e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-endpoints/package.json @@ -0,0 +1,54 @@ +{ + "name": "@aws-sdk/util-endpoints", + "version": "3.257.0", + "description": "Utilities to help with endpoint resolution", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-endpoints", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-endpoints" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/util-hex-encoding/CHANGELOG.md b/server/node_modules/@aws-sdk/util-hex-encoding/CHANGELOG.md new file mode 100644 index 0000000000..a0725990e9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-hex-encoding/CHANGELOG.md @@ -0,0 +1,676 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.201.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.200.0...v3.201.0) (2022-11-01) + + +### Features + +* end support for Node.js 12.x ([#4123](https://github.com/aws/aws-sdk-js-v3/issues/4123)) ([83f913e](https://github.com/aws/aws-sdk-js-v3/commit/83f913ec2ac3878d8726c6964f585550dc5caf3e)) + + + + + +# [3.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.170.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.169.0...v3.170.0) (2022-09-13) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.168.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.167.0...v3.168.0) (2022-09-09) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.109.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.108.1...v3.109.0) (2022-06-13) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.58.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.57.0...v3.58.0) (2022-03-28) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.52.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.51.0...v3.52.0) (2022-02-18) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.49.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.48.0...v3.49.0) (2022-01-29) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +## [3.47.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.47.0-release-test-1...v3.47.1) (2022-01-20) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.47.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.46.0...v3.47.0) (2022-01-15) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.46.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.45.0...v3.46.0) (2022-01-07) + + +### Features + +* **packages:** end support for Node.js 10.x ([#3141](https://github.com/aws/aws-sdk-js-v3/issues/3141)) ([1a62865](https://github.com/aws/aws-sdk-js-v3/commit/1a6286513f7cdb556708845c512861c5f92eb883)) + + + + + +# [3.37.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.36.1...v3.37.0) (2021-10-15) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.36.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.35.0...v3.36.0) (2021-10-08) + + +### Features + +* publish files in dist-* only ([#2873](https://github.com/aws/aws-sdk-js-v3/issues/2873)) ([53b4243](https://github.com/aws/aws-sdk-js-v3/commit/53b4243b066f25ff2412d5f0dea1036054b2df32)) + + + + + +# [3.35.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.34.0...v3.35.0) (2021-10-04) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.34.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.33.0...v3.34.0) (2021-09-24) + + +### Features + +* **non-clients:** remove comments from transpiled JS files ([#2813](https://github.com/aws/aws-sdk-js-v3/issues/2813)) ([e6fc7f3](https://github.com/aws/aws-sdk-js-v3/commit/e6fc7f3e0fa74785590ac19e7ed143c916bb9b6e)) + + + + + +# [3.32.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.31.0...v3.32.0) (2021-09-17) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.29.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.28.0...v3.29.0) (2021-09-02) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.23.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.22.0...v3.23.0) (2021-07-23) + + +### Bug Fixes + +* bump up tslib to 2.3.0 ([#2601](https://github.com/aws/aws-sdk-js-v3/issues/2601)) ([7040faa](https://github.com/aws/aws-sdk-js-v3/commit/7040faac07976c1dcfd5240675b82a2f275b2a55)) + + + + + +# [3.22.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.21.0...v3.22.0) (2021-07-16) + + +### Bug Fixes + +* **clients:** prefix `dist/` for typesVersions TS<4 ([#2580](https://github.com/aws/aws-sdk-js-v3/issues/2580)) ([dff5cd4](https://github.com/aws/aws-sdk-js-v3/commit/dff5cd4b6fa00453e938ce8f238c1542ee7ba3d6)) + + + + + +# [3.20.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.19.0...v3.20.0) (2021-07-02) + + +### Bug Fixes + +* replace prepublishOnly script with downlevel-dts ([#2537](https://github.com/aws/aws-sdk-js-v3/issues/2537)) ([63818a1](https://github.com/aws/aws-sdk-js-v3/commit/63818a1e47b08af56f092031a01bbbff0a9af590)) + + + + + +# [3.18.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.17.0...v3.18.0) (2021-06-04) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +## [3.13.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.13.0...v3.13.1) (2021-04-22) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.12.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.11.0...v3.12.0) (2021-04-09) + + +### Bug Fixes + +* run downlevel-dts in prepublishOnly ([#2218](https://github.com/aws/aws-sdk-js-v3/issues/2218)) ([0745502](https://github.com/aws/aws-sdk-js-v3/commit/0745502dcf819460ee1d81362470859674c757a7)) + + + + + +# [3.10.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.9.0...v3.10.0) (2021-03-26) + + +### Features + +* use ts-jest for running jest tests ([#2088](https://github.com/aws/aws-sdk-js-v3/issues/2088)) ([456002c](https://github.com/aws/aws-sdk-js-v3/commit/456002cf7fa16864b72c3c279b094886a42abddb)) + + + + + +## [3.6.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.6.0...v3.6.1) (2021-02-22) + + +### Bug Fixes + +* update references of default branch from master to main ([#2057](https://github.com/aws/aws-sdk-js-v3/issues/2057)) ([59b8b58](https://github.com/aws/aws-sdk-js-v3/commit/59b8b58c3a8c057b36abfaa59bae3a6ffb068cf1)) + + + + + +## [3.4.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.4.0...v3.4.1) (2021-01-29) + + +### Bug Fixes + +* **clients:** use TS 3.4 compatible types for TS 3.9 ([#1978](https://github.com/aws/aws-sdk-js-v3/issues/1978)) ([8bced5c](https://github.com/aws/aws-sdk-js-v3/commit/8bced5c32b9dbc68f1065054d796cb0b8b87bcc4)) + + + + + +# [3.4.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.3.0...v3.4.0) (2021-01-28) + + +### Features + +* use downlevel-dts to generate TS 3.4 compatible types ([#1943](https://github.com/aws/aws-sdk-js-v3/issues/1943)) ([63ad215](https://github.com/aws/aws-sdk-js-v3/commit/63ad2151c8bb7be32ea8838a9b0974806ed3906b)) + + + + + +# [3.1.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.0.0...v3.1.0) (2020-12-23) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [3.0.0](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.10...v3.0.0) (2020-12-15) + + +### Features + +* bump version to 3.0.0 ([#1793](https://github.com/aws/aws-sdk-js-v3/issues/1793)) ([d8475f8](https://github.com/aws/aws-sdk-js-v3/commit/d8475f8d972d28fbc15cd7e23abfe18f9eab0644)) + + + + + +# [1.0.0-rc.8](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.7...v1.0.0-rc.8) (2020-12-05) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [1.0.0-rc.3](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2020-10-27) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [1.0.0-rc.2](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.1...v1.0.0-rc.2) (2020-10-22) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [1.0.0-rc.1](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-gamma.11...v1.0.0-rc.1) (2020-10-19) + + +### Features + +* ready for release candidate ([#1578](https://github.com/aws/aws-sdk-js-v3/issues/1578)) ([519f66c](https://github.com/aws/aws-sdk-js-v3/commit/519f66c6388b91d0bd750a511e6d1af56196835e)) + + + + + +# [1.0.0-gamma.7](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@1.0.0-gamma.6...@aws-sdk/util-hex-encoding@1.0.0-gamma.7) (2020-10-07) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [1.0.0-gamma.6](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@1.0.0-gamma.5...@aws-sdk/util-hex-encoding@1.0.0-gamma.6) (2020-08-25) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [1.0.0-gamma.5](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@1.0.0-gamma.4...@aws-sdk/util-hex-encoding@1.0.0-gamma.5) (2020-08-04) + + +### Features + +* build command ([#1407](https://github.com/aws/aws-sdk-js-v3/issues/1407)) ([81b2e87](https://github.com/aws/aws-sdk-js-v3/commit/81b2e87067642a8cea8649cbdb2c342ca9fb6ac6)) + + + + + +# [1.0.0-gamma.4](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@1.0.0-gamma.3...@aws-sdk/util-hex-encoding@1.0.0-gamma.4) (2020-07-21) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [1.0.0-gamma.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@1.0.0-gamma.2...@aws-sdk/util-hex-encoding@1.0.0-gamma.3) (2020-07-13) + +**Note:** Version bump only for package @aws-sdk/util-hex-encoding + + + + + +# [1.0.0-gamma.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@0.1.0-preview.1...@aws-sdk/util-hex-encoding@1.0.0-gamma.2) (2020-07-08) + + +### Features + +* use a common tsconfig for the monorepo ([#1297](https://github.com/aws/aws-sdk-js-v3/issues/1297)) ([16aea66](https://github.com/aws/aws-sdk-js-v3/commit/16aea66d1fc5386680d3e6da9b7dcde78e178bd3)) + + + +# 1.0.0-gamma.1 (2020-05-21) + + +### Features + +* bump up to gamma version ([#1192](https://github.com/aws/aws-sdk-js-v3/issues/1192)) ([a609075](https://github.com/aws/aws-sdk-js-v3/commit/a6090754f2a6c21e5b70bf0c8782cc0fbe59ee12)) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-gamma.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@0.1.0-preview.1...@aws-sdk/util-hex-encoding@1.0.0-gamma.1) (2020-05-21) + + +### Features + +* bump up to gamma version ([#1192](https://github.com/aws/aws-sdk-js-v3/issues/1192)) ([a609075](https://github.com/aws/aws-sdk-js-v3/commit/a6090754f2a6c21e5b70bf0c8782cc0fbe59ee12)) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@0.1.0-preview.1...@aws-sdk/util-hex-encoding@1.0.0-beta.2) (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@0.1.0-preview.1...@aws-sdk/util-hex-encoding@1.0.0-beta.1) (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-alpha.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@0.1.0-preview.1...@aws-sdk/util-hex-encoding@1.0.0-alpha.3) (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-alpha.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@0.1.0-preview.1...@aws-sdk/util-hex-encoding@1.0.0-alpha.2) (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [1.0.0-alpha.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@0.1.0-preview.1...@aws-sdk/util-hex-encoding@1.0.0-alpha.1) (2020-01-08) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [0.1.0-preview.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@0.1.0-preview.1...@aws-sdk/util-hex-encoding@0.1.0-preview.3) (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [0.1.0-preview.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-hex-encoding@0.1.0-preview.1...@aws-sdk/util-hex-encoding@0.1.0-preview.2) (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) diff --git a/server/node_modules/@aws-sdk/util-hex-encoding/LICENSE b/server/node_modules/@aws-sdk/util-hex-encoding/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-hex-encoding/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-hex-encoding/README.md b/server/node_modules/@aws-sdk/util-hex-encoding/README.md new file mode 100644 index 0000000000..0f62ea9aa6 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-hex-encoding/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/util-hex-encoding + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-hex-encoding/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-hex-encoding) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-hex-encoding.svg)](https://www.npmjs.com/package/@aws-sdk/util-hex-encoding) diff --git a/server/node_modules/@aws-sdk/util-hex-encoding/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-hex-encoding/dist-cjs/index.js new file mode 100644 index 0000000000..afdc0f0892 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-hex-encoding/dist-cjs/index.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toHex = exports.fromHex = void 0; +const SHORT_TO_HEX = {}; +const HEX_TO_SHORT = {}; +for (let i = 0; i < 256; i++) { + let encodedByte = i.toString(16).toLowerCase(); + if (encodedByte.length === 1) { + encodedByte = `0${encodedByte}`; + } + SHORT_TO_HEX[i] = encodedByte; + HEX_TO_SHORT[encodedByte] = i; +} +function fromHex(encoded) { + if (encoded.length % 2 !== 0) { + throw new Error("Hex encoded strings must have an even number length"); + } + const out = new Uint8Array(encoded.length / 2); + for (let i = 0; i < encoded.length; i += 2) { + const encodedByte = encoded.slice(i, i + 2).toLowerCase(); + if (encodedByte in HEX_TO_SHORT) { + out[i / 2] = HEX_TO_SHORT[encodedByte]; + } + else { + throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); + } + } + return out; +} +exports.fromHex = fromHex; +function toHex(bytes) { + let out = ""; + for (let i = 0; i < bytes.byteLength; i++) { + out += SHORT_TO_HEX[bytes[i]]; + } + return out; +} +exports.toHex = toHex; diff --git a/server/node_modules/@aws-sdk/util-hex-encoding/dist-es/index.js b/server/node_modules/@aws-sdk/util-hex-encoding/dist-es/index.js new file mode 100644 index 0000000000..e47b3aa22e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-hex-encoding/dist-es/index.js @@ -0,0 +1,33 @@ +const SHORT_TO_HEX = {}; +const HEX_TO_SHORT = {}; +for (let i = 0; i < 256; i++) { + let encodedByte = i.toString(16).toLowerCase(); + if (encodedByte.length === 1) { + encodedByte = `0${encodedByte}`; + } + SHORT_TO_HEX[i] = encodedByte; + HEX_TO_SHORT[encodedByte] = i; +} +export function fromHex(encoded) { + if (encoded.length % 2 !== 0) { + throw new Error("Hex encoded strings must have an even number length"); + } + const out = new Uint8Array(encoded.length / 2); + for (let i = 0; i < encoded.length; i += 2) { + const encodedByte = encoded.slice(i, i + 2).toLowerCase(); + if (encodedByte in HEX_TO_SHORT) { + out[i / 2] = HEX_TO_SHORT[encodedByte]; + } + else { + throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); + } + } + return out; +} +export function toHex(bytes) { + let out = ""; + for (let i = 0; i < bytes.byteLength; i++) { + out += SHORT_TO_HEX[bytes[i]]; + } + return out; +} diff --git a/server/node_modules/@aws-sdk/util-hex-encoding/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-hex-encoding/dist-types/index.d.ts new file mode 100644 index 0000000000..9d4307ad78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-hex-encoding/dist-types/index.d.ts @@ -0,0 +1,12 @@ +/** + * Converts a hexadecimal encoded string to a Uint8Array of bytes. + * + * @param encoded The hexadecimal encoded string + */ +export declare function fromHex(encoded: string): Uint8Array; +/** + * Converts a Uint8Array of binary data to a hexadecimal encoded string. + * + * @param bytes The binary data to encode + */ +export declare function toHex(bytes: Uint8Array): string; diff --git a/server/node_modules/@aws-sdk/util-hex-encoding/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-hex-encoding/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..5991ad6ec7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-hex-encoding/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export declare function fromHex(encoded: string): Uint8Array; +export declare function toHex(bytes: Uint8Array): string; diff --git a/server/node_modules/@aws-sdk/util-hex-encoding/package.json b/server/node_modules/@aws-sdk/util-hex-encoding/package.json new file mode 100644 index 0000000000..90dffb6507 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-hex-encoding/package.json @@ -0,0 +1,53 @@ +{ + "name": "@aws-sdk/util-hex-encoding", + "version": "3.201.0", + "description": "Converts binary buffers to and from lowercase hexadecimal encoding", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "dependencies": { + "tslib": "^2.3.1" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-hex-encoding", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-hex-encoding" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/util-locate-window/LICENSE b/server/node_modules/@aws-sdk/util-locate-window/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-locate-window/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-locate-window/README.md b/server/node_modules/@aws-sdk/util-locate-window/README.md new file mode 100644 index 0000000000..cac53d3f3e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-locate-window/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/util-locate-window + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-locate-window/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-locate-window) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-locate-window.svg)](https://www.npmjs.com/package/@aws-sdk/util-locate-window) diff --git a/server/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js new file mode 100644 index 0000000000..a66c1a7e7f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js @@ -0,0 +1,13 @@ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.locateWindow = void 0; +const fallbackWindow = {}; +function locateWindow() { + if (typeof window !== "undefined") { + return window; + } + else if (typeof self !== "undefined") { + return self; + } + return fallbackWindow; +} +exports.locateWindow = locateWindow; diff --git a/server/node_modules/@aws-sdk/util-locate-window/dist-es/index.js b/server/node_modules/@aws-sdk/util-locate-window/dist-es/index.js new file mode 100644 index 0000000000..a51e64424d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-locate-window/dist-es/index.js @@ -0,0 +1,10 @@ +const fallbackWindow = {}; +export function locateWindow() { + if (typeof window !== "undefined") { + return window; + } + else if (typeof self !== "undefined") { + return self; + } + return fallbackWindow; +} diff --git a/server/node_modules/@aws-sdk/util-locate-window/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-locate-window/dist-types/index.d.ts new file mode 100644 index 0000000000..2b02d7f47e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-locate-window/dist-types/index.d.ts @@ -0,0 +1,6 @@ +/** + * Locates the global scope for a browser or browser-like environment. If + * neither `window` nor `self` is defined by the environment, the same object + * will be returned on each invocation. + */ +export declare function locateWindow(): Window; diff --git a/server/node_modules/@aws-sdk/util-locate-window/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-locate-window/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..a5bbba3168 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-locate-window/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export declare function locateWindow(): Window; diff --git a/server/node_modules/@aws-sdk/util-locate-window/package.json b/server/node_modules/@aws-sdk/util-locate-window/package.json new file mode 100644 index 0000000000..7eec6eb35c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-locate-window/package.json @@ -0,0 +1,53 @@ +{ + "name": "@aws-sdk/util-locate-window", + "version": "3.208.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-locate-window", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-locate-window" + } +} diff --git a/server/node_modules/@aws-sdk/util-middleware/LICENSE b/server/node_modules/@aws-sdk/util-middleware/LICENSE new file mode 100644 index 0000000000..a1895fac30 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-middleware/README.md b/server/node_modules/@aws-sdk/util-middleware/README.md new file mode 100644 index 0000000000..73ed96c98b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/README.md @@ -0,0 +1,12 @@ +# @aws-sdk/util-middleware + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-middleware/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-middleware) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-middleware.svg)](https://www.npmjs.com/package/@aws-sdk/util-middleware) + +> An internal package + +This package provides shared utilities for middleware. + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-middleware/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-middleware/dist-cjs/index.js new file mode 100644 index 0000000000..b6e130492a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/dist-cjs/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./normalizeProvider"), exports); diff --git a/server/node_modules/@aws-sdk/util-middleware/dist-cjs/normalizeProvider.js b/server/node_modules/@aws-sdk/util-middleware/dist-cjs/normalizeProvider.js new file mode 100644 index 0000000000..3fdcce5dfc --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/dist-cjs/normalizeProvider.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.normalizeProvider = void 0; +const normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; +}; +exports.normalizeProvider = normalizeProvider; diff --git a/server/node_modules/@aws-sdk/util-middleware/dist-es/index.js b/server/node_modules/@aws-sdk/util-middleware/dist-es/index.js new file mode 100644 index 0000000000..9a63c0a6f0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/dist-es/index.js @@ -0,0 +1 @@ +export * from "./normalizeProvider"; diff --git a/server/node_modules/@aws-sdk/util-middleware/dist-es/normalizeProvider.js b/server/node_modules/@aws-sdk/util-middleware/dist-es/normalizeProvider.js new file mode 100644 index 0000000000..a83ea99eb9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/dist-es/normalizeProvider.js @@ -0,0 +1,6 @@ +export const normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; +}; diff --git a/server/node_modules/@aws-sdk/util-middleware/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-middleware/dist-types/index.d.ts new file mode 100644 index 0000000000..9a63c0a6f0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/dist-types/index.d.ts @@ -0,0 +1 @@ +export * from "./normalizeProvider"; diff --git a/server/node_modules/@aws-sdk/util-middleware/dist-types/normalizeProvider.d.ts b/server/node_modules/@aws-sdk/util-middleware/dist-types/normalizeProvider.d.ts new file mode 100644 index 0000000000..d57e5afdea --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/dist-types/normalizeProvider.d.ts @@ -0,0 +1,5 @@ +import { Provider } from "@aws-sdk/types"; +/** + * @returns a provider function for the input value if it isn't already one. + */ +export declare const normalizeProvider: (input: T | Provider) => Provider; diff --git a/server/node_modules/@aws-sdk/util-middleware/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-middleware/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..9a63c0a6f0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/dist-types/ts3.4/index.d.ts @@ -0,0 +1 @@ +export * from "./normalizeProvider"; diff --git a/server/node_modules/@aws-sdk/util-middleware/dist-types/ts3.4/normalizeProvider.d.ts b/server/node_modules/@aws-sdk/util-middleware/dist-types/ts3.4/normalizeProvider.d.ts new file mode 100644 index 0000000000..ef084e51d9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/dist-types/ts3.4/normalizeProvider.d.ts @@ -0,0 +1,4 @@ +import { Provider } from "@aws-sdk/types"; +export declare const normalizeProvider: ( + input: T | Provider +) => Provider; diff --git a/server/node_modules/@aws-sdk/util-middleware/package.json b/server/node_modules/@aws-sdk/util-middleware/package.json new file mode 100644 index 0000000000..bfd56bcf74 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-middleware/package.json @@ -0,0 +1,59 @@ +{ + "name": "@aws-sdk/util-middleware", + "version": "3.257.0", + "description": "Shared utilities for to be used in middleware packages.", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "middleware" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/types": "3.257.0", + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "types/*": [ + "types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/master/packages/util-middleware", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-middleware" + } +} diff --git a/server/node_modules/@aws-sdk/util-retry/LICENSE b/server/node_modules/@aws-sdk/util-retry/LICENSE new file mode 100644 index 0000000000..a1895fac30 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-retry/README.md b/server/node_modules/@aws-sdk/util-retry/README.md new file mode 100644 index 0000000000..b35e76c108 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/README.md @@ -0,0 +1,12 @@ +# @aws-sdk/util-retry + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-retry/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-retry) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-retry.svg)](https://www.npmjs.com/package/@aws-sdk/util-retry) + +> An internal package + +This package provides shared utilities for retries. + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-retry/dist-cjs/AdaptiveRetryStrategy.js b/server/node_modules/@aws-sdk/util-retry/dist-cjs/AdaptiveRetryStrategy.js new file mode 100644 index 0000000000..8fb8a2f4b9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-cjs/AdaptiveRetryStrategy.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AdaptiveRetryStrategy = void 0; +const config_1 = require("./config"); +const DefaultRateLimiter_1 = require("./DefaultRateLimiter"); +const StandardRetryStrategy_1 = require("./StandardRetryStrategy"); +class AdaptiveRetryStrategy { + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = config_1.RETRY_MODES.ADAPTIVE; + const { rateLimiter } = options !== null && options !== void 0 ? options : {}; + this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new DefaultRateLimiter_1.DefaultRateLimiter(); + this.standardRetryStrategy = new StandardRetryStrategy_1.StandardRetryStrategy(maxAttemptsProvider); + } + async acquireInitialRetryToken(retryTokenScope) { + await this.rateLimiter.getSendToken(); + return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + this.rateLimiter.updateClientSendingRate(errorInfo); + return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + } + recordSuccess(token) { + this.rateLimiter.updateClientSendingRate({}); + this.standardRetryStrategy.recordSuccess(token); + } +} +exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-cjs/DefaultRateLimiter.js b/server/node_modules/@aws-sdk/util-retry/dist-cjs/DefaultRateLimiter.js new file mode 100644 index 0000000000..ee487915b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-cjs/DefaultRateLimiter.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefaultRateLimiter = void 0; +const service_error_classification_1 = require("@aws-sdk/service-error-classification"); +class DefaultRateLimiter { + constructor(options) { + var _a, _b, _c, _d, _e; + this.currentCapacity = 0; + this.enabled = false; + this.lastMaxRate = 0; + this.measuredTxRate = 0; + this.requestCount = 0; + this.lastTimestamp = 0; + this.timeWindow = 0; + this.beta = (_a = options === null || options === void 0 ? void 0 : options.beta) !== null && _a !== void 0 ? _a : 0.7; + this.minCapacity = (_b = options === null || options === void 0 ? void 0 : options.minCapacity) !== null && _b !== void 0 ? _b : 1; + this.minFillRate = (_c = options === null || options === void 0 ? void 0 : options.minFillRate) !== null && _c !== void 0 ? _c : 0.5; + this.scaleConstant = (_d = options === null || options === void 0 ? void 0 : options.scaleConstant) !== null && _d !== void 0 ? _d : 0.4; + this.smooth = (_e = options === null || options === void 0 ? void 0 : options.smooth) !== null && _e !== void 0 ? _e : 0.8; + const currentTimeInSeconds = this.getCurrentTimeInSeconds(); + this.lastThrottleTime = currentTimeInSeconds; + this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); + this.fillRate = this.minFillRate; + this.maxCapacity = this.minCapacity; + } + getCurrentTimeInSeconds() { + return Date.now() / 1000; + } + async getSendToken() { + return this.acquireTokenBucket(1); + } + async acquireTokenBucket(amount) { + if (!this.enabled) { + return; + } + this.refillTokenBucket(); + if (amount > this.currentCapacity) { + const delay = ((amount - this.currentCapacity) / this.fillRate) * 1000; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + this.currentCapacity = this.currentCapacity - amount; + } + refillTokenBucket() { + const timestamp = this.getCurrentTimeInSeconds(); + if (!this.lastTimestamp) { + this.lastTimestamp = timestamp; + return; + } + const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; + this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); + this.lastTimestamp = timestamp; + } + updateClientSendingRate(response) { + let calculatedRate; + this.updateMeasuredRate(); + if ((0, service_error_classification_1.isThrottlingError)(response)) { + const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); + this.lastMaxRate = rateToUse; + this.calculateTimeWindow(); + this.lastThrottleTime = this.getCurrentTimeInSeconds(); + calculatedRate = this.cubicThrottle(rateToUse); + this.enableTokenBucket(); + } + else { + this.calculateTimeWindow(); + calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); + } + const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); + this.updateTokenBucketRate(newRate); + } + calculateTimeWindow() { + this.timeWindow = this.getPrecise(Math.pow((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant, 1 / 3)); + } + cubicThrottle(rateToUse) { + return this.getPrecise(rateToUse * this.beta); + } + cubicSuccess(timestamp) { + return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); + } + enableTokenBucket() { + this.enabled = true; + } + updateTokenBucketRate(newRate) { + this.refillTokenBucket(); + this.fillRate = Math.max(newRate, this.minFillRate); + this.maxCapacity = Math.max(newRate, this.minCapacity); + this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); + } + updateMeasuredRate() { + const t = this.getCurrentTimeInSeconds(); + const timeBucket = Math.floor(t * 2) / 2; + this.requestCount++; + if (timeBucket > this.lastTxRateBucket) { + const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); + this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); + this.requestCount = 0; + this.lastTxRateBucket = timeBucket; + } + } + getPrecise(num) { + return parseFloat(num.toFixed(8)); + } +} +exports.DefaultRateLimiter = DefaultRateLimiter; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-cjs/StandardRetryStrategy.js b/server/node_modules/@aws-sdk/util-retry/dist-cjs/StandardRetryStrategy.js new file mode 100644 index 0000000000..4ac802dd75 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-cjs/StandardRetryStrategy.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StandardRetryStrategy = void 0; +const config_1 = require("./config"); +const constants_1 = require("./constants"); +const defaultRetryToken_1 = require("./defaultRetryToken"); +class StandardRetryStrategy { + constructor(maxAttemptsProvider) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = config_1.RETRY_MODES.STANDARD; + this.retryToken = (0, defaultRetryToken_1.getDefaultRetryToken)(constants_1.INITIAL_RETRY_TOKENS, constants_1.DEFAULT_RETRY_DELAY_BASE); + this.maxAttemptsProvider = maxAttemptsProvider; + } + async acquireInitialRetryToken(retryTokenScope) { + return this.retryToken; + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + const maxAttempts = await this.getMaxAttempts(); + if (this.shouldRetry(tokenToRenew, errorInfo, maxAttempts)) { + tokenToRenew.getRetryTokenCount(errorInfo); + return tokenToRenew; + } + throw new Error("No retry token available"); + } + recordSuccess(token) { + this.retryToken.releaseRetryTokens(token.getLastRetryCost()); + } + async getMaxAttempts() { + let maxAttempts; + try { + return await this.maxAttemptsProvider(); + } + catch (error) { + console.warn(`Max attempts provider could not resolve. Using default of ${config_1.DEFAULT_MAX_ATTEMPTS}`); + return config_1.DEFAULT_MAX_ATTEMPTS; + } + } + shouldRetry(tokenToRenew, errorInfo, maxAttempts) { + const attempts = tokenToRenew.getRetryCount(); + return (attempts < maxAttempts && + tokenToRenew.hasRetryTokens(errorInfo.errorType) && + this.isRetryableError(errorInfo.errorType)); + } + isRetryableError(errorType) { + return errorType === "THROTTLING" || errorType === "TRANSIENT"; + } +} +exports.StandardRetryStrategy = StandardRetryStrategy; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-cjs/config.js b/server/node_modules/@aws-sdk/util-retry/dist-cjs/config.js new file mode 100644 index 0000000000..853d2a5f04 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-cjs/config.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_RETRY_MODE = exports.DEFAULT_MAX_ATTEMPTS = exports.RETRY_MODES = void 0; +var RETRY_MODES; +(function (RETRY_MODES) { + RETRY_MODES["STANDARD"] = "standard"; + RETRY_MODES["ADAPTIVE"] = "adaptive"; +})(RETRY_MODES = exports.RETRY_MODES || (exports.RETRY_MODES = {})); +exports.DEFAULT_MAX_ATTEMPTS = 3; +exports.DEFAULT_RETRY_MODE = "STANDARD"; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-cjs/constants.js b/server/node_modules/@aws-sdk/util-retry/dist-cjs/constants.js new file mode 100644 index 0000000000..2f44514011 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-cjs/constants.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.REQUEST_HEADER = exports.INVOCATION_ID_HEADER = exports.NO_RETRY_INCREMENT = exports.TIMEOUT_RETRY_COST = exports.RETRY_COST = exports.INITIAL_RETRY_TOKENS = exports.THROTTLING_RETRY_DELAY_BASE = exports.MAXIMUM_RETRY_DELAY = exports.DEFAULT_RETRY_DELAY_BASE = void 0; +exports.DEFAULT_RETRY_DELAY_BASE = 100; +exports.MAXIMUM_RETRY_DELAY = 20 * 1000; +exports.THROTTLING_RETRY_DELAY_BASE = 500; +exports.INITIAL_RETRY_TOKENS = 500; +exports.RETRY_COST = 5; +exports.TIMEOUT_RETRY_COST = 10; +exports.NO_RETRY_INCREMENT = 1; +exports.INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; +exports.REQUEST_HEADER = "amz-sdk-request"; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-cjs/defaultRetryBackoffStrategy.js b/server/node_modules/@aws-sdk/util-retry/dist-cjs/defaultRetryBackoffStrategy.js new file mode 100644 index 0000000000..05f2a52153 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-cjs/defaultRetryBackoffStrategy.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDefaultRetryBackoffStrategy = void 0; +const constants_1 = require("./constants"); +const getDefaultRetryBackoffStrategy = () => { + let delayBase = constants_1.DEFAULT_RETRY_DELAY_BASE; + const computeNextBackoffDelay = (attempts) => { + return Math.floor(Math.min(constants_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); + }; + const setDelayBase = (delay) => { + delayBase = delay; + }; + return { + computeNextBackoffDelay, + setDelayBase, + }; +}; +exports.getDefaultRetryBackoffStrategy = getDefaultRetryBackoffStrategy; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-cjs/defaultRetryToken.js b/server/node_modules/@aws-sdk/util-retry/dist-cjs/defaultRetryToken.js new file mode 100644 index 0000000000..e733c642da --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-cjs/defaultRetryToken.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDefaultRetryToken = void 0; +const constants_1 = require("./constants"); +const defaultRetryBackoffStrategy_1 = require("./defaultRetryBackoffStrategy"); +const getDefaultRetryToken = (initialRetryTokens, initialRetryDelay, initialRetryCount, options) => { + var _a, _b, _c; + const MAX_CAPACITY = initialRetryTokens; + const retryCost = (_a = options === null || options === void 0 ? void 0 : options.retryCost) !== null && _a !== void 0 ? _a : constants_1.RETRY_COST; + const timeoutRetryCost = (_b = options === null || options === void 0 ? void 0 : options.timeoutRetryCost) !== null && _b !== void 0 ? _b : constants_1.TIMEOUT_RETRY_COST; + const retryBackoffStrategy = (_c = options === null || options === void 0 ? void 0 : options.retryBackoffStrategy) !== null && _c !== void 0 ? _c : (0, defaultRetryBackoffStrategy_1.getDefaultRetryBackoffStrategy)(); + let availableCapacity = initialRetryTokens; + let retryDelay = Math.min(constants_1.MAXIMUM_RETRY_DELAY, initialRetryDelay); + let lastRetryCost = undefined; + let retryCount = initialRetryCount !== null && initialRetryCount !== void 0 ? initialRetryCount : 0; + const getCapacityAmount = (errorType) => (errorType === "TRANSIENT" ? timeoutRetryCost : retryCost); + const getRetryCount = () => retryCount; + const getRetryDelay = () => retryDelay; + const getLastRetryCost = () => lastRetryCost; + const hasRetryTokens = (errorType) => getCapacityAmount(errorType) <= availableCapacity; + const getRetryTokenCount = (errorInfo) => { + const errorType = errorInfo.errorType; + if (!hasRetryTokens(errorType)) { + throw new Error("No retry token available"); + } + const capacityAmount = getCapacityAmount(errorType); + const delayBase = errorType === "THROTTLING" ? constants_1.THROTTLING_RETRY_DELAY_BASE : constants_1.DEFAULT_RETRY_DELAY_BASE; + retryBackoffStrategy.setDelayBase(delayBase); + const delayFromErrorType = retryBackoffStrategy.computeNextBackoffDelay(retryCount); + if (errorInfo.retryAfterHint) { + const delayFromRetryAfterHint = errorInfo.retryAfterHint.getTime() - Date.now(); + retryDelay = Math.max(delayFromRetryAfterHint || 0, delayFromErrorType); + } + else { + retryDelay = delayFromErrorType; + } + retryCount++; + lastRetryCost = capacityAmount; + availableCapacity -= capacityAmount; + return capacityAmount; + }; + const releaseRetryTokens = (releaseAmount) => { + availableCapacity += releaseAmount !== null && releaseAmount !== void 0 ? releaseAmount : constants_1.NO_RETRY_INCREMENT; + availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); + }; + return { + getRetryCount, + getRetryDelay, + getLastRetryCost, + hasRetryTokens, + getRetryTokenCount, + releaseRetryTokens, + }; +}; +exports.getDefaultRetryToken = getDefaultRetryToken; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-retry/dist-cjs/index.js new file mode 100644 index 0000000000..d8799682cd --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-cjs/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./AdaptiveRetryStrategy"), exports); +tslib_1.__exportStar(require("./DefaultRateLimiter"), exports); +tslib_1.__exportStar(require("./StandardRetryStrategy"), exports); +tslib_1.__exportStar(require("./config"), exports); +tslib_1.__exportStar(require("./constants"), exports); +tslib_1.__exportStar(require("./types"), exports); diff --git a/server/node_modules/@aws-sdk/util-retry/dist-cjs/types.js b/server/node_modules/@aws-sdk/util-retry/dist-cjs/types.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-cjs/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/util-retry/dist-es/AdaptiveRetryStrategy.js b/server/node_modules/@aws-sdk/util-retry/dist-es/AdaptiveRetryStrategy.js new file mode 100644 index 0000000000..e20cf0f8b4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-es/AdaptiveRetryStrategy.js @@ -0,0 +1,24 @@ +import { RETRY_MODES } from "./config"; +import { DefaultRateLimiter } from "./DefaultRateLimiter"; +import { StandardRetryStrategy } from "./StandardRetryStrategy"; +export class AdaptiveRetryStrategy { + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = RETRY_MODES.ADAPTIVE; + const { rateLimiter } = options ?? {}; + this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); + this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); + } + async acquireInitialRetryToken(retryTokenScope) { + await this.rateLimiter.getSendToken(); + return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + this.rateLimiter.updateClientSendingRate(errorInfo); + return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + } + recordSuccess(token) { + this.rateLimiter.updateClientSendingRate({}); + this.standardRetryStrategy.recordSuccess(token); + } +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-es/DefaultRateLimiter.js b/server/node_modules/@aws-sdk/util-retry/dist-es/DefaultRateLimiter.js new file mode 100644 index 0000000000..8eb7c71ac0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-es/DefaultRateLimiter.js @@ -0,0 +1,99 @@ +import { isThrottlingError } from "@aws-sdk/service-error-classification"; +export class DefaultRateLimiter { + constructor(options) { + this.currentCapacity = 0; + this.enabled = false; + this.lastMaxRate = 0; + this.measuredTxRate = 0; + this.requestCount = 0; + this.lastTimestamp = 0; + this.timeWindow = 0; + this.beta = options?.beta ?? 0.7; + this.minCapacity = options?.minCapacity ?? 1; + this.minFillRate = options?.minFillRate ?? 0.5; + this.scaleConstant = options?.scaleConstant ?? 0.4; + this.smooth = options?.smooth ?? 0.8; + const currentTimeInSeconds = this.getCurrentTimeInSeconds(); + this.lastThrottleTime = currentTimeInSeconds; + this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); + this.fillRate = this.minFillRate; + this.maxCapacity = this.minCapacity; + } + getCurrentTimeInSeconds() { + return Date.now() / 1000; + } + async getSendToken() { + return this.acquireTokenBucket(1); + } + async acquireTokenBucket(amount) { + if (!this.enabled) { + return; + } + this.refillTokenBucket(); + if (amount > this.currentCapacity) { + const delay = ((amount - this.currentCapacity) / this.fillRate) * 1000; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + this.currentCapacity = this.currentCapacity - amount; + } + refillTokenBucket() { + const timestamp = this.getCurrentTimeInSeconds(); + if (!this.lastTimestamp) { + this.lastTimestamp = timestamp; + return; + } + const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; + this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); + this.lastTimestamp = timestamp; + } + updateClientSendingRate(response) { + let calculatedRate; + this.updateMeasuredRate(); + if (isThrottlingError(response)) { + const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); + this.lastMaxRate = rateToUse; + this.calculateTimeWindow(); + this.lastThrottleTime = this.getCurrentTimeInSeconds(); + calculatedRate = this.cubicThrottle(rateToUse); + this.enableTokenBucket(); + } + else { + this.calculateTimeWindow(); + calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); + } + const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); + this.updateTokenBucketRate(newRate); + } + calculateTimeWindow() { + this.timeWindow = this.getPrecise(Math.pow((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant, 1 / 3)); + } + cubicThrottle(rateToUse) { + return this.getPrecise(rateToUse * this.beta); + } + cubicSuccess(timestamp) { + return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); + } + enableTokenBucket() { + this.enabled = true; + } + updateTokenBucketRate(newRate) { + this.refillTokenBucket(); + this.fillRate = Math.max(newRate, this.minFillRate); + this.maxCapacity = Math.max(newRate, this.minCapacity); + this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); + } + updateMeasuredRate() { + const t = this.getCurrentTimeInSeconds(); + const timeBucket = Math.floor(t * 2) / 2; + this.requestCount++; + if (timeBucket > this.lastTxRateBucket) { + const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); + this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); + this.requestCount = 0; + this.lastTxRateBucket = timeBucket; + } + } + getPrecise(num) { + return parseFloat(num.toFixed(8)); + } +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-es/StandardRetryStrategy.js b/server/node_modules/@aws-sdk/util-retry/dist-es/StandardRetryStrategy.js new file mode 100644 index 0000000000..b3c39c4984 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-es/StandardRetryStrategy.js @@ -0,0 +1,44 @@ +import { DEFAULT_MAX_ATTEMPTS, RETRY_MODES } from "./config"; +import { DEFAULT_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS } from "./constants"; +import { getDefaultRetryToken } from "./defaultRetryToken"; +export class StandardRetryStrategy { + constructor(maxAttemptsProvider) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = RETRY_MODES.STANDARD; + this.retryToken = getDefaultRetryToken(INITIAL_RETRY_TOKENS, DEFAULT_RETRY_DELAY_BASE); + this.maxAttemptsProvider = maxAttemptsProvider; + } + async acquireInitialRetryToken(retryTokenScope) { + return this.retryToken; + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + const maxAttempts = await this.getMaxAttempts(); + if (this.shouldRetry(tokenToRenew, errorInfo, maxAttempts)) { + tokenToRenew.getRetryTokenCount(errorInfo); + return tokenToRenew; + } + throw new Error("No retry token available"); + } + recordSuccess(token) { + this.retryToken.releaseRetryTokens(token.getLastRetryCost()); + } + async getMaxAttempts() { + let maxAttempts; + try { + return await this.maxAttemptsProvider(); + } + catch (error) { + console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); + return DEFAULT_MAX_ATTEMPTS; + } + } + shouldRetry(tokenToRenew, errorInfo, maxAttempts) { + const attempts = tokenToRenew.getRetryCount(); + return (attempts < maxAttempts && + tokenToRenew.hasRetryTokens(errorInfo.errorType) && + this.isRetryableError(errorInfo.errorType)); + } + isRetryableError(errorType) { + return errorType === "THROTTLING" || errorType === "TRANSIENT"; + } +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-es/config.js b/server/node_modules/@aws-sdk/util-retry/dist-es/config.js new file mode 100644 index 0000000000..de0cb22e61 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-es/config.js @@ -0,0 +1,7 @@ +export var RETRY_MODES; +(function (RETRY_MODES) { + RETRY_MODES["STANDARD"] = "standard"; + RETRY_MODES["ADAPTIVE"] = "adaptive"; +})(RETRY_MODES || (RETRY_MODES = {})); +export const DEFAULT_MAX_ATTEMPTS = 3; +export const DEFAULT_RETRY_MODE = "STANDARD"; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-es/constants.js b/server/node_modules/@aws-sdk/util-retry/dist-es/constants.js new file mode 100644 index 0000000000..0876f8e23d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-es/constants.js @@ -0,0 +1,9 @@ +export const DEFAULT_RETRY_DELAY_BASE = 100; +export const MAXIMUM_RETRY_DELAY = 20 * 1000; +export const THROTTLING_RETRY_DELAY_BASE = 500; +export const INITIAL_RETRY_TOKENS = 500; +export const RETRY_COST = 5; +export const TIMEOUT_RETRY_COST = 10; +export const NO_RETRY_INCREMENT = 1; +export const INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; +export const REQUEST_HEADER = "amz-sdk-request"; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-es/defaultRetryBackoffStrategy.js b/server/node_modules/@aws-sdk/util-retry/dist-es/defaultRetryBackoffStrategy.js new file mode 100644 index 0000000000..ce04bc5e3f --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-es/defaultRetryBackoffStrategy.js @@ -0,0 +1,14 @@ +import { DEFAULT_RETRY_DELAY_BASE, MAXIMUM_RETRY_DELAY } from "./constants"; +export const getDefaultRetryBackoffStrategy = () => { + let delayBase = DEFAULT_RETRY_DELAY_BASE; + const computeNextBackoffDelay = (attempts) => { + return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); + }; + const setDelayBase = (delay) => { + delayBase = delay; + }; + return { + computeNextBackoffDelay, + setDelayBase, + }; +}; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-es/defaultRetryToken.js b/server/node_modules/@aws-sdk/util-retry/dist-es/defaultRetryToken.js new file mode 100644 index 0000000000..14ac7471a5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-es/defaultRetryToken.js @@ -0,0 +1,50 @@ +import { DEFAULT_RETRY_DELAY_BASE, MAXIMUM_RETRY_DELAY, NO_RETRY_INCREMENT, RETRY_COST, THROTTLING_RETRY_DELAY_BASE, TIMEOUT_RETRY_COST, } from "./constants"; +import { getDefaultRetryBackoffStrategy } from "./defaultRetryBackoffStrategy"; +export const getDefaultRetryToken = (initialRetryTokens, initialRetryDelay, initialRetryCount, options) => { + const MAX_CAPACITY = initialRetryTokens; + const retryCost = options?.retryCost ?? RETRY_COST; + const timeoutRetryCost = options?.timeoutRetryCost ?? TIMEOUT_RETRY_COST; + const retryBackoffStrategy = options?.retryBackoffStrategy ?? getDefaultRetryBackoffStrategy(); + let availableCapacity = initialRetryTokens; + let retryDelay = Math.min(MAXIMUM_RETRY_DELAY, initialRetryDelay); + let lastRetryCost = undefined; + let retryCount = initialRetryCount ?? 0; + const getCapacityAmount = (errorType) => (errorType === "TRANSIENT" ? timeoutRetryCost : retryCost); + const getRetryCount = () => retryCount; + const getRetryDelay = () => retryDelay; + const getLastRetryCost = () => lastRetryCost; + const hasRetryTokens = (errorType) => getCapacityAmount(errorType) <= availableCapacity; + const getRetryTokenCount = (errorInfo) => { + const errorType = errorInfo.errorType; + if (!hasRetryTokens(errorType)) { + throw new Error("No retry token available"); + } + const capacityAmount = getCapacityAmount(errorType); + const delayBase = errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE; + retryBackoffStrategy.setDelayBase(delayBase); + const delayFromErrorType = retryBackoffStrategy.computeNextBackoffDelay(retryCount); + if (errorInfo.retryAfterHint) { + const delayFromRetryAfterHint = errorInfo.retryAfterHint.getTime() - Date.now(); + retryDelay = Math.max(delayFromRetryAfterHint || 0, delayFromErrorType); + } + else { + retryDelay = delayFromErrorType; + } + retryCount++; + lastRetryCost = capacityAmount; + availableCapacity -= capacityAmount; + return capacityAmount; + }; + const releaseRetryTokens = (releaseAmount) => { + availableCapacity += releaseAmount ?? NO_RETRY_INCREMENT; + availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); + }; + return { + getRetryCount, + getRetryDelay, + getLastRetryCost, + hasRetryTokens, + getRetryTokenCount, + releaseRetryTokens, + }; +}; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-es/index.js b/server/node_modules/@aws-sdk/util-retry/dist-es/index.js new file mode 100644 index 0000000000..ad2af06977 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-es/index.js @@ -0,0 +1,6 @@ +export * from "./AdaptiveRetryStrategy"; +export * from "./DefaultRateLimiter"; +export * from "./StandardRetryStrategy"; +export * from "./config"; +export * from "./constants"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-es/types.js b/server/node_modules/@aws-sdk/util-retry/dist-es/types.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-es/types.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/AdaptiveRetryStrategy.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/AdaptiveRetryStrategy.d.ts new file mode 100644 index 0000000000..d1b1f6aaa7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/AdaptiveRetryStrategy.d.ts @@ -0,0 +1,29 @@ +import { Provider, RetryErrorInfo, RetryStrategyV2, RetryToken, StandardRetryToken } from "@aws-sdk/types"; +import { RateLimiter } from "./types"; +/** + * Strategy options to be passed to AdaptiveRetryStrategy + */ +export interface AdaptiveRetryStrategyOptions { + rateLimiter?: RateLimiter; +} +/** + * The AdaptiveRetryStrategy is a retry strategy for executing against a very + * resource constrained set of resources. Care should be taken when using this + * retry strategy. By default, it uses a dynamic backoff delay based on load + * currently perceived against the downstream resource and performs circuit + * breaking to disable retries in the event of high downstream failures using + * the DefaultRateLimiter. + * + * @see {@link StandardRetryStrategy} + * @see {@link DefaultRateLimiter } + */ +export declare class AdaptiveRetryStrategy implements RetryStrategyV2 { + private readonly maxAttemptsProvider; + private rateLimiter; + private standardRetryStrategy; + readonly mode: string; + constructor(maxAttemptsProvider: Provider, options?: AdaptiveRetryStrategyOptions); + acquireInitialRetryToken(retryTokenScope: string): Promise; + refreshRetryTokenForRetry(tokenToRenew: StandardRetryToken, errorInfo: RetryErrorInfo): Promise; + recordSuccess(token: StandardRetryToken): void; +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/DefaultRateLimiter.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/DefaultRateLimiter.d.ts new file mode 100644 index 0000000000..0bf657c1ec --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/DefaultRateLimiter.d.ts @@ -0,0 +1,39 @@ +import { RateLimiter } from "./types"; +export interface DefaultRateLimiterOptions { + beta?: number; + minCapacity?: number; + minFillRate?: number; + scaleConstant?: number; + smooth?: number; +} +export declare class DefaultRateLimiter implements RateLimiter { + private beta; + private minCapacity; + private minFillRate; + private scaleConstant; + private smooth; + private currentCapacity; + private enabled; + private lastMaxRate; + private measuredTxRate; + private requestCount; + private fillRate; + private lastThrottleTime; + private lastTimestamp; + private lastTxRateBucket; + private maxCapacity; + private timeWindow; + constructor(options?: DefaultRateLimiterOptions); + private getCurrentTimeInSeconds; + getSendToken(): Promise; + private acquireTokenBucket; + private refillTokenBucket; + updateClientSendingRate(response: any): void; + private calculateTimeWindow; + private cubicThrottle; + private cubicSuccess; + private enableTokenBucket; + private updateTokenBucketRate; + private updateMeasuredRate; + private getPrecise; +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/StandardRetryStrategy.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/StandardRetryStrategy.d.ts new file mode 100644 index 0000000000..3a48da7c99 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/StandardRetryStrategy.d.ts @@ -0,0 +1,13 @@ +import { Provider, RetryErrorInfo, RetryStrategyV2, StandardRetryToken } from "@aws-sdk/types"; +export declare class StandardRetryStrategy implements RetryStrategyV2 { + private readonly maxAttemptsProvider; + private retryToken; + readonly mode: string; + constructor(maxAttemptsProvider: Provider); + acquireInitialRetryToken(retryTokenScope: string): Promise; + refreshRetryTokenForRetry(tokenToRenew: StandardRetryToken, errorInfo: RetryErrorInfo): Promise; + recordSuccess(token: StandardRetryToken): void; + private getMaxAttempts; + private shouldRetry; + private isRetryableError; +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/config.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/config.d.ts new file mode 100644 index 0000000000..471099fe24 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/config.d.ts @@ -0,0 +1,13 @@ +export declare enum RETRY_MODES { + STANDARD = "standard", + ADAPTIVE = "adaptive" +} +/** + * The default value for how many HTTP requests an SDK should make for a + * single SDK operation invocation before giving up + */ +export declare const DEFAULT_MAX_ATTEMPTS = 3; +/** + * The default retry algorithm to use. + */ +export declare const DEFAULT_RETRY_MODE: RETRY_MODES; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/constants.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/constants.d.ts new file mode 100644 index 0000000000..cb9b250a01 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/constants.d.ts @@ -0,0 +1,41 @@ +/** + * The base number of milliseconds to use in calculating a suitable cool-down + * time when a retryable error is encountered. + */ +export declare const DEFAULT_RETRY_DELAY_BASE = 100; +/** + * The maximum amount of time (in milliseconds) that will be used as a delay + * between retry attempts. + */ +export declare const MAXIMUM_RETRY_DELAY: number; +/** + * The retry delay base (in milliseconds) to use when a throttling error is + * encountered. + */ +export declare const THROTTLING_RETRY_DELAY_BASE = 500; +/** + * Initial number of retry tokens in Retry Quota + */ +export declare const INITIAL_RETRY_TOKENS = 500; +/** + * The total amount of retry tokens to be decremented from retry token balance. + */ +export declare const RETRY_COST = 5; +/** + * The total amount of retry tokens to be decremented from retry token balance + * when a throttling error is encountered. + */ +export declare const TIMEOUT_RETRY_COST = 10; +/** + * The total amount of retry token to be incremented from retry token balance + * if an SDK operation invocation succeeds without requiring a retry request. + */ +export declare const NO_RETRY_INCREMENT = 1; +/** + * Header name for SDK invocation ID + */ +export declare const INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; +/** + * Header name for request retry information. + */ +export declare const REQUEST_HEADER = "amz-sdk-request"; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/defaultRetryBackoffStrategy.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/defaultRetryBackoffStrategy.d.ts new file mode 100644 index 0000000000..c023cc9524 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/defaultRetryBackoffStrategy.d.ts @@ -0,0 +1,2 @@ +import { StandardRetryBackoffStrategy } from "@aws-sdk/types"; +export declare const getDefaultRetryBackoffStrategy: () => StandardRetryBackoffStrategy; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/defaultRetryToken.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/defaultRetryToken.d.ts new file mode 100644 index 0000000000..fbe7bd50a0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/defaultRetryToken.d.ts @@ -0,0 +1,17 @@ +import { StandardRetryBackoffStrategy, StandardRetryToken } from "@aws-sdk/types"; +export interface DefaultRetryTokenOptions { + /** + * The total amount of retry tokens to be decremented from retry token balance. + */ + retryCost?: number; + /** + * The total amount of retry tokens to be decremented from retry token balance + * when a throttling error is encountered. + */ + timeoutRetryCost?: number; + /** + * + */ + retryBackoffStrategy?: StandardRetryBackoffStrategy; +} +export declare const getDefaultRetryToken: (initialRetryTokens: number, initialRetryDelay: number, initialRetryCount?: number | undefined, options?: DefaultRetryTokenOptions | undefined) => StandardRetryToken; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/index.d.ts new file mode 100644 index 0000000000..ad2af06977 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/index.d.ts @@ -0,0 +1,6 @@ +export * from "./AdaptiveRetryStrategy"; +export * from "./DefaultRateLimiter"; +export * from "./StandardRetryStrategy"; +export * from "./config"; +export * from "./constants"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/AdaptiveRetryStrategy.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/AdaptiveRetryStrategy.d.ts new file mode 100644 index 0000000000..d3b0510be8 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/AdaptiveRetryStrategy.d.ts @@ -0,0 +1,27 @@ +import { + Provider, + RetryErrorInfo, + RetryStrategyV2, + RetryToken, + StandardRetryToken, +} from "@aws-sdk/types"; +import { RateLimiter } from "./types"; +export interface AdaptiveRetryStrategyOptions { + rateLimiter?: RateLimiter; +} +export declare class AdaptiveRetryStrategy implements RetryStrategyV2 { + private readonly maxAttemptsProvider; + private rateLimiter; + private standardRetryStrategy; + readonly mode: string; + constructor( + maxAttemptsProvider: Provider, + options?: AdaptiveRetryStrategyOptions + ); + acquireInitialRetryToken(retryTokenScope: string): Promise; + refreshRetryTokenForRetry( + tokenToRenew: StandardRetryToken, + errorInfo: RetryErrorInfo + ): Promise; + recordSuccess(token: StandardRetryToken): void; +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/DefaultRateLimiter.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/DefaultRateLimiter.d.ts new file mode 100644 index 0000000000..0b6f8b8179 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/DefaultRateLimiter.d.ts @@ -0,0 +1,39 @@ +import { RateLimiter } from "./types"; +export interface DefaultRateLimiterOptions { + beta?: number; + minCapacity?: number; + minFillRate?: number; + scaleConstant?: number; + smooth?: number; +} +export declare class DefaultRateLimiter implements RateLimiter { + private beta; + private minCapacity; + private minFillRate; + private scaleConstant; + private smooth; + private currentCapacity; + private enabled; + private lastMaxRate; + private measuredTxRate; + private requestCount; + private fillRate; + private lastThrottleTime; + private lastTimestamp; + private lastTxRateBucket; + private maxCapacity; + private timeWindow; + constructor(options?: DefaultRateLimiterOptions); + private getCurrentTimeInSeconds; + getSendToken(): Promise; + private acquireTokenBucket; + private refillTokenBucket; + updateClientSendingRate(response: any): void; + private calculateTimeWindow; + private cubicThrottle; + private cubicSuccess; + private enableTokenBucket; + private updateTokenBucketRate; + private updateMeasuredRate; + private getPrecise; +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts new file mode 100644 index 0000000000..d05aebbbc2 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts @@ -0,0 +1,23 @@ +import { + Provider, + RetryErrorInfo, + RetryStrategyV2, + StandardRetryToken, +} from "@aws-sdk/types"; +export declare class StandardRetryStrategy implements RetryStrategyV2 { + private readonly maxAttemptsProvider; + private retryToken; + readonly mode: string; + constructor(maxAttemptsProvider: Provider); + acquireInitialRetryToken( + retryTokenScope: string + ): Promise; + refreshRetryTokenForRetry( + tokenToRenew: StandardRetryToken, + errorInfo: RetryErrorInfo + ): Promise; + recordSuccess(token: StandardRetryToken): void; + private getMaxAttempts; + private shouldRetry; + private isRetryableError; +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/config.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/config.d.ts new file mode 100644 index 0000000000..5e7d41af98 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/config.d.ts @@ -0,0 +1,6 @@ +export declare enum RETRY_MODES { + STANDARD = "standard", + ADAPTIVE = "adaptive", +} +export declare const DEFAULT_MAX_ATTEMPTS = 3; +export declare const DEFAULT_RETRY_MODE: RETRY_MODES; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/constants.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/constants.d.ts new file mode 100644 index 0000000000..4b60a8f70d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/constants.d.ts @@ -0,0 +1,9 @@ +export declare const DEFAULT_RETRY_DELAY_BASE = 100; +export declare const MAXIMUM_RETRY_DELAY: number; +export declare const THROTTLING_RETRY_DELAY_BASE = 500; +export declare const INITIAL_RETRY_TOKENS = 500; +export declare const RETRY_COST = 5; +export declare const TIMEOUT_RETRY_COST = 10; +export declare const NO_RETRY_INCREMENT = 1; +export declare const INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; +export declare const REQUEST_HEADER = "amz-sdk-request"; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/defaultRetryBackoffStrategy.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/defaultRetryBackoffStrategy.d.ts new file mode 100644 index 0000000000..c023cc9524 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/defaultRetryBackoffStrategy.d.ts @@ -0,0 +1,2 @@ +import { StandardRetryBackoffStrategy } from "@aws-sdk/types"; +export declare const getDefaultRetryBackoffStrategy: () => StandardRetryBackoffStrategy; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/defaultRetryToken.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/defaultRetryToken.d.ts new file mode 100644 index 0000000000..bc0a000c72 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/defaultRetryToken.d.ts @@ -0,0 +1,15 @@ +import { + StandardRetryBackoffStrategy, + StandardRetryToken, +} from "@aws-sdk/types"; +export interface DefaultRetryTokenOptions { + retryCost?: number; + timeoutRetryCost?: number; + retryBackoffStrategy?: StandardRetryBackoffStrategy; +} +export declare const getDefaultRetryToken: ( + initialRetryTokens: number, + initialRetryDelay: number, + initialRetryCount?: number | undefined, + options?: DefaultRetryTokenOptions | undefined +) => StandardRetryToken; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..ad2af06977 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/index.d.ts @@ -0,0 +1,6 @@ +export * from "./AdaptiveRetryStrategy"; +export * from "./DefaultRateLimiter"; +export * from "./StandardRetryStrategy"; +export * from "./config"; +export * from "./constants"; +export * from "./types"; diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/types.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/types.d.ts new file mode 100644 index 0000000000..bf306f1635 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/ts3.4/types.d.ts @@ -0,0 +1,4 @@ +export interface RateLimiter { + getSendToken: () => Promise; + updateClientSendingRate: (response: any) => void; +} diff --git a/server/node_modules/@aws-sdk/util-retry/dist-types/types.d.ts b/server/node_modules/@aws-sdk/util-retry/dist-types/types.d.ts new file mode 100644 index 0000000000..f4f80398e9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/dist-types/types.d.ts @@ -0,0 +1,16 @@ +export interface RateLimiter { + /** + * If there is sufficient capacity (tokens) available, it immediately returns. + * If there is not sufficient capacity, it will either sleep a certain amount + * of time until the rate limiter can retrieve a token from its token bucket + * or raise an exception indicating there is insufficient capacity. + */ + getSendToken: () => Promise; + /** + * Updates the client sending rate based on response. + * If the response was successful, the capacity and fill rate are increased. + * If the response was a throttling response, the capacity and fill rate are + * decreased. Transient errors do not affect the rate limiter. + */ + updateClientSendingRate: (response: any) => void; +} diff --git a/server/node_modules/@aws-sdk/util-retry/package.json b/server/node_modules/@aws-sdk/util-retry/package.json new file mode 100644 index 0000000000..5184f2522a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-retry/package.json @@ -0,0 +1,60 @@ +{ + "name": "@aws-sdk/util-retry", + "version": "3.257.0", + "description": "Shared retry utilities to be used in middleware packages.", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "keywords": [ + "aws", + "retry" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/service-error-classification": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/types": "3.257.0", + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">= 14.0.0" + }, + "typesVersions": { + "<4.0": { + "types/*": [ + "types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/master/packages/util-retry", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-retry" + } +} diff --git a/server/node_modules/@aws-sdk/util-uri-escape/CHANGELOG.md b/server/node_modules/@aws-sdk/util-uri-escape/CHANGELOG.md new file mode 100644 index 0000000000..0417cf6604 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/CHANGELOG.md @@ -0,0 +1,768 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [3.201.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.200.0...v3.201.0) (2022-11-01) + + +### Features + +* end support for Node.js 12.x ([#4123](https://github.com/aws/aws-sdk-js-v3/issues/4123)) ([83f913e](https://github.com/aws/aws-sdk-js-v3/commit/83f913ec2ac3878d8726c6964f585550dc5caf3e)) + + + + + +# [3.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.170.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.169.0...v3.170.0) (2022-09-13) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.168.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.167.0...v3.168.0) (2022-09-09) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.52.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.51.0...v3.52.0) (2022-02-18) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.49.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.48.0...v3.49.0) (2022-01-29) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +## [3.47.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.47.0-release-test-1...v3.47.1) (2022-01-20) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.47.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.46.0...v3.47.0) (2022-01-15) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.46.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.45.0...v3.46.0) (2022-01-07) + + +### Features + +* **packages:** end support for Node.js 10.x ([#3141](https://github.com/aws/aws-sdk-js-v3/issues/3141)) ([1a62865](https://github.com/aws/aws-sdk-js-v3/commit/1a6286513f7cdb556708845c512861c5f92eb883)) + + + + + +# [3.37.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.36.1...v3.37.0) (2021-10-15) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.36.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.35.0...v3.36.0) (2021-10-08) + + +### Features + +* publish files in dist-* only ([#2873](https://github.com/aws/aws-sdk-js-v3/issues/2873)) ([53b4243](https://github.com/aws/aws-sdk-js-v3/commit/53b4243b066f25ff2412d5f0dea1036054b2df32)) + + + + + +# [3.35.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.34.0...v3.35.0) (2021-10-04) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.34.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.33.0...v3.34.0) (2021-09-24) + + +### Features + +* **non-clients:** remove comments from transpiled JS files ([#2813](https://github.com/aws/aws-sdk-js-v3/issues/2813)) ([e6fc7f3](https://github.com/aws/aws-sdk-js-v3/commit/e6fc7f3e0fa74785590ac19e7ed143c916bb9b6e)) + + + + + +# [3.32.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.31.0...v3.32.0) (2021-09-17) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.29.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.28.0...v3.29.0) (2021-09-02) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.23.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.22.0...v3.23.0) (2021-07-23) + + +### Bug Fixes + +* bump up tslib to 2.3.0 ([#2601](https://github.com/aws/aws-sdk-js-v3/issues/2601)) ([7040faa](https://github.com/aws/aws-sdk-js-v3/commit/7040faac07976c1dcfd5240675b82a2f275b2a55)) + + + + + +# [3.22.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.21.0...v3.22.0) (2021-07-16) + + +### Bug Fixes + +* **clients:** prefix `dist/` for typesVersions TS<4 ([#2580](https://github.com/aws/aws-sdk-js-v3/issues/2580)) ([dff5cd4](https://github.com/aws/aws-sdk-js-v3/commit/dff5cd4b6fa00453e938ce8f238c1542ee7ba3d6)) + + + + + +# [3.20.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.19.0...v3.20.0) (2021-07-02) + + +### Bug Fixes + +* replace prepublishOnly script with downlevel-dts ([#2537](https://github.com/aws/aws-sdk-js-v3/issues/2537)) ([63818a1](https://github.com/aws/aws-sdk-js-v3/commit/63818a1e47b08af56f092031a01bbbff0a9af590)) + + + + + +# [3.18.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.17.0...v3.18.0) (2021-06-04) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +## [3.13.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.13.0...v3.13.1) (2021-04-22) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.12.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.11.0...v3.12.0) (2021-04-09) + + +### Bug Fixes + +* run downlevel-dts in prepublishOnly ([#2218](https://github.com/aws/aws-sdk-js-v3/issues/2218)) ([0745502](https://github.com/aws/aws-sdk-js-v3/commit/0745502dcf819460ee1d81362470859674c757a7)) + + + + + +# [3.10.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.9.0...v3.10.0) (2021-03-26) + + +### Features + +* use ts-jest for running jest tests ([#2088](https://github.com/aws/aws-sdk-js-v3/issues/2088)) ([456002c](https://github.com/aws/aws-sdk-js-v3/commit/456002cf7fa16864b72c3c279b094886a42abddb)) + + + + + +## [3.6.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.6.0...v3.6.1) (2021-02-22) + + +### Bug Fixes + +* update references of default branch from master to main ([#2057](https://github.com/aws/aws-sdk-js-v3/issues/2057)) ([59b8b58](https://github.com/aws/aws-sdk-js-v3/commit/59b8b58c3a8c057b36abfaa59bae3a6ffb068cf1)) + + + + + +## [3.4.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.4.0...v3.4.1) (2021-01-29) + + +### Bug Fixes + +* **clients:** use TS 3.4 compatible types for TS 3.9 ([#1978](https://github.com/aws/aws-sdk-js-v3/issues/1978)) ([8bced5c](https://github.com/aws/aws-sdk-js-v3/commit/8bced5c32b9dbc68f1065054d796cb0b8b87bcc4)) + + + + + +# [3.4.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.3.0...v3.4.0) (2021-01-28) + + +### Features + +* use downlevel-dts to generate TS 3.4 compatible types ([#1943](https://github.com/aws/aws-sdk-js-v3/issues/1943)) ([63ad215](https://github.com/aws/aws-sdk-js-v3/commit/63ad2151c8bb7be32ea8838a9b0974806ed3906b)) + + + + + +# [3.1.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.0.0...v3.1.0) (2020-12-23) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [3.0.0](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.10...v3.0.0) (2020-12-15) + + +### Features + +* bump version to 3.0.0 ([#1793](https://github.com/aws/aws-sdk-js-v3/issues/1793)) ([d8475f8](https://github.com/aws/aws-sdk-js-v3/commit/d8475f8d972d28fbc15cd7e23abfe18f9eab0644)) + + + + + +# [1.0.0-rc.8](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.7...v1.0.0-rc.8) (2020-12-05) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [1.0.0-rc.3](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2020-10-27) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [1.0.0-rc.2](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-rc.1...v1.0.0-rc.2) (2020-10-22) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [1.0.0-rc.1](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-gamma.11...v1.0.0-rc.1) (2020-10-19) + + +### Features + +* ready for release candidate ([#1578](https://github.com/aws/aws-sdk-js-v3/issues/1578)) ([519f66c](https://github.com/aws/aws-sdk-js-v3/commit/519f66c6388b91d0bd750a511e6d1af56196835e)) + + + + + +# [1.0.0-gamma.7](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@1.0.0-gamma.6...@aws-sdk/util-uri-escape@1.0.0-gamma.7) (2020-10-07) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [1.0.0-gamma.6](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@1.0.0-gamma.5...@aws-sdk/util-uri-escape@1.0.0-gamma.6) (2020-08-25) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [1.0.0-gamma.5](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@1.0.0-gamma.4...@aws-sdk/util-uri-escape@1.0.0-gamma.5) (2020-08-04) + + +### Features + +* build command ([#1407](https://github.com/aws/aws-sdk-js-v3/issues/1407)) ([81b2e87](https://github.com/aws/aws-sdk-js-v3/commit/81b2e87067642a8cea8649cbdb2c342ca9fb6ac6)) + + + + + +# [1.0.0-gamma.4](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@1.0.0-gamma.3...@aws-sdk/util-uri-escape@1.0.0-gamma.4) (2020-07-21) + +**Note:** Version bump only for package @aws-sdk/util-uri-escape + + + + + +# [1.0.0-gamma.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@1.0.0-gamma.2...@aws-sdk/util-uri-escape@1.0.0-gamma.3) (2020-07-13) + + +### Features + +* add code linting and prettify ([#1350](https://github.com/aws/aws-sdk-js-v3/issues/1350)) ([47770fa](https://github.com/aws/aws-sdk-js-v3/commit/47770fa493c3405f193069cd18319882529ff484)) + + + + + +# [1.0.0-gamma.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@1.0.0-gamma.2) (2020-07-08) + + +### Features + +* use a common tsconfig for the monorepo ([#1297](https://github.com/aws/aws-sdk-js-v3/issues/1297)) ([16aea66](https://github.com/aws/aws-sdk-js-v3/commit/16aea66d1fc5386680d3e6da9b7dcde78e178bd3)) + + + +# 1.0.0-gamma.1 (2020-05-21) + + +### Features + +* bump up to gamma version ([#1192](https://github.com/aws/aws-sdk-js-v3/issues/1192)) ([a609075](https://github.com/aws/aws-sdk-js-v3/commit/a6090754f2a6c21e5b70bf0c8782cc0fbe59ee12)) + + + +# 1.0.0-beta.4 (2020-04-25) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-gamma.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@1.0.0-gamma.1) (2020-05-21) + + +### Features + +* bump up to gamma version ([#1192](https://github.com/aws/aws-sdk-js-v3/issues/1192)) ([a609075](https://github.com/aws/aws-sdk-js-v3/commit/a6090754f2a6c21e5b70bf0c8782cc0fbe59ee12)) + + + +# 1.0.0-beta.4 (2020-04-25) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.4](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@1.0.0-beta.4) (2020-04-27) + + +### Features + +* use exact @aws-sdk/* dependencies ([#1110](https://github.com/aws/aws-sdk-js-v3/issues/1110)) ([bcfd7a2](https://github.com/aws/aws-sdk-js-v3/commit/bcfd7a2faeca3a2605057fd4736d710aa4902b62)) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@1.0.0-beta.3) (2020-04-25) + + + +# 1.0.0-beta.2 (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@1.0.0-beta.2) (2020-03-28) + + + +# 1.0.0-beta.1 (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-beta.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@1.0.0-beta.1) (2020-03-25) + + +### Features + +* bump packages to beta ([#1050](https://github.com/aws/aws-sdk-js-v3/issues/1050)) ([40501d4](https://github.com/aws/aws-sdk-js-v3/commit/40501d4394d04bc1bc91c10136fa48b1d3a67d8f)) + + + +# 1.0.0-alpha.28 (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-alpha.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@1.0.0-alpha.3) (2020-03-20) + + + +# 0.9.0 (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed45fd5580ef9633da78f13aaa6aa472805)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10cb6b0ebc32004b797556bfc171c96bbf16)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab4ac5343058eaf7d448a428d8c4b72c844)) + + + + + +# [1.0.0-alpha.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@1.0.0-alpha.2) (2020-01-09) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [1.0.0-alpha.1](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@1.0.0-alpha.1) (2020-01-08) + + + +# 0.3.0 (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [0.1.0-preview.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@0.1.0-preview.3) (2019-09-09) + + +### Features + +* commit all clients ([#324](https://github.com/aws/aws-sdk-js-v3/issues/324)) ([cb268ed](https://github.com/aws/aws-sdk-js-v3/commit/cb268ed)) + + + +# 0.2.0 (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) + + + + + +# [0.1.0-preview.2](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/util-uri-escape@0.1.0-preview.1...@aws-sdk/util-uri-escape@0.1.0-preview.2) (2019-07-12) + + +### Features + +* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) +* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) diff --git a/server/node_modules/@aws-sdk/util-uri-escape/LICENSE b/server/node_modules/@aws-sdk/util-uri-escape/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-uri-escape/README.md b/server/node_modules/@aws-sdk/util-uri-escape/README.md new file mode 100644 index 0000000000..ee06a36bb5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/util-uri-escape + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-uri-escape/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-uri-escape) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-uri-escape.svg)](https://www.npmjs.com/package/@aws-sdk/util-uri-escape) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/escape-uri-path.js b/server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/escape-uri-path.js new file mode 100644 index 0000000000..f1dcdaaf88 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/escape-uri-path.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escapeUriPath = void 0; +const escape_uri_1 = require("./escape-uri"); +const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); +exports.escapeUriPath = escapeUriPath; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/escape-uri.js b/server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/escape-uri.js new file mode 100644 index 0000000000..4389a2a653 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/escape-uri.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escapeUri = void 0; +const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); +exports.escapeUri = escapeUri; +const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/index.js new file mode 100644 index 0000000000..dade19fa47 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-cjs/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./escape-uri"), exports); +tslib_1.__exportStar(require("./escape-uri-path"), exports); diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-es/escape-uri-path.js b/server/node_modules/@aws-sdk/util-uri-escape/dist-es/escape-uri-path.js new file mode 100644 index 0000000000..81b3fe37e0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-es/escape-uri-path.js @@ -0,0 +1,2 @@ +import { escapeUri } from "./escape-uri"; +export const escapeUriPath = (uri) => uri.split("/").map(escapeUri).join("/"); diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-es/escape-uri.js b/server/node_modules/@aws-sdk/util-uri-escape/dist-es/escape-uri.js new file mode 100644 index 0000000000..8990be1339 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-es/escape-uri.js @@ -0,0 +1,2 @@ +export const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); +const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-es/index.js b/server/node_modules/@aws-sdk/util-uri-escape/dist-es/index.js new file mode 100644 index 0000000000..ed402e1cd9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-es/index.js @@ -0,0 +1,2 @@ +export * from "./escape-uri"; +export * from "./escape-uri-path"; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-types/escape-uri-path.d.ts b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/escape-uri-path.d.ts new file mode 100644 index 0000000000..96005fa47d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/escape-uri-path.d.ts @@ -0,0 +1 @@ +export declare const escapeUriPath: (uri: string) => string; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-types/escape-uri.d.ts b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/escape-uri.d.ts new file mode 100644 index 0000000000..1331f55c5a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/escape-uri.d.ts @@ -0,0 +1 @@ +export declare const escapeUri: (uri: string) => string; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/index.d.ts new file mode 100644 index 0000000000..ed402e1cd9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/index.d.ts @@ -0,0 +1,2 @@ +export * from "./escape-uri"; +export * from "./escape-uri-path"; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/escape-uri-path.d.ts b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/escape-uri-path.d.ts new file mode 100644 index 0000000000..96005fa47d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/escape-uri-path.d.ts @@ -0,0 +1 @@ +export declare const escapeUriPath: (uri: string) => string; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/escape-uri.d.ts b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/escape-uri.d.ts new file mode 100644 index 0000000000..1331f55c5a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/escape-uri.d.ts @@ -0,0 +1 @@ +export declare const escapeUri: (uri: string) => string; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..ed402e1cd9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export * from "./escape-uri"; +export * from "./escape-uri-path"; diff --git a/server/node_modules/@aws-sdk/util-uri-escape/package.json b/server/node_modules/@aws-sdk/util-uri-escape/package.json new file mode 100644 index 0000000000..1cb47f2d19 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-uri-escape/package.json @@ -0,0 +1,52 @@ +{ + "name": "@aws-sdk/util-uri-escape", + "version": "3.201.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-uri-escape", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-uri-escape" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/LICENSE b/server/node_modules/@aws-sdk/util-user-agent-browser/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/README.md b/server/node_modules/@aws-sdk/util-user-agent-browser/README.md new file mode 100644 index 0000000000..f2b6c62827 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/util-user-agent-browser + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-user-agent-browser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-user-agent-browser) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-user-agent-browser.svg)](https://www.npmjs.com/package/@aws-sdk/util-user-agent-browser) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/configurations.js b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/configurations.js new file mode 100644 index 0000000000..c8ad2e549b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/configurations.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js new file mode 100644 index 0000000000..dac9ed8b3b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultUserAgent = void 0; +const tslib_1 = require("tslib"); +const bowser_1 = tslib_1.__importDefault(require("bowser")); +const defaultUserAgent = ({ serviceId, clientVersion }) => async () => { + var _a, _b, _c, _d, _e, _f, _g; + const parsedUA = typeof window !== "undefined" && ((_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) + ? bowser_1.default.parse(window.navigator.userAgent) + : undefined; + const sections = [ + ["aws-sdk-js", clientVersion], + [`os/${((_b = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.os) === null || _b === void 0 ? void 0 : _b.name) || "other"}`, (_c = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.os) === null || _c === void 0 ? void 0 : _c.version], + ["lang/js"], + ["md/browser", `${(_e = (_d = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.browser) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : "unknown"}_${(_g = (_f = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.browser) === null || _f === void 0 ? void 0 : _f.version) !== null && _g !== void 0 ? _g : "unknown"}`], + ]; + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); + } + return sections; +}; +exports.defaultUserAgent = defaultUserAgent; diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.native.js b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.native.js new file mode 100644 index 0000000000..aae69b12ce --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.native.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultUserAgent = void 0; +const defaultUserAgent = ({ serviceId, clientVersion }) => async () => { + const sections = [ + ["aws-sdk-js", clientVersion], + ["os/other"], + ["lang/js"], + ["md/rn"], + ]; + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); + } + return sections; +}; +exports.defaultUserAgent = defaultUserAgent; diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/configurations.js b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/configurations.js new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/configurations.js @@ -0,0 +1 @@ +export {}; diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js new file mode 100644 index 0000000000..063438024b --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js @@ -0,0 +1,16 @@ +import bowser from "bowser"; +export const defaultUserAgent = ({ serviceId, clientVersion }) => async () => { + const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent + ? bowser.parse(window.navigator.userAgent) + : undefined; + const sections = [ + ["aws-sdk-js", clientVersion], + [`os/${parsedUA?.os?.name || "other"}`, parsedUA?.os?.version], + ["lang/js"], + ["md/browser", `${parsedUA?.browser?.name ?? "unknown"}_${parsedUA?.browser?.version ?? "unknown"}`], + ]; + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); + } + return sections; +}; diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.native.js b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.native.js new file mode 100644 index 0000000000..0550b71230 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.native.js @@ -0,0 +1,12 @@ +export const defaultUserAgent = ({ serviceId, clientVersion }) => async () => { + const sections = [ + ["aws-sdk-js", clientVersion], + ["os/other"], + ["lang/js"], + ["md/rn"], + ]; + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); + } + return sections; +}; diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/configurations.d.ts b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/configurations.d.ts new file mode 100644 index 0000000000..474179b3f5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/configurations.d.ts @@ -0,0 +1,4 @@ +export interface DefaultUserAgentOptions { + serviceId?: string; + clientVersion: string; +} diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.d.ts new file mode 100644 index 0000000000..934bfe38c0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.d.ts @@ -0,0 +1,7 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; +import { DefaultUserAgentOptions } from "./configurations"; +/** + * Default provider to the user agent in browsers. It's a best effort to infer + * the device information. It uses bowser library to detect the browser and version + */ +export declare const defaultUserAgent: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.native.d.ts b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.native.d.ts new file mode 100644 index 0000000000..987dde5606 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.native.d.ts @@ -0,0 +1,7 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; +import { DefaultUserAgentOptions } from "./configurations"; +/** + * Default provider to the user agent in ReactNative. It's a best effort to infer + * the device information. It uses bowser library to detect the browser and virsion + */ +export declare const defaultUserAgent: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/configurations.d.ts b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/configurations.d.ts new file mode 100644 index 0000000000..1428231da0 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/configurations.d.ts @@ -0,0 +1,4 @@ +export interface DefaultUserAgentOptions { + serviceId?: string; + clientVersion: string; +} diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..2e6a920c19 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.d.ts @@ -0,0 +1,6 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; +import { DefaultUserAgentOptions } from "./configurations"; +export declare const defaultUserAgent: ({ + serviceId, + clientVersion, +}: DefaultUserAgentOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.native.d.ts b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.native.d.ts new file mode 100644 index 0000000000..2e6a920c19 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.native.d.ts @@ -0,0 +1,6 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; +import { DefaultUserAgentOptions } from "./configurations"; +export declare const defaultUserAgent: ({ + serviceId, + clientVersion, +}: DefaultUserAgentOptions) => Provider; diff --git a/server/node_modules/@aws-sdk/util-user-agent-browser/package.json b/server/node_modules/@aws-sdk/util-user-agent-browser/package.json new file mode 100644 index 0000000000..e584dfaea3 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-browser/package.json @@ -0,0 +1,53 @@ +{ + "name": "@aws-sdk/util-user-agent-browser", + "version": "3.257.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "react-native": "dist-es/index.native.js", + "dependencies": { + "@aws-sdk/types": "3.257.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-user-agent-browser", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-user-agent-browser" + } +} diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/LICENSE b/server/node_modules/@aws-sdk/util-user-agent-node/LICENSE new file mode 100644 index 0000000000..dd65ae06be --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/README.md b/server/node_modules/@aws-sdk/util-user-agent-node/README.md new file mode 100644 index 0000000000..fccfbb54eb --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/README.md @@ -0,0 +1,10 @@ +# @aws-sdk/util-user-agent-node + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-user-agent-node/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-user-agent-node) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-user-agent-node.svg)](https://www.npmjs.com/package/@aws-sdk/util-user-agent-node) + +> An internal package + +## Usage + +You probably shouldn't, at least directly. diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js new file mode 100644 index 0000000000..32d7ecc996 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultUserAgent = exports.UA_APP_ID_INI_NAME = exports.UA_APP_ID_ENV_NAME = void 0; +const node_config_provider_1 = require("@aws-sdk/node-config-provider"); +const os_1 = require("os"); +const process_1 = require("process"); +const is_crt_available_1 = require("./is-crt-available"); +exports.UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; +exports.UA_APP_ID_INI_NAME = "sdk-ua-app-id"; +const defaultUserAgent = ({ serviceId, clientVersion }) => { + const sections = [ + ["aws-sdk-js", clientVersion], + [`os/${(0, os_1.platform)()}`, (0, os_1.release)()], + ["lang/js"], + ["md/nodejs", `${process_1.versions.node}`], + ]; + const crtAvailable = (0, is_crt_available_1.isCrtAvailable)(); + if (crtAvailable) { + sections.push(crtAvailable); + } + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); + } + if (process_1.env.AWS_EXECUTION_ENV) { + sections.push([`exec-env/${process_1.env.AWS_EXECUTION_ENV}`]); + } + const appIdPromise = (0, node_config_provider_1.loadConfig)({ + environmentVariableSelector: (env) => env[exports.UA_APP_ID_ENV_NAME], + configFileSelector: (profile) => profile[exports.UA_APP_ID_INI_NAME], + default: undefined, + })(); + let resolvedUserAgent = undefined; + return async () => { + if (!resolvedUserAgent) { + const appId = await appIdPromise; + resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; + } + return resolvedUserAgent; + }; +}; +exports.defaultUserAgent = defaultUserAgent; diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js b/server/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js new file mode 100644 index 0000000000..4d794148f7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isCrtAvailable = void 0; +const isCrtAvailable = () => { + try { + if (typeof require === "function" && typeof module !== "undefined" && module.require && require("aws-crt")) { + return ["md/crt-avail"]; + } + return null; + } + catch (e) { + return null; + } +}; +exports.isCrtAvailable = isCrtAvailable; diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js b/server/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js new file mode 100644 index 0000000000..8923a9a0f7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js @@ -0,0 +1,37 @@ +import { loadConfig } from "@aws-sdk/node-config-provider"; +import { platform, release } from "os"; +import { env, versions } from "process"; +import { isCrtAvailable } from "./is-crt-available"; +export const UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; +export const UA_APP_ID_INI_NAME = "sdk-ua-app-id"; +export const defaultUserAgent = ({ serviceId, clientVersion }) => { + const sections = [ + ["aws-sdk-js", clientVersion], + [`os/${platform()}`, release()], + ["lang/js"], + ["md/nodejs", `${versions.node}`], + ]; + const crtAvailable = isCrtAvailable(); + if (crtAvailable) { + sections.push(crtAvailable); + } + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); + } + if (env.AWS_EXECUTION_ENV) { + sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]); + } + const appIdPromise = loadConfig({ + environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME], + configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME], + default: undefined, + })(); + let resolvedUserAgent = undefined; + return async () => { + if (!resolvedUserAgent) { + const appId = await appIdPromise; + resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; + } + return resolvedUserAgent; + }; +}; diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js b/server/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js new file mode 100644 index 0000000000..b060369f45 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js @@ -0,0 +1,11 @@ +export const isCrtAvailable = () => { + try { + if (typeof require === "function" && typeof module !== "undefined" && module.require && require("aws-crt")) { + return ["md/crt-avail"]; + } + return null; + } + catch (e) { + return null; + } +}; diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/index.d.ts new file mode 100644 index 0000000000..61c3fc5417 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/index.d.ts @@ -0,0 +1,12 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; +export declare const UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; +export declare const UA_APP_ID_INI_NAME = "sdk-ua-app-id"; +interface DefaultUserAgentOptions { + serviceId?: string; + clientVersion: string; +} +/** + * Collect metrics from runtime to put into user agent. + */ +export declare const defaultUserAgent: ({ serviceId, clientVersion }: DefaultUserAgentOptions) => Provider; +export {}; diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/is-crt-available.d.ts b/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/is-crt-available.d.ts new file mode 100644 index 0000000000..c3f8a3abe4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/is-crt-available.d.ts @@ -0,0 +1,2 @@ +import { UserAgentPair } from "@aws-sdk/types"; +export declare const isCrtAvailable: () => UserAgentPair | null; diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..cb43e2f9de --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/index.d.ts @@ -0,0 +1,12 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; +export declare const UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; +export declare const UA_APP_ID_INI_NAME = "sdk-ua-app-id"; +interface DefaultUserAgentOptions { + serviceId?: string; + clientVersion: string; +} +export declare const defaultUserAgent: ({ + serviceId, + clientVersion, +}: DefaultUserAgentOptions) => Provider; +export {}; diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/is-crt-available.d.ts b/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/is-crt-available.d.ts new file mode 100644 index 0000000000..c3f8a3abe4 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/is-crt-available.d.ts @@ -0,0 +1,2 @@ +import { UserAgentPair } from "@aws-sdk/types"; +export declare const isCrtAvailable: () => UserAgentPair | null; diff --git a/server/node_modules/@aws-sdk/util-user-agent-node/package.json b/server/node_modules/@aws-sdk/util-user-agent-node/package.json new file mode 100644 index 0000000000..02737283c9 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-user-agent-node/package.json @@ -0,0 +1,64 @@ +{ + "name": "@aws-sdk/util-user-agent-node", + "version": "3.259.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "types": "./dist-types/index.d.ts", + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/node-config-provider": "3.259.0", + "@aws-sdk/types": "3.257.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@aws-sdk/protocol-http": "3.257.0", + "@tsconfig/recommended": "1.0.1", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-user-agent-node", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-user-agent-node" + } +} diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/LICENSE b/server/node_modules/@aws-sdk/util-utf8-browser/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/README.md b/server/node_modules/@aws-sdk/util-utf8-browser/README.md new file mode 100644 index 0000000000..0ee6c23b90 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/README.md @@ -0,0 +1,8 @@ +# @aws-sdk/util-utf8-browser + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-utf8-browser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-utf8-browser) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-utf8-browser.svg)](https://www.npmjs.com/package/@aws-sdk/util-utf8-browser) + +> Deprecated package +> +> This internal package is deprecated in favor of [@aws-sdk/util-utf8](https://www.npmjs.com/package/@aws-sdk/util-utf8). diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js new file mode 100644 index 0000000000..e5960876c8 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toUtf8 = exports.fromUtf8 = void 0; +const pureJs_1 = require("./pureJs"); +const whatwgEncodingApi_1 = require("./whatwgEncodingApi"); +const fromUtf8 = (input) => typeof TextEncoder === "function" ? (0, whatwgEncodingApi_1.fromUtf8)(input) : (0, pureJs_1.fromUtf8)(input); +exports.fromUtf8 = fromUtf8; +const toUtf8 = (input) => typeof TextDecoder === "function" ? (0, whatwgEncodingApi_1.toUtf8)(input) : (0, pureJs_1.toUtf8)(input); +exports.toUtf8 = toUtf8; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/pureJs.js b/server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/pureJs.js new file mode 100644 index 0000000000..0361b761d6 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/pureJs.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toUtf8 = exports.fromUtf8 = void 0; +const fromUtf8 = (input) => { + const bytes = []; + for (let i = 0, len = input.length; i < len; i++) { + const value = input.charCodeAt(i); + if (value < 0x80) { + bytes.push(value); + } + else if (value < 0x800) { + bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000); + } + else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { + const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111); + bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000); + } + else { + bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000); + } + } + return Uint8Array.from(bytes); +}; +exports.fromUtf8 = fromUtf8; +const toUtf8 = (input) => { + let decoded = ""; + for (let i = 0, len = input.length; i < len; i++) { + const byte = input[i]; + if (byte < 0x80) { + decoded += String.fromCharCode(byte); + } + else if (0b11000000 <= byte && byte < 0b11100000) { + const nextByte = input[++i]; + decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111)); + } + else if (0b11110000 <= byte && byte < 0b101101101) { + const surrogatePair = [byte, input[++i], input[++i], input[++i]]; + const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%"); + decoded += decodeURIComponent(encoded); + } + else { + decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111)); + } + } + return decoded; +}; +exports.toUtf8 = toUtf8; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/whatwgEncodingApi.js b/server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/whatwgEncodingApi.js new file mode 100644 index 0000000000..b17f490640 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/whatwgEncodingApi.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toUtf8 = exports.fromUtf8 = void 0; +function fromUtf8(input) { + return new TextEncoder().encode(input); +} +exports.fromUtf8 = fromUtf8; +function toUtf8(input) { + return new TextDecoder("utf-8").decode(input); +} +exports.toUtf8 = toUtf8; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js b/server/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js new file mode 100644 index 0000000000..2f8b105637 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js @@ -0,0 +1,4 @@ +import { fromUtf8 as jsFromUtf8, toUtf8 as jsToUtf8 } from "./pureJs"; +import { fromUtf8 as textEncoderFromUtf8, toUtf8 as textEncoderToUtf8 } from "./whatwgEncodingApi"; +export const fromUtf8 = (input) => typeof TextEncoder === "function" ? textEncoderFromUtf8(input) : jsFromUtf8(input); +export const toUtf8 = (input) => typeof TextDecoder === "function" ? textEncoderToUtf8(input) : jsToUtf8(input); diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js b/server/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js new file mode 100644 index 0000000000..c038096b20 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js @@ -0,0 +1,42 @@ +export const fromUtf8 = (input) => { + const bytes = []; + for (let i = 0, len = input.length; i < len; i++) { + const value = input.charCodeAt(i); + if (value < 0x80) { + bytes.push(value); + } + else if (value < 0x800) { + bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000); + } + else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { + const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111); + bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000); + } + else { + bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000); + } + } + return Uint8Array.from(bytes); +}; +export const toUtf8 = (input) => { + let decoded = ""; + for (let i = 0, len = input.length; i < len; i++) { + const byte = input[i]; + if (byte < 0x80) { + decoded += String.fromCharCode(byte); + } + else if (0b11000000 <= byte && byte < 0b11100000) { + const nextByte = input[++i]; + decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111)); + } + else if (0b11110000 <= byte && byte < 0b101101101) { + const surrogatePair = [byte, input[++i], input[++i], input[++i]]; + const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%"); + decoded += decodeURIComponent(encoded); + } + else { + decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111)); + } + } + return decoded; +}; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js b/server/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js new file mode 100644 index 0000000000..22f6f567fe --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js @@ -0,0 +1,6 @@ +export function fromUtf8(input) { + return new TextEncoder().encode(input); +} +export function toUtf8(input) { + return new TextDecoder("utf-8").decode(input); +} diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/index.d.ts new file mode 100644 index 0000000000..c0cf357504 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/index.d.ts @@ -0,0 +1,2 @@ +export declare const fromUtf8: (input: string) => Uint8Array; +export declare const toUtf8: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/pureJs.d.ts b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/pureJs.d.ts new file mode 100644 index 0000000000..1590f9902a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/pureJs.d.ts @@ -0,0 +1,17 @@ +/** + * Converts a JS string from its native UCS-2/UTF-16 representation into a + * Uint8Array of the bytes used to represent the equivalent characters in UTF-8. + * + * Cribbed from the `goog.crypt.stringToUtf8ByteArray` function in the Google + * Closure library, though updated to use typed arrays. + */ +export declare const fromUtf8: (input: string) => Uint8Array; +/** + * Converts a typed array of bytes containing UTF-8 data into a native JS + * string. + * + * Partly cribbed from the `goog.crypt.utf8ByteArrayToString` function in the + * Google Closure library, though updated to use typed arrays and to better + * handle astral plane code points. + */ +export declare const toUtf8: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..c0cf357504 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/index.d.ts @@ -0,0 +1,2 @@ +export declare const fromUtf8: (input: string) => Uint8Array; +export declare const toUtf8: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/pureJs.d.ts b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/pureJs.d.ts new file mode 100644 index 0000000000..c0cf357504 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/pureJs.d.ts @@ -0,0 +1,2 @@ +export declare const fromUtf8: (input: string) => Uint8Array; +export declare const toUtf8: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/whatwgEncodingApi.d.ts b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/whatwgEncodingApi.d.ts new file mode 100644 index 0000000000..287ec898d3 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/ts3.4/whatwgEncodingApi.d.ts @@ -0,0 +1,2 @@ +export declare function fromUtf8(input: string): Uint8Array; +export declare function toUtf8(input: Uint8Array): string; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/whatwgEncodingApi.d.ts b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/whatwgEncodingApi.d.ts new file mode 100644 index 0000000000..287ec898d3 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/dist-types/whatwgEncodingApi.d.ts @@ -0,0 +1,2 @@ +export declare function fromUtf8(input: string): Uint8Array; +export declare function toUtf8(input: Uint8Array): string; diff --git a/server/node_modules/@aws-sdk/util-utf8-browser/package.json b/server/node_modules/@aws-sdk/util-utf8-browser/package.json new file mode 100644 index 0000000000..f3dd61f518 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8-browser/package.json @@ -0,0 +1,50 @@ +{ + "name": "@aws-sdk/util-utf8-browser", + "version": "3.259.0", + "description": "A browser UTF-8 string <-> UInt8Array converter", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.3.1" + }, + "types": "./dist-types/index.d.ts", + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-utf8-browser", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-utf8-browser" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + } +} diff --git a/server/node_modules/@aws-sdk/util-utf8/LICENSE b/server/node_modules/@aws-sdk/util-utf8/LICENSE new file mode 100644 index 0000000000..7b6491ba78 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/server/node_modules/@aws-sdk/util-utf8/README.md b/server/node_modules/@aws-sdk/util-utf8/README.md new file mode 100644 index 0000000000..be0ffd1440 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/util-utf8 + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-utf8/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-utf8) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-utf8.svg)](https://www.npmjs.com/package/@aws-sdk/util-utf8) diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-cjs/fromUtf8.browser.js b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/fromUtf8.browser.js new file mode 100644 index 0000000000..5da3fc91d5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/fromUtf8.browser.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromUtf8 = void 0; +const fromUtf8 = (input) => new TextEncoder().encode(input); +exports.fromUtf8 = fromUtf8; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-cjs/fromUtf8.js b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/fromUtf8.js new file mode 100644 index 0000000000..8ff3e19010 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/fromUtf8.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromUtf8 = void 0; +const util_buffer_from_1 = require("@aws-sdk/util-buffer-from"); +const fromUtf8 = (input) => { + const buf = (0, util_buffer_from_1.fromString)(input, "utf8"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); +}; +exports.fromUtf8 = fromUtf8; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-cjs/index.js b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/index.js new file mode 100644 index 0000000000..be13c2f235 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./fromUtf8"), exports); +tslib_1.__exportStar(require("./toUint8Array"), exports); +tslib_1.__exportStar(require("./toUtf8"), exports); diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUint8Array.js b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUint8Array.js new file mode 100644 index 0000000000..b68e87a883 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUint8Array.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toUint8Array = void 0; +const fromUtf8_1 = require("./fromUtf8"); +const toUint8Array = (data) => { + if (typeof data === "string") { + return (0, fromUtf8_1.fromUtf8)(data); + } + if (ArrayBuffer.isView(data)) { + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); + } + return new Uint8Array(data); +}; +exports.toUint8Array = toUint8Array; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUtf8.browser.js b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUtf8.browser.js new file mode 100644 index 0000000000..9ad34bad21 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUtf8.browser.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toUtf8 = void 0; +const toUtf8 = (input) => new TextDecoder("utf-8").decode(input); +exports.toUtf8 = toUtf8; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUtf8.js b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUtf8.js new file mode 100644 index 0000000000..372988a5b5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-cjs/toUtf8.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toUtf8 = void 0; +const util_buffer_from_1 = require("@aws-sdk/util-buffer-from"); +const toUtf8 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); +exports.toUtf8 = toUtf8; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-es/fromUtf8.browser.js b/server/node_modules/@aws-sdk/util-utf8/dist-es/fromUtf8.browser.js new file mode 100644 index 0000000000..73441900f5 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-es/fromUtf8.browser.js @@ -0,0 +1 @@ +export const fromUtf8 = (input) => new TextEncoder().encode(input); diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-es/fromUtf8.js b/server/node_modules/@aws-sdk/util-utf8/dist-es/fromUtf8.js new file mode 100644 index 0000000000..9982efc09c --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-es/fromUtf8.js @@ -0,0 +1,5 @@ +import { fromString } from "@aws-sdk/util-buffer-from"; +export const fromUtf8 = (input) => { + const buf = fromString(input, "utf8"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); +}; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-es/index.js b/server/node_modules/@aws-sdk/util-utf8/dist-es/index.js new file mode 100644 index 0000000000..00ba46574e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-es/index.js @@ -0,0 +1,3 @@ +export * from "./fromUtf8"; +export * from "./toUint8Array"; +export * from "./toUtf8"; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-es/toUint8Array.js b/server/node_modules/@aws-sdk/util-utf8/dist-es/toUint8Array.js new file mode 100644 index 0000000000..2cd36f7559 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-es/toUint8Array.js @@ -0,0 +1,10 @@ +import { fromUtf8 } from "./fromUtf8"; +export const toUint8Array = (data) => { + if (typeof data === "string") { + return fromUtf8(data); + } + if (ArrayBuffer.isView(data)) { + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); + } + return new Uint8Array(data); +}; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-es/toUtf8.browser.js b/server/node_modules/@aws-sdk/util-utf8/dist-es/toUtf8.browser.js new file mode 100644 index 0000000000..2dcdeba1a7 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-es/toUtf8.browser.js @@ -0,0 +1 @@ +export const toUtf8 = (input) => new TextDecoder("utf-8").decode(input); diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-es/toUtf8.js b/server/node_modules/@aws-sdk/util-utf8/dist-es/toUtf8.js new file mode 100644 index 0000000000..1a2950020a --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-es/toUtf8.js @@ -0,0 +1,2 @@ +import { fromArrayBuffer } from "@aws-sdk/util-buffer-from"; +export const toUtf8 = (input) => fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/fromUtf8.browser.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/fromUtf8.browser.d.ts new file mode 100644 index 0000000000..dd9198177d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/fromUtf8.browser.d.ts @@ -0,0 +1 @@ +export declare const fromUtf8: (input: string) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/fromUtf8.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/fromUtf8.d.ts new file mode 100644 index 0000000000..dd9198177d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/fromUtf8.d.ts @@ -0,0 +1 @@ +export declare const fromUtf8: (input: string) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/index.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/index.d.ts new file mode 100644 index 0000000000..00ba46574e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/index.d.ts @@ -0,0 +1,3 @@ +export * from "./fromUtf8"; +export * from "./toUint8Array"; +export * from "./toUtf8"; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/toUint8Array.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/toUint8Array.d.ts new file mode 100644 index 0000000000..11b6342e82 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/toUint8Array.d.ts @@ -0,0 +1 @@ +export declare const toUint8Array: (data: string | ArrayBuffer | ArrayBufferView) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/toUtf8.browser.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/toUtf8.browser.d.ts new file mode 100644 index 0000000000..46248f7f3e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/toUtf8.browser.d.ts @@ -0,0 +1 @@ +export declare const toUtf8: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/toUtf8.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/toUtf8.d.ts new file mode 100644 index 0000000000..46248f7f3e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/toUtf8.d.ts @@ -0,0 +1 @@ +export declare const toUtf8: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/fromUtf8.browser.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/fromUtf8.browser.d.ts new file mode 100644 index 0000000000..dd9198177d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/fromUtf8.browser.d.ts @@ -0,0 +1 @@ +export declare const fromUtf8: (input: string) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/fromUtf8.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/fromUtf8.d.ts new file mode 100644 index 0000000000..dd9198177d --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/fromUtf8.d.ts @@ -0,0 +1 @@ +export declare const fromUtf8: (input: string) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/index.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/index.d.ts new file mode 100644 index 0000000000..00ba46574e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/index.d.ts @@ -0,0 +1,3 @@ +export * from "./fromUtf8"; +export * from "./toUint8Array"; +export * from "./toUtf8"; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUint8Array.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUint8Array.d.ts new file mode 100644 index 0000000000..6cbd6390ad --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUint8Array.d.ts @@ -0,0 +1,3 @@ +export declare const toUint8Array: ( + data: string | ArrayBuffer | ArrayBufferView +) => Uint8Array; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUtf8.browser.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUtf8.browser.d.ts new file mode 100644 index 0000000000..46248f7f3e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUtf8.browser.d.ts @@ -0,0 +1 @@ +export declare const toUtf8: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUtf8.d.ts b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUtf8.d.ts new file mode 100644 index 0000000000..46248f7f3e --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/dist-types/ts3.4/toUtf8.d.ts @@ -0,0 +1 @@ +export declare const toUtf8: (input: Uint8Array) => string; diff --git a/server/node_modules/@aws-sdk/util-utf8/package.json b/server/node_modules/@aws-sdk/util-utf8/package.json new file mode 100644 index 0000000000..81c63dd057 --- /dev/null +++ b/server/node_modules/@aws-sdk/util-utf8/package.json @@ -0,0 +1,62 @@ +{ + "name": "@aws-sdk/util-utf8", + "version": "3.254.0", + "description": "A UTF-8 string <-> UInt8Array converter", + "main": "./dist-cjs/index.js", + "module": "./dist-es/index.js", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "test": "jest" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + }, + "devDependencies": { + "@tsconfig/recommended": "1.0.1", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "types": "./dist-types/index.d.ts", + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*" + ], + "browser": { + "./dist-es/fromUtf8": "./dist-es/fromUtf8.browser", + "./dist-es/toUtf8": "./dist-es/toUtf8.browser" + }, + "react-native": { + "./dist-es/fromUtf8": "./dist-es/fromUtf8.browser", + "./dist-es/toUtf8": "./dist-es/toUtf8.browser" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-utf8", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "packages/util-utf8" + } +} diff --git a/server/node_modules/@sindresorhus/is/dist/index.d.ts b/server/node_modules/@sindresorhus/is/dist/index.d.ts deleted file mode 100644 index e94d30b767..0000000000 --- a/server/node_modules/@sindresorhus/is/dist/index.d.ts +++ /dev/null @@ -1,132 +0,0 @@ -/// -/// -/// -/// -/// -declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; -declare type Primitive = null | undefined | string | number | boolean | Symbol; -export interface ArrayLike { - length: number; -} -export interface Class { - new (...args: any[]): T; -} -declare type DomElement = object & { - nodeType: 1; - nodeName: string; -}; -declare type NodeStream = object & { - pipe: Function; -}; -export declare const enum TypeName { - null = "null", - boolean = "boolean", - undefined = "undefined", - string = "string", - number = "number", - symbol = "symbol", - Function = "Function", - GeneratorFunction = "GeneratorFunction", - AsyncFunction = "AsyncFunction", - Observable = "Observable", - Array = "Array", - Buffer = "Buffer", - Object = "Object", - RegExp = "RegExp", - Date = "Date", - Error = "Error", - Map = "Map", - Set = "Set", - WeakMap = "WeakMap", - WeakSet = "WeakSet", - Int8Array = "Int8Array", - Uint8Array = "Uint8Array", - Uint8ClampedArray = "Uint8ClampedArray", - Int16Array = "Int16Array", - Uint16Array = "Uint16Array", - Int32Array = "Int32Array", - Uint32Array = "Uint32Array", - Float32Array = "Float32Array", - Float64Array = "Float64Array", - ArrayBuffer = "ArrayBuffer", - SharedArrayBuffer = "SharedArrayBuffer", - DataView = "DataView", - Promise = "Promise", - URL = "URL" -} -declare function is(value: unknown): TypeName; -declare namespace is { - const undefined: (value: unknown) => value is undefined; - const string: (value: unknown) => value is string; - const number: (value: unknown) => value is number; - const function_: (value: unknown) => value is Function; - const null_: (value: unknown) => value is null; - const class_: (value: unknown) => value is Class; - const boolean: (value: unknown) => value is boolean; - const symbol: (value: unknown) => value is Symbol; - const numericString: (value: unknown) => boolean; - const array: (arg: any) => arg is any[]; - const buffer: (input: unknown) => input is Buffer; - const nullOrUndefined: (value: unknown) => value is null | undefined; - const object: (value: unknown) => value is object; - const iterable: (value: unknown) => value is IterableIterator; - const asyncIterable: (value: unknown) => value is AsyncIterableIterator; - const generator: (value: unknown) => value is Generator; - const nativePromise: (value: unknown) => value is Promise; - const promise: (value: unknown) => value is Promise; - const generatorFunction: (value: unknown) => value is GeneratorFunction; - const asyncFunction: (value: unknown) => value is Function; - const boundFunction: (value: unknown) => value is Function; - const regExp: (value: unknown) => value is RegExp; - const date: (value: unknown) => value is Date; - const error: (value: unknown) => value is Error; - const map: (value: unknown) => value is Map; - const set: (value: unknown) => value is Set; - const weakMap: (value: unknown) => value is WeakMap; - const weakSet: (value: unknown) => value is WeakSet; - const int8Array: (value: unknown) => value is Int8Array; - const uint8Array: (value: unknown) => value is Uint8Array; - const uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray; - const int16Array: (value: unknown) => value is Int16Array; - const uint16Array: (value: unknown) => value is Uint16Array; - const int32Array: (value: unknown) => value is Int32Array; - const uint32Array: (value: unknown) => value is Uint32Array; - const float32Array: (value: unknown) => value is Float32Array; - const float64Array: (value: unknown) => value is Float64Array; - const arrayBuffer: (value: unknown) => value is ArrayBuffer; - const sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer; - const dataView: (value: unknown) => value is DataView; - const directInstanceOf: (instance: unknown, klass: Class) => instance is T; - const urlInstance: (value: unknown) => value is URL; - const urlString: (value: unknown) => boolean; - const truthy: (value: unknown) => boolean; - const falsy: (value: unknown) => boolean; - const nan: (value: unknown) => boolean; - const primitive: (value: unknown) => value is Primitive; - const integer: (value: unknown) => value is number; - const safeInteger: (value: unknown) => value is number; - const plainObject: (value: unknown) => boolean; - const typedArray: (value: unknown) => value is TypedArray; - const arrayLike: (value: unknown) => value is ArrayLike; - const inRange: (value: number, range: number | number[]) => boolean; - const domElement: (value: unknown) => value is DomElement; - const observable: (value: unknown) => boolean; - const nodeStream: (value: unknown) => value is NodeStream; - const infinite: (value: unknown) => boolean; - const even: (value: number) => boolean; - const odd: (value: number) => boolean; - const emptyArray: (value: unknown) => boolean; - const nonEmptyArray: (value: unknown) => boolean; - const emptyString: (value: unknown) => boolean; - const nonEmptyString: (value: unknown) => boolean; - const emptyStringOrWhitespace: (value: unknown) => boolean; - const emptyObject: (value: unknown) => boolean; - const nonEmptyObject: (value: unknown) => boolean; - const emptySet: (value: unknown) => boolean; - const nonEmptySet: (value: unknown) => boolean; - const emptyMap: (value: unknown) => boolean; - const nonEmptyMap: (value: unknown) => boolean; - const any: (predicate: unknown, ...values: unknown[]) => boolean; - const all: (predicate: unknown, ...values: unknown[]) => boolean; -} -export default is; diff --git a/server/node_modules/@sindresorhus/is/dist/index.js b/server/node_modules/@sindresorhus/is/dist/index.js deleted file mode 100644 index 3cbafae18c..0000000000 --- a/server/node_modules/@sindresorhus/is/dist/index.js +++ /dev/null @@ -1,245 +0,0 @@ -"use strict"; -/// -/// -/// -/// -Object.defineProperty(exports, "__esModule", { value: true }); -// TODO: Use the `URL` global when targeting Node.js 10 -// tslint:disable-next-line -const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL; -const toString = Object.prototype.toString; -const isOfType = (type) => (value) => typeof value === type; -const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input); -const getObjectType = (value) => { - const objectName = toString.call(value).slice(8, -1); - if (objectName) { - return objectName; - } - return null; -}; -const isObjectOfType = (type) => (value) => getObjectType(value) === type; -function is(value) { - switch (value) { - case null: - return "null" /* null */; - case true: - case false: - return "boolean" /* boolean */; - default: - } - switch (typeof value) { - case 'undefined': - return "undefined" /* undefined */; - case 'string': - return "string" /* string */; - case 'number': - return "number" /* number */; - case 'symbol': - return "symbol" /* symbol */; - default: - } - if (is.function_(value)) { - return "Function" /* Function */; - } - if (is.observable(value)) { - return "Observable" /* Observable */; - } - if (Array.isArray(value)) { - return "Array" /* Array */; - } - if (isBuffer(value)) { - return "Buffer" /* Buffer */; - } - const tagType = getObjectType(value); - if (tagType) { - return tagType; - } - if (value instanceof String || value instanceof Boolean || value instanceof Number) { - throw new TypeError('Please don\'t use object wrappers for primitive types'); - } - return "Object" /* Object */; -} -(function (is) { - // tslint:disable-next-line:strict-type-predicates - const isObject = (value) => typeof value === 'object'; - // tslint:disable:variable-name - is.undefined = isOfType('undefined'); - is.string = isOfType('string'); - is.number = isOfType('number'); - is.function_ = isOfType('function'); - // tslint:disable-next-line:strict-type-predicates - is.null_ = (value) => value === null; - is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); - is.boolean = (value) => value === true || value === false; - is.symbol = isOfType('symbol'); - // tslint:enable:variable-name - is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value)); - is.array = Array.isArray; - is.buffer = isBuffer; - is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); - is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value)); - is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]); - is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]); - is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); - is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value); - const hasPromiseAPI = (value) => !is.null_(value) && - isObject(value) && - is.function_(value.then) && - is.function_(value.catch); - is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); - is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */); - is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */); - is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); - is.regExp = isObjectOfType("RegExp" /* RegExp */); - is.date = isObjectOfType("Date" /* Date */); - is.error = isObjectOfType("Error" /* Error */); - is.map = (value) => isObjectOfType("Map" /* Map */)(value); - is.set = (value) => isObjectOfType("Set" /* Set */)(value); - is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value); - is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value); - is.int8Array = isObjectOfType("Int8Array" /* Int8Array */); - is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */); - is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */); - is.int16Array = isObjectOfType("Int16Array" /* Int16Array */); - is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */); - is.int32Array = isObjectOfType("Int32Array" /* Int32Array */); - is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */); - is.float32Array = isObjectOfType("Float32Array" /* Float32Array */); - is.float64Array = isObjectOfType("Float64Array" /* Float64Array */); - is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */); - is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */); - is.dataView = isObjectOfType("DataView" /* DataView */); - is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype; - is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value); - is.urlString = (value) => { - if (!is.string(value)) { - return false; - } - try { - new URLGlobal(value); // tslint:disable-line no-unused-expression - return true; - } - catch (_a) { - return false; - } - }; - is.truthy = (value) => Boolean(value); - is.falsy = (value) => !value; - is.nan = (value) => Number.isNaN(value); - const primitiveTypes = new Set([ - 'undefined', - 'string', - 'number', - 'boolean', - 'symbol' - ]); - is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value); - is.integer = (value) => Number.isInteger(value); - is.safeInteger = (value) => Number.isSafeInteger(value); - is.plainObject = (value) => { - // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js - let prototype; - return getObjectType(value) === "Object" /* Object */ && - (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator - prototype === Object.getPrototypeOf({})); - }; - const typedArrayTypes = new Set([ - "Int8Array" /* Int8Array */, - "Uint8Array" /* Uint8Array */, - "Uint8ClampedArray" /* Uint8ClampedArray */, - "Int16Array" /* Int16Array */, - "Uint16Array" /* Uint16Array */, - "Int32Array" /* Int32Array */, - "Uint32Array" /* Uint32Array */, - "Float32Array" /* Float32Array */, - "Float64Array" /* Float64Array */ - ]); - is.typedArray = (value) => { - const objectType = getObjectType(value); - if (objectType === null) { - return false; - } - return typedArrayTypes.has(objectType); - }; - const isValidLength = (value) => is.safeInteger(value) && value > -1; - is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); - is.inRange = (value, range) => { - if (is.number(range)) { - return value >= Math.min(0, range) && value <= Math.max(range, 0); - } - if (is.array(range) && range.length === 2) { - return value >= Math.min(...range) && value <= Math.max(...range); - } - throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); - }; - const NODE_TYPE_ELEMENT = 1; - const DOM_PROPERTIES_TO_CHECK = [ - 'innerHTML', - 'ownerDocument', - 'style', - 'attributes', - 'nodeValue' - ]; - is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) && - !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value); - is.observable = (value) => { - if (!value) { - return false; - } - if (value[Symbol.observable] && value === value[Symbol.observable]()) { - return true; - } - if (value['@@observable'] && value === value['@@observable']()) { - return true; - } - return false; - }; - is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value); - is.infinite = (value) => value === Infinity || value === -Infinity; - const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem; - is.even = isAbsoluteMod2(0); - is.odd = isAbsoluteMod2(1); - const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false; - is.emptyArray = (value) => is.array(value) && value.length === 0; - is.nonEmptyArray = (value) => is.array(value) && value.length > 0; - is.emptyString = (value) => is.string(value) && value.length === 0; - is.nonEmptyString = (value) => is.string(value) && value.length > 0; - is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); - is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; - is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; - is.emptySet = (value) => is.set(value) && value.size === 0; - is.nonEmptySet = (value) => is.set(value) && value.size > 0; - is.emptyMap = (value) => is.map(value) && value.size === 0; - is.nonEmptyMap = (value) => is.map(value) && value.size > 0; - const predicateOnArray = (method, predicate, values) => { - if (is.function_(predicate) === false) { - throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); - } - if (values.length === 0) { - throw new TypeError('Invalid number of values'); - } - return method.call(values, predicate); - }; - // tslint:disable variable-name - is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values); - is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); - // tslint:enable variable-name -})(is || (is = {})); -// Some few keywords are reserved, but we'll populate them for Node.js users -// See https://github.com/Microsoft/TypeScript/issues/2536 -Object.defineProperties(is, { - class: { - value: is.class_ - }, - function: { - value: is.function_ - }, - null: { - value: is.null_ - } -}); -exports.default = is; -// For CommonJS default export support -module.exports = is; -module.exports.default = is; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/server/node_modules/@sindresorhus/is/dist/index.js.map b/server/node_modules/@sindresorhus/is/dist/index.js.map deleted file mode 100644 index cd827fc291..0000000000 --- a/server/node_modules/@sindresorhus/is/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,0CAA0C;AAC1C,2CAA2C;AAC3C,0BAA0B;;AAE1B,uDAAuD;AACvD,2BAA2B;AAC3B,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAqDxE,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;AAC3C,MAAM,Q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,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;SACvE;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACxB,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;SAChD;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,SAAgB,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,+BAA+B;IAClB,MAAG,GAAG,CAAC,SAAkB,EAAE,GAAG,MAAiB,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC9G,MAAG,GAAG,CAAC,SAAkB,EAAE,GAAG,MAAiB,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5H,8BAA8B;AAC/B,CAAC,EAvNS,EAAE,KAAF,EAAE,QAuNX;AAED,4EAA4E;AAC5E,0DAA0D;AAC1D,MAAM,CAAC,gBAAgB,CAAC,EAAE,EAAE;IAC3B,KAAK,EAAE;QACN,KAAK,EAAE,EAAE,CAAC,MAAM;KAChB;IACD,QAAQ,EAAE;QACT,KAAK,EAAE,EAAE,CAAC,SAAS;KACnB;IACD,IAAI,EAAE;QACL,KAAK,EAAE,EAAE,CAAC,KAAK;KACf;CACD,CAAC,CAAC;AAEH,kBAAe,EAAE,CAAC;AAElB,sCAAsC;AACtC,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;AACpB,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/server/node_modules/@sindresorhus/is/license b/server/node_modules/@sindresorhus/is/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/server/node_modules/@sindresorhus/is/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/@sindresorhus/is/package.json b/server/node_modules/@sindresorhus/is/package.json deleted file mode 100644 index f34a1aa3bf..0000000000 --- a/server/node_modules/@sindresorhus/is/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_from": "@sindresorhus/is@^0.14.0", - "_id": "@sindresorhus/is@0.14.0", - "_inBundle": false, - "_integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "_location": "/@sindresorhus/is", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@sindresorhus/is@^0.14.0", - "name": "@sindresorhus/is", - "escapedName": "@sindresorhus%2fis", - "scope": "@sindresorhus", - "rawSpec": "^0.14.0", - "saveSpec": null, - "fetchSpec": "^0.14.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "_shasum": "9fb3a3cf3132328151f353de4632e01e52102bea", - "_spec": "@sindresorhus/is@^0.14.0", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\got", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Type check values: `is.string('🦄') //=> true`", - "devDependencies": { - "@sindresorhus/tsconfig": "^0.1.0", - "@types/jsdom": "^11.12.0", - "@types/node": "^10.12.10", - "@types/tempy": "^0.2.0", - "@types/zen-observable": "^0.8.0", - "ava": "^0.25.0", - "del-cli": "^1.1.0", - "jsdom": "^11.6.2", - "rxjs": "^6.3.3", - "tempy": "^0.2.1", - "tslint": "^5.9.1", - "tslint-xo": "^0.10.0", - "typescript": "^3.2.1", - "zen-observable": "^0.8.8" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "dist" - ], - "homepage": "https://github.com/sindresorhus/is#readme", - "keywords": [ - "type", - "types", - "is", - "check", - "checking", - "validate", - "validation", - "utility", - "util", - "typeof", - "instanceof", - "object", - "assert", - "assertion", - "test", - "kind", - "primitive", - "verify", - "compare" - ], - "license": "MIT", - "main": "dist/index.js", - "name": "@sindresorhus/is", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is.git" - }, - "scripts": { - "build": "del dist && tsc", - "lint": "tslint --format stylish --project .", - "prepublish": "npm run build && del dist/tests", - "test": "npm run lint && npm run build && ava dist/tests" - }, - "types": "dist/index.d.ts", - "version": "0.14.0" -} diff --git a/server/node_modules/@sindresorhus/is/readme.md b/server/node_modules/@sindresorhus/is/readme.md deleted file mode 100644 index 97c023b574..0000000000 --- a/server/node_modules/@sindresorhus/is/readme.md +++ /dev/null @@ -1,451 +0,0 @@ -# is [![Build Status](https://travis-ci.org/sindresorhus/is.svg?branch=master)](https://travis-ci.org/sindresorhus/is) - -> Type check values: `is.string('🦄') //=> true` - - - - -## Install - -``` -$ npm install @sindresorhus/is -``` - - -## Usage - -```js -const is = require('@sindresorhus/is'); - -is('🦄'); -//=> 'string' - -is(new Map()); -//=> 'Map' - -is.number(6); -//=> true -``` - -When using `is` together with TypeScript, [type guards](http://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types) are being used to infer the correct type inside if-else statements. - -```ts -import is from '@sindresorhus/is'; - -const padLeft = (value: string, padding: string | number) => { - if (is.number(padding)) { - // `padding` is typed as `number` - return Array(padding + 1).join(' ') + value; - } - - if (is.string(padding)) { - // `padding` is typed as `string` - return padding + value; - } - - throw new TypeError(`Expected 'padding' to be of type 'string' or 'number', got '${is(padding)}'.`); -} - -padLeft('🦄', 3); -//=> ' 🦄' - -padLeft('🦄', '🌈'); -//=> '🌈🦄' -``` - - -## API - -### is(value) - -Returns the type of `value`. - -Primitives are lowercase and object types are camelcase. - -Example: - -- `'undefined'` -- `'null'` -- `'string'` -- `'symbol'` -- `'Array'` -- `'Function'` -- `'Object'` - -Note: It will throw an error if you try to feed it object-wrapped primitives, as that's a bad practice. For example `new String('foo')`. - -### is.{method} - -All the below methods accept a value and returns a boolean for whether the value is of the desired type. - -#### Primitives - -##### .undefined(value) -##### .null(value) -##### .string(value) -##### .number(value) -##### .boolean(value) -##### .symbol(value) - -#### Built-in types - -##### .array(value) -##### .function(value) -##### .buffer(value) -##### .object(value) - -Keep in mind that [functions are objects too](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions). - -##### .numericString(value) - -Returns `true` for a string that represents a number. For example, `'42'` and `'-8'`. - -Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`. - -##### .regExp(value) -##### .date(value) -##### .error(value) -##### .nativePromise(value) -##### .promise(value) - -Returns `true` for any object with a `.then()` and `.catch()` method. Prefer this one over `.nativePromise()` as you usually want to allow userland promise implementations too. - -##### .generator(value) - -Returns `true` for any object that implements its own `.next()` and `.throw()` methods and has a function definition for `Symbol.iterator`. - -##### .generatorFunction(value) - -##### .asyncFunction(value) - -Returns `true` for any `async` function that can be called with the `await` operator. - -```js -is.asyncFunction(async () => {}); -// => true - -is.asyncFunction(() => {}); -// => false -``` - -##### .boundFunction(value) - -Returns `true` for any `bound` function. - -```js -is.boundFunction(() => {}); -// => true - -is.boundFunction(function () {}.bind(null)); -// => true - -is.boundFunction(function () {}); -// => false -``` - -##### .map(value) -##### .set(value) -##### .weakMap(value) -##### .weakSet(value) - -#### Typed arrays - -##### .int8Array(value) -##### .uint8Array(value) -##### .uint8ClampedArray(value) -##### .int16Array(value) -##### .uint16Array(value) -##### .int32Array(value) -##### .uint32Array(value) -##### .float32Array(value) -##### .float64Array(value) - -#### Structured data - -##### .arrayBuffer(value) -##### .sharedArrayBuffer(value) -##### .dataView(value) - -#### Emptiness - -##### .emptyString(value) - -Returns `true` if the value is a `string` and the `.length` is 0. - -##### .nonEmptyString(value) - -Returns `true` if the value is a `string` and the `.length` is more than 0. - -##### .emptyStringOrWhitespace(value) - -Returns `true` if `is.emptyString(value)` or if it's a `string` that is all whitespace. - -##### .emptyArray(value) - -Returns `true` if the value is an `Array` and the `.length` is 0. - -##### .nonEmptyArray(value) - -Returns `true` if the value is an `Array` and the `.length` is more than 0. - -##### .emptyObject(value) - -Returns `true` if the value is an `Object` and `Object.keys(value).length` is 0. - -Please note that `Object.keys` returns only own enumerable properties. Hence something like this can happen: - -```js -const object1 = {}; - -Object.defineProperty(object1, 'property1', { - value: 42, - writable: true, - enumerable: false, - configurable: true -}); - -is.emptyObject(object1); -// => true -``` - -##### .nonEmptyObject(value) - -Returns `true` if the value is an `Object` and `Object.keys(value).length` is more than 0. - -##### .emptySet(value) - -Returns `true` if the value is a `Set` and the `.size` is 0. - -##### .nonEmptySet(Value) - -Returns `true` if the value is a `Set` and the `.size` is more than 0. - -##### .emptyMap(value) - -Returns `true` if the value is a `Map` and the `.size` is 0. - -##### .nonEmptyMap(value) - -Returns `true` if the value is a `Map` and the `.size` is more than 0. - -#### Miscellaneous - -##### .directInstanceOf(value, class) - -Returns `true` if `value` is a direct instance of `class`. - -```js -is.directInstanceOf(new Error(), Error); -//=> true - -class UnicornError extends Error {} - -is.directInstanceOf(new UnicornError(), Error); -//=> false -``` - -##### .urlInstance(value) - -Returns `true` if `value` is an instance of the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL). - -```js -const url = new URL('https://example.com'); - -is.urlInstance(url); -//=> true -``` - -### .url(value) - -Returns `true` if `value` is a URL string. - -Note: this only does basic checking using the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL) constructor. - -```js -const url = 'https://example.com'; - -is.url(url); -//=> true - -is.url(new URL(url)); -//=> false -``` - -##### .truthy(value) - -Returns `true` for all values that evaluate to true in a boolean context: - -```js -is.truthy('🦄'); -//=> true - -is.truthy(undefined); -//=> false -``` - -##### .falsy(value) - -Returns `true` if `value` is one of: `false`, `0`, `''`, `null`, `undefined`, `NaN`. - -##### .nan(value) -##### .nullOrUndefined(value) -##### .primitive(value) - -JavaScript primitives are as follows: `null`, `undefined`, `string`, `number`, `boolean`, `symbol`. - -##### .integer(value) - -##### .safeInteger(value) - -Returns `true` if `value` is a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - -##### .plainObject(value) - -An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`. - -##### .iterable(value) -##### .asyncIterable(value) -##### .class(value) - -Returns `true` for instances created by a class. - -##### .typedArray(value) - -##### .arrayLike(value) - -A `value` is array-like if it is not a function and has a `value.length` that is a safe integer greater than or equal to 0. - -```js -is.arrayLike(document.forms); -//=> true - -function foo() { - is.arrayLike(arguments); - //=> true -} -foo(); -``` - -##### .inRange(value, range) - -Check if `value` (number) is in the given `range`. The range is an array of two values, lower bound and upper bound, in no specific order. - -```js -is.inRange(3, [0, 5]); -is.inRange(3, [5, 0]); -is.inRange(0, [-2, 2]); -``` - -##### .inRange(value, upperBound) - -Check if `value` (number) is in the range of `0` to `upperBound`. - -```js -is.inRange(3, 10); -``` - -##### .domElement(value) - -Returns `true` if `value` is a DOM Element. - -##### .nodeStream(value) - -Returns `true` if `value` is a Node.js [stream](https://nodejs.org/api/stream.html). - -```js -const fs = require('fs'); - -is.nodeStream(fs.createReadStream('unicorn.png')); -//=> true -``` - -##### .observable(value) - -Returns `true` if `value` is an `Observable`. - -```js -const {Observable} = require('rxjs'); - -is.observable(new Observable()); -//=> true -``` - -##### .infinite(value) - -Check if `value` is `Infinity` or `-Infinity`. - -##### .even(value) - -Returns `true` if `value` is an even integer. - -##### .odd(value) - -Returns `true` if `value` is an odd integer. - -##### .any(predicate, ...values) - -Returns `true` if **any** of the input `values` returns true in the `predicate`: - -```js -is.any(is.string, {}, true, '🦄'); -//=> true - -is.any(is.boolean, 'unicorns', [], new Map()); -//=> false -``` - -##### .all(predicate, ...values) - -Returns `true` if **all** of the input `values` returns true in the `predicate`: - -```js -is.all(is.object, {}, new Map(), new Set()); -//=> true - -is.all(is.string, '🦄', [], 'unicorns'); -//=> false -``` - - -## FAQ - -### Why yet another type checking module? - -There are hundreds of type checking modules on npm, unfortunately, I couldn't find any that fit my needs: - -- Includes both type methods and ability to get the type -- Types of primitives returned as lowercase and object types as camelcase -- Covers all built-ins -- Unsurprising behavior -- Well-maintained -- Comprehensive test suite - -For the ones I found, pick 3 of these. - -The most common mistakes I noticed in these modules was using `instanceof` for type checking, forgetting that functions are objects, and omitting `symbol` as a primitive. - - -## Related - -- [ow](https://github.com/sindresorhus/ow) - Function argument validation for humans -- [is-stream](https://github.com/sindresorhus/is-stream) - Check if something is a Node.js stream -- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable -- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array -- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address -- [is-array-sorted](https://github.com/sindresorhus/is-array-sorted) - Check if an Array is sorted -- [is-error-constructor](https://github.com/sindresorhus/is-error-constructor) - Check if a value is an error constructor -- [is-empty-iterable](https://github.com/sindresorhus/is-empty-iterable) - Check if an Iterable is empty -- [is-blob](https://github.com/sindresorhus/is-blob) - Check if a value is a Blob - File-like object of immutable, raw data -- [has-emoji](https://github.com/sindresorhus/has-emoji) - Check whether a string has any emoji - - -## Created by - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Giora Guttsait](https://github.com/gioragutt) -- [Brandon Smith](https://github.com/brandon93s) - - -## License - -MIT diff --git a/server/node_modules/@szmarczak/http-timer/LICENSE b/server/node_modules/@szmarczak/http-timer/LICENSE deleted file mode 100644 index 15ad2e8d57..0000000000 --- a/server/node_modules/@szmarczak/http-timer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Szymon Marczak - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/server/node_modules/@szmarczak/http-timer/README.md b/server/node_modules/@szmarczak/http-timer/README.md deleted file mode 100644 index 13279ed8cf..0000000000 --- a/server/node_modules/@szmarczak/http-timer/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# http-timer -> Timings for HTTP requests - -[![Build Status](https://travis-ci.org/szmarczak/http-timer.svg?branch=master)](https://travis-ci.org/szmarczak/http-timer) -[![Coverage Status](https://coveralls.io/repos/github/szmarczak/http-timer/badge.svg?branch=master)](https://coveralls.io/github/szmarczak/http-timer?branch=master) -[![install size](https://packagephobia.now.sh/badge?p=@szmarczak/http-timer)](https://packagephobia.now.sh/result?p=@szmarczak/http-timer) - -Inspired by the [`request` package](https://github.com/request/request). - -## Usage -```js -'use strict'; -const https = require('https'); -const timer = require('@szmarczak/http-timer'); - -const request = https.get('https://httpbin.org/anything'); -const timings = timer(request); - -request.on('response', response => { - response.on('data', () => {}); // Consume the data somehow - response.on('end', () => { - console.log(timings); - }); -}); - -// { start: 1535708511443, -// socket: 1535708511444, -// lookup: 1535708511444, -// connect: 1535708511582, -// upload: 1535708511887, -// response: 1535708512037, -// end: 1535708512040, -// phases: -// { wait: 1, -// dns: 0, -// tcp: 138, -// request: 305, -// firstByte: 150, -// download: 3, -// total: 597 } } -``` - -## API - -### timer(request) - -Returns: `Object` - -- `start` - Time when the request started. -- `socket` - Time when a socket was assigned to the request. -- `lookup` - Time when the DNS lookup finished. -- `connect` - Time when the socket successfully connected. -- `upload` - Time when the request finished uploading. -- `response` - Time when the request fired the `response` event. -- `end` - Time when the response fired the `end` event. -- `error` - Time when the request fired the `error` event. -- `phases` - - `wait` - `timings.socket - timings.start` - - `dns` - `timings.lookup - timings.socket` - - `tcp` - `timings.connect - timings.lookup` - - `request` - `timings.upload - timings.connect` - - `firstByte` - `timings.response - timings.upload` - - `download` - `timings.end - timings.response` - - `total` - `timings.end - timings.start` or `timings.error - timings.start` - -**Note**: The time is a `number` representing the milliseconds elapsed since the UNIX epoch. - -## License - -MIT diff --git a/server/node_modules/@szmarczak/http-timer/package.json b/server/node_modules/@szmarczak/http-timer/package.json deleted file mode 100644 index ee9f5f832c..0000000000 --- a/server/node_modules/@szmarczak/http-timer/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "@szmarczak/http-timer@^1.1.2", - "_id": "@szmarczak/http-timer@1.1.2", - "_inBundle": false, - "_integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "_location": "/@szmarczak/http-timer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@szmarczak/http-timer@^1.1.2", - "name": "@szmarczak/http-timer", - "escapedName": "@szmarczak%2fhttp-timer", - "scope": "@szmarczak", - "rawSpec": "^1.1.2", - "saveSpec": null, - "fetchSpec": "^1.1.2" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "_shasum": "b1665e2c461a2cd92f4c1bbf50d5454de0d4b421", - "_spec": "@szmarczak/http-timer@^1.1.2", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\got", - "author": { - "name": "Szymon Marczak" - }, - "bugs": { - "url": "https://github.com/szmarczak/http-timer/issues" - }, - "bundleDependencies": false, - "dependencies": { - "defer-to-connect": "^1.0.1" - }, - "deprecated": false, - "description": "Timings for HTTP requests", - "devDependencies": { - "ava": "^0.25.0", - "coveralls": "^3.0.2", - "nyc": "^12.0.2", - "p-event": "^2.1.0", - "xo": "^0.22.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "source" - ], - "homepage": "https://github.com/szmarczak/http-timer#readme", - "keywords": [ - "http", - "https", - "timer", - "timings" - ], - "license": "MIT", - "main": "source", - "name": "@szmarczak/http-timer", - "repository": { - "type": "git", - "url": "git+https://github.com/szmarczak/http-timer.git" - }, - "scripts": { - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "test": "xo && nyc ava" - }, - "version": "1.1.2", - "xo": { - "rules": { - "unicorn/filename-case": "camelCase" - } - } -} diff --git a/server/node_modules/@szmarczak/http-timer/source/index.js b/server/node_modules/@szmarczak/http-timer/source/index.js deleted file mode 100644 index e294580402..0000000000 --- a/server/node_modules/@szmarczak/http-timer/source/index.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; -const deferToConnect = require('defer-to-connect'); - -module.exports = request => { - const timings = { - start: Date.now(), - socket: null, - lookup: null, - connect: null, - upload: null, - response: null, - end: null, - error: null, - phases: { - wait: null, - dns: null, - tcp: null, - request: null, - firstByte: null, - download: null, - total: null - } - }; - - const handleError = origin => { - const emit = origin.emit.bind(origin); - origin.emit = (event, ...args) => { - // Catches the `error` event - if (event === 'error') { - timings.error = Date.now(); - timings.phases.total = timings.error - timings.start; - - origin.emit = emit; - } - - // Saves the original behavior - return emit(event, ...args); - }; - }; - - let uploadFinished = false; - const onUpload = () => { - timings.upload = Date.now(); - timings.phases.request = timings.upload - timings.connect; - }; - - handleError(request); - - request.once('socket', socket => { - timings.socket = Date.now(); - timings.phases.wait = timings.socket - timings.start; - - const lookupListener = () => { - timings.lookup = Date.now(); - timings.phases.dns = timings.lookup - timings.socket; - }; - - socket.once('lookup', lookupListener); - - deferToConnect(socket, () => { - timings.connect = Date.now(); - - if (timings.lookup === null) { - socket.removeListener('lookup', lookupListener); - timings.lookup = timings.connect; - timings.phases.dns = timings.lookup - timings.socket; - } - - timings.phases.tcp = timings.connect - timings.lookup; - - if (uploadFinished && !timings.upload) { - onUpload(); - } - }); - }); - - request.once('finish', () => { - uploadFinished = true; - - if (timings.connect) { - onUpload(); - } - }); - - request.once('response', response => { - timings.response = Date.now(); - timings.phases.firstByte = timings.response - timings.upload; - - handleError(response); - - response.once('end', () => { - timings.end = Date.now(); - timings.phases.download = timings.end - timings.response; - timings.phases.total = timings.end - timings.start; - }); - }); - - return timings; -}; diff --git a/server/node_modules/@types/node/LICENSE b/server/node_modules/@types/node/LICENSE new file mode 100755 index 0000000000..9e841e7a26 --- /dev/null +++ b/server/node_modules/@types/node/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/server/node_modules/@types/node/README.md b/server/node_modules/@types/node/README.md new file mode 100755 index 0000000000..667a8d792c --- /dev/null +++ b/server/node_modules/@types/node/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for Node.js (https://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. + +### Additional Details + * Last updated: Mon, 26 Dec 2022 17:32:37 GMT + * Dependencies: none + * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone` + +# Credits +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). diff --git a/server/node_modules/@types/node/assert.d.ts b/server/node_modules/@types/node/assert.d.ts new file mode 100755 index 0000000000..e8595e6371 --- /dev/null +++ b/server/node_modules/@types/node/assert.d.ts @@ -0,0 +1,961 @@ +/** + * The `assert` module provides a set of assertion functions for verifying + * invariants. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/assert.js) + */ +declare module 'assert' { + /** + * An alias of {@link ok}. + * @since v0.5.9 + * @param value The input that is checked for being truthy. + */ + function assert(value: unknown, message?: string | Error): asserts value; + namespace assert { + /** + * Indicates the failure of an assertion. All errors thrown by the `assert` module + * will be instances of the `AssertionError` class. + */ + class AssertionError extends Error { + actual: unknown; + expected: unknown; + operator: string; + generatedMessage: boolean; + code: 'ERR_ASSERTION'; + constructor(options?: { + /** If provided, the error message is set to this value. */ + message?: string | undefined; + /** The `actual` property on the error instance. */ + actual?: unknown | undefined; + /** The `expected` property on the error instance. */ + expected?: unknown | undefined; + /** The `operator` property on the error instance. */ + operator?: string | undefined; + /** If provided, the generated stack trace omits frames before this function. */ + // tslint:disable-next-line:ban-types + stackStartFn?: Function | undefined; + }); + } + /** + * This feature is currently experimental and behavior might still change. + * @since v14.2.0, v12.19.0 + * @experimental + */ + class CallTracker { + /** + * The wrapper function is expected to be called exactly `exact` times. If the + * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an + * error. + * + * ```js + * import assert from 'assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func); + * ``` + * @since v14.2.0, v12.19.0 + * @param [fn='A no-op function'] + * @param [exact=1] + * @return that wraps `fn`. + */ + calls(exact?: number): () => void; + calls any>(fn?: Func, exact?: number): Func; + /** + * Example: + * + * ```js + * import assert from 'node:assert'; + * + * const tracker = new assert.CallTracker(); + * + * function func() {} + * const callsfunc = tracker.calls(func); + * callsfunc(1, 2, 3); + * + * assert.deepStrictEqual(tracker.getCalls(callsfunc), + * [{ thisArg: this, arguments: [1, 2, 3 ] }]); + * ``` + * + * @since v18.8.0, v16.18.0 + * @params fn + * @returns An Array with the calls to a tracked function. + */ + getCalls(fn: Function): CallTrackerCall[]; + /** + * The arrays contains information about the expected and actual number of calls of + * the functions that have not been called the expected number of times. + * + * ```js + * import assert from 'assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * function foo() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func, 2); + * + * // Returns an array containing information on callsfunc() + * tracker.report(); + * // [ + * // { + * // message: 'Expected the func function to be executed 2 time(s) but was + * // executed 0 time(s).', + * // actual: 0, + * // expected: 2, + * // operator: 'func', + * // stack: stack trace + * // } + * // ] + * ``` + * @since v14.2.0, v12.19.0 + * @return of objects containing information about the wrapper functions returned by `calls`. + */ + report(): CallTrackerReportInformation[]; + /** + * Reset calls of the call tracker. + * If a tracked function is passed as an argument, the calls will be reset for it. + * If no arguments are passed, all tracked functions will be reset. + * + * ```js + * import assert from 'node:assert'; + * + * const tracker = new assert.CallTracker(); + * + * function func() {} + * const callsfunc = tracker.calls(func); + * + * callsfunc(); + * // Tracker was called once + * tracker.getCalls(callsfunc).length === 1; + * + * tracker.reset(callsfunc); + * tracker.getCalls(callsfunc).length === 0; + * ``` + * + * @since v18.8.0, v16.18.0 + * @param fn a tracked function to reset. + */ + reset(fn?: Function): void; + /** + * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that + * have not been called the expected number of times. + * + * ```js + * import assert from 'assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func, 2); + * + * callsfunc(); + * + * // Will throw an error since callsfunc() was only called once. + * tracker.verify(); + * ``` + * @since v14.2.0, v12.19.0 + */ + verify(): void; + } + interface CallTrackerCall { + thisArg: object; + arguments: unknown[]; + } + interface CallTrackerReportInformation { + message: string; + /** The actual number of times the function was called. */ + actual: number; + /** The number of times the function was expected to be called. */ + expected: number; + /** The name of the function that is wrapped. */ + operator: string; + /** A stack trace of the function. */ + stack: object; + } + type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error; + /** + * Throws an `AssertionError` with the provided error message or a default + * error message. If the `message` parameter is an instance of an `Error` then + * it will be thrown instead of the `AssertionError`. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.fail(); + * // AssertionError [ERR_ASSERTION]: Failed + * + * assert.fail('boom'); + * // AssertionError [ERR_ASSERTION]: boom + * + * assert.fail(new TypeError('need array')); + * // TypeError: need array + * ``` + * + * Using `assert.fail()` with more than two arguments is possible but deprecated. + * See below for further details. + * @since v0.1.21 + * @param [message='Failed'] + */ + function fail(message?: string | Error): never; + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ + function fail( + actual: unknown, + expected: unknown, + message?: string | Error, + operator?: string, + // tslint:disable-next-line:ban-types + stackStartFn?: Function + ): never; + /** + * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. + * + * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default + * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. + * + * Be aware that in the `repl` the error message will be different to the one + * thrown in a file! See below for further details. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.ok(true); + * // OK + * assert.ok(1); + * // OK + * + * assert.ok(); + * // AssertionError: No value argument passed to `assert.ok()` + * + * assert.ok(false, 'it\'s false'); + * // AssertionError: it's false + * + * // In the repl: + * assert.ok(typeof 123 === 'string'); + * // AssertionError: false == true + * + * // In a file (e.g. test.js): + * assert.ok(typeof 123 === 'string'); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(typeof 123 === 'string') + * + * assert.ok(false); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(false) + * + * assert.ok(0); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(0) + * ``` + * + * ```js + * import assert from 'assert/strict'; + * + * // Using `assert()` works the same: + * assert(0); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert(0) + * ``` + * @since v0.1.21 + */ + function ok(value: unknown, message?: string | Error): asserts value; + /** + * **Strict assertion mode** + * + * An alias of {@link strictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link strictEqual} instead. + * + * Tests shallow, coercive equality between the `actual` and `expected` parameters + * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled + * and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'assert'; + * + * assert.equal(1, 1); + * // OK, 1 == 1 + * assert.equal(1, '1'); + * // OK, 1 == '1' + * assert.equal(NaN, NaN); + * // OK + * + * assert.equal(1, 2); + * // AssertionError: 1 == 2 + * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); + * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } + * ``` + * + * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default + * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * @since v0.1.21 + */ + function equal(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. + * + * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is + * specially handled and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'assert'; + * + * assert.notEqual(1, 2); + * // OK + * + * assert.notEqual(1, 1); + * // AssertionError: 1 != 1 + * + * assert.notEqual(1, '1'); + * // AssertionError: 1 != '1' + * ``` + * + * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error + * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * @since v0.1.21 + */ + function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link deepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. + * + * Tests for deep equality between the `actual` and `expected` parameters. Consider + * using {@link deepStrictEqual} instead. {@link deepEqual} can have + * surprising results. + * + * _Deep equality_ means that the enumerable "own" properties of child objects + * are also recursively evaluated by the following rules. + * @since v0.1.21 + */ + function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notDeepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. + * + * Tests for any deep inequality. Opposite of {@link deepEqual}. + * + * ```js + * import assert from 'assert'; + * + * const obj1 = { + * a: { + * b: 1 + * } + * }; + * const obj2 = { + * a: { + * b: 2 + * } + * }; + * const obj3 = { + * a: { + * b: 1 + * } + * }; + * const obj4 = Object.create(obj1); + * + * assert.notDeepEqual(obj1, obj1); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj2); + * // OK + * + * assert.notDeepEqual(obj1, obj3); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj4); + * // OK + * ``` + * + * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default + * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests strict equality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'assert/strict'; + * + * assert.strictEqual(1, 2); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + * // 1 !== 2 + * + * assert.strictEqual(1, 1); + * // OK + * + * assert.strictEqual('Hello foobar', 'Hello World!'); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + actual - expected + * // + * // + 'Hello foobar' + * // - 'Hello World!' + * // ^ + * + * const apples = 1; + * const oranges = 2; + * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); + * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 + * + * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); + * // TypeError: Inputs are not identical + * ``` + * + * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a + * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests strict inequality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'assert/strict'; + * + * assert.notStrictEqual(1, 2); + * // OK + * + * assert.notStrictEqual(1, 1); + * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: + * // + * // 1 + * + * assert.notStrictEqual(1, '1'); + * // OK + * ``` + * + * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a + * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests for deep equality between the `actual` and `expected` parameters. + * "Deep" equality means that the enumerable "own" properties of child objects + * are recursively evaluated also by the following rules. + * @since v1.2.0 + */ + function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); + * // OK + * ``` + * + * If the values are deeply and strictly equal, an `AssertionError` is thrown + * with a `message` property set equal to the value of the `message` parameter. If + * the `message` parameter is undefined, a default error message is assigned. If + * the `message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v1.2.0 + */ + function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Expects the function `fn` to throw an error. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * a validation object where each property will be tested for strict deep equality, + * or an instance of error where each property will be tested for strict deep + * equality including the non-enumerable `message` and `name` properties. When + * using an object, it is also possible to use a regular expression, when + * validating against a string property. See below for examples. + * + * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation + * fails. + * + * Custom validation object/error instance: + * + * ```js + * import assert from 'assert/strict'; + * + * const err = new TypeError('Wrong value'); + * err.code = 404; + * err.foo = 'bar'; + * err.info = { + * nested: true, + * baz: 'text' + * }; + * err.reg = /abc/i; + * + * assert.throws( + * () => { + * throw err; + * }, + * { + * name: 'TypeError', + * message: 'Wrong value', + * info: { + * nested: true, + * baz: 'text' + * } + * // Only properties on the validation object will be tested for. + * // Using nested objects requires all properties to be present. Otherwise + * // the validation is going to fail. + * } + * ); + * + * // Using regular expressions to validate error properties: + * throws( + * () => { + * throw err; + * }, + * { + * // The `name` and `message` properties are strings and using regular + * // expressions on those will match against the string. If they fail, an + * // error is thrown. + * name: /^TypeError$/, + * message: /Wrong/, + * foo: 'bar', + * info: { + * nested: true, + * // It is not possible to use regular expressions for nested properties! + * baz: 'text' + * }, + * // The `reg` property contains a regular expression and only if the + * // validation object contains an identical regular expression, it is going + * // to pass. + * reg: /abc/i + * } + * ); + * + * // Fails due to the different `message` and `name` properties: + * throws( + * () => { + * const otherErr = new Error('Not found'); + * // Copy all enumerable properties from `err` to `otherErr`. + * for (const [key, value] of Object.entries(err)) { + * otherErr[key] = value; + * } + * throw otherErr; + * }, + * // The error's `message` and `name` properties will also be checked when using + * // an error as validation object. + * err + * ); + * ``` + * + * Validate instanceof using constructor: + * + * ```js + * import assert from 'assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * Error + * ); + * ``` + * + * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): + * + * Using a regular expression runs `.toString` on the error object, and will + * therefore also include the error name. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * /^Error: Wrong value$/ + * ); + * ``` + * + * Custom error validation: + * + * The function must return `true` to indicate all internal validations passed. + * It will otherwise fail with an `AssertionError`. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * (err) => { + * assert(err instanceof Error); + * assert(/value/.test(err)); + * // Avoid returning anything from validation functions besides `true`. + * // Otherwise, it's not clear what part of the validation failed. Instead, + * // throw an error about the specific validation that failed (as done in this + * // example) and add as much helpful debugging information to that error as + * // possible. + * return true; + * }, + * 'unexpected error' + * ); + * ``` + * + * `error` cannot be a string. If a string is provided as the second + * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same + * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using + * a string as the second argument gets considered: + * + * ```js + * import assert from 'assert/strict'; + * + * function throwingFirst() { + * throw new Error('First'); + * } + * + * function throwingSecond() { + * throw new Error('Second'); + * } + * + * function notThrowing() {} + * + * // The second argument is a string and the input function threw an Error. + * // The first case will not throw as it does not match for the error message + * // thrown by the input function! + * assert.throws(throwingFirst, 'Second'); + * // In the next example the message has no benefit over the message from the + * // error and since it is not clear if the user intended to actually match + * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. + * assert.throws(throwingSecond, 'Second'); + * // TypeError [ERR_AMBIGUOUS_ARGUMENT] + * + * // The string is only used (as message) in case the function does not throw: + * assert.throws(notThrowing, 'Second'); + * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second + * + * // If it was intended to match for the error message do this instead: + * // It does not throw because the error messages match. + * assert.throws(throwingSecond, /Second$/); + * + * // If the error message does not match, an AssertionError is thrown. + * assert.throws(throwingFirst, /Second$/); + * // AssertionError [ERR_ASSERTION] + * ``` + * + * Due to the confusing error-prone notation, avoid a string as the second + * argument. + * @since v0.1.21 + */ + function throws(block: () => unknown, message?: string | Error): void; + function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Asserts that the function `fn` does not throw an error. + * + * Using `assert.doesNotThrow()` is actually not useful because there + * is no benefit in catching an error and then rethrowing it. Instead, consider + * adding a comment next to the specific code path that should not throw and keep + * error messages as expressive as possible. + * + * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. + * + * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a + * different type, or if the `error` parameter is undefined, the error is + * propagated back to the caller. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation + * function. See {@link throws} for more details. + * + * The following, for instance, will throw the `TypeError` because there is no + * matching error type in the assertion: + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError + * ); + * ``` + * + * However, the following will result in an `AssertionError` with the message + * 'Got unwanted exception...': + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * TypeError + * ); + * ``` + * + * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * /Wrong value/, + * 'Whoops' + * ); + * // Throws: AssertionError: Got unwanted exception: Whoops + * ``` + * @since v0.1.21 + */ + function doesNotThrow(block: () => unknown, message?: string | Error): void; + function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Throws `value` if `value` is not `undefined` or `null`. This is useful when + * testing the `error` argument in callbacks. The stack trace contains all frames + * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.ifError(null); + * // OK + * assert.ifError(0); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 + * assert.ifError('error'); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' + * assert.ifError(new Error()); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error + * + * // Create some random error frames. + * let err; + * (function errorFrame() { + * err = new Error('test error'); + * })(); + * + * (function ifErrorFrame() { + * assert.ifError(err); + * })(); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error + * // at ifErrorFrame + * // at errorFrame + * ``` + * @since v0.1.97 + */ + function ifError(value: unknown): asserts value is null | undefined; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is rejected. + * + * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the + * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error + * handler is skipped. + * + * Besides the async nature to await the completion behaves identically to {@link throws}. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * an object where each property will be tested for, or an instance of error where + * each property will be tested for including the non-enumerable `message` and`name` properties. + * + * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. + * + * ```js + * import assert from 'assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * { + * name: 'TypeError', + * message: 'Wrong value' + * } + * ); + * ``` + * + * ```js + * import assert from 'assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * (err) => { + * assert.strictEqual(err.name, 'TypeError'); + * assert.strictEqual(err.message, 'Wrong value'); + * return true; + * } + * ); + * ``` + * + * ```js + * import assert from 'assert/strict'; + * + * assert.rejects( + * Promise.reject(new Error('Wrong value')), + * Error + * ).then(() => { + * // ... + * }); + * ``` + * + * `error` cannot be a string. If a string is provided as the second + * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the + * example in {@link throws} carefully if using a string as the second + * argument gets considered. + * @since v10.0.0 + */ + function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; + function rejects(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is not rejected. + * + * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If + * the function does not return a promise, `assert.doesNotReject()` will return a + * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases + * the error handler is skipped. + * + * Using `assert.doesNotReject()` is actually not useful because there is little + * benefit in catching a rejection and then rejecting it again. Instead, consider + * adding a comment next to the specific code path that should not reject and keep + * error messages as expressive as possible. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation + * function. See {@link throws} for more details. + * + * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. + * + * ```js + * import assert from 'assert/strict'; + * + * await assert.doesNotReject( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError + * ); + * ``` + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) + * .then(() => { + * // ... + * }); + * ``` + * @since v10.0.0 + */ + function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; + function doesNotReject(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; + /** + * Expects the `string` input to match the regular expression. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.match('I will fail', /pass/); + * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... + * + * assert.match(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.match('I will pass', /pass/); + * // OK + * ``` + * + * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v13.6.0, v12.16.0 + */ + function match(value: string, regExp: RegExp, message?: string | Error): void; + /** + * Expects the `string` input not to match the regular expression. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotMatch('I will fail', /fail/); + * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... + * + * assert.doesNotMatch(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.doesNotMatch('I will pass', /different/); + * // OK + * ``` + * + * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v13.6.0, v12.16.0 + */ + function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; + const strict: Omit & { + (value: unknown, message?: string | Error): asserts value; + equal: typeof strictEqual; + notEqual: typeof notStrictEqual; + deepEqual: typeof deepStrictEqual; + notDeepEqual: typeof notDeepStrictEqual; + // Mapped types and assertion functions are incompatible? + // TS2775: Assertions require every name in the call target + // to be declared with an explicit type annotation. + ok: typeof ok; + strictEqual: typeof strictEqual; + deepStrictEqual: typeof deepStrictEqual; + ifError: typeof ifError; + strict: typeof strict; + }; + } + export = assert; +} +declare module 'node:assert' { + import assert = require('assert'); + export = assert; +} diff --git a/server/node_modules/@types/node/assert/strict.d.ts b/server/node_modules/@types/node/assert/strict.d.ts new file mode 100755 index 0000000000..b4319b9748 --- /dev/null +++ b/server/node_modules/@types/node/assert/strict.d.ts @@ -0,0 +1,8 @@ +declare module 'assert/strict' { + import { strict } from 'node:assert'; + export = strict; +} +declare module 'node:assert/strict' { + import { strict } from 'node:assert'; + export = strict; +} diff --git a/server/node_modules/@types/node/async_hooks.d.ts b/server/node_modules/@types/node/async_hooks.d.ts new file mode 100755 index 0000000000..0bf4739650 --- /dev/null +++ b/server/node_modules/@types/node/async_hooks.d.ts @@ -0,0 +1,501 @@ +/** + * The `async_hooks` module provides an API to track asynchronous resources. It + * can be accessed using: + * + * ```js + * import async_hooks from 'async_hooks'; + * ``` + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/async_hooks.js) + */ +declare module 'async_hooks' { + /** + * ```js + * import { executionAsyncId } from 'async_hooks'; + * + * console.log(executionAsyncId()); // 1 - bootstrap + * fs.open(path, 'r', (err, fd) => { + * console.log(executionAsyncId()); // 6 - open() + * }); + * ``` + * + * The ID returned from `executionAsyncId()` is related to execution timing, not + * causality (which is covered by `triggerAsyncId()`): + * + * ```js + * const server = net.createServer((conn) => { + * // Returns the ID of the server, not of the new connection, because the + * // callback runs in the execution scope of the server's MakeCallback(). + * async_hooks.executionAsyncId(); + * + * }).listen(port, () => { + * // Returns the ID of a TickObject (process.nextTick()) because all + * // callbacks passed to .listen() are wrapped in a nextTick(). + * async_hooks.executionAsyncId(); + * }); + * ``` + * + * Promise contexts may not get precise `executionAsyncIds` by default. + * See the section on `promise execution tracking`. + * @since v8.1.0 + * @return The `asyncId` of the current execution context. Useful to track when something calls. + */ + function executionAsyncId(): number; + /** + * Resource objects returned by `executionAsyncResource()` are most often internal + * Node.js handle objects with undocumented APIs. Using any functions or properties + * on the object is likely to crash your application and should be avoided. + * + * Using `executionAsyncResource()` in the top-level execution context will + * return an empty object as there is no handle or request object to use, + * but having an object representing the top-level can be helpful. + * + * ```js + * import { open } from 'fs'; + * import { executionAsyncId, executionAsyncResource } from 'async_hooks'; + * + * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} + * open(new URL(import.meta.url), 'r', (err, fd) => { + * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap + * }); + * ``` + * + * This can be used to implement continuation local storage without the + * use of a tracking `Map` to store the metadata: + * + * ```js + * import { createServer } from 'http'; + * import { + * executionAsyncId, + * executionAsyncResource, + * createHook + * } from 'async_hooks'; + * const sym = Symbol('state'); // Private symbol to avoid pollution + * + * createHook({ + * init(asyncId, type, triggerAsyncId, resource) { + * const cr = executionAsyncResource(); + * if (cr) { + * resource[sym] = cr[sym]; + * } + * } + * }).enable(); + * + * const server = createServer((req, res) => { + * executionAsyncResource()[sym] = { state: req.url }; + * setTimeout(function() { + * res.end(JSON.stringify(executionAsyncResource()[sym])); + * }, 100); + * }).listen(3000); + * ``` + * @since v13.9.0, v12.17.0 + * @return The resource representing the current execution. Useful to store data within the resource. + */ + function executionAsyncResource(): object; + /** + * ```js + * const server = net.createServer((conn) => { + * // The resource that caused (or triggered) this callback to be called + * // was that of the new connection. Thus the return value of triggerAsyncId() + * // is the asyncId of "conn". + * async_hooks.triggerAsyncId(); + * + * }).listen(port, () => { + * // Even though all callbacks passed to .listen() are wrapped in a nextTick() + * // the callback itself exists because the call to the server's .listen() + * // was made. So the return value would be the ID of the server. + * async_hooks.triggerAsyncId(); + * }); + * ``` + * + * Promise contexts may not get valid `triggerAsyncId`s by default. See + * the section on `promise execution tracking`. + * @return The ID of the resource responsible for calling the callback that is currently being executed. + */ + function triggerAsyncId(): number; + interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId a unique ID for the async resource + * @param type the type of the async resource + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created + * @param resource reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + /** + * Called immediately after the callback specified in before is completed. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + /** + * Registers functions to be called for different lifetime events of each async + * operation. + * + * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the + * respective asynchronous event during a resource's lifetime. + * + * All callbacks are optional. For example, if only resource cleanup needs to + * be tracked, then only the `destroy` callback needs to be passed. The + * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. + * + * ```js + * import { createHook } from 'async_hooks'; + * + * const asyncHook = createHook({ + * init(asyncId, type, triggerAsyncId, resource) { }, + * destroy(asyncId) { } + * }); + * ``` + * + * The callbacks will be inherited via the prototype chain: + * + * ```js + * class MyAsyncCallbacks { + * init(asyncId, type, triggerAsyncId, resource) { } + * destroy(asyncId) {} + * } + * + * class MyAddedCallbacks extends MyAsyncCallbacks { + * before(asyncId) { } + * after(asyncId) { } + * } + * + * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); + * ``` + * + * Because promises are asynchronous resources whose lifecycle is tracked + * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. + * @since v8.1.0 + * @param callbacks The `Hook Callbacks` to register + * @return Instance used for disabling and enabling hooks + */ + function createHook(callbacks: HookCallbacks): AsyncHook; + interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * @default executionAsyncId() + */ + triggerAsyncId?: number | undefined; + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * @default false + */ + requireManualDestroy?: boolean | undefined; + } + /** + * The class `AsyncResource` is designed to be extended by the embedder's async + * resources. Using this, users can easily trigger the lifetime events of their + * own resources. + * + * The `init` hook will trigger when an `AsyncResource` is instantiated. + * + * The following is an overview of the `AsyncResource` API. + * + * ```js + * import { AsyncResource, executionAsyncId } from 'async_hooks'; + * + * // AsyncResource() is meant to be extended. Instantiating a + * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * // async_hook.executionAsyncId() is used. + * const asyncResource = new AsyncResource( + * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false } + * ); + * + * // Run a function in the execution context of the resource. This will + * // * establish the context of the resource + * // * trigger the AsyncHooks before callbacks + * // * call the provided function `fn` with the supplied arguments + * // * trigger the AsyncHooks after callbacks + * // * restore the original execution context + * asyncResource.runInAsyncScope(fn, thisArg, ...args); + * + * // Call AsyncHooks destroy callbacks. + * asyncResource.emitDestroy(); + * + * // Return the unique ID assigned to the AsyncResource instance. + * asyncResource.asyncId(); + * + * // Return the trigger ID for the AsyncResource instance. + * asyncResource.triggerAsyncId(); + * ``` + */ + class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since v9.3.0) + */ + constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); + /** + * Binds the given function to the current execution context. + * + * The returned function will have an `asyncResource` property referencing + * the `AsyncResource` to which the function is bound. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current execution context. + * @param type An optional name to associate with the underlying `AsyncResource`. + */ + static bind any, ThisArg>( + fn: Func, + type?: string, + thisArg?: ThisArg + ): Func & { + asyncResource: AsyncResource; + }; + /** + * Binds the given function to execute to this `AsyncResource`'s scope. + * + * The returned function will have an `asyncResource` property referencing + * the `AsyncResource` to which the function is bound. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current `AsyncResource`. + */ + bind any>( + fn: Func + ): Func & { + asyncResource: AsyncResource; + }; + /** + * Call the provided function with the provided arguments in the execution context + * of the async resource. This will establish the context, trigger the AsyncHooks + * before callbacks, call the function, trigger the AsyncHooks after callbacks, and + * then restore the original execution context. + * @since v9.6.0 + * @param fn The function to call in the execution context of this async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; + /** + * Call all `destroy` hooks. This should only ever be called once. An error will + * be thrown if it is called more than once. This **must** be manually called. If + * the resource is left to be collected by the GC then the `destroy` hooks will + * never be called. + * @return A reference to `asyncResource`. + */ + emitDestroy(): this; + /** + * @return The unique `asyncId` assigned to the resource. + */ + asyncId(): number; + /** + * + * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. + */ + triggerAsyncId(): number; + } + /** + * This class creates stores that stay coherent through asynchronous operations. + * + * While you can create your own implementation on top of the `async_hooks` module,`AsyncLocalStorage` should be preferred as it is a performant and memory safe + * implementation that involves significant optimizations that are non-obvious to + * implement. + * + * The following example uses `AsyncLocalStorage` to build a simple logger + * that assigns IDs to incoming HTTP requests and includes them in messages + * logged within each request. + * + * ```js + * import http from 'http'; + * import { AsyncLocalStorage } from 'async_hooks'; + * + * const asyncLocalStorage = new AsyncLocalStorage(); + * + * function logWithId(msg) { + * const id = asyncLocalStorage.getStore(); + * console.log(`${id !== undefined ? id : '-'}:`, msg); + * } + * + * let idSeq = 0; + * http.createServer((req, res) => { + * asyncLocalStorage.run(idSeq++, () => { + * logWithId('start'); + * // Imagine any chain of async operations here + * setImmediate(() => { + * logWithId('finish'); + * res.end(); + * }); + * }); + * }).listen(8080); + * + * http.get('http://localhost:8080'); + * http.get('http://localhost:8080'); + * // Prints: + * // 0: start + * // 1: start + * // 0: finish + * // 1: finish + * ``` + * + * Each instance of `AsyncLocalStorage` maintains an independent storage context. + * Multiple instances can safely exist simultaneously without risk of interfering + * with each other's data. + * @since v13.10.0, v12.17.0 + */ + class AsyncLocalStorage { + /** + * Disables the instance of `AsyncLocalStorage`. All subsequent calls + * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. + * + * When calling `asyncLocalStorage.disable()`, all current contexts linked to the + * instance will be exited. + * + * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores + * provided by the `asyncLocalStorage`, as those objects are garbage collected + * along with the corresponding async resources. + * + * Use this method when the `asyncLocalStorage` is not in use anymore + * in the current process. + * @since v13.10.0, v12.17.0 + * @experimental + */ + disable(): void; + /** + * Returns the current store. + * If called outside of an asynchronous context initialized by + * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it + * returns `undefined`. + * @since v13.10.0, v12.17.0 + */ + getStore(): T | undefined; + /** + * Runs a function synchronously within a context and returns its + * return value. The store is not accessible outside of the callback function. + * The store is accessible to any asynchronous operations created within the + * callback. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `run()` too. + * The stacktrace is not impacted by this call and the context is exited. + * + * Example: + * + * ```js + * const store = { id: 2 }; + * try { + * asyncLocalStorage.run(store, () => { + * asyncLocalStorage.getStore(); // Returns the store object + * setTimeout(() => { + * asyncLocalStorage.getStore(); // Returns the store object + * }, 200); + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns undefined + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + */ + run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Runs a function synchronously outside of a context and returns its + * return value. The store is not accessible within the callback function or + * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `exit()` too. + * The stacktrace is not impacted by this call and the context is re-entered. + * + * Example: + * + * ```js + * // Within a call to run + * try { + * asyncLocalStorage.getStore(); // Returns the store object or value + * asyncLocalStorage.exit(() => { + * asyncLocalStorage.getStore(); // Returns undefined + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns the same object or value + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + * @experimental + */ + exit(callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Transitions into the context for the remainder of the current + * synchronous execution and then persists the store through any following + * asynchronous calls. + * + * Example: + * + * ```js + * const store = { id: 1 }; + * // Replaces previous store with the given store object + * asyncLocalStorage.enterWith(store); + * asyncLocalStorage.getStore(); // Returns the store object + * someAsyncOperation(() => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * ``` + * + * This transition will continue for the _entire_ synchronous execution. + * This means that if, for example, the context is entered within an event + * handler subsequent event handlers will also run within that context unless + * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons + * to use the latter method. + * + * ```js + * const store = { id: 1 }; + * + * emitter.on('my-event', () => { + * asyncLocalStorage.enterWith(store); + * }); + * emitter.on('my-event', () => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * + * asyncLocalStorage.getStore(); // Returns undefined + * emitter.emit('my-event'); + * asyncLocalStorage.getStore(); // Returns the same object + * ``` + * @since v13.11.0, v12.17.0 + * @experimental + */ + enterWith(store: T): void; + } +} +declare module 'node:async_hooks' { + export * from 'async_hooks'; +} diff --git a/server/node_modules/@types/node/buffer.d.ts b/server/node_modules/@types/node/buffer.d.ts new file mode 100755 index 0000000000..5ec326d033 --- /dev/null +++ b/server/node_modules/@types/node/buffer.d.ts @@ -0,0 +1,2258 @@ +/** + * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many + * Node.js APIs support `Buffer`s. + * + * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and + * extends it with methods that cover additional use cases. Node.js APIs accept + * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. + * + * While the `Buffer` class is available within the global scope, it is still + * recommended to explicitly reference it via an import or require statement. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Creates a zero-filled Buffer of length 10. + * const buf1 = Buffer.alloc(10); + * + * // Creates a Buffer of length 10, + * // filled with bytes which all have the value `1`. + * const buf2 = Buffer.alloc(10, 1); + * + * // Creates an uninitialized buffer of length 10. + * // This is faster than calling Buffer.alloc() but the returned + * // Buffer instance might contain old data that needs to be + * // overwritten using fill(), write(), or other functions that fill the Buffer's + * // contents. + * const buf3 = Buffer.allocUnsafe(10); + * + * // Creates a Buffer containing the bytes [1, 2, 3]. + * const buf4 = Buffer.from([1, 2, 3]); + * + * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries + * // are all truncated using `(value & 255)` to fit into the range 0–255. + * const buf5 = Buffer.from([257, 257.5, -255, '1']); + * + * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': + * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) + * // [116, 195, 169, 115, 116] (in decimal notation) + * const buf6 = Buffer.from('tést'); + * + * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. + * const buf7 = Buffer.from('tést', 'latin1'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/buffer.js) + */ +declare module 'buffer' { + import { BinaryLike } from 'node:crypto'; + import { ReadableStream as WebReadableStream } from 'node:stream/web'; + export const INSPECT_MAX_BYTES: number; + export const kMaxLength: number; + export const kStringMaxLength: number; + export const constants: { + MAX_LENGTH: number; + MAX_STRING_LENGTH: number; + }; + export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary'; + /** + * Re-encodes the given `Buffer` or `Uint8Array` instance from one character + * encoding to another. Returns a new `Buffer` instance. + * + * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if + * conversion from `fromEnc` to `toEnc` is not permitted. + * + * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. + * + * The transcoding process will use substitution characters if a given byte + * sequence cannot be adequately represented in the target encoding. For instance: + * + * ```js + * import { Buffer, transcode } from 'buffer'; + * + * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); + * console.log(newBuf.toString('ascii')); + * // Prints: '?' + * ``` + * + * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced + * with `?` in the transcoded `Buffer`. + * @since v7.1.0 + * @param source A `Buffer` or `Uint8Array` instance. + * @param fromEnc The current encoding. + * @param toEnc To target encoding. + */ + export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; + export const SlowBuffer: { + /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ + new (size: number): Buffer; + prototype: Buffer; + }; + /** + * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using + * a prior call to `URL.createObjectURL()`. + * @since v16.7.0 + * @experimental + * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. + */ + export function resolveObjectURL(id: string): Blob | undefined; + export { Buffer }; + /** + * @experimental + */ + export interface BlobOptions { + /** + * @default 'utf8' + */ + encoding?: BufferEncoding | undefined; + /** + * The Blob content-type. The intent is for `type` to convey + * the MIME media type of the data, however no validation of the type format + * is performed. + */ + type?: string | undefined; + } + /** + * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across + * multiple worker threads. + * @since v15.7.0, v14.18.0 + */ + export class Blob { + /** + * The total size of the `Blob` in bytes. + * @since v15.7.0, v14.18.0 + */ + readonly size: number; + /** + * The content-type of the `Blob`. + * @since v15.7.0, v14.18.0 + */ + readonly type: string; + /** + * Creates a new `Blob` object containing a concatenation of the given sources. + * + * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into + * the 'Blob' and can therefore be safely modified after the 'Blob' is created. + * + * String sources are also copied into the `Blob`. + */ + constructor(sources: Array, options?: BlobOptions); + /** + * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of + * the `Blob` data. + * @since v15.7.0, v14.18.0 + */ + arrayBuffer(): Promise; + /** + * Creates and returns a new `Blob` containing a subset of this `Blob` objects + * data. The original `Blob` is not altered. + * @since v15.7.0, v14.18.0 + * @param start The starting index. + * @param end The ending index. + * @param type The content-type for the new `Blob` + */ + slice(start?: number, end?: number, type?: string): Blob; + /** + * Returns a promise that fulfills with the contents of the `Blob` decoded as a + * UTF-8 string. + * @since v15.7.0, v14.18.0 + */ + text(): Promise; + /** + * Returns a new (WHATWG) `ReadableStream` that allows the content of the `Blob` to be read. + * @since v16.7.0 + */ + stream(): WebReadableStream; + } + export import atob = globalThis.atob; + export import btoa = globalThis.btoa; + + import { Blob as NodeBlob } from 'buffer'; + // This conditional type will be the existing global Blob in a browser, or + // the copy below in a Node environment. + type __Blob = typeof globalThis extends { onmessage: any, Blob: infer T } + ? T : NodeBlob; + global { + // Buffer class + type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; + type WithImplicitCoercion = + | T + | { + valueOf(): T; + }; + /** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' + */ + interface BufferConstructor { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + */ + new (str: string, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + */ + new (size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new (array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}/{SharedArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + */ + new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new (array: ReadonlyArray): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. + */ + new (buffer: Buffer): Buffer; + /** + * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. + * Array entries outside that range will be truncated to fit into it. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. + * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + * ``` + * + * A `TypeError` will be thrown if `array` is not an `Array` or another type + * appropriate for `Buffer.from()` variants. + * + * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v5.10.0 + */ + from(arrayBuffer: WithImplicitCoercion, byteOffset?: number, length?: number): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer + */ + from(data: Uint8Array | ReadonlyArray): Buffer; + from(data: WithImplicitCoercion | string>): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + */ + from( + str: + | WithImplicitCoercion + | { + [Symbol.toPrimitive](hint: 'string'): string; + }, + encoding?: BufferEncoding + ): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param values to create a new Buffer + */ + of(...items: number[]): Buffer; + /** + * Returns `true` if `obj` is a `Buffer`, `false` otherwise. + * + * ```js + * import { Buffer } from 'buffer'; + * + * Buffer.isBuffer(Buffer.alloc(10)); // true + * Buffer.isBuffer(Buffer.from('foo')); // true + * Buffer.isBuffer('a string'); // false + * Buffer.isBuffer([]); // false + * Buffer.isBuffer(new Uint8Array(1024)); // false + * ``` + * @since v0.1.101 + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns `true` if `encoding` is the name of a supported character encoding, + * or `false` otherwise. + * + * ```js + * import { Buffer } from 'buffer'; + * + * console.log(Buffer.isEncoding('utf8')); + * // Prints: true + * + * console.log(Buffer.isEncoding('hex')); + * // Prints: true + * + * console.log(Buffer.isEncoding('utf/8')); + * // Prints: false + * + * console.log(Buffer.isEncoding('')); + * // Prints: false + * ``` + * @since v0.9.1 + * @param encoding A character encoding name to check. + */ + isEncoding(encoding: string): encoding is BufferEncoding; + /** + * Returns the byte length of a string when encoded using `encoding`. + * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account + * for the encoding that is used to convert the string into bytes. + * + * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. + * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the + * return value might be greater than the length of a `Buffer` created from the + * string. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const str = '\u00bd + \u00bc = \u00be'; + * + * console.log(`${str}: ${str.length} characters, ` + + * `${Buffer.byteLength(str, 'utf8')} bytes`); + * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes + * ``` + * + * When `string` is a + * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- + * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- + * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. + * @since v0.1.90 + * @param string A value to calculate the length of. + * @param [encoding='utf8'] If `string` is a string, this is its encoding. + * @return The number of bytes contained within `string`. + */ + byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; + /** + * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. + * + * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. + * + * If `totalLength` is not provided, it is calculated from the `Buffer` instances + * in `list` by adding their lengths. + * + * If `totalLength` is provided, it is coerced to an unsigned integer. If the + * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is + * truncated to `totalLength`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Create a single `Buffer` from a list of three `Buffer` instances. + * + * const buf1 = Buffer.alloc(10); + * const buf2 = Buffer.alloc(14); + * const buf3 = Buffer.alloc(18); + * const totalLength = buf1.length + buf2.length + buf3.length; + * + * console.log(totalLength); + * // Prints: 42 + * + * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); + * + * console.log(bufA); + * // Prints: + * console.log(bufA.length); + * // Prints: 42 + * ``` + * + * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v0.7.11 + * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. + * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. + */ + concat(list: ReadonlyArray, totalLength?: number): Buffer; + /** + * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from('1234'); + * const buf2 = Buffer.from('0123'); + * const arr = [buf1, buf2]; + * + * console.log(arr.sort(Buffer.compare)); + * // Prints: [ , ] + * // (This result is equal to: [buf2, buf1].) + * ``` + * @since v0.11.13 + * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. + */ + compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; + /** + * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.alloc(5); + * + * console.log(buf); + * // Prints: + * ``` + * + * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. + * + * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.alloc(5, 'a'); + * + * console.log(buf); + * // Prints: + * ``` + * + * If both `fill` and `encoding` are specified, the allocated `Buffer` will be + * initialized by calling `buf.fill(fill, encoding)`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); + * + * console.log(buf); + * // Prints: + * ``` + * + * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance + * contents will never contain sensitive data from previous allocations, including + * data that might not have been allocated for `Buffer`s. + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + * @param [fill=0] A value to pre-fill the new `Buffer` with. + * @param [encoding='utf8'] If `fill` is a string, this is its encoding. + */ + alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(10); + * + * console.log(buf); + * // Prints (contents may vary): + * + * buf.fill(0); + * + * console.log(buf); + * // Prints: + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * + * The `Buffer` module pre-allocates an internal `Buffer` instance of + * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the + * deprecated`new Buffer(size)` constructor only when `size` is less than or equal + * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + * + * Use of this pre-allocated internal memory pool is a key difference between + * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. + * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less + * than or equal to half `Buffer.poolSize`. The + * difference is subtle but can be important when an application requires the + * additional performance that `Buffer.allocUnsafe()` provides. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created + * if `size` is 0. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize + * such `Buffer` instances with zeroes. + * + * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, + * allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This + * allows applications to avoid the garbage collection overhead of creating many + * individually allocated `Buffer` instances. This approach improves both + * performance and memory usage by eliminating the need to track and clean up as + * many individual `ArrayBuffer` objects. + * + * However, in the case where a developer may need to retain a small chunk of + * memory from a pool for an indeterminate amount of time, it may be appropriate + * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and + * then copying out the relevant bits. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Need to keep around a few small chunks of memory. + * const store = []; + * + * socket.on('readable', () => { + * let data; + * while (null !== (data = readable.read())) { + * // Allocate for retained data. + * const sb = Buffer.allocUnsafeSlow(10); + * + * // Copy the data into the new allocation. + * data.copy(sb, 0, 0, 10); + * + * store.push(sb); + * } + * }); + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.12.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafeSlow(size: number): Buffer; + /** + * This is the size (in bytes) of pre-allocated internal `Buffer` instances used + * for pooling. This value may be modified. + * @since v0.11.3 + */ + poolSize: number; + } + interface Buffer extends Uint8Array { + /** + * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did + * not contain enough space to fit the entire string, only part of `string` will be + * written. However, partially encoded characters will not be written. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.alloc(256); + * + * const len = buf.write('\u00bd + \u00bc = \u00be', 0); + * + * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); + * // Prints: 12 bytes: ½ + ¼ = ¾ + * + * const buffer = Buffer.alloc(10); + * + * const length = buffer.write('abcd', 8); + * + * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); + * // Prints: 2 bytes : ab + * ``` + * @since v0.1.90 + * @param string String to write to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write `string`. + * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). + * @param [encoding='utf8'] The character encoding of `string`. + * @return Number of bytes written. + */ + write(string: string, encoding?: BufferEncoding): number; + write(string: string, offset: number, encoding?: BufferEncoding): number; + write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; + /** + * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. + * + * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, + * then each invalid byte is replaced with the replacement character `U+FFFD`. + * + * The maximum length of a string instance (in UTF-16 code units) is available + * as {@link constants.MAX_STRING_LENGTH}. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * console.log(buf1.toString('utf8')); + * // Prints: abcdefghijklmnopqrstuvwxyz + * console.log(buf1.toString('utf8', 0, 5)); + * // Prints: abcde + * + * const buf2 = Buffer.from('tést'); + * + * console.log(buf2.toString('hex')); + * // Prints: 74c3a97374 + * console.log(buf2.toString('utf8', 0, 3)); + * // Prints: té + * console.log(buf2.toString(undefined, 0, 3)); + * // Prints: té + * ``` + * @since v0.1.90 + * @param [encoding='utf8'] The character encoding to use. + * @param [start=0] The byte offset to start decoding at. + * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). + */ + toString(encoding?: BufferEncoding, start?: number, end?: number): string; + /** + * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls + * this function when stringifying a `Buffer` instance. + * + * `Buffer.from()` accepts objects in the format returned from this method. + * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); + * const json = JSON.stringify(buf); + * + * console.log(json); + * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} + * + * const copy = JSON.parse(json, (key, value) => { + * return value && value.type === 'Buffer' ? + * Buffer.from(value) : + * value; + * }); + * + * console.log(copy); + * // Prints: + * ``` + * @since v0.9.2 + */ + toJSON(): { + type: 'Buffer'; + data: number[]; + }; + /** + * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('414243', 'hex'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.equals(buf2)); + * // Prints: true + * console.log(buf1.equals(buf3)); + * // Prints: false + * ``` + * @since v0.11.13 + * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. + */ + equals(otherBuffer: Uint8Array): boolean; + /** + * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. + * Comparison is based on the actual sequence of bytes in each `Buffer`. + * + * * `0` is returned if `target` is the same as `buf` + * * `1` is returned if `target` should come _before_`buf` when sorted. + * * `-1` is returned if `target` should come _after_`buf` when sorted. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('BCD'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.compare(buf1)); + * // Prints: 0 + * console.log(buf1.compare(buf2)); + * // Prints: -1 + * console.log(buf1.compare(buf3)); + * // Prints: -1 + * console.log(buf2.compare(buf1)); + * // Prints: 1 + * console.log(buf2.compare(buf3)); + * // Prints: 1 + * console.log([buf1, buf2, buf3].sort(Buffer.compare)); + * // Prints: [ , , ] + * // (This result is equal to: [buf1, buf3, buf2].) + * ``` + * + * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); + * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); + * + * console.log(buf1.compare(buf2, 5, 9, 0, 4)); + * // Prints: 0 + * console.log(buf1.compare(buf2, 0, 6, 4)); + * // Prints: -1 + * console.log(buf1.compare(buf2, 5, 6, 5)); + * // Prints: 1 + * ``` + * + * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. + * @since v0.11.13 + * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. + * @param [targetStart=0] The offset within `target` at which to begin comparison. + * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). + * @param [sourceStart=0] The offset within `buf` at which to begin comparison. + * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). + */ + compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1; + /** + * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. + * + * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available + * for all TypedArrays, including Node.js `Buffer`s, although it takes + * different function arguments. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Create two `Buffer` instances. + * const buf1 = Buffer.allocUnsafe(26); + * const buf2 = Buffer.allocUnsafe(26).fill('!'); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. + * buf1.copy(buf2, 8, 16, 20); + * // This is equivalent to: + * // buf2.set(buf1.subarray(16, 20), 8); + * + * console.log(buf2.toString('ascii', 0, 25)); + * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! + * ``` + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Create a `Buffer` and copy data from one region to an overlapping region + * // within the same `Buffer`. + * + * const buf = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf[i] = i + 97; + * } + * + * buf.copy(buf, 0, 4, 10); + * + * console.log(buf.toString()); + * // Prints: efghijghijklmnopqrstuvwxyz + * ``` + * @since v0.1.90 + * @param target A `Buffer` or {@link Uint8Array} to copy into. + * @param [targetStart=0] The offset within `target` at which to begin writing. + * @param [sourceStart=0] The offset within `buf` from which to begin copying. + * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). + * @return The number of bytes copied. + */ + copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * This method is not compatible with the `Uint8Array.prototype.slice()`, + * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('buffer'); + * + * const copiedBuf = Uint8Array.prototype.slice.call(buf); + * copiedBuf[0]++; + * console.log(copiedBuf.toString()); + * // Prints: cuffer + * + * console.log(buf.toString()); + * // Prints: buffer + * + * // With buf.slice(), the original buffer is modified. + * const notReallyCopiedBuf = buf.slice(); + * notReallyCopiedBuf[0]++; + * console.log(notReallyCopiedBuf.toString()); + * // Prints: cuffer + * console.log(buf.toString()); + * // Also prints: cuffer (!) + * ``` + * @since v0.3.0 + * @deprecated Use `subarray` instead. + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + slice(start?: number, end?: number): Buffer; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * Specifying `end` greater than `buf.length` will return the same result as + * that of `end` equal to `buf.length`. + * + * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). + * + * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte + * // from the original `Buffer`. + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * const buf2 = buf1.subarray(0, 3); + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: abc + * + * buf1[0] = 33; + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: !bc + * ``` + * + * Specifying negative indexes causes the slice to be generated relative to the + * end of `buf` rather than the beginning. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('buffer'); + * + * console.log(buf.subarray(-6, -1).toString()); + * // Prints: buffe + * // (Equivalent to buf.subarray(0, 5).) + * + * console.log(buf.subarray(-6, -2).toString()); + * // Prints: buff + * // (Equivalent to buf.subarray(0, 4).) + * + * console.log(buf.subarray(-5, -2).toString()); + * // Prints: uff + * // (Equivalent to buf.subarray(1, 4).) + * ``` + * @since v3.0.0 + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + subarray(start?: number, end?: number): Buffer; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64BE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64LE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64LE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * This function is also available under the `writeBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64BE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * + * This function is also available under the `writeBigUint64LE` alias. + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64LE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64LE(value: bigint, offset?: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintLE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntLE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntLE + * @since v14.9.0, v12.19.0 + */ + writeUintLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintBE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntBE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntBE + * @since v14.9.0, v12.19.0 + */ + writeUintBE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than a signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a + * signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntBE(value: number, offset: number, byteLength: number): number; + /** + * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64BE(0)); + * // Prints: 4294967295n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64BE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + readBigUint64BE(offset?: number): bigint; + /** + * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64LE(0)); + * // Prints: 18446744069414584320n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64LE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + readBigUint64LE(offset?: number): bigint; + /** + * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64BE(offset?: number): bigint; + /** + * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64LE(offset?: number): bigint; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintLE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntLE(0, 6).toString(16)); + * // Prints: ab9078563412 + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntLE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntLE + * @since v14.9.0, v12.19.0 + */ + readUintLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintBE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readUIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntBE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntBE + * @since v14.9.0, v12.19.0 + */ + readUintBE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntLE(0, 6).toString(16)); + * // Prints: -546f87a9cbee + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * console.log(buf.readIntBE(1, 0).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntBE(offset: number, byteLength: number): number; + /** + * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. + * + * This function is also available under the `readUint8` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, -2]); + * + * console.log(buf.readUInt8(0)); + * // Prints: 1 + * console.log(buf.readUInt8(1)); + * // Prints: 254 + * console.log(buf.readUInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readUInt8(offset?: number): number; + /** + * @alias Buffer.readUInt8 + * @since v14.9.0, v12.19.0 + */ + readUint8(offset?: number): number; + /** + * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint16LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16LE(0).toString(16)); + * // Prints: 3412 + * console.log(buf.readUInt16LE(1).toString(16)); + * // Prints: 5634 + * console.log(buf.readUInt16LE(2).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16LE(offset?: number): number; + /** + * @alias Buffer.readUInt16LE + * @since v14.9.0, v12.19.0 + */ + readUint16LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint16BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16BE(0).toString(16)); + * // Prints: 1234 + * console.log(buf.readUInt16BE(1).toString(16)); + * // Prints: 3456 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16BE(offset?: number): number; + /** + * @alias Buffer.readUInt16BE + * @since v14.9.0, v12.19.0 + */ + readUint16BE(offset?: number): number; + /** + * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32LE(0).toString(16)); + * // Prints: 78563412 + * console.log(buf.readUInt32LE(1).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32LE(offset?: number): number; + /** + * @alias Buffer.readUInt32LE + * @since v14.9.0, v12.19.0 + */ + readUint32LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32BE(0).toString(16)); + * // Prints: 12345678 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32BE(offset?: number): number; + /** + * @alias Buffer.readUInt32BE + * @since v14.9.0, v12.19.0 + */ + readUint32BE(offset?: number): number; + /** + * Reads a signed 8-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([-1, 5]); + * + * console.log(buf.readInt8(0)); + * // Prints: -1 + * console.log(buf.readInt8(1)); + * // Prints: 5 + * console.log(buf.readInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readInt8(offset?: number): number; + /** + * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16LE(0)); + * // Prints: 1280 + * console.log(buf.readInt16LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16LE(offset?: number): number; + /** + * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16BE(offset?: number): number; + /** + * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32LE(0)); + * // Prints: 83886080 + * console.log(buf.readInt32LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32LE(offset?: number): number; + /** + * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32BE(offset?: number): number; + /** + * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatLE(0)); + * // Prints: 1.539989614439558e-36 + * console.log(buf.readFloatLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatLE(offset?: number): number; + /** + * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatBE(0)); + * // Prints: 2.387939260590663e-38 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatBE(offset?: number): number; + /** + * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleLE(0)); + * // Prints: 5.447603722011605e-270 + * console.log(buf.readDoubleLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleLE(offset?: number): number; + /** + * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleBE(0)); + * // Prints: 8.20788039913184e-304 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleBE(offset?: number): number; + reverse(): this; + /** + * Interprets `buf` as an array of unsigned 16-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap16(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap16(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * + * One convenient use of `buf.swap16()` is to perform a fast in-place conversion + * between UTF-16 little-endian and UTF-16 big-endian: + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); + * buf.swap16(); // Convert to big-endian UTF-16 text. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap16(): Buffer; + /** + * Interprets `buf` as an array of unsigned 32-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap32(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap32(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap32(): Buffer; + /** + * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. + * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap64(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap64(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v6.3.0 + * @return A reference to `buf`. + */ + swap64(): Buffer; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a + * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything + * other than an unsigned 8-bit integer. + * + * This function is also available under the `writeUint8` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt8(0x3, 0); + * buf.writeUInt8(0x4, 1); + * buf.writeUInt8(0x23, 2); + * buf.writeUInt8(0x42, 3); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeUInt8(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt8 + * @since v14.9.0, v12.19.0 + */ + writeUint8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 16-bit integer. + * + * This function is also available under the `writeUint16LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16LE(0xdead, 0); + * buf.writeUInt16LE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16LE + * @since v14.9.0, v12.19.0 + */ + writeUint16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 16-bit integer. + * + * This function is also available under the `writeUint16BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16BE(0xdead, 0); + * buf.writeUInt16BE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16BE + * @since v14.9.0, v12.19.0 + */ + writeUint16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 32-bit integer. + * + * This function is also available under the `writeUint32LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32LE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32LE + * @since v14.9.0, v12.19.0 + */ + writeUint32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 32-bit integer. + * + * This function is also available under the `writeUint32BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32BE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32BE + * @since v14.9.0, v12.19.0 + */ + writeUint32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a valid + * signed 8-bit integer. Behavior is undefined when `value` is anything other than + * a signed 8-bit integer. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt8(2, 0); + * buf.writeInt8(-2, 1); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeInt8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16LE(0x0304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16BE(0x0102, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32LE(0x05060708, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32BE(0x01020304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatLE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatBE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatBE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleLE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleBE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleBE(value: number, offset?: number): number; + /** + * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, + * the entire `buf` will be filled: + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Fill a `Buffer` with the ASCII character 'h'. + * + * const b = Buffer.allocUnsafe(50).fill('h'); + * + * console.log(b.toString()); + * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh + * ``` + * + * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or + * integer. If the resulting integer is greater than `255` (decimal), `buf` will be + * filled with `value & 255`. + * + * If the final write of a `fill()` operation falls on a multi-byte character, + * then only the bytes of that character that fit into `buf` are written: + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Fill a `Buffer` with character that takes up two bytes in UTF-8. + * + * console.log(Buffer.allocUnsafe(5).fill('\u0222')); + * // Prints: + * ``` + * + * If `value` contains invalid characters, it is truncated; if no valid + * fill data remains, an exception is thrown: + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(5); + * + * console.log(buf.fill('a')); + * // Prints: + * console.log(buf.fill('aazz', 'hex')); + * // Prints: + * console.log(buf.fill('zz', 'hex')); + * // Throws an exception. + * ``` + * @since v0.5.0 + * @param value The value with which to fill `buf`. + * @param [offset=0] Number of bytes to skip before starting to fill `buf`. + * @param [end=buf.length] Where to stop filling `buf` (not inclusive). + * @param [encoding='utf8'] The encoding for `value` if `value` is a string. + * @return A reference to `buf`. + */ + fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; + /** + * If `value` is: + * + * * a string, `value` is interpreted according to the character encoding in`encoding`. + * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. + * To compare a partial `Buffer`, use `buf.subarray`. + * * a number, `value` will be interpreted as an unsigned 8-bit integer + * value between `0` and `255`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.indexOf('this')); + * // Prints: 0 + * console.log(buf.indexOf('is')); + * // Prints: 2 + * console.log(buf.indexOf(Buffer.from('a buffer'))); + * // Prints: 8 + * console.log(buf.indexOf(97)); + * // Prints: 8 (97 is the decimal ASCII value for 'a') + * console.log(buf.indexOf(Buffer.from('a buffer example'))); + * // Prints: -1 + * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: 8 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); + * // Prints: 4 + * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); + * // Prints: 6 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. If the result + * of coercion is `NaN` or `0`, then the entire buffer will be searched. This + * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). + * + * ```js + * import { Buffer } from 'buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.indexOf(99.9)); + * console.log(b.indexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN or 0. + * // Prints: 1, searching the whole buffer. + * console.log(b.indexOf('b', undefined)); + * console.log(b.indexOf('b', {})); + * console.log(b.indexOf('b', null)); + * console.log(b.indexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer` and `byteOffset` is less + * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. + * @since v1.5.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + /** + * Identical to `buf.indexOf()`, except the last occurrence of `value` is found + * rather than the first occurrence. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('this buffer is a buffer'); + * + * console.log(buf.lastIndexOf('this')); + * // Prints: 0 + * console.log(buf.lastIndexOf('buffer')); + * // Prints: 17 + * console.log(buf.lastIndexOf(Buffer.from('buffer'))); + * // Prints: 17 + * console.log(buf.lastIndexOf(97)); + * // Prints: 15 (97 is the decimal ASCII value for 'a') + * console.log(buf.lastIndexOf(Buffer.from('yolo'))); + * // Prints: -1 + * console.log(buf.lastIndexOf('buffer', 5)); + * // Prints: 5 + * console.log(buf.lastIndexOf('buffer', 4)); + * // Prints: -1 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); + * // Prints: 6 + * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); + * // Prints: 4 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. Any arguments + * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. + * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). + * + * ```js + * import { Buffer } from 'buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.lastIndexOf(99.9)); + * console.log(b.lastIndexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN. + * // Prints: 1, searching the whole buffer. + * console.log(b.lastIndexOf('b', undefined)); + * console.log(b.lastIndexOf('b', {})); + * + * // Passing a byteOffset that coerces to 0. + * // Prints: -1, equivalent to passing 0. + * console.log(b.lastIndexOf('b', null)); + * console.log(b.lastIndexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. + * @since v6.0.0 + * @param value What to search for. + * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents + * of `buf`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Log the entire contents of a `Buffer`. + * + * const buf = Buffer.from('buffer'); + * + * for (const pair of buf.entries()) { + * console.log(pair); + * } + * // Prints: + * // [0, 98] + * // [1, 117] + * // [2, 102] + * // [3, 102] + * // [4, 101] + * // [5, 114] + * ``` + * @since v1.1.0 + */ + entries(): IterableIterator<[number, number]>; + /** + * Equivalent to `buf.indexOf() !== -1`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.includes('this')); + * // Prints: true + * console.log(buf.includes('is')); + * // Prints: true + * console.log(buf.includes(Buffer.from('a buffer'))); + * // Prints: true + * console.log(buf.includes(97)); + * // Prints: true (97 is the decimal ASCII value for 'a') + * console.log(buf.includes(Buffer.from('a buffer example'))); + * // Prints: false + * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: true + * console.log(buf.includes('this', 4)); + * // Prints: false + * ``` + * @since v5.3.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is its encoding. + * @return `true` if `value` was found in `buf`, `false` otherwise. + */ + includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('buffer'); + * + * for (const key of buf.keys()) { + * console.log(key); + * } + * // Prints: + * // 0 + * // 1 + * // 2 + * // 3 + * // 4 + * // 5 + * ``` + * @since v1.1.0 + */ + keys(): IterableIterator; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is + * called automatically when a `Buffer` is used in a `for..of` statement. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('buffer'); + * + * for (const value of buf.values()) { + * console.log(value); + * } + * // Prints: + * // 98 + * // 117 + * // 102 + * // 102 + * // 101 + * // 114 + * + * for (const value of buf) { + * console.log(value); + * } + * // Prints: + * // 98 + * // 117 + * // 102 + * // 102 + * // 101 + * // 114 + * ``` + * @since v1.1.0 + */ + values(): IterableIterator; + } + var Buffer: BufferConstructor; + /** + * Decodes a string of Base64-encoded data into bytes, and encodes those bytes + * into a string using Latin-1 (ISO-8859-1). + * + * The `data` may be any JavaScript-value that can be coerced into a string. + * + * **This function is only provided for compatibility with legacy web platform APIs** + * **and should never be used in new code, because they use strings to represent** + * **binary data and predate the introduction of typed arrays in JavaScript.** + * **For code running using Node.js APIs, converting between base64-encoded strings** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * @since v15.13.0, v14.17.0 + * @deprecated Use `Buffer.from(data, 'base64')` instead. + * @param data The Base64-encoded input string. + */ + function atob(data: string): string; + /** + * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes + * into a string using Base64. + * + * The `data` may be any JavaScript-value that can be coerced into a string. + * + * **This function is only provided for compatibility with legacy web platform APIs** + * **and should never be used in new code, because they use strings to represent** + * **binary data and predate the introduction of typed arrays in JavaScript.** + * **For code running using Node.js APIs, converting between base64-encoded strings** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * @since v15.13.0, v14.17.0 + * @deprecated Use `buf.toString('base64')` instead. + * @param data An ASCII (Latin1) string. + */ + function btoa(data: string): string; + + interface Blob extends __Blob {} + /** + * `Blob` class is a global reference for `require('node:buffer').Blob` + * https://nodejs.org/api/buffer.html#class-blob + * @since v18.0.0 + */ + var Blob: typeof globalThis extends { + onmessage: any; + Blob: infer T; + } + ? T + : typeof NodeBlob; + } +} +declare module 'node:buffer' { + export * from 'buffer'; +} diff --git a/server/node_modules/@types/node/child_process.d.ts b/server/node_modules/@types/node/child_process.d.ts new file mode 100755 index 0000000000..c537d6d621 --- /dev/null +++ b/server/node_modules/@types/node/child_process.d.ts @@ -0,0 +1,1369 @@ +/** + * The `child_process` module provides the ability to spawn subprocesses in + * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability + * is primarily provided by the {@link spawn} function: + * + * ```js + * const { spawn } = require('child_process'); + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * ls.on('close', (code) => { + * console.log(`child process exited with code ${code}`); + * }); + * ``` + * + * By default, pipes for `stdin`, `stdout`, and `stderr` are established between + * the parent Node.js process and the spawned subprocess. These pipes have + * limited (and platform-specific) capacity. If the subprocess writes to + * stdout in excess of that limit without the output being captured, the + * subprocess blocks waiting for the pipe buffer to accept more data. This is + * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. + * + * The command lookup is performed using the `options.env.PATH` environment + * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is + * used. If `options.env` is set without `PATH`, lookup on Unix is performed + * on a default search path search of `/usr/bin:/bin` (see your operating system's + * manual for execvpe/execvp), on Windows the current processes environment + * variable `PATH` is used. + * + * On Windows, environment variables are case-insensitive. Node.js + * lexicographically sorts the `env` keys and uses the first one that + * case-insensitively matches. Only first (in lexicographic order) entry will be + * passed to the subprocess. This might lead to issues on Windows when passing + * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. + * + * The {@link spawn} method spawns the child process asynchronously, + * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks + * the event loop until the spawned process either exits or is terminated. + * + * For convenience, the `child_process` module provides a handful of synchronous + * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on + * top of {@link spawn} or {@link spawnSync}. + * + * * {@link exec}: spawns a shell and runs a command within that + * shell, passing the `stdout` and `stderr` to a callback function when + * complete. + * * {@link execFile}: similar to {@link exec} except + * that it spawns the command directly without first spawning a shell by + * default. + * * {@link fork}: spawns a new Node.js process and invokes a + * specified module with an IPC communication channel established that allows + * sending messages between parent and child. + * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. + * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. + * + * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, + * the synchronous methods can have significant impact on performance due to + * stalling the event loop while spawned processes complete. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/child_process.js) + */ +declare module 'child_process' { + import { ObjectEncodingOptions } from 'node:fs'; + import { EventEmitter, Abortable } from 'node:events'; + import * as net from 'node:net'; + import { Writable, Readable, Stream, Pipe } from 'node:stream'; + import { URL } from 'node:url'; + type Serializable = string | object | number | boolean | bigint; + type SendHandle = net.Socket | net.Server; + /** + * Instances of the `ChildProcess` represent spawned child processes. + * + * Instances of `ChildProcess` are not intended to be created directly. Rather, + * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create + * instances of `ChildProcess`. + * @since v2.2.0 + */ + class ChildProcess extends EventEmitter { + /** + * A `Writable Stream` that represents the child process's `stdin`. + * + * If a child process waits to read all of its input, the child will not continue + * until this stream has been closed via `end()`. + * + * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will + * refer to the same value. + * + * The `subprocess.stdin` property can be `undefined` if the child process could + * not be successfully spawned. + * @since v0.1.90 + */ + stdin: Writable | null; + /** + * A `Readable Stream` that represents the child process's `stdout`. + * + * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will + * refer to the same value. + * + * ```js + * const { spawn } = require('child_process'); + * + * const subprocess = spawn('ls'); + * + * subprocess.stdout.on('data', (data) => { + * console.log(`Received chunk ${data}`); + * }); + * ``` + * + * The `subprocess.stdout` property can be `null` if the child process could + * not be successfully spawned. + * @since v0.1.90 + */ + stdout: Readable | null; + /** + * A `Readable Stream` that represents the child process's `stderr`. + * + * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will + * refer to the same value. + * + * The `subprocess.stderr` property can be `null` if the child process could + * not be successfully spawned. + * @since v0.1.90 + */ + stderr: Readable | null; + /** + * The `subprocess.channel` property is a reference to the child's IPC channel. If + * no IPC channel currently exists, this property is `undefined`. + * @since v7.1.0 + */ + readonly channel?: Pipe | null | undefined; + /** + * A sparse array of pipes to the child process, corresponding with positions in + * the `stdio` option passed to {@link spawn} that have been set + * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, + * respectively. + * + * In the following example, only the child's fd `1` (stdout) is configured as a + * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values + * in the array are `null`. + * + * ```js + * const assert = require('assert'); + * const fs = require('fs'); + * const child_process = require('child_process'); + * + * const subprocess = child_process.spawn('ls', { + * stdio: [ + * 0, // Use parent's stdin for child. + * 'pipe', // Pipe child's stdout to parent. + * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. + * ] + * }); + * + * assert.strictEqual(subprocess.stdio[0], null); + * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); + * + * assert(subprocess.stdout); + * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); + * + * assert.strictEqual(subprocess.stdio[2], null); + * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); + * ``` + * + * The `subprocess.stdio` property can be `undefined` if the child process could + * not be successfully spawned. + * @since v0.7.10 + */ + readonly stdio: [ + Writable | null, + // stdin + Readable | null, + // stdout + Readable | null, + // stderr + Readable | Writable | null | undefined, + // extra + Readable | Writable | null | undefined // extra + ]; + /** + * The `subprocess.killed` property indicates whether the child process + * successfully received a signal from `subprocess.kill()`. The `killed` property + * does not indicate that the child process has been terminated. + * @since v0.5.10 + */ + readonly killed: boolean; + /** + * Returns the process identifier (PID) of the child process. If the child process + * fails to spawn due to errors, then the value is `undefined` and `error` is + * emitted. + * + * ```js + * const { spawn } = require('child_process'); + * const grep = spawn('grep', ['ssh']); + * + * console.log(`Spawned child pid: ${grep.pid}`); + * grep.stdin.end(); + * ``` + * @since v0.1.90 + */ + readonly pid?: number | undefined; + /** + * The `subprocess.connected` property indicates whether it is still possible to + * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. + * @since v0.7.2 + */ + readonly connected: boolean; + /** + * The `subprocess.exitCode` property indicates the exit code of the child process. + * If the child process is still running, the field will be `null`. + */ + readonly exitCode: number | null; + /** + * The `subprocess.signalCode` property indicates the signal received by + * the child process if any, else `null`. + */ + readonly signalCode: NodeJS.Signals | null; + /** + * The `subprocess.spawnargs` property represents the full list of command-line + * arguments the child process was launched with. + */ + readonly spawnargs: string[]; + /** + * The `subprocess.spawnfile` property indicates the executable file name of + * the child process that is launched. + * + * For {@link fork}, its value will be equal to `process.execPath`. + * For {@link spawn}, its value will be the name of + * the executable file. + * For {@link exec}, its value will be the name of the shell + * in which the child process is launched. + */ + readonly spawnfile: string; + /** + * The `subprocess.kill()` method sends a signal to the child process. If no + * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function + * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. + * + * ```js + * const { spawn } = require('child_process'); + * const grep = spawn('grep', ['ssh']); + * + * grep.on('close', (code, signal) => { + * console.log( + * `child process terminated due to receipt of signal ${signal}`); + * }); + * + * // Send SIGHUP to process. + * grep.kill('SIGHUP'); + * ``` + * + * The `ChildProcess` object may emit an `'error'` event if the signal + * cannot be delivered. Sending a signal to a child process that has already exited + * is not an error but may have unforeseen consequences. Specifically, if the + * process identifier (PID) has been reassigned to another process, the signal will + * be delivered to that process instead which can have unexpected results. + * + * While the function is called `kill`, the signal delivered to the child process + * may not actually terminate the process. + * + * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. + * + * On Windows, where POSIX signals do not exist, the `signal` argument will be + * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). + * See `Signal Events` for more details. + * + * On Linux, child processes of child processes will not be terminated + * when attempting to kill their parent. This is likely to happen when running a + * new process in a shell or with the use of the `shell` option of `ChildProcess`: + * + * ```js + * 'use strict'; + * const { spawn } = require('child_process'); + * + * const subprocess = spawn( + * 'sh', + * [ + * '-c', + * `node -e "setInterval(() => { + * console.log(process.pid, 'is alive') + * }, 500);"`, + * ], { + * stdio: ['inherit', 'inherit', 'inherit'] + * } + * ); + * + * setTimeout(() => { + * subprocess.kill(); // Does not terminate the Node.js process in the shell. + * }, 2000); + * ``` + * @since v0.1.90 + */ + kill(signal?: NodeJS.Signals | number): boolean; + /** + * When an IPC channel has been established between the parent and child ( + * i.e. when using {@link fork}), the `subprocess.send()` method can + * be used to send messages to the child process. When the child process is a + * Node.js instance, these messages can be received via the `'message'` event. + * + * The message goes through serialization and parsing. The resulting + * message might not be the same as what is originally sent. + * + * For example, in the parent script: + * + * ```js + * const cp = require('child_process'); + * const n = cp.fork(`${__dirname}/sub.js`); + * + * n.on('message', (m) => { + * console.log('PARENT got message:', m); + * }); + * + * // Causes the child to print: CHILD got message: { hello: 'world' } + * n.send({ hello: 'world' }); + * ``` + * + * And then the child script, `'sub.js'` might look like this: + * + * ```js + * process.on('message', (m) => { + * console.log('CHILD got message:', m); + * }); + * + * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } + * process.send({ foo: 'bar', baz: NaN }); + * ``` + * + * Child Node.js processes will have a `process.send()` method of their own + * that allows the child to send messages back to the parent. + * + * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages + * containing a `NODE_` prefix in the `cmd` property are reserved for use within + * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. + * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. + * + * The optional `sendHandle` argument that may be passed to `subprocess.send()` is + * for passing a TCP server or socket object to the child process. The child will + * receive the object as the second argument passed to the callback function + * registered on the `'message'` event. Any data that is received + * and buffered in the socket will not be sent to the child. + * + * The optional `callback` is a function that is invoked after the message is + * sent but before the child may have received it. The function is called with a + * single argument: `null` on success, or an `Error` object on failure. + * + * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can + * happen, for instance, when the child process has already exited. + * + * `subprocess.send()` will return `false` if the channel has closed or when the + * backlog of unsent messages exceeds a threshold that makes it unwise to send + * more. Otherwise, the method returns `true`. The `callback` function can be + * used to implement flow control. + * + * #### Example: sending a server object + * + * The `sendHandle` argument can be used, for instance, to pass the handle of + * a TCP server object to the child process as illustrated in the example below: + * + * ```js + * const subprocess = require('child_process').fork('subprocess.js'); + * + * // Open up the server object and send the handle. + * const server = require('net').createServer(); + * server.on('connection', (socket) => { + * socket.end('handled by parent'); + * }); + * server.listen(1337, () => { + * subprocess.send('server', server); + * }); + * ``` + * + * The child would then receive the server object as: + * + * ```js + * process.on('message', (m, server) => { + * if (m === 'server') { + * server.on('connection', (socket) => { + * socket.end('handled by child'); + * }); + * } + * }); + * ``` + * + * Once the server is now shared between the parent and child, some connections + * can be handled by the parent and some by the child. + * + * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on + * a `'message'` event instead of `'connection'` and using `server.bind()` instead + * of `server.listen()`. This is, however, currently only supported on Unix + * platforms. + * + * #### Example: sending a socket object + * + * Similarly, the `sendHandler` argument can be used to pass the handle of a + * socket to the child process. The example below spawns two children that each + * handle connections with "normal" or "special" priority: + * + * ```js + * const { fork } = require('child_process'); + * const normal = fork('subprocess.js', ['normal']); + * const special = fork('subprocess.js', ['special']); + * + * // Open up the server and send sockets to child. Use pauseOnConnect to prevent + * // the sockets from being read before they are sent to the child process. + * const server = require('net').createServer({ pauseOnConnect: true }); + * server.on('connection', (socket) => { + * + * // If this is special priority... + * if (socket.remoteAddress === '74.125.127.100') { + * special.send('socket', socket); + * return; + * } + * // This is normal priority. + * normal.send('socket', socket); + * }); + * server.listen(1337); + * ``` + * + * The `subprocess.js` would receive the socket handle as the second argument + * passed to the event callback function: + * + * ```js + * process.on('message', (m, socket) => { + * if (m === 'socket') { + * if (socket) { + * // Check that the client socket exists. + * // It is possible for the socket to be closed between the time it is + * // sent and the time it is received in the child process. + * socket.end(`Request handled with ${process.argv[2]} priority`); + * } + * } + * }); + * ``` + * + * Do not use `.maxConnections` on a socket that has been passed to a subprocess. + * The parent cannot track when the socket is destroyed. + * + * Any `'message'` handlers in the subprocess should verify that `socket` exists, + * as the connection may have been closed during the time it takes to send the + * connection to the child. + * @since v0.5.9 + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send(message: Serializable, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; + /** + * Closes the IPC channel between parent and child, allowing the child to exit + * gracefully once there are no other connections keeping it alive. After calling + * this method the `subprocess.connected` and `process.connected` properties in + * both the parent and child (respectively) will be set to `false`, and it will be + * no longer possible to pass messages between the processes. + * + * The `'disconnect'` event will be emitted when there are no messages in the + * process of being received. This will most often be triggered immediately after + * calling `subprocess.disconnect()`. + * + * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked + * within the child process to close the IPC channel as well. + * @since v0.7.2 + */ + disconnect(): void; + /** + * By default, the parent will wait for the detached child to exit. To prevent the + * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not + * include the child in its reference count, allowing the parent to exit + * independently of the child, unless there is an established IPC channel between + * the child and the parent. + * + * ```js + * const { spawn } = require('child_process'); + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore' + * }); + * + * subprocess.unref(); + * ``` + * @since v0.7.10 + */ + unref(): void; + /** + * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will + * restore the removed reference count for the child process, forcing the parent + * to wait for the child to exit before exiting itself. + * + * ```js + * const { spawn } = require('child_process'); + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore' + * }); + * + * subprocess.unref(); + * subprocess.ref(); + * ``` + * @since v0.7.10 + */ + ref(): void; + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + * 6. spawn + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: 'disconnect', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + addListener(event: 'spawn', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean; + emit(event: 'spawn', listener: () => void): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: 'disconnect', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + on(event: 'spawn', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: 'disconnect', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + once(event: 'spawn', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: 'disconnect', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependListener(event: 'spawn', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: 'disconnect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependOnceListener(event: 'spawn', listener: () => void): this; + } + // return this object when stdio option is undefined or not specified + interface ChildProcessWithoutNullStreams extends ChildProcess { + stdin: Writable; + stdout: Readable; + stderr: Readable; + readonly stdio: [ + Writable, + Readable, + Readable, + // stderr + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + // return this object when stdio option is a tuple of 3 + interface ChildProcessByStdio extends ChildProcess { + stdin: I; + stdout: O; + stderr: E; + readonly stdio: [ + I, + O, + E, + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + interface MessageOptions { + keepOpen?: boolean | undefined; + } + type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit'; + type StdioOptions = IOType | Array; + type SerializationType = 'json' | 'advanced'; + interface MessagingOptions extends Abortable { + /** + * Specify the kind of serialization used for sending messages between processes. + * @default 'json' + */ + serialization?: SerializationType | undefined; + /** + * The signal value to be used when the spawned process will be killed by the abort signal. + * @default 'SIGTERM' + */ + killSignal?: NodeJS.Signals | number | undefined; + /** + * In milliseconds the maximum amount of time the process is allowed to run. + */ + timeout?: number | undefined; + } + interface ProcessEnvOptions { + uid?: number | undefined; + gid?: number | undefined; + cwd?: string | URL | undefined; + env?: NodeJS.ProcessEnv | undefined; + } + interface CommonOptions extends ProcessEnvOptions { + /** + * @default false + */ + windowsHide?: boolean | undefined; + /** + * @default 0 + */ + timeout?: number | undefined; + } + interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { + argv0?: string | undefined; + stdio?: StdioOptions | undefined; + shell?: boolean | string | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + interface SpawnOptions extends CommonSpawnOptions { + detached?: boolean | undefined; + } + interface SpawnOptionsWithoutStdio extends SpawnOptions { + stdio?: StdioPipeNamed | StdioPipe[] | undefined; + } + type StdioNull = 'inherit' | 'ignore' | Stream; + type StdioPipeNamed = 'pipe' | 'overlapped'; + type StdioPipe = undefined | null | StdioPipeNamed; + interface SpawnOptionsWithStdioTuple extends SpawnOptions { + stdio: [Stdin, Stdout, Stderr]; + } + /** + * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults + * to an empty array. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * A third argument may be used to specify additional options, with these defaults: + * + * ```js + * const defaults = { + * cwd: undefined, + * env: process.env + * }; + * ``` + * + * Use `cwd` to specify the working directory from which the process is spawned. + * If not given, the default is to inherit the current working directory. If given, + * but the path does not exist, the child process emits an `ENOENT` error + * and exits immediately. `ENOENT` is also emitted when the command + * does not exist. + * + * Use `env` to specify environment variables that will be visible to the new + * process, the default is `process.env`. + * + * `undefined` values in `env` will be ignored. + * + * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the + * exit code: + * + * ```js + * const { spawn } = require('child_process'); + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * ls.on('close', (code) => { + * console.log(`child process exited with code ${code}`); + * }); + * ``` + * + * Example: A very elaborate way to run `ps ax | grep ssh` + * + * ```js + * const { spawn } = require('child_process'); + * const ps = spawn('ps', ['ax']); + * const grep = spawn('grep', ['ssh']); + * + * ps.stdout.on('data', (data) => { + * grep.stdin.write(data); + * }); + * + * ps.stderr.on('data', (data) => { + * console.error(`ps stderr: ${data}`); + * }); + * + * ps.on('close', (code) => { + * if (code !== 0) { + * console.log(`ps process exited with code ${code}`); + * } + * grep.stdin.end(); + * }); + * + * grep.stdout.on('data', (data) => { + * console.log(data.toString()); + * }); + * + * grep.stderr.on('data', (data) => { + * console.error(`grep stderr: ${data}`); + * }); + * + * grep.on('close', (code) => { + * if (code !== 0) { + * console.log(`grep process exited with code ${code}`); + * } + * }); + * ``` + * + * Example of checking for failed `spawn`: + * + * ```js + * const { spawn } = require('child_process'); + * const subprocess = spawn('bad_command'); + * + * subprocess.on('error', (err) => { + * console.error('Failed to start subprocess.'); + * }); + * ``` + * + * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process + * title while others (Windows, SunOS) will use `command`. + * + * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent, + * retrieve it with the`process.argv0` property instead. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { spawn } = require('child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const grep = spawn('grep', ['ssh'], { signal }); + * grep.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * ``` + * @since v0.1.90 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptions): ChildProcess; + // overloads of spawn with 'args' + function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; + interface ExecOptions extends CommonOptions { + shell?: string | undefined; + signal?: AbortSignal | undefined; + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + } + interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: BufferEncoding | null; // specify `null`. + } + interface ExecException extends Error { + cmd?: string | undefined; + killed?: boolean | undefined; + code?: number | undefined; + signal?: NodeJS.Signals | undefined; + } + /** + * Spawns a shell then executes the `command` within that shell, buffering any + * generated output. The `command` string passed to the exec function is processed + * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) + * need to be dealt with accordingly: + * + * ```js + * const { exec } = require('child_process'); + * + * exec('"/path/to/test file/test.sh" arg1 arg2'); + * // Double quotes are used so that the space in the path is not interpreted as + * // a delimiter of multiple arguments. + * + * exec('echo "The \\$HOME variable is $HOME"'); + * // The $HOME variable is escaped in the first instance, but not in the second. + * ``` + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * + * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The + * `error.code` property will be + * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the + * process. + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * ```js + * const { exec } = require('child_process'); + * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { + * if (error) { + * console.error(`exec error: ${error}`); + * return; + * } + * console.log(`stdout: ${stdout}`); + * console.error(`stderr: ${stderr}`); + * }); + * ``` + * + * If `timeout` is greater than `0`, the parent will send the signal + * identified by the `killSignal` property (the default is `'SIGTERM'`) if the + * child runs longer than `timeout` milliseconds. + * + * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace + * the existing process and uses a shell to execute the command. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * const util = require('util'); + * const exec = util.promisify(require('child_process').exec); + * + * async function lsExample() { + * const { stdout, stderr } = await exec('ls'); + * console.log('stdout:', stdout); + * console.error('stderr:', stderr); + * } + * lsExample(); + * ``` + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { exec } = require('child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = exec('grep ssh', { signal }, (error) => { + * console.log(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.90 + * @param command The command to run, with space-separated arguments. + * @param callback called with the output when process terminates. + */ + function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function exec( + command: string, + options: { + encoding: 'buffer' | null; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void + ): ChildProcess; + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function exec( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function exec( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function exec( + command: string, + options: (ObjectEncodingOptions & ExecOptions) | undefined | null, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + interface PromiseWithChild extends Promise { + child: ChildProcess; + } + namespace exec { + function __promisify__(command: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: { + encoding: 'buffer' | null; + } & ExecOptions + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: ExecOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options?: (ObjectEncodingOptions & ExecOptions) | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + } + interface ExecFileOptions extends CommonOptions, Abortable { + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + windowsVerbatimArguments?: boolean | undefined; + shell?: boolean | string | undefined; + signal?: AbortSignal | undefined; + } + interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: 'buffer' | null; + } + interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + type ExecFileException = ExecException & NodeJS.ErrnoException; + /** + * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified + * executable `file` is spawned directly as a new process making it slightly more + * efficient than {@link exec}. + * + * The same options as {@link exec} are supported. Since a shell is + * not spawned, behaviors such as I/O redirection and file globbing are not + * supported. + * + * ```js + * const { execFile } = require('child_process'); + * const child = execFile('node', ['--version'], (error, stdout, stderr) => { + * if (error) { + * throw error; + * } + * console.log(stdout); + * }); + * ``` + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * const util = require('util'); + * const execFile = util.promisify(require('child_process').execFile); + * async function getVersion() { + * const { stdout } = await execFile('node', ['--version']); + * console.log(stdout); + * } + * getVersion(); + * ``` + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { execFile } = require('child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = execFile('node', ['--version'], { signal }, (error) => { + * console.log(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.91 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @param callback Called with the output when process terminates. + */ + function execFile(file: string): ChildProcess; + function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + // no `options` definitely means stdout/stderr are `string`. + function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding, + callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void + ): ChildProcess; + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding, + callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptions, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function execFile( + file: string, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null + ): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null + ): ChildProcess; + namespace execFile { + function __promisify__(file: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithBufferEncoding + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithStringEncoding + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithOtherEncoding + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + options: ExecFileOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + } + interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + execPath?: string | undefined; + execArgv?: string[] | undefined; + silent?: boolean | undefined; + stdio?: StdioOptions | undefined; + detached?: boolean | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + /** + * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. + * Like {@link spawn}, a `ChildProcess` object is returned. The + * returned `ChildProcess` will have an additional communication channel + * built-in that allows messages to be passed back and forth between the parent and + * child. See `subprocess.send()` for details. + * + * Keep in mind that spawned Node.js child processes are + * independent of the parent with exception of the IPC communication channel + * that is established between the two. Each process has its own memory, with + * their own V8 instances. Because of the additional resource allocations + * required, spawning a large number of child Node.js processes is not + * recommended. + * + * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative + * execution path to be used. + * + * Node.js processes launched with a custom `execPath` will communicate with the + * parent process using the file descriptor (fd) identified using the + * environment variable `NODE_CHANNEL_FD` on the child process. + * + * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the + * current process. + * + * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * if (process.argv[2] === 'child') { + * setTimeout(() => { + * console.log(`Hello from ${process.argv[2]}!`); + * }, 1_000); + * } else { + * const { fork } = require('child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = fork(__filename, ['child'], { signal }); + * child.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * } + * ``` + * @since v0.5.0 + * @param modulePath The module to run in the child. + * @param args List of string arguments. + */ + function fork(modulePath: string, options?: ForkOptions): ChildProcess; + function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; + interface SpawnSyncOptions extends CommonSpawnOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | 'buffer' | null | undefined; + } + interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding?: 'buffer' | null | undefined; + } + interface SpawnSyncReturns { + pid: number; + output: Array; + stdout: T; + stderr: T; + status: number | null; + signal: NodeJS.Signals | null; + error?: Error | undefined; + } + /** + * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the process intercepts and handles the `SIGTERM` signal + * and doesn't exit, the parent process will wait until the child process has + * exited. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawnSync(command: string): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; + interface CommonExecOptions extends CommonOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + stdio?: StdioOptions | undefined; + killSignal?: NodeJS.Signals | number | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | 'buffer' | null | undefined; + } + interface ExecSyncOptions extends CommonExecOptions { + shell?: string | undefined; + } + interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding?: 'buffer' | null | undefined; + } + /** + * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process + * has exited. + * + * If the process times out or has a non-zero exit code, this method will throw. + * The `Error` object will contain the entire result from {@link spawnSync}. + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @return The stdout from the command. + */ + function execSync(command: string): Buffer; + function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; + function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; + function execSync(command: string, options?: ExecSyncOptions): string | Buffer; + interface ExecFileSyncOptions extends CommonExecOptions { + shell?: boolean | string | undefined; + } + interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding?: 'buffer' | null; // specify `null`. + } + /** + * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not + * return until the child process has fully closed. When a timeout has been + * encountered and `killSignal` is sent, the method won't return until the process + * has completely exited. + * + * If the child process intercepts and handles the `SIGTERM` signal and + * does not exit, the parent process will still wait until the child process has + * exited. + * + * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @return The stdout from the command. + */ + function execFileSync(file: string): Buffer; + function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; + function execFileSync(file: string, args: ReadonlyArray): Buffer; + function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): string | Buffer; +} +declare module 'node:child_process' { + export * from 'child_process'; +} diff --git a/server/node_modules/@types/node/cluster.d.ts b/server/node_modules/@types/node/cluster.d.ts new file mode 100755 index 0000000000..37dbc57461 --- /dev/null +++ b/server/node_modules/@types/node/cluster.d.ts @@ -0,0 +1,410 @@ +/** + * Clusters of Node.js processes can be used to run multiple instances of Node.js + * that can distribute workloads among their application threads. When process + * isolation is not needed, use the `worker_threads` module instead, which + * allows running multiple application threads within a single Node.js instance. + * + * The cluster module allows easy creation of child processes that all share + * server ports. + * + * ```js + * import cluster from 'cluster'; + * import http from 'http'; + * import { cpus } from 'os'; + * import process from 'process'; + * + * const numCPUs = cpus().length; + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('exit', (worker, code, signal) => { + * console.log(`worker ${worker.process.pid} died`); + * }); + * } else { + * // Workers can share any TCP connection + * // In this case it is an HTTP server + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * + * console.log(`Worker ${process.pid} started`); + * } + * ``` + * + * Running Node.js will now share port 8000 between the workers: + * + * ```console + * $ node server.js + * Primary 3596 is running + * Worker 4324 started + * Worker 4520 started + * Worker 6056 started + * Worker 5644 started + * ``` + * + * On Windows, it is not yet possible to set up a named pipe server in a worker. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/cluster.js) + */ +declare module 'cluster' { + import * as child from 'node:child_process'; + import EventEmitter = require('node:events'); + import * as net from 'node:net'; + export interface ClusterSettings { + execArgv?: string[] | undefined; // default: process.execArgv + exec?: string | undefined; + args?: string[] | undefined; + silent?: boolean | undefined; + stdio?: any[] | undefined; + uid?: number | undefined; + gid?: number | undefined; + inspectPort?: number | (() => number) | undefined; + } + export interface Address { + address: string; + port: number; + addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6" + } + /** + * A `Worker` object contains all public information and method about a worker. + * In the primary it can be obtained using `cluster.workers`. In a worker + * it can be obtained using `cluster.worker`. + * @since v0.7.0 + */ + export class Worker extends EventEmitter { + /** + * Each new worker is given its own unique id, this id is stored in the`id`. + * + * While a worker is alive, this is the key that indexes it in`cluster.workers`. + * @since v0.8.0 + */ + id: number; + /** + * All workers are created using `child_process.fork()`, the returned object + * from this function is stored as `.process`. In a worker, the global `process`is stored. + * + * See: `Child Process module`. + * + * Workers will call `process.exit(0)` if the `'disconnect'` event occurs + * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against + * accidental disconnection. + * @since v0.7.0 + */ + process: child.ChildProcess; + /** + * Send a message to a worker or primary, optionally with a handle. + * + * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. + * + * In a worker, this sends a message to the primary. It is identical to`process.send()`. + * + * This example will echo back all messages from the primary: + * + * ```js + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * worker.send('hi there'); + * + * } else if (cluster.isWorker) { + * process.on('message', (msg) => { + * process.send(msg); + * }); + * } + * ``` + * @since v0.7.0 + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; + send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean; + send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean; + /** + * This function will kill the worker. In the primary worker, it does this by + * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. + * + * The `kill()` function kills the worker process without waiting for a graceful + * disconnect, it has the same behavior as `worker.process.kill()`. + * + * This method is aliased as `worker.destroy()` for backwards compatibility. + * + * In a worker, `process.kill()` exists, but it is not this function; + * it is `kill()`. + * @since v0.9.12 + * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. + */ + kill(signal?: string): void; + destroy(signal?: string): void; + /** + * In a worker, this function will close all servers, wait for the `'close'` event + * on those servers, and then disconnect the IPC channel. + * + * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. + * + * Causes `.exitedAfterDisconnect` to be set. + * + * After a server is closed, it will no longer accept new connections, + * but connections may be accepted by any other listening worker. Existing + * connections will be allowed to close as usual. When no more connections exist, + * see `server.close()`, the IPC channel to the worker will close allowing it + * to die gracefully. + * + * The above applies _only_ to server connections, client connections are not + * automatically closed by workers, and disconnect does not wait for them to close + * before exiting. + * + * In a worker, `process.disconnect` exists, but it is not this function; + * it is `disconnect()`. + * + * Because long living server connections may block workers from disconnecting, it + * may be useful to send a message, so application specific actions may be taken to + * close them. It also may be useful to implement a timeout, killing a worker if + * the `'disconnect'` event has not been emitted after some time. + * + * ```js + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * let timeout; + * + * worker.on('listening', (address) => { + * worker.send('shutdown'); + * worker.disconnect(); + * timeout = setTimeout(() => { + * worker.kill(); + * }, 2000); + * }); + * + * worker.on('disconnect', () => { + * clearTimeout(timeout); + * }); + * + * } else if (cluster.isWorker) { + * const net = require('net'); + * const server = net.createServer((socket) => { + * // Connections never end + * }); + * + * server.listen(8000); + * + * process.on('message', (msg) => { + * if (msg === 'shutdown') { + * // Initiate graceful close of any connections to server + * } + * }); + * } + * ``` + * @since v0.7.7 + * @return A reference to `worker`. + */ + disconnect(): void; + /** + * This function returns `true` if the worker is connected to its primary via its + * IPC channel, `false` otherwise. A worker is connected to its primary after it + * has been created. It is disconnected after the `'disconnect'` event is emitted. + * @since v0.11.14 + */ + isConnected(): boolean; + /** + * This function returns `true` if the worker's process has terminated (either + * because of exiting or being signaled). Otherwise, it returns `false`. + * + * ```js + * import cluster from 'cluster'; + * import http from 'http'; + * import { cpus } from 'os'; + * import process from 'process'; + * + * const numCPUs = cpus().length; + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('fork', (worker) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * + * cluster.on('exit', (worker, code, signal) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * } else { + * // Workers can share any TCP connection. In this case, it is an HTTP server. + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end(`Current process\n ${process.pid}`); + * process.kill(process.pid); + * }).listen(8000); + * } + * ``` + * @since v0.11.14 + */ + isDead(): boolean; + /** + * This property is `true` if the worker exited due to `.disconnect()`. + * If the worker exited any other way, it is `false`. If the + * worker has not exited, it is `undefined`. + * + * The boolean `worker.exitedAfterDisconnect` allows distinguishing between + * voluntary and accidental exit, the primary may choose not to respawn a worker + * based on this value. + * + * ```js + * cluster.on('exit', (worker, code, signal) => { + * if (worker.exitedAfterDisconnect === true) { + * console.log('Oh, it was just voluntary – no need to worry'); + * } + * }); + * + * // kill worker + * worker.kill(); + * ``` + * @since v6.0.0 + */ + exitedAfterDisconnect: boolean; + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'disconnect', listener: () => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'exit', listener: (code: number, signal: string) => void): this; + addListener(event: 'listening', listener: (address: Address) => void): this; + addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: 'online', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'error', error: Error): boolean; + emit(event: 'exit', code: number, signal: string): boolean; + emit(event: 'listening', address: Address): boolean; + emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean; + emit(event: 'online'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'disconnect', listener: () => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'exit', listener: (code: number, signal: string) => void): this; + on(event: 'listening', listener: (address: Address) => void): this; + on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: 'online', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'disconnect', listener: () => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'exit', listener: (code: number, signal: string) => void): this; + once(event: 'listening', listener: (address: Address) => void): this; + once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: 'online', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'disconnect', listener: () => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'exit', listener: (code: number, signal: string) => void): this; + prependListener(event: 'listening', listener: (address: Address) => void): this; + prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: 'online', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'disconnect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this; + prependOnceListener(event: 'listening', listener: (address: Address) => void): this; + prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: 'online', listener: () => void): this; + } + export interface Cluster extends EventEmitter { + disconnect(callback?: () => void): void; + fork(env?: any): Worker; + /** @deprecated since v16.0.0 - use isPrimary. */ + readonly isMaster: boolean; + readonly isPrimary: boolean; + readonly isWorker: boolean; + schedulingPolicy: number; + readonly settings: ClusterSettings; + /** @deprecated since v16.0.0 - use setupPrimary. */ + setupMaster(settings?: ClusterSettings): void; + /** + * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. + */ + setupPrimary(settings?: ClusterSettings): void; + readonly worker?: Worker | undefined; + readonly workers?: NodeJS.Dict | undefined; + readonly SCHED_NONE: number; + readonly SCHED_RR: number; + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'disconnect', listener: (worker: Worker) => void): this; + addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: 'fork', listener: (worker: Worker) => void): this; + addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: 'online', listener: (worker: Worker) => void): this; + addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'disconnect', worker: Worker): boolean; + emit(event: 'exit', worker: Worker, code: number, signal: string): boolean; + emit(event: 'fork', worker: Worker): boolean; + emit(event: 'listening', worker: Worker, address: Address): boolean; + emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + emit(event: 'online', worker: Worker): boolean; + emit(event: 'setup', settings: ClusterSettings): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'disconnect', listener: (worker: Worker) => void): this; + on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: 'fork', listener: (worker: Worker) => void): this; + on(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: 'online', listener: (worker: Worker) => void): this; + on(event: 'setup', listener: (settings: ClusterSettings) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'disconnect', listener: (worker: Worker) => void): this; + once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: 'fork', listener: (worker: Worker) => void): this; + once(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: 'online', listener: (worker: Worker) => void): this; + once(event: 'setup', listener: (settings: ClusterSettings) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'disconnect', listener: (worker: Worker) => void): this; + prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: 'fork', listener: (worker: Worker) => void): this; + prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this; + prependListener(event: 'online', listener: (worker: Worker) => void): this; + prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; + prependOnceListener(event: 'online', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + } + const cluster: Cluster; + export default cluster; +} +declare module 'node:cluster' { + export * from 'cluster'; + export { default as default } from 'cluster'; +} diff --git a/server/node_modules/@types/node/console.d.ts b/server/node_modules/@types/node/console.d.ts new file mode 100755 index 0000000000..16c9137adf --- /dev/null +++ b/server/node_modules/@types/node/console.d.ts @@ -0,0 +1,412 @@ +/** + * The `console` module provides a simple debugging console that is similar to the + * JavaScript console mechanism provided by web browsers. + * + * The module exports two specific components: + * + * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. + * + * _**Warning**_: The global console object's methods are neither consistently + * synchronous like the browser APIs they resemble, nor are they consistently + * asynchronous like all other Node.js streams. See the `note on process I/O` for + * more information. + * + * Example using the global `console`: + * + * ```js + * console.log('hello world'); + * // Prints: hello world, to stdout + * console.log('hello %s', 'world'); + * // Prints: hello world, to stdout + * console.error(new Error('Whoops, something bad happened')); + * // Prints error message and stack trace to stderr: + * // Error: Whoops, something bad happened + * // at [eval]:5:15 + * // at Script.runInThisContext (node:vm:132:18) + * // at Object.runInThisContext (node:vm:309:38) + * // at node:internal/process/execution:77:19 + * // at [eval]-wrapper:6:22 + * // at evalScript (node:internal/process/execution:76:60) + * // at node:internal/main/eval_string:23:3 + * + * const name = 'Will Robinson'; + * console.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to stderr + * ``` + * + * Example using the `Console` class: + * + * ```js + * const out = getStreamSomehow(); + * const err = getStreamSomehow(); + * const myConsole = new console.Console(out, err); + * + * myConsole.log('hello world'); + * // Prints: hello world, to out + * myConsole.log('hello %s', 'world'); + * // Prints: hello world, to out + * myConsole.error(new Error('Whoops, something bad happened')); + * // Prints: [Error: Whoops, something bad happened], to err + * + * const name = 'Will Robinson'; + * myConsole.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to err + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/console.js) + */ +declare module 'console' { + import console = require('node:console'); + export = console; +} +declare module 'node:console' { + import { InspectOptions } from 'node:util'; + global { + // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build + interface Console { + Console: console.ConsoleConstructor; + /** + * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only + * writes a message and does not otherwise affect execution. The output always + * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. + * + * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. + * + * ```js + * console.assert(true, 'does nothing'); + * + * console.assert(false, 'Whoops %s work', 'didn\'t'); + * // Assertion failed: Whoops didn't work + * + * console.assert(); + * // Assertion failed + * ``` + * @since v0.1.101 + * @param value The value tested for being truthy. + * @param message All arguments besides `value` are used as error message. + */ + assert(value: any, message?: string, ...optionalParams: any[]): void; + /** + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the + * TTY. When `stdout` is not a TTY, this method does nothing. + * + * The specific operation of `console.clear()` can vary across operating systems + * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the + * current terminal viewport for the Node.js + * binary. + * @since v8.3.0 + */ + clear(): void; + /** + * Maintains an internal counter specific to `label` and outputs to `stdout` the + * number of times `console.count()` has been called with the given `label`. + * + * ```js + * > console.count() + * default: 1 + * undefined + * > console.count('default') + * default: 2 + * undefined + * > console.count('abc') + * abc: 1 + * undefined + * > console.count('xyz') + * xyz: 1 + * undefined + * > console.count('abc') + * abc: 2 + * undefined + * > console.count() + * default: 3 + * undefined + * > + * ``` + * @since v8.3.0 + * @param label The display label for the counter. + */ + count(label?: string): void; + /** + * Resets the internal counter specific to `label`. + * + * ```js + * > console.count('abc'); + * abc: 1 + * undefined + * > console.countReset('abc'); + * undefined + * > console.count('abc'); + * abc: 1 + * undefined + * > + * ``` + * @since v8.3.0 + * @param label The display label for the counter. + */ + countReset(label?: string): void; + /** + * The `console.debug()` function is an alias for {@link log}. + * @since v8.0.0 + */ + debug(message?: any, ...optionalParams: any[]): void; + /** + * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. + * This function bypasses any custom `inspect()` function defined on `obj`. + * @since v0.1.101 + */ + dir(obj: any, options?: InspectOptions): void; + /** + * This method calls `console.log()` passing it the arguments received. + * This method does not produce any XML formatting. + * @since v8.0.0 + */ + dirxml(...data: any[]): void; + /** + * Prints to `stderr` with newline. Multiple arguments can be passed, with the + * first used as the primary message and all additional used as substitution + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * + * ```js + * const code = 5; + * console.error('error #%d', code); + * // Prints: error #5, to stderr + * console.error('error', code); + * // Prints: error 5, to stderr + * ``` + * + * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string + * values are concatenated. See `util.format()` for more information. + * @since v0.1.100 + */ + error(message?: any, ...optionalParams: any[]): void; + /** + * Increases indentation of subsequent lines by spaces for `groupIndentation`length. + * + * If one or more `label`s are provided, those are printed first without the + * additional indentation. + * @since v8.5.0 + */ + group(...label: any[]): void; + /** + * An alias for {@link group}. + * @since v8.5.0 + */ + groupCollapsed(...label: any[]): void; + /** + * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. + * @since v8.5.0 + */ + groupEnd(): void; + /** + * The `console.info()` function is an alias for {@link log}. + * @since v0.1.100 + */ + info(message?: any, ...optionalParams: any[]): void; + /** + * Prints to `stdout` with newline. Multiple arguments can be passed, with the + * first used as the primary message and all additional used as substitution + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * + * ```js + * const count = 5; + * console.log('count: %d', count); + * // Prints: count: 5, to stdout + * console.log('count:', count); + * // Prints: count: 5, to stdout + * ``` + * + * See `util.format()` for more information. + * @since v0.1.100 + */ + log(message?: any, ...optionalParams: any[]): void; + /** + * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just + * logging the argument if it can’t be parsed as tabular. + * + * ```js + * // These can't be parsed as tabular data + * console.table(Symbol()); + * // Symbol() + * + * console.table(undefined); + * // undefined + * + * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); + * // ┌─────────┬─────┬─────┐ + * // │ (index) │ a │ b │ + * // ├─────────┼─────┼─────┤ + * // │ 0 │ 1 │ 'Y' │ + * // │ 1 │ 'Z' │ 2 │ + * // └─────────┴─────┴─────┘ + * + * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); + * // ┌─────────┬─────┐ + * // │ (index) │ a │ + * // ├─────────┼─────┤ + * // │ 0 │ 1 │ + * // │ 1 │ 'Z' │ + * // └─────────┴─────┘ + * ``` + * @since v10.0.0 + * @param properties Alternate properties for constructing the table. + */ + table(tabularData: any, properties?: ReadonlyArray): void; + /** + * Starts a timer that can be used to compute the duration of an operation. Timers + * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in + * suitable time units to `stdout`. For example, if the elapsed + * time is 3869ms, `console.timeEnd()` displays "3.869s". + * @since v0.1.104 + */ + time(label?: string): void; + /** + * Stops a timer that was previously started by calling {@link time} and + * prints the result to `stdout`: + * + * ```js + * console.time('100-elements'); + * for (let i = 0; i < 100; i++) {} + * console.timeEnd('100-elements'); + * // prints 100-elements: 225.438ms + * ``` + * @since v0.1.104 + */ + timeEnd(label?: string): void; + /** + * For a timer that was previously started by calling {@link time}, prints + * the elapsed time and other `data` arguments to `stdout`: + * + * ```js + * console.time('process'); + * const value = expensiveProcess1(); // Returns 42 + * console.timeLog('process', value); + * // Prints "process: 365.227ms 42". + * doExpensiveProcess2(value); + * console.timeEnd('process'); + * ``` + * @since v10.7.0 + */ + timeLog(label?: string, ...data: any[]): void; + /** + * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. + * + * ```js + * console.trace('Show me'); + * // Prints: (stack trace will vary based on where trace is called) + * // Trace: Show me + * // at repl:2:9 + * // at REPLServer.defaultEval (repl.js:248:27) + * // at bound (domain.js:287:14) + * // at REPLServer.runBound [as eval] (domain.js:300:12) + * // at REPLServer. (repl.js:412:12) + * // at emitOne (events.js:82:20) + * // at REPLServer.emit (events.js:169:7) + * // at REPLServer.Interface._onLine (readline.js:210:10) + * // at REPLServer.Interface._line (readline.js:549:8) + * // at REPLServer.Interface._ttyWrite (readline.js:826:14) + * ``` + * @since v0.1.104 + */ + trace(message?: any, ...optionalParams: any[]): void; + /** + * The `console.warn()` function is an alias for {@link error}. + * @since v0.1.100 + */ + warn(message?: any, ...optionalParams: any[]): void; + // --- Inspector mode only --- + /** + * This method does not display anything unless used in the inspector. + * Starts a JavaScript CPU profile with an optional label. + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + */ + profileEnd(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Adds an event with the label `label` to the Timeline panel of the inspector. + */ + timeStamp(label?: string): void; + } + /** + * The `console` module provides a simple debugging console that is similar to the + * JavaScript console mechanism provided by web browsers. + * + * The module exports two specific components: + * + * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. + * + * _**Warning**_: The global console object's methods are neither consistently + * synchronous like the browser APIs they resemble, nor are they consistently + * asynchronous like all other Node.js streams. See the `note on process I/O` for + * more information. + * + * Example using the global `console`: + * + * ```js + * console.log('hello world'); + * // Prints: hello world, to stdout + * console.log('hello %s', 'world'); + * // Prints: hello world, to stdout + * console.error(new Error('Whoops, something bad happened')); + * // Prints error message and stack trace to stderr: + * // Error: Whoops, something bad happened + * // at [eval]:5:15 + * // at Script.runInThisContext (node:vm:132:18) + * // at Object.runInThisContext (node:vm:309:38) + * // at node:internal/process/execution:77:19 + * // at [eval]-wrapper:6:22 + * // at evalScript (node:internal/process/execution:76:60) + * // at node:internal/main/eval_string:23:3 + * + * const name = 'Will Robinson'; + * console.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to stderr + * ``` + * + * Example using the `Console` class: + * + * ```js + * const out = getStreamSomehow(); + * const err = getStreamSomehow(); + * const myConsole = new console.Console(out, err); + * + * myConsole.log('hello world'); + * // Prints: hello world, to out + * myConsole.log('hello %s', 'world'); + * // Prints: hello world, to out + * myConsole.error(new Error('Whoops, something bad happened')); + * // Prints: [Error: Whoops, something bad happened], to err + * + * const name = 'Will Robinson'; + * myConsole.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to err + * ``` + * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) + */ + namespace console { + interface ConsoleConstructorOptions { + stdout: NodeJS.WritableStream; + stderr?: NodeJS.WritableStream | undefined; + ignoreErrors?: boolean | undefined; + colorMode?: boolean | 'auto' | undefined; + inspectOptions?: InspectOptions | undefined; + /** + * Set group indentation + * @default 2 + */ + groupIndentation?: number | undefined; + } + interface ConsoleConstructor { + prototype: Console; + new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; + new (options: ConsoleConstructorOptions): Console; + } + } + var console: Console; + } + export = globalThis.console; +} diff --git a/server/node_modules/@types/node/constants.d.ts b/server/node_modules/@types/node/constants.d.ts new file mode 100755 index 0000000000..208020dcba --- /dev/null +++ b/server/node_modules/@types/node/constants.d.ts @@ -0,0 +1,18 @@ +/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ +declare module 'constants' { + import { constants as osConstants, SignalConstants } from 'node:os'; + import { constants as cryptoConstants } from 'node:crypto'; + import { constants as fsConstants } from 'node:fs'; + + const exp: typeof osConstants.errno & + typeof osConstants.priority & + SignalConstants & + typeof cryptoConstants & + typeof fsConstants; + export = exp; +} + +declare module 'node:constants' { + import constants = require('constants'); + export = constants; +} diff --git a/server/node_modules/@types/node/crypto.d.ts b/server/node_modules/@types/node/crypto.d.ts new file mode 100755 index 0000000000..20d960cd6d --- /dev/null +++ b/server/node_modules/@types/node/crypto.d.ts @@ -0,0 +1,3964 @@ +/** + * The `crypto` module provides cryptographic functionality that includes a set of + * wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. + * + * ```js + * const { createHmac } = await import('crypto'); + * + * const secret = 'abcdefg'; + * const hash = createHmac('sha256', secret) + * .update('I love cupcakes') + * .digest('hex'); + * console.log(hash); + * // Prints: + * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/crypto.js) + */ +declare module 'crypto' { + import * as stream from 'node:stream'; + import { PeerCertificate } from 'node:tls'; + /** + * SPKAC is a Certificate Signing Request mechanism originally implemented by + * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen). + * + * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects + * should not use this element anymore. + * + * The `crypto` module provides the `Certificate` class for working with SPKAC + * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC + * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally. + * @since v0.11.8 + */ + class Certificate { + /** + * ```js + * const { Certificate } = await import('crypto'); + * const spkac = getSpkacSomehow(); + * const challenge = Certificate.exportChallenge(spkac); + * console.log(challenge.toString('utf8')); + * // Prints: the challenge as a UTF8 string + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportChallenge(spkac: BinaryLike): Buffer; + /** + * ```js + * const { Certificate } = await import('crypto'); + * const spkac = getSpkacSomehow(); + * const publicKey = Certificate.exportPublicKey(spkac); + * console.log(publicKey); + * // Prints: the public key as + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * ```js + * import { Buffer } from 'buffer'; + * const { Certificate } = await import('crypto'); + * + * const spkac = getSpkacSomehow(); + * console.log(Certificate.verifySpkac(Buffer.from(spkac))); + * // Prints: true or false + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return `true` if the given `spkac` data structure is valid, `false` otherwise. + */ + static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + /** + * @deprecated + * @param spkac + * @returns The challenge component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportChallenge(spkac: BinaryLike): Buffer; + /** + * @deprecated + * @param spkac + * @param encoding The encoding of the spkac string. + * @returns The public key component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * @deprecated + * @param spkac + * @returns `true` if the given `spkac` data structure is valid, + * `false` otherwise. + */ + verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + } + namespace constants { + // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants + const OPENSSL_VERSION_NUMBER: number; + /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ + const SSL_OP_ALL: number; + /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_CIPHER_SERVER_PREFERENCE: number; + /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ + const SSL_OP_CISCO_ANYCONNECT: number; + /** Instructs OpenSSL to turn on cookie exchange. */ + const SSL_OP_COOKIE_EXCHANGE: number; + /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ + const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ + const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */ + const SSL_OP_EPHEMERAL_RSA: number; + /** Allows initial connection to servers that do not support RI. */ + const SSL_OP_LEGACY_SERVER_CONNECT: number; + const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + const SSL_OP_MICROSOFT_SESS_ID_BUG: number; + /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */ + const SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + const SSL_OP_NETSCAPE_CA_DN_BUG: number; + const SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + /** Instructs OpenSSL to disable support for SSL/TLS compression. */ + const SSL_OP_NO_COMPRESSION: number; + const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to always start a new session when performing renegotiation. */ + const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + const SSL_OP_NO_SSLv2: number; + const SSL_OP_NO_SSLv3: number; + const SSL_OP_NO_TICKET: number; + const SSL_OP_NO_TLSv1: number; + const SSL_OP_NO_TLSv1_1: number; + const SSL_OP_NO_TLSv1_2: number; + const SSL_OP_PKCS1_CHECK_1: number; + const SSL_OP_PKCS1_CHECK_2: number; + /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */ + const SSL_OP_SINGLE_DH_USE: number; + /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */ + const SSL_OP_SINGLE_ECDH_USE: number; + const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + const SSL_OP_TLS_BLOCK_PADDING_BUG: number; + const SSL_OP_TLS_D5_BUG: number; + /** Instructs OpenSSL to disable version rollback attack detection. */ + const SSL_OP_TLS_ROLLBACK_BUG: number; + const ENGINE_METHOD_RSA: number; + const ENGINE_METHOD_DSA: number; + const ENGINE_METHOD_DH: number; + const ENGINE_METHOD_RAND: number; + const ENGINE_METHOD_EC: number; + const ENGINE_METHOD_CIPHERS: number; + const ENGINE_METHOD_DIGESTS: number; + const ENGINE_METHOD_PKEY_METHS: number; + const ENGINE_METHOD_PKEY_ASN1_METHS: number; + const ENGINE_METHOD_ALL: number; + const ENGINE_METHOD_NONE: number; + const DH_CHECK_P_NOT_SAFE_PRIME: number; + const DH_CHECK_P_NOT_PRIME: number; + const DH_UNABLE_TO_CHECK_GENERATOR: number; + const DH_NOT_SUITABLE_GENERATOR: number; + const ALPN_ENABLED: number; + const RSA_PKCS1_PADDING: number; + const RSA_SSLV23_PADDING: number; + const RSA_NO_PADDING: number; + const RSA_PKCS1_OAEP_PADDING: number; + const RSA_X931_PADDING: number; + const RSA_PKCS1_PSS_PADDING: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ + const RSA_PSS_SALTLEN_DIGEST: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ + const RSA_PSS_SALTLEN_MAX_SIGN: number; + /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ + const RSA_PSS_SALTLEN_AUTO: number; + const POINT_CONVERSION_COMPRESSED: number; + const POINT_CONVERSION_UNCOMPRESSED: number; + const POINT_CONVERSION_HYBRID: number; + /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ + const defaultCoreCipherList: string; + /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ + const defaultCipherList: string; + } + interface HashOptions extends stream.TransformOptions { + /** + * For XOF hash functions such as `shake256`, the + * outputLength option can be used to specify the desired output length in bytes. + */ + outputLength?: number | undefined; + } + /** @deprecated since v10.0.0 */ + const fips: boolean; + /** + * Creates and returns a `Hash` object that can be used to generate hash digests + * using the given `algorithm`. Optional `options` argument controls stream + * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option + * can be used to specify the desired output length in bytes. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * Example: generating the sha256 sum of a file + * + * ```js + * import { + * createReadStream + * } from 'fs'; + * import { argv } from 'process'; + * const { + * createHash + * } = await import('crypto'); + * + * const filename = argv[2]; + * + * const hash = createHash('sha256'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hash.update(data); + * else { + * console.log(`${hash.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.92 + * @param options `stream.transform` options + */ + function createHash(algorithm: string, options?: HashOptions): Hash; + /** + * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. + * Optional `options` argument controls stream behavior. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is + * a `KeyObject`, its type must be `secret`. + * + * Example: generating the sha256 HMAC of a file + * + * ```js + * import { + * createReadStream + * } from 'fs'; + * import { argv } from 'process'; + * const { + * createHmac + * } = await import('crypto'); + * + * const filename = argv[2]; + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hmac.update(data); + * else { + * console.log(`${hmac.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; + // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings + type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'; + type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1'; + type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2'; + type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; + type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'; + /** + * The `Hash` class is a utility for creating hash digests of data. It can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed hash digest on the readable side, or + * * Using the `hash.update()` and `hash.digest()` methods to produce the + * computed hash. + * + * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hash` objects as streams: + * + * ```js + * const { + * createHash + * } = await import('crypto'); + * + * const hash = createHash('sha256'); + * + * hash.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hash.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * } + * }); + * + * hash.write('some data to hash'); + * hash.end(); + * ``` + * + * Example: Using `Hash` and piped streams: + * + * ```js + * import { createReadStream } from 'fs'; + * import { stdout } from 'process'; + * const { createHash } = await import('crypto'); + * + * const hash = createHash('sha256'); + * + * const input = createReadStream('test.js'); + * input.pipe(hash).setEncoding('hex').pipe(stdout); + * ``` + * + * Example: Using the `hash.update()` and `hash.digest()` methods: + * + * ```js + * const { + * createHash + * } = await import('crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('some data to hash'); + * console.log(hash.digest('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * ``` + * @since v0.1.92 + */ + class Hash extends stream.Transform { + private constructor(); + /** + * Creates a new `Hash` object that contains a deep copy of the internal state + * of the current `Hash` object. + * + * The optional `options` argument controls stream behavior. For XOF hash + * functions such as `'shake256'`, the `outputLength` option can be used to + * specify the desired output length in bytes. + * + * An error is thrown when an attempt is made to copy the `Hash` object after + * its `hash.digest()` method has been called. + * + * ```js + * // Calculate a rolling hash. + * const { + * createHash + * } = await import('crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('one'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('two'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('three'); + * console.log(hash.copy().digest('hex')); + * + * // Etc. + * ``` + * @since v13.1.0 + * @param options `stream.transform` options + */ + copy(options?: stream.TransformOptions): Hash; + /** + * Updates the hash content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hash; + update(data: string, inputEncoding: Encoding): Hash; + /** + * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). + * If `encoding` is provided a string will be returned; otherwise + * a `Buffer` is returned. + * + * The `Hash` object can not be used again after `hash.digest()` method has been + * called. Multiple calls will cause an error to be thrown. + * @since v0.1.92 + * @param encoding The `encoding` of the return value. + */ + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + /** + * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can + * be used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed HMAC digest on the readable side, or + * * Using the `hmac.update()` and `hmac.digest()` methods to produce the + * computed HMAC digest. + * + * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hmac` objects as streams: + * + * ```js + * const { + * createHmac + * } = await import('crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hmac.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * } + * }); + * + * hmac.write('some data to hash'); + * hmac.end(); + * ``` + * + * Example: Using `Hmac` and piped streams: + * + * ```js + * import { createReadStream } from 'fs'; + * import { stdout } from 'process'; + * const { + * createHmac + * } = await import('crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream('test.js'); + * input.pipe(hmac).pipe(stdout); + * ``` + * + * Example: Using the `hmac.update()` and `hmac.digest()` methods: + * + * ```js + * const { + * createHmac + * } = await import('crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.update('some data to hash'); + * console.log(hmac.digest('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * ``` + * @since v0.1.94 + */ + class Hmac extends stream.Transform { + private constructor(); + /** + * Updates the `Hmac` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hmac; + update(data: string, inputEncoding: Encoding): Hmac; + /** + * Calculates the HMAC digest of all of the data passed using `hmac.update()`. + * If `encoding` is + * provided a string is returned; otherwise a `Buffer` is returned; + * + * The `Hmac` object can not be used again after `hmac.digest()` has been + * called. Multiple calls to `hmac.digest()` will result in an error being thrown. + * @since v0.1.94 + * @param encoding The `encoding` of the return value. + */ + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + type KeyObjectType = 'secret' | 'public' | 'private'; + interface KeyExportOptions { + type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; + format: T; + cipher?: string | undefined; + passphrase?: string | Buffer | undefined; + } + interface JwkKeyExportOptions { + format: 'jwk'; + } + interface JsonWebKey { + crv?: string | undefined; + d?: string | undefined; + dp?: string | undefined; + dq?: string | undefined; + e?: string | undefined; + k?: string | undefined; + kty?: string | undefined; + n?: string | undefined; + p?: string | undefined; + q?: string | undefined; + qi?: string | undefined; + x?: string | undefined; + y?: string | undefined; + [key: string]: unknown; + } + interface AsymmetricKeyDetails { + /** + * Key size in bits (RSA, DSA). + */ + modulusLength?: number | undefined; + /** + * Public exponent (RSA). + */ + publicExponent?: bigint | undefined; + /** + * Name of the message digest (RSA-PSS). + */ + hashAlgorithm?: string | undefined; + /** + * Name of the message digest used by MGF1 (RSA-PSS). + */ + mgf1HashAlgorithm?: string | undefined; + /** + * Minimal salt length in bytes (RSA-PSS). + */ + saltLength?: number | undefined; + /** + * Size of q in bits (DSA). + */ + divisorLength?: number | undefined; + /** + * Name of the curve (EC). + */ + namedCurve?: string | undefined; + } + /** + * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, + * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` + * objects are not to be created directly using the `new`keyword. + * + * Most applications should consider using the new `KeyObject` API instead of + * passing keys as strings or `Buffer`s due to improved security features. + * + * `KeyObject` instances can be passed to other threads via `postMessage()`. + * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to + * be listed in the `transferList` argument. + * @since v11.6.0 + */ + class KeyObject { + private constructor(); + /** + * Example: Converting a `CryptoKey` instance to a `KeyObject`: + * + * ```js + * const { webcrypto, KeyObject } = await import('crypto'); + * const { subtle } = webcrypto; + * + * const key = await subtle.generateKey({ + * name: 'HMAC', + * hash: 'SHA-256', + * length: 256 + * }, true, ['sign', 'verify']); + * + * const keyObject = KeyObject.from(key); + * console.log(keyObject.symmetricKeySize); + * // Prints: 32 (symmetric key size in bytes) + * ``` + * @since v15.0.0 + */ + static from(key: webcrypto.CryptoKey): KeyObject; + /** + * For asymmetric keys, this property represents the type of the key. Supported key + * types are: + * + * * `'rsa'` (OID 1.2.840.113549.1.1.1) + * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) + * * `'dsa'` (OID 1.2.840.10040.4.1) + * * `'ec'` (OID 1.2.840.10045.2.1) + * * `'x25519'` (OID 1.3.101.110) + * * `'x448'` (OID 1.3.101.111) + * * `'ed25519'` (OID 1.3.101.112) + * * `'ed448'` (OID 1.3.101.113) + * * `'dh'` (OID 1.2.840.113549.1.3.1) + * + * This property is `undefined` for unrecognized `KeyObject` types and symmetric + * keys. + * @since v11.6.0 + */ + asymmetricKeyType?: KeyType | undefined; + /** + * For asymmetric keys, this property represents the size of the embedded key in + * bytes. This property is `undefined` for symmetric keys. + */ + asymmetricKeySize?: number | undefined; + /** + * This property exists only on asymmetric keys. Depending on the type of the key, + * this object contains information about the key. None of the information obtained + * through this property can be used to uniquely identify a key or to compromise + * the security of the key. + * + * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, + * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be + * set. + * + * Other key details might be exposed via this API using additional attributes. + * @since v15.7.0 + */ + asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; + /** + * For symmetric keys, the following encoding options can be used: + * + * For public keys, the following encoding options can be used: + * + * For private keys, the following encoding options can be used: + * + * The result type depends on the selected encoding format, when PEM the + * result is a string, when DER it will be a buffer containing the data + * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. + * + * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are + * ignored. + * + * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of + * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be + * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for + * encrypted private keys. Since PKCS#8 defines its own + * encryption mechanism, PEM-level encryption is not supported when encrypting + * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for + * PKCS#1 and SEC1 encryption. + * @since v11.6.0 + */ + export(options: KeyExportOptions<'pem'>): string | Buffer; + export(options?: KeyExportOptions<'der'>): Buffer; + export(options?: JwkKeyExportOptions): JsonWebKey; + /** + * For secret keys, this property represents the size of the key in bytes. This + * property is `undefined` for asymmetric keys. + * @since v11.6.0 + */ + symmetricKeySize?: number | undefined; + /** + * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys + * or `'private'` for private (asymmetric) keys. + * @since v11.6.0 + */ + type: KeyObjectType; + } + type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; + type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; + type CipherOCBTypes = 'aes-128-ocb' | 'aes-192-ocb' | 'aes-256-ocb'; + type BinaryLike = string | NodeJS.ArrayBufferView; + type CipherKey = BinaryLike | KeyObject; + interface CipherCCMOptions extends stream.TransformOptions { + authTagLength: number; + } + interface CipherGCMOptions extends stream.TransformOptions { + authTagLength?: number | undefined; + } + interface CipherOCBOptions extends stream.TransformOptions { + authTagLength: number; + } + /** + * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication + * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `password` is used to derive the cipher key and initialization vector (IV). + * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. + * + * The implementation of `crypto.createCipher()` derives keys using the OpenSSL + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * iteration, and no salt. The lack of salt allows dictionary attacks as the same + * password always creates the same key. The low iteration count and + * non-cryptographically secure hash algorithm allow passwords to be tested very + * rapidly. + * + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that + * developers derive a key and IV on + * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode + * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when + * they are used in order to avoid the risk of IV reuse that causes + * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. + * @since v0.1.94 + * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. + * @param options `stream.transform` options + */ + function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; + /** + * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and + * initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication + * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a + * given IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): CipherCCM; + function createCipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): CipherOCB; + function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): CipherGCM; + function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher; + /** + * Instances of the `Cipher` class are used to encrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain unencrypted + * data is written to produce encrypted data on the readable side, or + * * Using the `cipher.update()` and `cipher.final()` methods to produce + * the encrypted data. + * + * The {@link createCipher} or {@link createCipheriv} methods are + * used to create `Cipher` instances. `Cipher` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Cipher` objects as streams: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * // Once we have the key and iv, we can create and use the cipher... + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = ''; + * cipher.setEncoding('hex'); + * + * cipher.on('data', (chunk) => encrypted += chunk); + * cipher.on('end', () => console.log(encrypted)); + * + * cipher.write('some clear text data'); + * cipher.end(); + * }); + * }); + * ``` + * + * Example: Using `Cipher` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'fs'; + * + * import { + * pipeline + * } from 'stream'; + * + * const { + * scrypt, + * randomFill, + * createCipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.js'); + * const output = createWriteStream('test.enc'); + * + * pipeline(input, cipher, output, (err) => { + * if (err) throw err; + * }); + * }); + * }); + * ``` + * + * Example: Using the `cipher.update()` and `cipher.final()` methods: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); + * encrypted += cipher.final('hex'); + * console.log(encrypted); + * }); + * }); + * ``` + * @since v0.1.94 + */ + class Cipher extends stream.Transform { + private constructor(); + /** + * Updates the cipher with `data`. If the `inputEncoding` argument is given, + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, + * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * + * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being + * thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the data. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: BinaryLike): Buffer; + update(data: string, inputEncoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `cipher.final()` method has been called, the `Cipher` object can no + * longer be used to encrypt data. Attempts to call `cipher.final()` more than + * once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): Buffer; + final(outputEncoding: BufferEncoding): string; + /** + * When using block encryption algorithms, the `Cipher` class will automatically + * add padding to the input data to the appropriate block size. To disable the + * default padding call `cipher.setAutoPadding(false)`. + * + * When `autoPadding` is `false`, the length of the entire input data must be a + * multiple of the cipher's block size or `cipher.final()` will throw an error. + * Disabling automatic padding is useful for non-standard padding, for instance + * using `0x0` instead of PKCS padding. + * + * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(autoPadding?: boolean): this; + } + interface CipherCCM extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + interface CipherGCM extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + interface CipherOCB extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + /** + * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * iteration, and no salt. The lack of salt allows dictionary attacks as the same + * password always creates the same key. The low iteration count and + * non-cryptographically secure hash algorithm allow passwords to be tested very + * rapidly. + * + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that + * developers derive a key and IV on + * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. + * @since v0.1.94 + * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. + * @param options `stream.transform` options + */ + function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; + /** + * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags + * to those with the specified length. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a given + * IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): DecipherCCM; + function createDecipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): DecipherOCB; + function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; + /** + * Instances of the `Decipher` class are used to decrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain encrypted + * data is written to produce unencrypted data on the readable side, or + * * Using the `decipher.update()` and `decipher.final()` methods to + * produce the unencrypted data. + * + * The {@link createDecipher} or {@link createDecipheriv} methods are + * used to create `Decipher` instances. `Decipher` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Decipher` objects as streams: + * + * ```js + * import { Buffer } from 'buffer'; + * const { + * scryptSync, + * createDecipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Key length is dependent on the algorithm. In this case for aes192, it is + * // 24 bytes (192 bits). + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * let decrypted = ''; + * decipher.on('readable', () => { + * while (null !== (chunk = decipher.read())) { + * decrypted += chunk.toString('utf8'); + * } + * }); + * decipher.on('end', () => { + * console.log(decrypted); + * // Prints: some clear text data + * }); + * + * // Encrypted with same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * decipher.write(encrypted, 'hex'); + * decipher.end(); + * ``` + * + * Example: Using `Decipher` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'fs'; + * import { Buffer } from 'buffer'; + * const { + * scryptSync, + * createDecipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.enc'); + * const output = createWriteStream('test.js'); + * + * input.pipe(decipher).pipe(output); + * ``` + * + * Example: Using the `decipher.update()` and `decipher.final()` methods: + * + * ```js + * import { Buffer } from 'buffer'; + * const { + * scryptSync, + * createDecipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * // Encrypted using same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); + * decrypted += decipher.final('utf8'); + * console.log(decrypted); + * // Prints: some clear text data + * ``` + * @since v0.1.94 + */ + class Decipher extends stream.Transform { + private constructor(); + /** + * Updates the decipher with `data`. If the `inputEncoding` argument is given, + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is + * ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * + * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error + * being thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: NodeJS.ArrayBufferView): Buffer; + update(data: string, inputEncoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `decipher.final()` method has been called, the `Decipher` object can + * no longer be used to decrypt data. Attempts to call `decipher.final()` more + * than once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): Buffer; + final(outputEncoding: BufferEncoding): string; + /** + * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and + * removing padding. + * + * Turning auto padding off will only work if the input data's length is a + * multiple of the ciphers block size. + * + * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(auto_padding?: boolean): this; + } + interface DecipherCCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + } + ): this; + } + interface DecipherGCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + } + interface DecipherOCB extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + } + interface PrivateKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; + passphrase?: string | Buffer | undefined; + } + interface PublicKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: 'pkcs1' | 'spki' | undefined; + } + /** + * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKey + * } = await import('crypto'); + * + * generateKey('hmac', { length: 64 }, (err, key) => { + * if (err) throw err; + * console.log(key.export().toString('hex')); // 46e..........620 + * }); + * ``` + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKey( + type: 'hmac' | 'aes', + options: { + length: number; + }, + callback: (err: Error | null, key: KeyObject) => void + ): void; + /** + * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKeySync + * } = await import('crypto'); + * + * const key = generateKeySync('hmac', { length: 64 }); + * console.log(key.export().toString('hex')); // e89..........41e + * ``` + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKeySync( + type: 'hmac' | 'aes', + options: { + length: number; + } + ): KeyObject; + interface JsonWebKeyInput { + key: JsonWebKey; + format: 'jwk'; + } + /** + * Creates and returns a new key object containing a private key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. + * + * If the private key is encrypted, a `passphrase` must be specified. The length + * of the passphrase is limited to 1024 bytes. + * @since v11.6.0 + */ + function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a public key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; + * otherwise, `key` must be an object with the properties described above. + * + * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. + * + * Because public keys can be derived from private keys, a private key may be + * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the + * returned `KeyObject` will be `'public'` and that the private key cannot be + * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned + * and it will be impossible to extract the private key from the returned object. + * @since v11.6.0 + */ + function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a secret key for symmetric + * encryption or `Hmac`. + * @since v11.6.0 + * @param encoding The string encoding when `key` is a string. + */ + function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; + function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; + /** + * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. + * Optional `options` argument controls the `stream.Writable` behavior. + * + * In some cases, a `Sign` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + function createSign(algorithm: string, options?: stream.WritableOptions): Sign; + type DSAEncoding = 'der' | 'ieee-p1363'; + interface SigningOptions { + /** + * @See crypto.constants.RSA_PKCS1_PADDING + */ + padding?: number | undefined; + saltLength?: number | undefined; + dsaEncoding?: DSAEncoding | undefined; + } + interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} + interface SignKeyObjectInput extends SigningOptions { + key: KeyObject; + } + interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} + interface VerifyKeyObjectInput extends SigningOptions { + key: KeyObject; + } + type KeyLike = string | Buffer | KeyObject; + /** + * The `Sign` class is a utility for generating signatures. It can be used in one + * of two ways: + * + * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or + * * Using the `sign.update()` and `sign.sign()` methods to produce the + * signature. + * + * The {@link createSign} method is used to create `Sign` instances. The + * argument is the string name of the hash function to use. `Sign` objects are not + * to be created directly using the `new` keyword. + * + * Example: Using `Sign` and `Verify` objects as streams: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify + * } = await import('crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('ec', { + * namedCurve: 'sect239k1' + * }); + * + * const sign = createSign('SHA256'); + * sign.write('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey, 'hex'); + * + * const verify = createVerify('SHA256'); + * verify.write('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature, 'hex')); + * // Prints: true + * ``` + * + * Example: Using the `sign.update()` and `verify.update()` methods: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify + * } = await import('crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('rsa', { + * modulusLength: 2048, + * }); + * + * const sign = createSign('SHA256'); + * sign.update('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey); + * + * const verify = createVerify('SHA256'); + * verify.update('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature)); + * // Prints: true + * ``` + * @since v0.1.92 + */ + class Sign extends stream.Writable { + private constructor(); + /** + * Updates the `Sign` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): this; + update(data: string, inputEncoding: Encoding): this; + /** + * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the following additional properties can be passed: + * + * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * The `Sign` object can not be again used after `sign.sign()` method has been + * called. Multiple calls to `sign.sign()` will result in an error being thrown. + * @since v0.1.92 + */ + sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; + sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string; + } + /** + * Creates and returns a `Verify` object that uses the given algorithm. + * Use {@link getHashes} to obtain an array of names of the available + * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. + * + * In some cases, a `Verify` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; + /** + * The `Verify` class is a utility for verifying signatures. It can be used in one + * of two ways: + * + * * As a writable `stream` where written data is used to validate against the + * supplied signature, or + * * Using the `verify.update()` and `verify.verify()` methods to verify + * the signature. + * + * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. + * + * See `Sign` for examples. + * @since v0.1.92 + */ + class Verify extends stream.Writable { + private constructor(); + /** + * Updates the `Verify` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `inputEncoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Verify; + update(data: string, inputEncoding: Encoding): Verify; + /** + * Verifies the provided data using the given `object` and `signature`. + * + * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an + * object, the following additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the data, in + * the `signatureEncoding`. + * If a `signatureEncoding` is specified, the `signature` is expected to be a + * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * The `verify` object can not be used again after `verify.verify()` has been + * called. Multiple calls to `verify.verify()` will result in an error being + * thrown. + * + * Because public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.1.92 + */ + verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; + verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; + } + /** + * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an + * optional specific `generator`. + * + * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. + * + * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise + * a `Buffer`, `TypedArray`, or `DataView` is expected. + * + * If `generatorEncoding` is specified, `generator` is expected to be a string; + * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. + * @since v0.11.12 + * @param primeEncoding The `encoding` of the `prime` string. + * @param [generator=2] + * @param generatorEncoding The `encoding` of the `generator` string. + */ + function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; + function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; + function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; + /** + * The `DiffieHellman` class is a utility for creating Diffie-Hellman key + * exchanges. + * + * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. + * + * ```js + * import assert from 'assert'; + * + * const { + * createDiffieHellman + * } = await import('crypto'); + * + * // Generate Alice's keys... + * const alice = createDiffieHellman(2048); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * // OK + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * ``` + * @since v0.5.0 + */ + class DiffieHellman { + private constructor(); + /** + * Generates private and public Diffie-Hellman key values, and returns + * the public key in the specified `encoding`. This key should be + * transferred to the other party. + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using the specified `inputEncoding`, and secret is + * encoded using specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. + * @since v0.5.0 + * @param inputEncoding The `encoding` of an `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman prime in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrime(): Buffer; + getPrime(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman generator in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getGenerator(): Buffer; + getGenerator(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman public key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPublicKey(): Buffer; + getPublicKey(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman private key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected + * to be a string. If no `encoding` is provided, `publicKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * @since v0.5.0 + * @param encoding The `encoding` of the `publicKey` string. + */ + setPublicKey(publicKey: NodeJS.ArrayBufferView): void; + setPublicKey(publicKey: string, encoding: BufferEncoding): void; + /** + * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected + * to be a string. If no `encoding` is provided, `privateKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * @since v0.5.0 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BufferEncoding): void; + /** + * A bit field containing any warnings and/or errors resulting from a check + * performed during initialization of the `DiffieHellman` object. + * + * The following values are valid for this property (as defined in `constants`module): + * + * * `DH_CHECK_P_NOT_SAFE_PRIME` + * * `DH_CHECK_P_NOT_PRIME` + * * `DH_UNABLE_TO_CHECK_GENERATOR` + * * `DH_NOT_SUITABLE_GENERATOR` + * @since v0.11.12 + */ + verifyError: number; + } + /** + * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. + * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. + * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. + * + * ```js + * const { createDiffieHellmanGroup } = await import('node:crypto'); + * const dh = createDiffieHellmanGroup('modp1'); + * ``` + * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): + * ```bash + * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h + * modp1 # 768 bits + * modp2 # 1024 bits + * modp5 # 1536 bits + * modp14 # 2048 bits + * modp15 # etc. + * modp16 + * modp17 + * modp18 + * ``` + * @since v0.7.5 + */ + const DiffieHellmanGroup: DiffieHellmanGroupConstructor; + interface DiffieHellmanGroupConstructor { + new(name: string): DiffieHellmanGroup; + (name: string): DiffieHellmanGroup; + readonly prototype: DiffieHellmanGroup; + } + type DiffieHellmanGroup = Omit; + /** + * Creates a predefined `DiffieHellmanGroup` key exchange object. The + * supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`, + * `'modp18'` (defined in [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt)). The + * returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing + * the keys (with `diffieHellman.setPublicKey()`, for example). The + * advantage of using this method is that the parties do not have to + * generate nor exchange a group modulus beforehand, saving both processor + * and communication time. + * + * Example (obtaining a shared secret): + * + * ```js + * const { + * getDiffieHellman + * } = await import('crypto'); + * const alice = getDiffieHellman('modp14'); + * const bob = getDiffieHellman('modp14'); + * + * alice.generateKeys(); + * bob.generateKeys(); + * + * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); + * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); + * + * // aliceSecret and bobSecret should be the same + * console.log(aliceSecret === bobSecret); + * ``` + * @since v0.7.5 + */ + function getDiffieHellman(groupName: string): DiffieHellmanGroup; + /** + * An alias for {@link getDiffieHellman} + * @since v0.9.3 + */ + function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; + /** + * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * + * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be + * thrown if any of the input arguments specify invalid values or types. + * + * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, + * please specify a `digest` explicitly. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2 + * } = await import('crypto'); + * + * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * ``` + * + * The `crypto.DEFAULT_ENCODING` property can be used to change the way the`derivedKey` is passed to the callback. This property, however, has been + * deprecated and use should be avoided. + * + * ```js + * import crypto from 'crypto'; + * crypto.DEFAULT_ENCODING = 'hex'; + * crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey); // '3745e48...aa39b34' + * }); + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * @since v0.5.5 + */ + function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void; + /** + * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * + * If an error occurs an `Error` will be thrown, otherwise the derived key will be + * returned as a `Buffer`. + * + * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, + * please specify a `digest` explicitly. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2Sync + * } = await import('crypto'); + * + * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); + * console.log(key.toString('hex')); // '3745e48...08d59ae' + * ``` + * + * The `crypto.DEFAULT_ENCODING` property may be used to change the way the`derivedKey` is returned. This property, however, is deprecated and use + * should be avoided. + * + * ```js + * import crypto from 'crypto'; + * crypto.DEFAULT_ENCODING = 'hex'; + * const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); + * console.log(key); // '3745e48...aa39b34' + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * @since v0.9.3 + */ + function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; + /** + * Generates cryptographically strong pseudorandom data. The `size` argument + * is a number indicating the number of bytes to generate. + * + * If a `callback` function is provided, the bytes are generated asynchronously + * and the `callback` function is invoked with two arguments: `err` and `buf`. + * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. + * + * ```js + * // Asynchronous + * const { + * randomBytes + * } = await import('crypto'); + * + * randomBytes(256, (err, buf) => { + * if (err) throw err; + * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); + * }); + * ``` + * + * If the `callback` function is not provided, the random bytes are generated + * synchronously and returned as a `Buffer`. An error will be thrown if + * there is a problem generating the bytes. + * + * ```js + * // Synchronous + * const { + * randomBytes + * } = await import('crypto'); + * + * const buf = randomBytes(256); + * console.log( + * `${buf.length} bytes of random data: ${buf.toString('hex')}`); + * ``` + * + * The `crypto.randomBytes()` method will not complete until there is + * sufficient entropy available. + * This should normally never take longer than a few milliseconds. The only time + * when generating the random bytes may conceivably block for a longer period of + * time is right after boot, when the whole system is still low on entropy. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomBytes()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomBytes` requests when doing so as part of fulfilling a client + * request. + * @since v0.5.8 + * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. + * @return if the `callback` function is not provided. + */ + function randomBytes(size: number): Buffer; + function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + function pseudoRandomBytes(size: number): Buffer; + function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + /** + * Return a random integer `n` such that `min <= n < max`. This + * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). + * + * The range (`max - min`) must be less than 2^48. `min` and `max` must + * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). + * + * If the `callback` function is not provided, the random integer is + * generated synchronously. + * + * ```js + * // Asynchronous + * const { + * randomInt + * } = await import('crypto'); + * + * randomInt(3, (err, n) => { + * if (err) throw err; + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * }); + * ``` + * + * ```js + * // Synchronous + * const { + * randomInt + * } = await import('crypto'); + * + * const n = randomInt(3); + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * ``` + * + * ```js + * // With `min` argument + * const { + * randomInt + * } = await import('crypto'); + * + * const n = randomInt(1, 7); + * console.log(`The dice rolled: ${n}`); + * ``` + * @since v14.10.0, v12.19.0 + * @param [min=0] Start of random range (inclusive). + * @param max End of random range (exclusive). + * @param callback `function(err, n) {}`. + */ + function randomInt(max: number): number; + function randomInt(min: number, max: number): number; + function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; + function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; + /** + * Synchronous version of {@link randomFill}. + * + * ```js + * import { Buffer } from 'buffer'; + * const { randomFillSync } = await import('crypto'); + * + * const buf = Buffer.alloc(10); + * console.log(randomFillSync(buf).toString('hex')); + * + * randomFillSync(buf, 5); + * console.log(buf.toString('hex')); + * + * // The above is equivalent to the following: + * randomFillSync(buf, 5, 5); + * console.log(buf.toString('hex')); + * ``` + * + * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. + * + * ```js + * import { Buffer } from 'buffer'; + * const { randomFillSync } = await import('crypto'); + * + * const a = new Uint32Array(10); + * console.log(Buffer.from(randomFillSync(a).buffer, + * a.byteOffset, a.byteLength).toString('hex')); + * + * const b = new DataView(new ArrayBuffer(10)); + * console.log(Buffer.from(randomFillSync(b).buffer, + * b.byteOffset, b.byteLength).toString('hex')); + * + * const c = new ArrayBuffer(10); + * console.log(Buffer.from(randomFillSync(c)).toString('hex')); + * ``` + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @return The object passed as `buffer` argument. + */ + function randomFillSync(buffer: T, offset?: number, size?: number): T; + /** + * This function is similar to {@link randomBytes} but requires the first + * argument to be a `Buffer` that will be filled. It also + * requires that a callback is passed in. + * + * If the `callback` function is not provided, an error will be thrown. + * + * ```js + * import { Buffer } from 'buffer'; + * const { randomFill } = await import('crypto'); + * + * const buf = Buffer.alloc(10); + * randomFill(buf, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * randomFill(buf, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * // The above is equivalent to the following: + * randomFill(buf, 5, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * ``` + * + * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. + * + * While this includes instances of `Float32Array` and `Float64Array`, this + * function should not be used to generate random floating-point numbers. The + * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array + * contains finite numbers only, they are not drawn from a uniform random + * distribution and have no meaningful lower or upper bounds. + * + * ```js + * import { Buffer } from 'buffer'; + * const { randomFill } = await import('crypto'); + * + * const a = new Uint32Array(10); + * randomFill(a, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const b = new DataView(new ArrayBuffer(10)); + * randomFill(b, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const c = new ArrayBuffer(10); + * randomFill(c, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf).toString('hex')); + * }); + * ``` + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomFill()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomFill` requests when doing so as part of fulfilling a client + * request. + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @param callback `function(err, buf) {}`. + */ + function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; + interface ScryptOptions { + cost?: number | undefined; + blockSize?: number | undefined; + parallelization?: number | undefined; + N?: number | undefined; + r?: number | undefined; + p?: number | undefined; + maxmem?: number | undefined; + } + /** + * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the + * callback as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scrypt + * } = await import('crypto'); + * + * // Using the factory defaults. + * scrypt('password', 'salt', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * // Using a custom N parameter. Must be a power of two. + * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' + * }); + * ``` + * @since v10.5.0 + */ + function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void; + function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void; + /** + * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * An exception is thrown when key derivation fails, otherwise the derived key is + * returned as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scryptSync + * } = await import('crypto'); + * // Using the factory defaults. + * + * const key1 = scryptSync('password', 'salt', 64); + * console.log(key1.toString('hex')); // '3745e48...08d59ae' + * // Using a custom N parameter. Must be a power of two. + * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); + * console.log(key2.toString('hex')); // '3745e48...aa39b34' + * ``` + * @since v10.5.0 + */ + function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; + interface RsaPublicKey { + key: KeyLike; + padding?: number | undefined; + } + interface RsaPrivateKey { + key: KeyLike; + passphrase?: string | undefined; + /** + * @default 'sha1' + */ + oaepHash?: string | undefined; + oaepLabel?: NodeJS.TypedArray | undefined; + padding?: number | undefined; + } + /** + * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using + * the corresponding private key, for example using {@link privateDecrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.11.14 + */ + function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Decrypts `buffer` with `key`.`buffer` was previously encrypted using + * the corresponding private key, for example using {@link privateEncrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v1.1.0 + */ + function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using + * the corresponding public key, for example using {@link publicEncrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * @since v0.11.14 + */ + function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using + * the corresponding public key, for example using {@link publicDecrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * @since v1.1.0 + */ + function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * ```js + * const { + * getCiphers + * } = await import('crypto'); + * + * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] + * ``` + * @since v0.9.3 + * @return An array with the names of the supported cipher algorithms. + */ + function getCiphers(): string[]; + /** + * ```js + * const { + * getCurves + * } = await import('crypto'); + * + * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] + * ``` + * @since v2.3.0 + * @return An array with the names of the supported elliptic curves. + */ + function getCurves(): string[]; + /** + * @since v10.0.0 + * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. + */ + function getFips(): 1 | 0; + /** + * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. Throws an error if FIPS mode is not available. + * @since v10.0.0 + * @param bool `true` to enable FIPS mode. + */ + function setFips(bool: boolean): void; + /** + * ```js + * const { + * getHashes + * } = await import('crypto'); + * + * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] + * ``` + * @since v0.9.3 + * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. + */ + function getHashes(): string[]; + /** + * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) + * key exchanges. + * + * Instances of the `ECDH` class can be created using the {@link createECDH} function. + * + * ```js + * import assert from 'assert'; + * + * const { + * createECDH + * } = await import('crypto'); + * + * // Generate Alice's keys... + * const alice = createECDH('secp521r1'); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createECDH('secp521r1'); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * // OK + * ``` + * @since v0.11.14 + */ + class ECDH { + private constructor(); + /** + * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the + * format specified by `format`. The `format` argument specifies point encoding + * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is + * interpreted using the specified `inputEncoding`, and the returned key is encoded + * using the specified `outputEncoding`. + * + * Use {@link getCurves} to obtain a list of available curve names. + * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display + * the name and description of each available elliptic curve. + * + * If `format` is not specified the point will be returned in `'uncompressed'`format. + * + * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * Example (uncompressing a key): + * + * ```js + * const { + * createECDH, + * ECDH + * } = await import('crypto'); + * + * const ecdh = createECDH('secp256k1'); + * ecdh.generateKeys(); + * + * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); + * + * const uncompressedKey = ECDH.convertKey(compressedKey, + * 'secp256k1', + * 'hex', + * 'hex', + * 'uncompressed'); + * + * // The converted key and the uncompressed public key should be the same + * console.log(uncompressedKey === ecdh.getPublicKey('hex')); + * ``` + * @since v10.0.0 + * @param inputEncoding The `encoding` of the `key` string. + * @param outputEncoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + static convertKey( + key: BinaryLike, + curve: string, + inputEncoding?: BinaryToTextEncoding, + outputEncoding?: 'latin1' | 'hex' | 'base64' | 'base64url', + format?: 'uncompressed' | 'compressed' | 'hybrid' + ): Buffer | string; + /** + * Generates private and public EC Diffie-Hellman key values, and returns + * the public key in the specified `format` and `encoding`. This key should be + * transferred to the other party. + * + * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. + * + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using specified `inputEncoding`, and the returned secret + * is encoded using the specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. + * + * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. + * + * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is + * usually supplied from a remote user over an insecure network, + * be sure to handle this exception accordingly. + * @since v0.11.14 + * @param inputEncoding The `encoding` of the `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; + /** + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @return The EC Diffie-Hellman in the specified `encoding`. + */ + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. + * + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param [encoding] The `encoding` of the return value. + * @param [format='uncompressed'] + * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. + */ + getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; + getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Sets the EC Diffie-Hellman private key. + * If `encoding` is provided, `privateKey` is expected + * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * If `privateKey` is not valid for the curve specified when the `ECDH` object was + * created, an error is thrown. Upon setting the private key, the associated + * public point (key) is also generated and set in the `ECDH` object. + * @since v0.11.14 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; + } + /** + * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a + * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent + * OpenSSL releases, `openssl ecparam -list_curves` will also display the name + * and description of each available elliptic curve. + * @since v0.11.14 + */ + function createECDH(curveName: string): ECDH; + /** + * This function is based on a constant-time algorithm. + * Returns true if `a` is equal to `b`, without leaking timing information that + * would allow an attacker to guess one of the values. This is suitable for + * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). + * + * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they + * must have the same byte length. An error is thrown if `a` and `b` have + * different byte lengths. + * + * If at least one of `a` and `b` is a `TypedArray` with more than one byte per + * entry, such as `Uint16Array`, the result will be computed using the platform + * byte order. + * + * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code + * is timing-safe. Care should be taken to ensure that the surrounding code does + * not introduce timing vulnerabilities. + * @since v6.6.0 + */ + function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; + /** @deprecated since v10.0.0 */ + const DEFAULT_ENCODING: BufferEncoding; + type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; + type KeyFormat = 'pem' | 'der' | 'jwk'; + interface BasePrivateKeyEncodingOptions { + format: T; + cipher?: string | undefined; + passphrase?: string | undefined; + } + interface KeyPairKeyObjectResult { + publicKey: KeyObject; + privateKey: KeyObject; + } + interface ED25519KeyPairKeyObjectOptions {} + interface ED448KeyPairKeyObjectOptions {} + interface X25519KeyPairKeyObjectOptions {} + interface X448KeyPairKeyObjectOptions {} + interface ECKeyPairKeyObjectOptions { + /** + * Name of the curve to use + */ + namedCurve: string; + } + interface RSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + } + interface RSAPSSKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + /** + * Name of the message digest + */ + hashAlgorithm?: string; + /** + * Name of the message digest used by MGF1 + */ + mgf1HashAlgorithm?: string; + /** + * Minimal salt length in bytes + */ + saltLength?: string; + } + interface DSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + } + interface RSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs1' | 'pkcs8'; + }; + } + interface RSAPSSKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + /** + * Name of the message digest + */ + hashAlgorithm?: string; + /** + * Name of the message digest used by MGF1 + */ + mgf1HashAlgorithm?: string; + /** + * Minimal salt length in bytes + */ + saltLength?: string; + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface DSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface ECKeyPairOptions { + /** + * Name of the curve to use. + */ + namedCurve: string; + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'sec1' | 'pkcs8'; + }; + } + interface ED25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface ED448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface X25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface X448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface KeyPairSyncResult { + publicKey: T1; + privateKey: T2; + } + /** + * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, + * Ed25519, Ed448, X25519, X448, and DH are currently supported. + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * When encoding public keys, it is recommended to use `'spki'`. When encoding + * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, + * and to keep the passphrase confidential. + * + * ```js + * const { + * generateKeyPairSync + * } = await import('crypto'); + * + * const { + * publicKey, + * privateKey, + * } = generateKeyPairSync('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem' + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret' + * } + * }); + * ``` + * + * The return value `{ publicKey, privateKey }` represents the generated key pair. + * When PEM encoding was selected, the respective key will be a string, otherwise + * it will be a buffer containing the data encoded as DER. + * @since v10.12.0 + * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. + */ + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + /** + * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, + * Ed25519, Ed448, X25519, X448, and DH are currently supported. + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: + * + * ```js + * const { + * generateKeyPair + * } = await import('crypto'); + * + * generateKeyPair('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem' + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret' + * } + * }, (err, publicKey, privateKey) => { + * // Handle errors and use the generated key pair. + * }); + * ``` + * + * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. + * @since v10.12.0 + * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. + */ + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + namespace generateKeyPair { + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise; + } + /** + * Calculates and returns the signature for `data` using the given private key and + * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is + * dependent upon the key type (especially Ed25519 and Ed448). + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPrivateKey}. If it is an object, the following + * additional properties can be passed: + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; + function sign( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, + callback: (error: Error | null, data: Buffer) => void + ): void; + /** + * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the + * key type (especially Ed25519 and Ed448). + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPublicKey}. If it is an object, the following + * additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the `data`. + * + * Because public keys can be derived from private keys, a private key or a public + * key may be passed for `key`. + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; + function verify( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, + signature: NodeJS.ArrayBufferView, + callback: (error: Error | null, result: boolean) => void + ): void; + /** + * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. + * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). + * @since v13.9.0, v12.17.0 + */ + function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; + type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts'; + interface CipherInfoOptions { + /** + * A test key length. + */ + keyLength?: number | undefined; + /** + * A test IV length. + */ + ivLength?: number | undefined; + } + interface CipherInfo { + /** + * The name of the cipher. + */ + name: string; + /** + * The nid of the cipher. + */ + nid: number; + /** + * The block size of the cipher in bytes. + * This property is omitted when mode is 'stream'. + */ + blockSize?: number | undefined; + /** + * The expected or default initialization vector length in bytes. + * This property is omitted if the cipher does not use an initialization vector. + */ + ivLength?: number | undefined; + /** + * The expected or default key length in bytes. + */ + keyLength: number; + /** + * The cipher mode. + */ + mode: CipherMode; + } + /** + * Returns information about a given cipher. + * + * Some ciphers accept variable length keys and initialization vectors. By default, + * the `crypto.getCipherInfo()` method will return the default values for these + * ciphers. To test if a given key length or iv length is acceptable for given + * cipher, use the `keyLength` and `ivLength` options. If the given values are + * unacceptable, `undefined` will be returned. + * @since v15.0.0 + * @param nameOrNid The name or nid of the cipher to query. + */ + function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; + /** + * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. + * + * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. The successfully generated `derivedKey` will + * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any + * of the input arguments specify invalid values or types. + * + * ```js + * import { Buffer } from 'buffer'; + * const { + * hkdf + * } = await import('crypto'); + * + * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * }); + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. It must be at least one byte in length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void; + /** + * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The + * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. + * + * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). + * + * An error will be thrown if any of the input arguments specify invalid values or + * types, or if the derived key cannot be generated. + * + * ```js + * import { Buffer } from 'buffer'; + * const { + * hkdfSync + * } = await import('crypto'); + * + * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. It must be at least one byte in length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer; + interface SecureHeapUsage { + /** + * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. + */ + total: number; + /** + * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. + */ + min: number; + /** + * The total number of bytes currently allocated from the secure heap. + */ + used: number; + /** + * The calculated ratio of `used` to `total` allocated bytes. + */ + utilization: number; + } + /** + * @since v15.6.0 + */ + function secureHeapUsed(): SecureHeapUsage; + interface RandomUUIDOptions { + /** + * By default, to improve performance, + * Node.js will pre-emptively generate and persistently cache enough + * random data to generate up to 128 random UUIDs. To generate a UUID + * without using the cache, set `disableEntropyCache` to `true`. + * + * @default `false` + */ + disableEntropyCache?: boolean | undefined; + } + /** + * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a + * cryptographic pseudorandom number generator. + * @since v15.6.0, v14.17.0 + */ + function randomUUID(options?: RandomUUIDOptions): string; + interface X509CheckOptions { + /** + * @default 'always' + */ + subject?: 'always' | 'default' | 'never'; + /** + * @default true + */ + wildcards?: boolean; + /** + * @default true + */ + partialWildcards?: boolean; + /** + * @default false + */ + multiLabelWildcards?: boolean; + /** + * @default false + */ + singleLabelSubdomains?: boolean; + } + /** + * Encapsulates an X509 certificate and provides read-only access to + * its information. + * + * ```js + * const { X509Certificate } = await import('crypto'); + * + * const x509 = new X509Certificate('{... pem encoded cert ...}'); + * + * console.log(x509.subject); + * ``` + * @since v15.6.0 + */ + class X509Certificate { + /** + * Will be \`true\` if this is a Certificate Authority (CA) certificate. + * @since v15.6.0 + */ + readonly ca: boolean; + /** + * The SHA-1 fingerprint of this certificate. + * + * Because SHA-1 is cryptographically broken and because the security of SHA-1 is + * significantly worse than that of algorithms that are commonly used to sign + * certificates, consider using `x509.fingerprint256` instead. + * @since v15.6.0 + */ + readonly fingerprint: string; + /** + * The SHA-256 fingerprint of this certificate. + * @since v15.6.0 + */ + readonly fingerprint256: string; + /** + * The SHA-512 fingerprint of this certificate. + * @since v16.14.0 + */ + readonly fingerprint512: string; + /** + * The complete subject of this certificate. + * @since v15.6.0 + */ + readonly subject: string; + /** + * The subject alternative name specified for this certificate or `undefined` + * if not available. + * @since v15.6.0 + */ + readonly subjectAltName: string | undefined; + /** + * The information access content of this certificate or `undefined` if not + * available. + * @since v15.6.0 + */ + readonly infoAccess: string | undefined; + /** + * An array detailing the key usages for this certificate. + * @since v15.6.0 + */ + readonly keyUsage: string[]; + /** + * The issuer identification included in this certificate. + * @since v15.6.0 + */ + readonly issuer: string; + /** + * The issuer certificate or `undefined` if the issuer certificate is not + * available. + * @since v15.9.0 + */ + readonly issuerCertificate?: X509Certificate | undefined; + /** + * The public key `KeyObject` for this certificate. + * @since v15.6.0 + */ + readonly publicKey: KeyObject; + /** + * A `Buffer` containing the DER encoding of this certificate. + * @since v15.6.0 + */ + readonly raw: Buffer; + /** + * The serial number of this certificate. + * + * Serial numbers are assigned by certificate authorities and do not uniquely + * identify certificates. Consider using `x509.fingerprint256` as a unique + * identifier instead. + * @since v15.6.0 + */ + readonly serialNumber: string; + /** + * The date/time from which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validFrom: string; + /** + * The date/time until which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validTo: string; + constructor(buffer: BinaryLike); + /** + * Checks whether the certificate matches the given email address. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any email addresses. + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching email + * address, the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns `email` if the certificate matches, `undefined` if it does not. + */ + checkEmail(email: string, options?: Pick): string | undefined; + /** + * Checks whether the certificate matches the given host name. + * + * If the certificate matches the given host name, the matching subject name is + * returned. The returned name might be an exact match (e.g., `foo.example.com`) + * or it might contain wildcards (e.g., `*.example.com`). Because host name + * comparisons are case-insensitive, the returned subject name might also differ + * from the given `name` in capitalization. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching DNS name, + * the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. + */ + checkHost(name: string, options?: X509CheckOptions): string | undefined; + /** + * Checks whether the certificate matches the given IP address (IPv4 or IPv6). + * + * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they + * must match the given `ip` address exactly. Other subject alternative names as + * well as the subject field of the certificate are ignored. + * @since v15.6.0 + * @return Returns `ip` if the certificate matches, `undefined` if it does not. + */ + checkIP(ip: string): string | undefined; + /** + * Checks whether this certificate was issued by the given `otherCert`. + * @since v15.6.0 + */ + checkIssued(otherCert: X509Certificate): boolean; + /** + * Checks whether the public key for this certificate is consistent with + * the given private key. + * @since v15.6.0 + * @param privateKey A private key. + */ + checkPrivateKey(privateKey: KeyObject): boolean; + /** + * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded + * certificate. + * @since v15.6.0 + */ + toJSON(): string; + /** + * Returns information about this certificate using the legacy `certificate object` encoding. + * @since v15.6.0 + */ + toLegacyObject(): PeerCertificate; + /** + * Returns the PEM-encoded certificate. + * @since v15.6.0 + */ + toString(): string; + /** + * Verifies that this certificate was signed by the given public key. + * Does not perform any other validation checks on the certificate. + * @since v15.6.0 + * @param publicKey A public key. + */ + verify(publicKey: KeyObject): boolean; + } + type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; + interface GeneratePrimeOptions { + add?: LargeNumberLike | undefined; + rem?: LargeNumberLike | undefined; + /** + * @default false + */ + safe?: boolean | undefined; + bigint?: boolean | undefined; + } + interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { + bigint: true; + } + interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { + bigint?: false | undefined; + } + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void; + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrimeSync(size: number): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; + interface CheckPrimeOptions { + /** + * The number of Miller-Rabin probabilistic primality iterations to perform. + * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. + * Care must be used when selecting a number of checks. + * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. + * + * @default 0 + */ + checks?: number | undefined; + } + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + */ + function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; + function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void; + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. + */ + function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; + /** + * Load and set the `engine` for some or all OpenSSL functions (selected by flags). + * + * `engine` could be either an id or a path to the engine's shared library. + * + * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. + * The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`): + * + * - `crypto.constants.ENGINE_METHOD_RSA` + * - `crypto.constants.ENGINE_METHOD_DSA` + * - `crypto.constants.ENGINE_METHOD_DH` + * - `crypto.constants.ENGINE_METHOD_RAND` + * - `crypto.constants.ENGINE_METHOD_EC` + * - `crypto.constants.ENGINE_METHOD_CIPHERS` + * - `crypto.constants.ENGINE_METHOD_DIGESTS` + * - `crypto.constants.ENGINE_METHOD_PKEY_METHS` + * - `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` + * - `crypto.constants.ENGINE_METHOD_ALL` + * - `crypto.constants.ENGINE_METHOD_NONE` + * + * The flags below are deprecated in OpenSSL-1.1.0. + * + * - `crypto.constants.ENGINE_METHOD_ECDH` + * - `crypto.constants.ENGINE_METHOD_ECDSA` + * - `crypto.constants.ENGINE_METHOD_STORE` + * @since v0.11.11 + * @param [flags=crypto.constants.ENGINE_METHOD_ALL] + */ + function setEngine(engine: string, flags?: number): void; + /** + * A convenient alias for `crypto.webcrypto.getRandomValues()`. + * This implementation is not compliant with the Web Crypto spec, + * to write web-compatible code use `crypto.webcrypto.getRandomValues()` instead. + * @since v17.4.0 + * @returns Returns `typedArray`. + */ + function getRandomValues(typedArray: T): T; + /** + * A convenient alias for `crypto.webcrypto.subtle`. + * @since v17.4.0 + */ + const subtle: webcrypto.SubtleCrypto; + /** + * An implementation of the Web Crypto API standard. + * + * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. + * @since v15.0.0 + */ + const webcrypto: webcrypto.Crypto; + namespace webcrypto { + type BufferSource = ArrayBufferView | ArrayBuffer; + type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki'; + type KeyType = 'private' | 'public' | 'secret'; + type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey'; + type AlgorithmIdentifier = Algorithm | string; + type HashAlgorithmIdentifier = AlgorithmIdentifier; + type NamedCurve = string; + type BigInteger = Uint8Array; + interface AesCbcParams extends Algorithm { + iv: BufferSource; + } + interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; + } + interface AesDerivedKeyParams extends Algorithm { + length: number; + } + interface AesGcmParams extends Algorithm { + additionalData?: BufferSource; + iv: BufferSource; + tagLength?: number; + } + interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; + } + interface AesKeyGenParams extends Algorithm { + length: number; + } + interface Algorithm { + name: string; + } + interface EcKeyAlgorithm extends KeyAlgorithm { + namedCurve: NamedCurve; + } + interface EcKeyGenParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcKeyImportParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; + } + interface EcdsaParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface Ed448Params extends Algorithm { + context?: BufferSource; + } + interface HkdfParams extends Algorithm { + hash: HashAlgorithmIdentifier; + info: BufferSource; + salt: BufferSource; + } + interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; + } + interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; + } + interface KeyAlgorithm { + name: string; + } + interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: BufferSource; + } + interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; + } + interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; + } + interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaOaepParams extends Algorithm { + label?: BufferSource; + } + interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; + } + interface RsaPssParams extends Algorithm { + saltLength: number; + } + /** + * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class. + * `Crypto` is a singleton that provides access to the remainder of the crypto API. + * @since v15.0.0 + */ + interface Crypto { + /** + * Provides access to the `SubtleCrypto` API. + * @since v15.0.0 + */ + readonly subtle: SubtleCrypto; + /** + * Generates cryptographically strong random values. + * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. + * + * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. + * + * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. + * @since v15.0.0 + */ + getRandomValues>(typedArray: T): T; + /** + * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. + * The UUID is generated using a cryptographic pseudorandom number generator. + * @since v16.7.0 + */ + randomUUID(): string; + CryptoKey: CryptoKeyConstructor; + } + // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. + interface CryptoKeyConstructor { + /** Illegal constructor */ + (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. + readonly length: 0; + readonly name: 'CryptoKey'; + readonly prototype: CryptoKey; + } + /** + * @since v15.0.0 + */ + interface CryptoKey { + /** + * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. + * @since v15.0.0 + */ + readonly algorithm: KeyAlgorithm; + /** + * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. + * @since v15.0.0 + */ + readonly extractable: boolean; + /** + * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. + * @since v15.0.0 + */ + readonly type: KeyType; + /** + * An array of strings identifying the operations for which the key may be used. + * + * The possible usages are: + * - `'encrypt'` - The key may be used to encrypt data. + * - `'decrypt'` - The key may be used to decrypt data. + * - `'sign'` - The key may be used to generate digital signatures. + * - `'verify'` - The key may be used to verify digital signatures. + * - `'deriveKey'` - The key may be used to derive a new key. + * - `'deriveBits'` - The key may be used to derive bits. + * - `'wrapKey'` - The key may be used to wrap another key. + * - `'unwrapKey'` - The key may be used to unwrap another key. + * + * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). + * @since v15.0.0 + */ + readonly usages: KeyUsage[]; + } + /** + * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. + * @since v15.0.0 + */ + interface CryptoKeyPair { + /** + * A {@link CryptoKey} whose type will be `'private'`. + * @since v15.0.0 + */ + privateKey: CryptoKey; + /** + * A {@link CryptoKey} whose type will be `'public'`. + * @since v15.0.0 + */ + publicKey: CryptoKey; + } + /** + * @since v15.0.0 + */ + interface SubtleCrypto { + /** + * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, + * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, + * the returned promise will be resolved with an `` containing the plaintext result. + * + * The algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * @since v15.0.0 + */ + decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; + /** + * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, + * `subtle.deriveBits()` attempts to generate `length` bits. + * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. + * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed + * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. + * If successful, the returned promise will be resolved with an `` containing the generated data. + * + * The algorithms currently supported include: + * + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HKDF'` + * - `'PBKDF2'` + * @since v15.0.0 + */ + deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; + deriveBits(algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; + /** + * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, + * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. + * + * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, + * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. + * + * The algorithms currently supported include: + * + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HKDF'` + * - `'PBKDF2'` + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + deriveKey( + algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, + baseKey: CryptoKey, + derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, + extractable: boolean, + keyUsages: ReadonlyArray + ): Promise; + /** + * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. + * If successful, the returned promise is resolved with an `` containing the computed digest. + * + * If `algorithm` is provided as a ``, it must be one of: + * + * - `'SHA-1'` + * - `'SHA-256'` + * - `'SHA-384'` + * - `'SHA-512'` + * + * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. + * @since v15.0.0 + */ + digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; + /** + * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, + * `subtle.encrypt()` attempts to encipher `data`. If successful, + * the returned promise is resolved with an `` containing the encrypted result. + * + * The algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * @since v15.0.0 + */ + encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; + /** + * Exports the given key into the specified format, if supported. + * + * If the `` is not extractable, the returned promise will reject. + * + * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, + * the returned promise will be resolved with an `` containing the exported key data. + * + * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a + * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @returns `` containing ``. + * @since v15.0.0 + */ + exportKey(format: 'jwk', key: CryptoKey): Promise; + exportKey(format: Exclude, key: CryptoKey): Promise; + /** + * Using the method and parameters provided in `algorithm`, + * `subtle.generateKey()` attempts to generate new keying material. + * Depending the method used, the method may generate either a single `` or a ``. + * + * The `` (public and private key) generating algorithms supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'RSA-OAEP'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * The `` (secret key) generating algorithms supported include: + * + * - `'HMAC'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray): Promise; + generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray): Promise; + generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; + /** + * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` + * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. + * If the import is successful, the returned promise will be resolved with the created ``. + * + * If importing a `'PBKDF2'` key, `extractable` must be `false`. + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + importKey( + format: 'jwk', + keyData: JsonWebKey, + algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: ReadonlyArray + ): Promise; + importKey( + format: Exclude, + keyData: BufferSource, + algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: KeyUsage[] + ): Promise; + /** + * Using the method and parameters given by `algorithm` and the keying material provided by `key`, + * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, + * the returned promise is resolved with an `` containing the generated signature. + * + * The algorithms currently supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'HMAC'` + * @since v15.0.0 + */ + sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise; + /** + * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. + * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. + * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) + * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. + * If successful, the returned promise is resolved with a `` object. + * + * The wrapping algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * + * The unwrapped key algorithms supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'RSA-OAEP'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HMAC'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + unwrapKey( + format: KeyFormat, + wrappedKey: BufferSource, + unwrappingKey: CryptoKey, + unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, + unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: KeyUsage[] + ): Promise; + /** + * Using the method and parameters given in `algorithm` and the keying material provided by `key`, + * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. + * The returned promise is resolved with either `true` or `false`. + * + * The algorithms currently supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'HMAC'` + * @since v15.0.0 + */ + verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise; + /** + * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. + * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, + * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. + * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, + * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. + * If successful, the returned promise will be resolved with an `` containing the encrypted key data. + * + * The wrapping algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @since v15.0.0 + */ + wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise; + } + } +} +declare module 'node:crypto' { + export * from 'crypto'; +} diff --git a/server/node_modules/@types/node/dgram.d.ts b/server/node_modules/@types/node/dgram.d.ts new file mode 100755 index 0000000000..247328d28b --- /dev/null +++ b/server/node_modules/@types/node/dgram.d.ts @@ -0,0 +1,545 @@ +/** + * The `dgram` module provides an implementation of UDP datagram sockets. + * + * ```js + * import dgram from 'dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.log(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dgram.js) + */ +declare module 'dgram' { + import { AddressInfo } from 'node:net'; + import * as dns from 'node:dns'; + import { EventEmitter, Abortable } from 'node:events'; + interface RemoteInfo { + address: string; + family: 'IPv4' | 'IPv6'; + port: number; + size: number; + } + interface BindOptions { + port?: number | undefined; + address?: string | undefined; + exclusive?: boolean | undefined; + fd?: number | undefined; + } + type SocketType = 'udp4' | 'udp6'; + interface SocketOptions extends Abortable { + type: SocketType; + reuseAddr?: boolean | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + recvBufferSize?: number | undefined; + sendBufferSize?: number | undefined; + lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined; + } + /** + * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram + * messages. When `address` and `port` are not passed to `socket.bind()` the + * method will bind the socket to the "all interfaces" address on a random port + * (it does the right thing for both `udp4` and `udp6` sockets). The bound address + * and port can be retrieved using `socket.address().address` and `socket.address().port`. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: + * + * ```js + * const controller = new AbortController(); + * const { signal } = controller; + * const server = dgram.createSocket({ type: 'udp4', signal }); + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * // Later, when you want to close the server. + * controller.abort(); + * ``` + * @since v0.11.13 + * @param options Available options are: + * @param callback Attached as a listener for `'message'` events. Optional. + */ + function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + /** + * Encapsulates the datagram functionality. + * + * New instances of `dgram.Socket` are created using {@link createSocket}. + * The `new` keyword is not to be used to create `dgram.Socket` instances. + * @since v0.1.99 + */ + class Socket extends EventEmitter { + /** + * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not + * specified, the operating system will choose + * one interface and will add membership to it. To add membership to every + * available interface, call `addMembership` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * + * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: + * + * ```js + * import cluster from 'cluster'; + * import dgram from 'dgram'; + * + * if (cluster.isPrimary) { + * cluster.fork(); // Works ok. + * cluster.fork(); // Fails with EADDRINUSE. + * } else { + * const s = dgram.createSocket('udp4'); + * s.bind(1234, () => { + * s.addMembership('224.0.0.114'); + * }); + * } + * ``` + * @since v0.6.9 + */ + addMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * Returns an object containing the address information for a socket. + * For UDP sockets, this object will contain `address`, `family` and `port`properties. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.99 + */ + address(): AddressInfo; + /** + * For UDP sockets, causes the `dgram.Socket` to listen for datagram + * messages on a named `port` and optional `address`. If `port` is not + * specified or is `0`, the operating system will attempt to bind to a + * random port. If `address` is not specified, the operating system will + * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is + * called. + * + * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very + * useful. + * + * A bound datagram socket keeps the Node.js process running to receive + * datagram messages. + * + * If binding fails, an `'error'` event is generated. In rare case (e.g. + * attempting to bind with a closed socket), an `Error` may be thrown. + * + * Example of a UDP server listening on port 41234: + * + * ```js + * import dgram from 'dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.log(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @since v0.1.99 + * @param callback with no parameters. Called when binding is complete. + */ + bind(port?: number, address?: string, callback?: () => void): this; + bind(port?: number, callback?: () => void): this; + bind(callback?: () => void): this; + bind(options: BindOptions, callback?: () => void): this; + /** + * Close the underlying socket and stop listening for data on it. If a callback is + * provided, it is added as a listener for the `'close'` event. + * @since v0.1.99 + * @param callback Called when the socket has been closed. + */ + close(callback?: () => void): this; + /** + * Associates the `dgram.Socket` to a remote address and port. Every + * message sent by this handle is automatically sent to that destination. Also, + * the socket will only receive messages from that remote peer. + * Trying to call `connect()` on an already connected socket will result + * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not + * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) + * will be used by default. Once the connection is complete, a `'connect'` event + * is emitted and the optional `callback` function is called. In case of failure, + * the `callback` is called or, failing this, an `'error'` event is emitted. + * @since v12.0.0 + * @param callback Called when the connection is completed or on error. + */ + connect(port: number, address?: string, callback?: () => void): void; + connect(port: number, callback: () => void): void; + /** + * A synchronous function that disassociates a connected `dgram.Socket` from + * its remote address. Trying to call `disconnect()` on an unbound or already + * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. + * @since v12.0.0 + */ + disconnect(): void; + /** + * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the + * kernel when the socket is closed or the process terminates, so most apps will + * never have reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v0.6.9 + */ + dropMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_RCVBUF` socket receive buffer size in bytes. + */ + getRecvBufferSize(): number; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_SNDBUF` socket send buffer size in bytes. + */ + getSendBufferSize(): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active. The `socket.ref()` method adds the socket back to the reference + * counting and restores the default behavior. + * + * Calling `socket.ref()` multiples times will have no additional effect. + * + * The `socket.ref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + ref(): this; + /** + * Returns an object containing the `address`, `family`, and `port` of the remote + * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception + * if the socket is not connected. + * @since v12.0.0 + */ + remoteAddress(): AddressInfo; + /** + * Broadcasts a datagram on the socket. + * For connectionless sockets, the destination `port` and `address` must be + * specified. Connected sockets, on the other hand, will use their associated + * remote endpoint, so the `port` and `address` arguments must not be set. + * + * The `msg` argument contains the message to be sent. + * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, + * any `TypedArray` or a `DataView`, + * the `offset` and `length` specify the offset within the `Buffer` where the + * message begins and the number of bytes in the message, respectively. + * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that + * contain multi-byte characters, `offset` and `length` will be calculated with + * respect to `byte length` and not the character position. + * If `msg` is an array, `offset` and `length` must not be specified. + * + * The `address` argument is a string. If the value of `address` is a host name, + * DNS will be used to resolve the address of the host. If `address` is not + * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. + * + * If the socket has not been previously bound with a call to `bind`, the socket + * is assigned a random port number and is bound to the "all interfaces" address + * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) + * + * An optional `callback` function may be specified to as a way of reporting + * DNS errors or for determining when it is safe to reuse the `buf` object. + * DNS lookups delay the time to send for at least one tick of the + * Node.js event loop. + * + * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be + * passed as the first argument to the `callback`. If a `callback` is not given, + * the error is emitted as an `'error'` event on the `socket` object. + * + * Offset and length are optional but both _must_ be set if either are used. + * They are supported only when the first argument is a `Buffer`, a `TypedArray`, + * or a `DataView`. + * + * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. + * + * Example of sending a UDP packet to a port on `localhost`; + * + * ```js + * import dgram from 'dgram'; + * import { Buffer } from 'buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.send(message, 41234, 'localhost', (err) => { + * client.close(); + * }); + * ``` + * + * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; + * + * ```js + * import dgram from 'dgram'; + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from('Some '); + * const buf2 = Buffer.from('bytes'); + * const client = dgram.createSocket('udp4'); + * client.send([buf1, buf2], 41234, (err) => { + * client.close(); + * }); + * ``` + * + * Sending multiple buffers might be faster or slower depending on the + * application and operating system. Run benchmarks to + * determine the optimal strategy on a case-by-case basis. Generally speaking, + * however, sending multiple buffers is faster. + * + * Example of sending a UDP packet using a socket connected to a port on`localhost`: + * + * ```js + * import dgram from 'dgram'; + * import { Buffer } from 'buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.connect(41234, 'localhost', (err) => { + * client.send(message, (err) => { + * client.close(); + * }); + * }); + * ``` + * @since v0.1.99 + * @param msg Message to be sent. + * @param offset Offset in the buffer where the message starts. + * @param length Number of bytes in the message. + * @param port Destination port. + * @param address Destination host name or IP address. + * @param callback Called when the message has been sent. + */ + send(msg: string | Uint8Array | ReadonlyArray, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; + /** + * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP + * packets may be sent to a local interface's broadcast address. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.6.9 + */ + setBroadcast(flag: boolean): void; + /** + * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC + * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ + * _with a scope index is written as `'IP%scope'` where scope is an interface name_ + * _or interface number._ + * + * Sets the default outgoing multicast interface of the socket to a chosen + * interface or back to system interface selection. The `multicastInterface` must + * be a valid string representation of an IP from the socket's family. + * + * For IPv4 sockets, this should be the IP configured for the desired physical + * interface. All packets sent to multicast on the socket will be sent on the + * interface determined by the most recent successful use of this call. + * + * For IPv6 sockets, `multicastInterface` should include a scope to indicate the + * interface as in the examples that follow. In IPv6, individual `send` calls can + * also use explicit scope in addresses, so only packets sent to a multicast + * address without specifying an explicit scope are affected by the most recent + * successful use of this call. + * + * This method throws `EBADF` if called on an unbound socket. + * + * #### Example: IPv6 outgoing multicast interface + * + * On most systems, where scope format uses the interface name: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%eth1'); + * }); + * ``` + * + * On Windows, where scope format uses an interface number: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%2'); + * }); + * ``` + * + * #### Example: IPv4 outgoing multicast interface + * + * All systems use an IP of the host on the desired physical interface: + * + * ```js + * const socket = dgram.createSocket('udp4'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('10.0.0.2'); + * }); + * ``` + * @since v8.6.0 + */ + setMulticastInterface(multicastInterface: string): void; + /** + * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, + * multicast packets will also be received on the local interface. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastLoopback(flag: boolean): boolean; + /** + * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for + * "Time to Live", in this context it specifies the number of IP hops that a + * packet is allowed to travel through, specifically for multicast traffic. Each + * router or gateway that forwards a packet decrements the TTL. If the TTL is + * decremented to 0 by a router, it will not be forwarded. + * + * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastTTL(ttl: number): number; + /** + * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setRecvBufferSize(size: number): void; + /** + * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setSendBufferSize(size: number): void; + /** + * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", + * in this context it specifies the number of IP hops that a packet is allowed to + * travel through. Each router or gateway that forwards a packet decrements the + * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. + * Changing TTL values is typically done for network probes or when multicasting. + * + * The `ttl` argument may be between 1 and 255\. The default on most systems + * is 64. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.101 + */ + setTTL(ttl: number): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active, allowing the process to exit even if the socket is still + * listening. + * + * Calling `socket.unref()` multiple times will have no addition effect. + * + * The `socket.unref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + unref(): this; + /** + * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket + * option. If the `multicastInterface` argument + * is not specified, the operating system will choose one interface and will add + * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * @since v13.1.0, v12.16.0 + */ + addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is + * automatically called by the kernel when the + * socket is closed or the process terminates, so most apps will never have + * reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v13.1.0, v12.16.0 + */ + dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. error + * 4. listening + * 5. message + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connect'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connect', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connect', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + } +} +declare module 'node:dgram' { + export * from 'dgram'; +} diff --git a/server/node_modules/@types/node/diagnostics_channel.d.ts b/server/node_modules/@types/node/diagnostics_channel.d.ts new file mode 100755 index 0000000000..3dcaa035a5 --- /dev/null +++ b/server/node_modules/@types/node/diagnostics_channel.d.ts @@ -0,0 +1,153 @@ +/** + * The `diagnostics_channel` module provides an API to create named channels + * to report arbitrary message data for diagnostics purposes. + * + * It can be accessed using: + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * ``` + * + * It is intended that a module writer wanting to report diagnostics messages + * will create one or many top-level channels to report messages through. + * Channels may also be acquired at runtime but it is not encouraged + * due to the additional overhead of doing so. Channels may be exported for + * convenience, but as long as the name is known it can be acquired anywhere. + * + * If you intend for your module to produce diagnostics data for others to + * consume it is recommended that you include documentation of what named + * channels are used along with the shape of the message data. Channel names + * should generally include the module name to avoid collisions with data from + * other modules. + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js) + */ +declare module 'diagnostics_channel' { + /** + * Check if there are active subscribers to the named channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * if (diagnostics_channel.hasSubscribers('my-channel')) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return If there are active subscribers + */ + function hasSubscribers(name: string | symbol): boolean; + /** + * This is the primary entry-point for anyone wanting to interact with a named + * channel. It produces a channel object which is optimized to reduce overhead at + * publish time as much as possible. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return The named channel object + */ + function channel(name: string | symbol): Channel; + type ChannelListener = (message: unknown, name: string | symbol) => void; + /** + * The class `Channel` represents an individual named channel within the data + * pipeline. It is use to track subscribers and to publish messages when there + * are subscribers present. It exists as a separate object to avoid channel + * lookups at publish time, enabling very fast publish speeds and allowing + * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly + * with `new Channel(name)` is not supported. + * @since v15.1.0, v14.17.0 + */ + class Channel { + readonly name: string | symbol; + /** + * Check if there are active subscribers to this channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * if (channel.hasSubscribers) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + */ + readonly hasSubscribers: boolean; + private constructor(name: string | symbol); + /** + * Publish a message to any subscribers to the channel. This will + * trigger message handlers synchronously so they will execute within + * the same context. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.publish({ + * some: 'message' + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @param message The message to send to the channel subscribers + */ + publish(message: unknown): void; + /** + * Register a message handler to subscribe to this channel. This message handler + * will be run synchronously whenever a message is published to the channel. Any + * errors thrown in the message handler will trigger an `'uncaughtException'`. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.subscribe((message, name) => { + * // Received data + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @param onMessage The handler to receive channel messages + */ + subscribe(onMessage: ChannelListener): void; + /** + * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * function onMessage(message, name) { + * // Received data + * } + * + * channel.subscribe(onMessage); + * + * channel.unsubscribe(onMessage); + * ``` + * @since v15.1.0, v14.17.0 + * @param onMessage The previous subscribed handler to remove + * @return `true` if the handler was found, `false` otherwise. + */ + unsubscribe(onMessage: ChannelListener): void; + } +} +declare module 'node:diagnostics_channel' { + export * from 'diagnostics_channel'; +} diff --git a/server/node_modules/@types/node/dns.d.ts b/server/node_modules/@types/node/dns.d.ts new file mode 100755 index 0000000000..305367b81d --- /dev/null +++ b/server/node_modules/@types/node/dns.d.ts @@ -0,0 +1,659 @@ +/** + * The `dns` module enables name resolution. For example, use it to look up IP + * addresses of host names. + * + * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the + * DNS protocol for lookups. {@link lookup} uses the operating system + * facilities to perform name resolution. It may not need to perform any network + * communication. To perform name resolution the way other applications on the same + * system do, use {@link lookup}. + * + * ```js + * const dns = require('dns'); + * + * dns.lookup('example.org', (err, address, family) => { + * console.log('address: %j family: IPv%s', address, family); + * }); + * // address: "93.184.216.34" family: IPv4 + * ``` + * + * All other functions in the `dns` module connect to an actual DNS server to + * perform name resolution. They will always use the network to perform DNS + * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform + * DNS queries, bypassing other name-resolution facilities. + * + * ```js + * const dns = require('dns'); + * + * dns.resolve4('archive.org', (err, addresses) => { + * if (err) throw err; + * + * console.log(`addresses: ${JSON.stringify(addresses)}`); + * + * addresses.forEach((a) => { + * dns.reverse(a, (err, hostnames) => { + * if (err) { + * throw err; + * } + * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); + * }); + * }); + * }); + * ``` + * + * See the `Implementation considerations section` for more information. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dns.js) + */ +declare module 'dns' { + import * as dnsPromises from 'node:dns/promises'; + // Supported getaddrinfo flags. + export const ADDRCONFIG: number; + export const V4MAPPED: number; + /** + * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as + * well as IPv4 mapped IPv6 addresses. + */ + export const ALL: number; + export interface LookupOptions { + family?: number | undefined; + hints?: number | undefined; + all?: boolean | undefined; + /** + * @default true + */ + verbatim?: boolean | undefined; + } + export interface LookupOneOptions extends LookupOptions { + all?: false | undefined; + } + export interface LookupAllOptions extends LookupOptions { + all: true; + } + export interface LookupAddress { + address: string; + family: number; + } + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 + * and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the + * properties `address` and `family`. + * + * On error, `err` is an `Error` object, where `err.code` is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. + * The implementation uses an operating system facility that can associate names + * with addresses, and vice versa. This implementation can have subtle but + * important consequences on the behavior of any Node.js program. Please take some + * time to consult the `Implementation considerations section` before using`dns.lookup()`. + * + * Example usage: + * + * ```js + * const dns = require('dns'); + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * dns.lookup('example.com', options, (err, address, family) => + * console.log('address: %j family: IPv%s', address, family)); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dns.lookup('example.com', options, (err, addresses) => + * console.log('addresses: %j', addresses)); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * ``` + * + * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. + * @since v0.1.90 + */ + export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; + export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; + export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export namespace lookup { + function __promisify__(hostname: string, options: LookupAllOptions): Promise; + function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; + function __promisify__(hostname: string, options: LookupOptions): Promise; + } + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * + * On an error, `err` is an `Error` object, where `err.code` is the error code. + * + * ```js + * const dns = require('dns'); + * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { + * console.log(hostname, service); + * // Prints: localhost ssh + * }); + * ``` + * + * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. + * @since v0.11.14 + */ + export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; + export namespace lookupService { + function __promisify__( + address: string, + port: number + ): Promise<{ + hostname: string; + service: string; + }>; + } + export interface ResolveOptions { + ttl: boolean; + } + export interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + export interface RecordWithTtl { + address: string; + ttl: number; + } + /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ + export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; + export interface AnyARecord extends RecordWithTtl { + type: 'A'; + } + export interface AnyAaaaRecord extends RecordWithTtl { + type: 'AAAA'; + } + export interface CaaRecord { + critial: number; + issue?: string | undefined; + issuewild?: string | undefined; + iodef?: string | undefined; + contactemail?: string | undefined; + contactphone?: string | undefined; + } + export interface MxRecord { + priority: number; + exchange: string; + } + export interface AnyMxRecord extends MxRecord { + type: 'MX'; + } + export interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + export interface AnyNaptrRecord extends NaptrRecord { + type: 'NAPTR'; + } + export interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + export interface AnySoaRecord extends SoaRecord { + type: 'SOA'; + } + export interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + export interface AnySrvRecord extends SrvRecord { + type: 'SRV'; + } + export interface AnyTxtRecord { + type: 'TXT'; + entries: string[]; + } + export interface AnyNsRecord { + type: 'NS'; + value: string; + } + export interface AnyPtrRecord { + type: 'PTR'; + value: string; + } + export interface AnyCnameRecord { + type: 'CNAME'; + value: string; + } + export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource + * records. The type and structure of individual results varies based on `rrtype`: + * + * + * + * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. + * @since v0.1.27 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; + export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export function resolve( + hostname: string, + rrtype: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void + ): void; + export namespace resolve { + function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise; + function __promisify__(hostname: string, rrtype: 'ANY'): Promise; + function __promisify__(hostname: string, rrtype: 'MX'): Promise; + function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise; + function __promisify__(hostname: string, rrtype: 'SOA'): Promise; + function __promisify__(hostname: string, rrtype: 'SRV'): Promise; + function __promisify__(hostname: string, rrtype: 'TXT'): Promise; + function __promisify__(hostname: string, rrtype: string): Promise; + } + /** + * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + export namespace resolve4 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv6 addresses. + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + export namespace resolve6 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function + * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). + * @since v0.3.2 + */ + export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveCname { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function + * will contain an array of certification authority authorization records + * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; + export namespace resolveCaa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v0.1.27 + */ + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export namespace resolveMx { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of + * objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v0.9.12 + */ + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export namespace resolveNaptr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). + * @since v0.1.90 + */ + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveNs { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * be an array of strings containing the reply records. + * @since v6.0.0 + */ + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolvePtr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. The `address` argument passed to the `callback` function will + * be an object with the following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v0.11.10 + */ + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; + export namespace resolveSoa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * be an array of objects with the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v0.1.27 + */ + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export namespace resolveSrv { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a + * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v0.1.27 + */ + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export namespace resolveTxt { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * The `ret` argument passed to the `callback` function will be an array containing + * various types of records. Each object has a property `type` that indicates the + * type of the current record. And depending on the `type`, additional properties + * will be present on the object: + * + * + * + * Here is an example of the `ret` object passed to the callback: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * + * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC + * 8482](https://tools.ietf.org/html/rfc8482). + */ + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export namespace resolveAny { + function __promisify__(hostname: string): Promise; + } + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, `err` is an `Error` object, where `err.code` is + * one of the `DNS error codes`. + * @since v0.1.16 + */ + export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dns.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dns.setServers()` method must not be called while a DNS query is in + * progress. + * + * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v0.11.3 + * @param servers array of `RFC 5952` formatted addresses + */ + export function setServers(servers: ReadonlyArray): void; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v0.11.3 + */ + export function getServers(): string[]; + /** + * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: sets default `verbatim` `false`. + * * `verbatim`: sets default `verbatim` `true`. + * + * The default is `ipv4first` and {@link setDefaultResultOrder} have higher + * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default + * dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'` or `'verbatim'`. + */ + export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; + // Error codes + export const NODATA: string; + export const FORMERR: string; + export const SERVFAIL: string; + export const NOTFOUND: string; + export const NOTIMP: string; + export const REFUSED: string; + export const BADQUERY: string; + export const BADNAME: string; + export const BADFAMILY: string; + export const BADRESP: string; + export const CONNREFUSED: string; + export const TIMEOUT: string; + export const EOF: string; + export const FILE: string; + export const NOMEM: string; + export const DESTRUCTION: string; + export const BADSTR: string; + export const BADFLAGS: string; + export const NONAME: string; + export const BADHINTS: string; + export const NOTINITIALIZED: string; + export const LOADIPHLPAPI: string; + export const ADDRGETNETWORKPARAMS: string; + export const CANCELLED: string; + export interface ResolverOptions { + timeout?: number | undefined; + /** + * @default 4 + */ + tries?: number; + } + /** + * An independent resolver for DNS requests. + * + * Creating a new resolver uses the default server settings. Setting + * the servers used for a resolver using `resolver.setServers()` does not affect + * other resolvers: + * + * ```js + * const { Resolver } = require('dns'); + * const resolver = new Resolver(); + * resolver.setServers(['4.4.4.4']); + * + * // This request will use the server at 4.4.4.4, independent of global settings. + * resolver.resolve4('example.org', (err, addresses) => { + * // ... + * }); + * ``` + * + * The following methods from the `dns` module are available: + * + * * `resolver.getServers()` + * * `resolver.resolve()` + * * `resolver.resolve4()` + * * `resolver.resolve6()` + * * `resolver.resolveAny()` + * * `resolver.resolveCaa()` + * * `resolver.resolveCname()` + * * `resolver.resolveMx()` + * * `resolver.resolveNaptr()` + * * `resolver.resolveNs()` + * * `resolver.resolvePtr()` + * * `resolver.resolveSoa()` + * * `resolver.resolveSrv()` + * * `resolver.resolveTxt()` + * * `resolver.reverse()` + * * `resolver.setServers()` + * @since v8.3.0 + */ + export class Resolver { + constructor(options?: ResolverOptions); + /** + * Cancel all outstanding DNS queries made by this resolver. The corresponding + * callbacks will be called with an error with code `ECANCELLED`. + * @since v8.3.0 + */ + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + /** + * The resolver instance will send its requests from the specified IP address. + * This allows programs to specify outbound interfaces when used on multi-homed + * systems. + * + * If a v4 or v6 address is not specified, it is set to the default, and the + * operating system will choose a local address automatically. + * + * The resolver will use the v4 local address when making requests to IPv4 DNS + * servers, and the v6 local address when making requests to IPv6 DNS servers. + * The `rrtype` of resolution requests has no impact on the local address used. + * @since v15.1.0, v14.17.0 + * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. + * @param [ipv6='::0'] A string representation of an IPv6 address. + */ + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } + export { dnsPromises as promises }; +} +declare module 'node:dns' { + export * from 'dns'; +} diff --git a/server/node_modules/@types/node/dns/promises.d.ts b/server/node_modules/@types/node/dns/promises.d.ts new file mode 100755 index 0000000000..77cd807bd5 --- /dev/null +++ b/server/node_modules/@types/node/dns/promises.d.ts @@ -0,0 +1,370 @@ +/** + * The `dns.promises` API provides an alternative set of asynchronous DNS methods + * that return `Promise` objects rather than using callbacks. The API is accessible + * via `require('dns').promises` or `require('dns/promises')`. + * @since v10.6.0 + */ +declare module 'dns/promises' { + import { + LookupAddress, + LookupOneOptions, + LookupAllOptions, + LookupOptions, + AnyRecord, + CaaRecord, + MxRecord, + NaptrRecord, + SoaRecord, + SrvRecord, + ResolveWithTtlOptions, + RecordWithTtl, + ResolveOptions, + ResolverOptions, + } from 'node:dns'; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v10.6.0 + */ + function getServers(): string[]; + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 + * and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS + * protocol. The implementation uses an operating system facility that can + * associate names with addresses, and vice versa. This implementation can have + * subtle but important consequences on the behavior of any Node.js program. Please + * take some time to consult the `Implementation considerations section` before + * using `dnsPromises.lookup()`. + * + * Example usage: + * + * ```js + * const dns = require('dns'); + * const dnsPromises = dns.promises; + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('address: %j family: IPv%s', result.address, result.family); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * }); + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('addresses: %j', result); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * }); + * ``` + * @since v10.6.0 + */ + function lookup(hostname: string, family: number): Promise; + function lookup(hostname: string, options: LookupOneOptions): Promise; + function lookup(hostname: string, options: LookupAllOptions): Promise; + function lookup(hostname: string, options: LookupOptions): Promise; + function lookup(hostname: string): Promise; + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * + * ```js + * const dnsPromises = require('dns').promises; + * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { + * console.log(result.hostname, result.service); + * // Prints: localhost ssh + * }); + * ``` + * @since v10.6.0 + */ + function lookupService( + address: string, + port: number + ): Promise<{ + hostname: string; + service: string; + }>; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. When successful, the `Promise` is resolved with an + * array of resource records. The type and structure of individual results vary + * based on `rrtype`: + * + * + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * @since v10.6.0 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + function resolve(hostname: string): Promise; + function resolve(hostname: string, rrtype: 'A'): Promise; + function resolve(hostname: string, rrtype: 'AAAA'): Promise; + function resolve(hostname: string, rrtype: 'ANY'): Promise; + function resolve(hostname: string, rrtype: 'CAA'): Promise; + function resolve(hostname: string, rrtype: 'CNAME'): Promise; + function resolve(hostname: string, rrtype: 'MX'): Promise; + function resolve(hostname: string, rrtype: 'NAPTR'): Promise; + function resolve(hostname: string, rrtype: 'NS'): Promise; + function resolve(hostname: string, rrtype: 'PTR'): Promise; + function resolve(hostname: string, rrtype: 'SOA'): Promise; + function resolve(hostname: string, rrtype: 'SRV'): Promise; + function resolve(hostname: string, rrtype: 'TXT'): Promise; + function resolve(hostname: string, rrtype: string): Promise; + /** + * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 + * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve4(hostname: string): Promise; + function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve4(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 + * addresses. + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve6(hostname: string): Promise; + function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve6(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * On success, the `Promise` is resolved with an array containing various types of + * records. Each object has a property `type` that indicates the type of the + * current record. And depending on the `type`, additional properties will be + * present on the object: + * + * + * + * Here is an example of the result object: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * @since v10.6.0 + */ + function resolveAny(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, + * the `Promise` is resolved with an array of objects containing available + * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + function resolveCaa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, + * the `Promise` is resolved with an array of canonical name records available for + * the `hostname` (e.g. `['bar.example.com']`). + * @since v10.6.0 + */ + function resolveCname(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects + * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v10.6.0 + */ + function resolveMx(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array + * of objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v10.6.0 + */ + function resolveNaptr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server + * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). + * @since v10.6.0 + */ + function resolveNs(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings + * containing the reply records. + * @since v10.6.0 + */ + function resolvePtr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. On success, the `Promise` is resolved with an object with the + * following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v10.6.0 + */ + function resolveSoa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with + * the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v10.6.0 + */ + function resolveSrv(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array + * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v10.6.0 + */ + function resolveTxt(hostname: string): Promise; + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * @since v10.6.0 + */ + function reverse(ip: string): Promise; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dnsPromises.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dnsPromises.setServers()` method must not be called while a DNS query is in + * progress. + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v10.6.0 + * @param servers array of `RFC 5952` formatted addresses + */ + function setServers(servers: ReadonlyArray): void; + /** + * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: sets default `verbatim` `false`. + * * `verbatim`: sets default `verbatim` `true`. + * + * The default is `ipv4first` and `dnsPromises.setDefaultResultOrder()` have + * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the + * default dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'` or `'verbatim'`. + */ + function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; + class Resolver { + constructor(options?: ResolverOptions); + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } +} +declare module 'node:dns/promises' { + export * from 'dns/promises'; +} diff --git a/server/node_modules/@types/node/dom-events.d.ts b/server/node_modules/@types/node/dom-events.d.ts new file mode 100755 index 0000000000..b9c1c3aa4f --- /dev/null +++ b/server/node_modules/@types/node/dom-events.d.ts @@ -0,0 +1,126 @@ +export {}; // Don't export anything! + +//// DOM-like Events +// NB: The Event / EventTarget / EventListener implementations below were copied +// from lib.dom.d.ts, then edited to reflect Node's documentation at +// https://nodejs.org/api/events.html#class-eventtarget. +// Please read that link to understand important implementation differences. + +// This conditional type will be the existing global Event in a browser, or +// the copy below in a Node environment. +type __Event = typeof globalThis extends { onmessage: any, Event: any } +? {} +: { + /** This is not used in Node.js and is provided purely for completeness. */ + readonly bubbles: boolean; + /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ + cancelBubble: () => void; + /** True if the event was created with the cancelable option */ + readonly cancelable: boolean; + /** This is not used in Node.js and is provided purely for completeness. */ + readonly composed: boolean; + /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ + composedPath(): [EventTarget?] + /** Alias for event.target. */ + readonly currentTarget: EventTarget | null; + /** Is true if cancelable is true and event.preventDefault() has been called. */ + readonly defaultPrevented: boolean; + /** This is not used in Node.js and is provided purely for completeness. */ + readonly eventPhase: 0 | 2; + /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ + readonly isTrusted: boolean; + /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ + preventDefault(): void; + /** This is not used in Node.js and is provided purely for completeness. */ + returnValue: boolean; + /** Alias for event.target. */ + readonly srcElement: EventTarget | null; + /** Stops the invocation of event listeners after the current one completes. */ + stopImmediatePropagation(): void; + /** This is not used in Node.js and is provided purely for completeness. */ + stopPropagation(): void; + /** The `EventTarget` dispatching the event */ + readonly target: EventTarget | null; + /** The millisecond timestamp when the Event object was created. */ + readonly timeStamp: number; + /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ + readonly type: string; +}; + +// See comment above explaining conditional type +type __EventTarget = typeof globalThis extends { onmessage: any, EventTarget: any } +? {} +: { + /** + * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. + * + * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. + * + * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. + * Specifically, the `capture` option is used as part of the key when registering a `listener`. + * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. + */ + addEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: AddEventListenerOptions | boolean, + ): void; + /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ + dispatchEvent(event: Event): boolean; + /** Removes the event listener in target's event listener list with the same type, callback, and options. */ + removeEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: EventListenerOptions | boolean, + ): void; +}; + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; + composed?: boolean; +} + +interface EventListenerOptions { + /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ + capture?: boolean; +} + +interface AddEventListenerOptions extends EventListenerOptions { + /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ + once?: boolean; + /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ + passive?: boolean; +} + +interface EventListener { + (evt: Event): void; +} + +interface EventListenerObject { + handleEvent(object: Event): void; +} + +import {} from 'events'; // Make this an ambient declaration +declare global { + /** An event which takes place in the DOM. */ + interface Event extends __Event {} + var Event: typeof globalThis extends { onmessage: any, Event: infer T } + ? T + : { + prototype: __Event; + new (type: string, eventInitDict?: EventInit): __Event; + }; + + /** + * EventTarget is a DOM interface implemented by objects that can + * receive events and may have listeners for them. + */ + interface EventTarget extends __EventTarget {} + var EventTarget: typeof globalThis extends { onmessage: any, EventTarget: infer T } + ? T + : { + prototype: __EventTarget; + new (): __EventTarget; + }; +} diff --git a/server/node_modules/@types/node/domain.d.ts b/server/node_modules/@types/node/domain.d.ts new file mode 100755 index 0000000000..fafe68a5d3 --- /dev/null +++ b/server/node_modules/@types/node/domain.d.ts @@ -0,0 +1,170 @@ +/** + * **This module is pending deprecation.** Once a replacement API has been + * finalized, this module will be fully deprecated. Most developers should + * **not** have cause to use this module. Users who absolutely must have + * the functionality that domains provide may rely on it for the time being + * but should expect to have to migrate to a different solution + * in the future. + * + * Domains provide a way to handle multiple different IO operations as a + * single group. If any of the event emitters or callbacks registered to a + * domain emit an `'error'` event, or throw an error, then the domain object + * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to + * exit immediately with an error code. + * @deprecated Since v1.4.2 - Deprecated + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/domain.js) + */ +declare module 'domain' { + import EventEmitter = require('node:events'); + /** + * The `Domain` class encapsulates the functionality of routing errors and + * uncaught exceptions to the active `Domain` object. + * + * To handle the errors that it catches, listen to its `'error'` event. + */ + class Domain extends EventEmitter { + /** + * An array of timers and event emitters that have been explicitly added + * to the domain. + */ + members: Array; + /** + * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly + * pushes the domain onto the domain + * stack managed by the domain module (see {@link exit} for details on the + * domain stack). The call to `enter()` delimits the beginning of a chain of + * asynchronous calls and I/O operations bound to a domain. + * + * Calling `enter()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + enter(): void; + /** + * The `exit()` method exits the current domain, popping it off the domain stack. + * Any time execution is going to switch to the context of a different chain of + * asynchronous calls, it's important to ensure that the current domain is exited. + * The call to `exit()` delimits either the end of or an interruption to the chain + * of asynchronous calls and I/O operations bound to a domain. + * + * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. + * + * Calling `exit()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + exit(): void; + /** + * Run the supplied function in the context of the domain, implicitly + * binding all event emitters, timers, and lowlevel requests that are + * created in that context. Optionally, arguments can be passed to + * the function. + * + * This is the most basic way to use a domain. + * + * ```js + * const domain = require('domain'); + * const fs = require('fs'); + * const d = domain.create(); + * d.on('error', (er) => { + * console.error('Caught error!', er); + * }); + * d.run(() => { + * process.nextTick(() => { + * setTimeout(() => { // Simulating some various async stuff + * fs.open('non-existent file', 'r', (er, fd) => { + * if (er) throw er; + * // proceed... + * }); + * }, 100); + * }); + * }); + * ``` + * + * In this example, the `d.on('error')` handler will be triggered, rather + * than crashing the program. + */ + run(fn: (...args: any[]) => T, ...args: any[]): T; + /** + * Explicitly adds an emitter to the domain. If any event handlers called by + * the emitter throw an error, or if the emitter emits an `'error'` event, it + * will be routed to the domain's `'error'` event, just like with implicit + * binding. + * + * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by + * the domain `'error'` handler. + * + * If the Timer or `EventEmitter` was already bound to a domain, it is removed + * from that one, and bound to this one instead. + * @param emitter emitter or timer to be added to the domain + */ + add(emitter: EventEmitter | NodeJS.Timer): void; + /** + * The opposite of {@link add}. Removes domain handling from the + * specified emitter. + * @param emitter emitter or timer to be removed from the domain + */ + remove(emitter: EventEmitter | NodeJS.Timer): void; + /** + * The returned function will be a wrapper around the supplied callback + * function. When the returned function is called, any errors that are + * thrown will be routed to the domain's `'error'` event. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.bind((er, data) => { + * // If this throws, it will also be passed to the domain. + * return cb(er, data ? JSON.parse(data) : null); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The bound function + */ + bind(callback: T): T; + /** + * This method is almost identical to {@link bind}. However, in + * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. + * + * In this way, the common `if (err) return callback(err);` pattern can be replaced + * with a single error handler in a single place. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.intercept((data) => { + * // Note, the first argument is never passed to the + * // callback since it is assumed to be the 'Error' argument + * // and thus intercepted by the domain. + * + * // If this throws, it will also be passed to the domain + * // so the error-handling logic can be moved to the 'error' + * // event on the domain instead of being repeated throughout + * // the program. + * return cb(null, JSON.parse(data)); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The intercepted function + */ + intercept(callback: T): T; + } + function create(): Domain; +} +declare module 'node:domain' { + export * from 'domain'; +} diff --git a/server/node_modules/@types/node/events.d.ts b/server/node_modules/@types/node/events.d.ts new file mode 100755 index 0000000000..4633df19c8 --- /dev/null +++ b/server/node_modules/@types/node/events.d.ts @@ -0,0 +1,678 @@ +/** + * Much of the Node.js core API is built around an idiomatic asynchronous + * event-driven architecture in which certain kinds of objects (called "emitters") + * emit named events that cause `Function` objects ("listeners") to be called. + * + * For instance: a `net.Server` object emits an event each time a peer + * connects to it; a `fs.ReadStream` emits an event when the file is opened; + * a `stream` emits an event whenever data is available to be read. + * + * All objects that emit events are instances of the `EventEmitter` class. These + * objects expose an `eventEmitter.on()` function that allows one or more + * functions to be attached to named events emitted by the object. Typically, + * event names are camel-cased strings but any valid JavaScript property key + * can be used. + * + * When the `EventEmitter` object emits an event, all of the functions attached + * to that specific event are called _synchronously_. Any values returned by the + * called listeners are _ignored_ and discarded. + * + * The following example shows a simple `EventEmitter` instance with a single + * listener. The `eventEmitter.on()` method is used to register listeners, while + * the `eventEmitter.emit()` method is used to trigger the event. + * + * ```js + * const EventEmitter = require('events'); + * + * class MyEmitter extends EventEmitter {} + * + * const myEmitter = new MyEmitter(); + * myEmitter.on('event', () => { + * console.log('an event occurred!'); + * }); + * myEmitter.emit('event'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js) + */ +declare module 'events' { + // NOTE: This class is in the docs but is **not actually exported** by Node. + // If https://github.com/nodejs/node/issues/39903 gets resolved and Node + // actually starts exporting the class, uncomment below. + + // import { EventListener, EventListenerObject } from '__dom-events'; + // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ + // interface NodeEventTarget extends EventTarget { + // /** + // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. + // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. + // */ + // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; + // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ + // eventNames(): string[]; + // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ + // listenerCount(type: string): number; + // /** Node.js-specific alias for `eventTarget.removeListener()`. */ + // off(type: string, listener: EventListener | EventListenerObject): this; + // /** Node.js-specific alias for `eventTarget.addListener()`. */ + // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; + // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ + // once(type: string, listener: EventListener | EventListenerObject): this; + // /** + // * Node.js-specific extension to the `EventTarget` class. + // * If `type` is specified, removes all registered listeners for `type`, + // * otherwise removes all registered listeners. + // */ + // removeAllListeners(type: string): this; + // /** + // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. + // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. + // */ + // removeListener(type: string, listener: EventListener | EventListenerObject): this; + // } + + interface EventEmitterOptions { + /** + * Enables automatic capturing of promise rejection. + */ + captureRejections?: boolean | undefined; + } + // Any EventTarget with a Node-style `once` function + interface _NodeEventTarget { + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + } + // Any EventTarget with a DOM-style `addEventListener` + interface _DOMEventTarget { + addEventListener( + eventName: string, + listener: (...args: any[]) => void, + opts?: { + once: boolean; + } + ): any; + } + interface StaticEventEmitterOptions { + signal?: AbortSignal | undefined; + } + interface EventEmitter extends NodeJS.EventEmitter {} + /** + * The `EventEmitter` class is defined and exposed by the `events` module: + * + * ```js + * const EventEmitter = require('events'); + * ``` + * + * All `EventEmitter`s emit the event `'newListener'` when new listeners are + * added and `'removeListener'` when existing listeners are removed. + * + * It supports the following option: + * @since v0.1.26 + */ + class EventEmitter { + constructor(options?: EventEmitterOptions); + /** + * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given + * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. + * The `Promise` will resolve with an array of all the arguments emitted to the + * given event. + * + * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event + * semantics and does not listen to the `'error'` event. + * + * ```js + * const { once, EventEmitter } = require('events'); + * + * async function run() { + * const ee = new EventEmitter(); + * + * process.nextTick(() => { + * ee.emit('myevent', 42); + * }); + * + * const [value] = await once(ee, 'myevent'); + * console.log(value); + * + * const err = new Error('kaboom'); + * process.nextTick(() => { + * ee.emit('error', err); + * }); + * + * try { + * await once(ee, 'myevent'); + * } catch (err) { + * console.log('error happened', err); + * } + * } + * + * run(); + * ``` + * + * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the + * '`error'` event itself, then it is treated as any other kind of event without + * special handling: + * + * ```js + * const { EventEmitter, once } = require('events'); + * + * const ee = new EventEmitter(); + * + * once(ee, 'error') + * .then(([err]) => console.log('ok', err.message)) + * .catch((err) => console.log('error', err.message)); + * + * ee.emit('error', new Error('boom')); + * + * // Prints: ok boom + * ``` + * + * An `AbortSignal` can be used to cancel waiting for the event: + * + * ```js + * const { EventEmitter, once } = require('events'); + * + * const ee = new EventEmitter(); + * const ac = new AbortController(); + * + * async function foo(emitter, event, signal) { + * try { + * await once(emitter, event, { signal }); + * console.log('event emitted!'); + * } catch (error) { + * if (error.name === 'AbortError') { + * console.error('Waiting for the event was canceled!'); + * } else { + * console.error('There was an error', error.message); + * } + * } + * } + * + * foo(ee, 'foo', ac.signal); + * ac.abort(); // Abort waiting for the event + * ee.emit('foo'); // Prints: Waiting for the event was canceled! + * ``` + * @since v11.13.0, v10.16.0 + */ + static once(emitter: _NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise; + static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; + /** + * ```js + * const { on, EventEmitter } = require('events'); + * + * (async () => { + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo')) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * })(); + * ``` + * + * Returns an `AsyncIterator` that iterates `eventName` events. It will throw + * if the `EventEmitter` emits `'error'`. It removes all listeners when + * exiting the loop. The `value` returned by each iteration is an array + * composed of the emitted event arguments. + * + * An `AbortSignal` can be used to cancel waiting on events: + * + * ```js + * const { on, EventEmitter } = require('events'); + * const ac = new AbortController(); + * + * (async () => { + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo', { signal: ac.signal })) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * })(); + * + * process.nextTick(() => ac.abort()); + * ``` + * @since v13.6.0, v12.16.0 + * @param eventName The name of the event being listened for + * @return that iterates `eventName` events emitted by the `emitter` + */ + static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator; + /** + * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. + * + * ```js + * const { EventEmitter, listenerCount } = require('events'); + * const myEmitter = new EventEmitter(); + * myEmitter.on('event', () => {}); + * myEmitter.on('event', () => {}); + * console.log(listenerCount(myEmitter, 'event')); + * // Prints: 2 + * ``` + * @since v0.9.12 + * @deprecated Since v3.2.0 - Use `listenerCount` instead. + * @param emitter The emitter to query + * @param eventName The event name + */ + static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the event listeners for the + * event target. This is useful for debugging and diagnostic purposes. + * + * ```js + * const { getEventListeners, EventEmitter } = require('events'); + * + * { + * const ee = new EventEmitter(); + * const listener = () => console.log('Events are fun'); + * ee.on('foo', listener); + * getEventListeners(ee, 'foo'); // [listener] + * } + * { + * const et = new EventTarget(); + * const listener = () => console.log('Events are fun'); + * et.addEventListener('foo', listener); + * getEventListeners(et, 'foo'); // [listener] + * } + * ``` + * @since v15.2.0, v14.17.0 + */ + static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; + /** + * ```js + * const { + * setMaxListeners, + * EventEmitter + * } = require('events'); + * + * const target = new EventTarget(); + * const emitter = new EventEmitter(); + * + * setMaxListeners(5, target, emitter); + * ``` + * @since v15.4.0 + * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. + * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} + * objects. + */ + static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; + /** + * This symbol shall be used to install a listener for only monitoring `'error'` + * events. Listeners installed using this symbol are called before the regular + * `'error'` listeners are called. + * + * Installing a listener using this symbol does not change the behavior once an + * `'error'` event is emitted, therefore the process will still crash if no + * regular `'error'` listener is installed. + */ + static readonly errorMonitor: unique symbol; + static readonly captureRejectionSymbol: unique symbol; + /** + * Sets or gets the default captureRejection value for all emitters. + */ + // TODO: These should be described using static getter/setter pairs: + static captureRejections: boolean; + static defaultMaxListeners: number; + } + import internal = require('node:events'); + namespace EventEmitter { + // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 + export { internal as EventEmitter }; + export interface Abortable { + /** + * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. + */ + signal?: AbortSignal | undefined; + } + } + global { + namespace NodeJS { + interface EventEmitter { + /** + * Alias for `emitter.on(eventName, listener)`. + * @since v0.1.26 + */ + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds the `listener` function to the end of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * const myEE = new EventEmitter(); + * myEE.on('foo', () => console.log('a')); + * myEE.prependListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.1.101 + * @param eventName The name of the event. + * @param listener The callback function + */ + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds a **one-time**`listener` function for the event named `eventName`. The + * next time `eventName` is triggered, this listener is removed and then invoked. + * + * ```js + * server.once('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * const myEE = new EventEmitter(); + * myEE.once('foo', () => console.log('a')); + * myEE.prependOnceListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.3.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Removes the specified `listener` from the listener array for the event named`eventName`. + * + * ```js + * const callback = (stream) => { + * console.log('someone connected!'); + * }; + * server.on('connection', callback); + * // ... + * server.removeListener('connection', callback); + * ``` + * + * `removeListener()` will remove, at most, one instance of a listener from the + * listener array. If any single listener has been added multiple times to the + * listener array for the specified `eventName`, then `removeListener()` must be + * called multiple times to remove each instance. + * + * Once an event is emitted, all listeners attached to it at the + * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution + * will not remove them from`emit()` in progress. Subsequent events behave as expected. + * + * ```js + * const myEmitter = new MyEmitter(); + * + * const callbackA = () => { + * console.log('A'); + * myEmitter.removeListener('event', callbackB); + * }; + * + * const callbackB = () => { + * console.log('B'); + * }; + * + * myEmitter.on('event', callbackA); + * + * myEmitter.on('event', callbackB); + * + * // callbackA removes listener callbackB but it will still be called. + * // Internal listener array at time of emit [callbackA, callbackB] + * myEmitter.emit('event'); + * // Prints: + * // A + * // B + * + * // callbackB is now removed. + * // Internal listener array [callbackA] + * myEmitter.emit('event'); + * // Prints: + * // A + * ``` + * + * Because listeners are managed using an internal array, calling this will + * change the position indices of any listener registered _after_ the listener + * being removed. This will not impact the order in which listeners are called, + * but it means that any copies of the listener array as returned by + * the `emitter.listeners()` method will need to be recreated. + * + * When a single function has been added as a handler multiple times for a single + * event (as in the example below), `removeListener()` will remove the most + * recently added instance. In the example the `once('ping')`listener is removed: + * + * ```js + * const ee = new EventEmitter(); + * + * function pong() { + * console.log('pong'); + * } + * + * ee.on('ping', pong); + * ee.once('ping', pong); + * ee.removeListener('ping', pong); + * + * ee.emit('ping'); + * ee.emit('ping'); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Alias for `emitter.removeListener()`. + * @since v10.0.0 + */ + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Removes all listeners, or those of the specified `eventName`. + * + * It is bad practice to remove listeners added elsewhere in the code, + * particularly when the `EventEmitter` instance was created by some other + * component or module (e.g. sockets or file streams). + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + removeAllListeners(event?: string | symbol): this; + /** + * By default `EventEmitter`s will print a warning if more than `10` listeners are + * added for a particular event. This is a useful default that helps finding + * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be + * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.3.5 + */ + setMaxListeners(n: number): this; + /** + * Returns the current max listener value for the `EventEmitter` which is either + * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. + * @since v1.0.0 + */ + getMaxListeners(): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * console.log(util.inspect(server.listeners('connection'))); + * // Prints: [ [Function] ] + * ``` + * @since v0.1.26 + */ + listeners(eventName: string | symbol): Function[]; + /** + * Returns a copy of the array of listeners for the event named `eventName`, + * including any wrappers (such as those created by `.once()`). + * + * ```js + * const emitter = new EventEmitter(); + * emitter.once('log', () => console.log('log once')); + * + * // Returns a new Array with a function `onceWrapper` which has a property + * // `listener` which contains the original listener bound above + * const listeners = emitter.rawListeners('log'); + * const logFnWrapper = listeners[0]; + * + * // Logs "log once" to the console and does not unbind the `once` event + * logFnWrapper.listener(); + * + * // Logs "log once" to the console and removes the listener + * logFnWrapper(); + * + * emitter.on('log', () => console.log('log persistently')); + * // Will return a new Array with a single function bound by `.on()` above + * const newListeners = emitter.rawListeners('log'); + * + * // Logs "log persistently" twice + * newListeners[0](); + * emitter.emit('log'); + * ``` + * @since v9.4.0 + */ + rawListeners(eventName: string | symbol): Function[]; + /** + * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments + * to each. + * + * Returns `true` if the event had listeners, `false` otherwise. + * + * ```js + * const EventEmitter = require('events'); + * const myEmitter = new EventEmitter(); + * + * // First listener + * myEmitter.on('event', function firstListener() { + * console.log('Helloooo! first listener'); + * }); + * // Second listener + * myEmitter.on('event', function secondListener(arg1, arg2) { + * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); + * }); + * // Third listener + * myEmitter.on('event', function thirdListener(...args) { + * const parameters = args.join(', '); + * console.log(`event with parameters ${parameters} in third listener`); + * }); + * + * console.log(myEmitter.listeners('event')); + * + * myEmitter.emit('event', 1, 2, 3, 4, 5); + * + * // Prints: + * // [ + * // [Function: firstListener], + * // [Function: secondListener], + * // [Function: thirdListener] + * // ] + * // Helloooo! first listener + * // event with parameters 1, 2 in second listener + * // event with parameters 1, 2, 3, 4, 5 in third listener + * ``` + * @since v0.1.26 + */ + emit(eventName: string | symbol, ...args: any[]): boolean; + /** + * Returns the number of listeners listening to the event named `eventName`. + * @since v3.2.0 + * @param eventName The name of the event being listened for + */ + listenerCount(eventName: string | symbol): number; + /** + * Adds the `listener` function to the _beginning_ of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.prependListener('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this + * listener is removed, and then invoked. + * + * ```js + * server.prependOnceListener('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Returns an array listing the events for which the emitter has registered + * listeners. The values in the array are strings or `Symbol`s. + * + * ```js + * const EventEmitter = require('events'); + * const myEE = new EventEmitter(); + * myEE.on('foo', () => {}); + * myEE.on('bar', () => {}); + * + * const sym = Symbol('symbol'); + * myEE.on(sym, () => {}); + * + * console.log(myEE.eventNames()); + * // Prints: [ 'foo', 'bar', Symbol(symbol) ] + * ``` + * @since v6.0.0 + */ + eventNames(): Array; + } + } + } + export = EventEmitter; +} +declare module 'node:events' { + import events = require('events'); + export = events; +} diff --git a/server/node_modules/@types/node/fs.d.ts b/server/node_modules/@types/node/fs.d.ts new file mode 100755 index 0000000000..75c53fb0d5 --- /dev/null +++ b/server/node_modules/@types/node/fs.d.ts @@ -0,0 +1,3872 @@ +/** + * The `fs` module enables interacting with the file system in a + * way modeled on standard POSIX functions. + * + * To use the promise-based APIs: + * + * ```js + * import * as fs from 'fs/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as fs from 'fs'; + * ``` + * + * All file system operations have synchronous, callback, and promise-based + * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/fs.js) + */ +declare module 'fs' { + import * as stream from 'node:stream'; + import { Abortable, EventEmitter } from 'node:events'; + import { URL } from 'node:url'; + import * as promises from 'node:fs/promises'; + export { promises }; + /** + * Valid types for path values in "fs". + */ + export type PathLike = string | Buffer | URL; + export type PathOrFileDescriptor = PathLike | number; + export type TimeLike = string | number | Date; + export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; + export type BufferEncodingOption = + | 'buffer' + | { + encoding: 'buffer'; + }; + export interface ObjectEncodingOptions { + encoding?: BufferEncoding | null | undefined; + } + export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; + export type OpenMode = number | string; + export type Mode = number | string; + export interface StatsBase { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: T; + ino: T; + mode: T; + nlink: T; + uid: T; + gid: T; + rdev: T; + size: T; + blksize: T; + blocks: T; + atimeMs: T; + mtimeMs: T; + ctimeMs: T; + birthtimeMs: T; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + export interface Stats extends StatsBase {} + /** + * A `fs.Stats` object provides information about a file. + * + * Objects returned from {@link stat}, {@link lstat} and {@link fstat} and + * their synchronous counterparts are of this type. + * If `bigint` in the `options` passed to those methods is true, the numeric values + * will be `bigint` instead of `number`, and the object will contain additional + * nanosecond-precision properties suffixed with `Ns`. + * + * ```console + * Stats { + * dev: 2114, + * ino: 48064969, + * mode: 33188, + * nlink: 1, + * uid: 85, + * gid: 100, + * rdev: 0, + * size: 527, + * blksize: 4096, + * blocks: 8, + * atimeMs: 1318289051000.1, + * mtimeMs: 1318289051000.1, + * ctimeMs: 1318289051000.1, + * birthtimeMs: 1318289051000.1, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * + * `bigint` version: + * + * ```console + * BigIntStats { + * dev: 2114n, + * ino: 48064969n, + * mode: 33188n, + * nlink: 1n, + * uid: 85n, + * gid: 100n, + * rdev: 0n, + * size: 527n, + * blksize: 4096n, + * blocks: 8n, + * atimeMs: 1318289051000n, + * mtimeMs: 1318289051000n, + * ctimeMs: 1318289051000n, + * birthtimeMs: 1318289051000n, + * atimeNs: 1318289051000000000n, + * mtimeNs: 1318289051000000000n, + * ctimeNs: 1318289051000000000n, + * birthtimeNs: 1318289051000000000n, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * @since v0.1.21 + */ + export class Stats {} + /** + * A representation of a directory entry, which can be a file or a subdirectory + * within the directory, as returned by reading from an `fs.Dir`. The + * directory entry is a combination of the file name and file type pairs. + * + * Additionally, when {@link readdir} or {@link readdirSync} is called with + * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. + * @since v10.10.0 + */ + export class Dirent { + /** + * Returns `true` if the `fs.Dirent` object describes a regular file. + * @since v10.10.0 + */ + isFile(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a file system + * directory. + * @since v10.10.0 + */ + isDirectory(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a block device. + * @since v10.10.0 + */ + isBlockDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a character device. + * @since v10.10.0 + */ + isCharacterDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a symbolic link. + * @since v10.10.0 + */ + isSymbolicLink(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a first-in-first-out + * (FIFO) pipe. + * @since v10.10.0 + */ + isFIFO(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a socket. + * @since v10.10.0 + */ + isSocket(): boolean; + /** + * The file name that this `fs.Dirent` object refers to. The type of this + * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. + * @since v10.10.0 + */ + name: string; + } + /** + * A class representing a directory stream. + * + * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. + * + * ```js + * import { opendir } from 'fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + */ + export class Dir implements AsyncIterable { + /** + * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. + * @since v12.12.0 + */ + readonly path: string; + /** + * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. + */ + [Symbol.asyncIterator](): AsyncIterableIterator; + /** + * Asynchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * + * A promise is returned that will be resolved after the resource has been + * closed. + * @since v12.12.0 + */ + close(): Promise; + close(cb: NoParamCallback): void; + /** + * Synchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * @since v12.12.0 + */ + closeSync(): void; + /** + * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. + * + * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + * @return containing {fs.Dirent|null} + */ + read(): Promise; + read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; + /** + * Synchronously read the next directory entry as an `fs.Dirent`. See the + * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. + * + * If there are no more directory entries to read, `null` will be returned. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + */ + readSync(): Dirent | null; + } + /** + * Class: fs.StatWatcher + * @since v14.3.0, v12.20.0 + * Extends `EventEmitter` + * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. + */ + export interface StatWatcher extends EventEmitter { + /** + * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have + * no effect. + * + * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally + * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been + * called previously. + * @since v14.3.0, v12.20.0 + */ + ref(): this; + /** + * When called, the active `fs.StatWatcher` object will not require the Node.js + * event loop to remain active. If there is no other activity keeping the + * event loop running, the process may exit before the `fs.StatWatcher` object's + * callback is invoked. Calling `watcher.unref()` multiple times will have + * no effect. + * @since v14.3.0, v12.20.0 + */ + unref(): this; + } + export interface FSWatcher extends EventEmitter { + /** + * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. + * @since v0.5.8 + */ + close(): void; + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'close', listener: () => void): this; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'close', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'close', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + } + /** + * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. + * @since v0.1.93 + */ + export class ReadStream extends stream.Readable { + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes that have been read so far. + * @since v6.4.0 + */ + bytesRead: number; + /** + * The path to the file the stream is reading from as specified in the first + * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a + * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0, v10.16.0 + */ + pending: boolean; + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'open', listener: (fd: number) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'open', listener: (fd: number) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'open', listener: (fd: number) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'open', listener: (fd: number) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'open', listener: (fd: number) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * * Extends `stream.Writable` + * + * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. + * @since v0.1.93 + */ + export class WriteStream extends stream.Writable { + /** + * Closes `writeStream`. Optionally accepts a + * callback that will be executed once the `writeStream`is closed. + * @since v0.9.4 + */ + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes written so far. Does not include data that is still queued + * for writing. + * @since v0.4.7 + */ + bytesWritten: number; + /** + * The path to the file the stream is writing to as specified in the first + * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a + * `Buffer`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0 + */ + pending: boolean; + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'open', listener: (fd: number) => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'open', listener: (fd: number) => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'open', listener: (fd: number) => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'open', listener: (fd: number) => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'open', listener: (fd: number) => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * Asynchronously rename file at `oldPath` to the pathname provided + * as `newPath`. In the case that `newPath` already exists, it will + * be overwritten. If there is a directory at `newPath`, an error will + * be raised instead. No arguments other than a possible exception are + * given to the completion callback. + * + * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). + * + * ```js + * import { rename } from 'fs'; + * + * rename('oldFile.txt', 'newFile.txt', (err) => { + * if (err) throw err; + * console.log('Rename complete!'); + * }); + * ``` + * @since v0.0.2 + */ + export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + export namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + /** + * Renames the file from `oldPath` to `newPath`. Returns `undefined`. + * + * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. + * @since v0.1.21 + */ + export function renameSync(oldPath: PathLike, newPath: PathLike): void; + /** + * Truncates the file. No arguments other than a possible exception are + * given to the completion callback. A file descriptor can also be passed as the + * first argument. In this case, `fs.ftruncate()` is called. + * + * ```js + * import { truncate } from 'fs'; + * // Assuming that 'path/file.txt' is a regular file. + * truncate('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was truncated'); + * }); + * ``` + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * + * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. + * @since v0.8.6 + * @param [len=0] + */ + export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function truncate(path: PathLike, callback: NoParamCallback): void; + export namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(path: PathLike, len?: number | null): Promise; + } + /** + * Truncates the file. Returns `undefined`. A file descriptor can also be + * passed as the first argument. In this case, `fs.ftruncateSync()` is called. + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * @since v0.8.6 + * @param [len=0] + */ + export function truncateSync(path: PathLike, len?: number | null): void; + /** + * Truncates the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. + * + * If the file referred to by the file descriptor was larger than `len` bytes, only + * the first `len` bytes will be retained in the file. + * + * For example, the following program retains only the first four bytes of the + * file: + * + * ```js + * import { open, close, ftruncate } from 'fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('temp.txt', 'r+', (err, fd) => { + * if (err) throw err; + * + * try { + * ftruncate(fd, 4, (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * if (err) throw err; + * } + * }); + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v0.8.6 + * @param [len=0] + */ + export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + export function ftruncate(fd: number, callback: NoParamCallback): void; + export namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(fd: number, len?: number | null): Promise; + } + /** + * Truncates the file descriptor. Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link ftruncate}. + * @since v0.8.6 + * @param [len=0] + */ + export function ftruncateSync(fd: number, len?: number | null): void; + /** + * Asynchronously changes owner and group of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + export namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Synchronously changes owner and group of a file. Returns `undefined`. + * This is the synchronous version of {@link chown}. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + export function chownSync(path: PathLike, uid: number, gid: number): void; + /** + * Sets the owner of the file. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; + export namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + function __promisify__(fd: number, uid: number, gid: number): Promise; + } + /** + * Sets the owner of the file. Returns `undefined`. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + export function fchownSync(fd: number, uid: number, gid: number): void; + /** + * Set the owner of the symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. + */ + export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + export namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Set the owner for the path. Returns `undefined`. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + export function lchownSync(path: PathLike, uid: number, gid: number): void; + /** + * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic + * link, then the link is not dereferenced: instead, the timestamps of the + * symbolic link itself are changed. + * + * No arguments other than a possible exception are given to the completion + * callback. + * @since v14.5.0, v12.19.0 + */ + export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace lutimes { + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, + * with the difference that if the path refers to a symbolic link, then the link is not + * dereferenced: instead, the timestamps of the symbolic link itself are changed. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Change the file system timestamps of the symbolic link referenced by `path`. + * Returns `undefined`, or throws an exception when parameters are incorrect or + * the operation fails. This is the synchronous version of {@link lutimes}. + * @since v14.5.0, v12.19.0 + */ + export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Asynchronously changes the permissions of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * + * ```js + * import { chmod } from 'fs'; + * + * chmod('my_file.txt', 0o775, (err) => { + * if (err) throw err; + * console.log('The permissions for file "my_file.txt" have been changed!'); + * }); + * ``` + * @since v0.1.30 + */ + export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + export namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link chmod}. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * @since v0.6.7 + */ + export function chmodSync(path: PathLike, mode: Mode): void; + /** + * Sets the permissions on the file. No arguments other than a possible exception + * are given to the completion callback. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; + export namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(fd: number, mode: Mode): Promise; + } + /** + * Sets the permissions on the file. Returns `undefined`. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchmodSync(fd: number, mode: Mode): void; + /** + * Changes the permissions on a symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + /** @deprecated */ + export namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * Changes the permissions on a symbolic link. Returns `undefined`. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + export function lchmodSync(path: PathLike, mode: Mode): void; + /** + * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * + * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. + * Instead, user code should open/read/write the file directly and handle the + * error raised if the file is not available. + * + * To check if a file exists without manipulating it afterwards, {@link access} is recommended. + * + * For example, given the following directory structure: + * + * ```text + * - txtDir + * -- file.txt + * - app.js + * ``` + * + * The next program will check for the stats of the given paths: + * + * ```js + * import { stat } from 'fs'; + * + * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; + * + * for (let i = 0; i < pathsToCheck.length; i++) { + * stat(pathsToCheck[i], (err, stats) => { + * console.log(stats.isDirectory()); + * console.log(stats); + * }); + * } + * ``` + * + * The resulting output will resemble: + * + * ```console + * true + * Stats { + * dev: 16777220, + * mode: 16877, + * nlink: 3, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214262, + * size: 96, + * blocks: 0, + * atimeMs: 1561174653071.963, + * mtimeMs: 1561174614583.3518, + * ctimeMs: 1561174626623.5366, + * birthtimeMs: 1561174126937.2893, + * atime: 2019-06-22T03:37:33.072Z, + * mtime: 2019-06-22T03:36:54.583Z, + * ctime: 2019-06-22T03:37:06.624Z, + * birthtime: 2019-06-22T03:28:46.937Z + * } + * false + * Stats { + * dev: 16777220, + * mode: 33188, + * nlink: 1, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214074, + * size: 8, + * blocks: 8, + * atimeMs: 1561174616618.8555, + * mtimeMs: 1561174614584, + * ctimeMs: 1561174614583.8145, + * birthtimeMs: 1561174007710.7478, + * atime: 2019-06-22T03:36:56.619Z, + * mtime: 2019-06-22T03:36:54.584Z, + * ctime: 2019-06-22T03:36:54.584Z, + * birthtime: 2019-06-22T03:26:47.711Z + * } + * ``` + * @since v0.0.2 + */ + export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function stat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function stat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + export interface StatSyncFn extends Function { + (path: PathLike, options?: undefined): Stats; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + throwIfNoEntry: false; + } + ): Stats | undefined; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + throwIfNoEntry: false; + } + ): BigIntStats | undefined; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + } + ): Stats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + } + ): BigIntStats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: boolean; + throwIfNoEntry?: false | undefined; + } + ): Stats | BigIntStats; + (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; + } + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const statSync: StatSyncFn; + /** + * Invokes the callback with the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function fstat( + fd: number, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function fstat( + fd: number, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + function __promisify__( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + fd: number, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(fd: number, options?: StatOptions): Promise; + } + /** + * Retrieves the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + export function fstatSync( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Stats; + export function fstatSync( + fd: number, + options: StatOptions & { + bigint: true; + } + ): BigIntStats; + export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; + /** + * Retrieves the `fs.Stats` for the symbolic link referred to by the path. + * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic + * link, then the link itself is stat-ed, not the file that it refers to. + * + * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. + * @since v0.1.30 + */ + export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function lstat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function lstat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const lstatSync: StatSyncFn; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than + * a possible + * exception are given to the completion callback. + * @since v0.1.31 + */ + export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + export namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; + } + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.31 + */ + export function linkSync(existingPath: PathLike, newPath: PathLike): void; + /** + * Creates the link called `path` pointing to `target`. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. + * + * The `type` argument is only available on Windows and ignored on other platforms. + * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is + * not set, Node.js will autodetect `target` type and use `'file'` or `'dir'`. If + * the `target` does not exist, `'file'` will be used. Windows junction points + * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. + * + * Relative targets are relative to the link’s parent directory. + * + * ```js + * import { symlink } from 'fs'; + * + * symlink('./mew', './mewtwo', callback); + * ``` + * + * The above example creates a symbolic link `mewtwo` which points to `mew` in the + * same directory: + * + * ```bash + * $ tree . + * . + * ├── mew + * └── mewtwo -> ./mew + * ``` + * @since v0.1.31 + */ + export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; + export namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + type Type = 'dir' | 'file' | 'junction'; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link symlink}. + * @since v0.1.31 + */ + export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; + /** + * Reads the contents of the symbolic link referred to by `path`. The callback gets + * two arguments `(err, linkString)`. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path passed to the callback. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + export namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + } + /** + * Returns the symbolic link's string value. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + export function readlinkSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; + /** + * Asynchronously computes the canonical pathname by resolving `.`, `..` and + * symbolic links. + * + * A canonical pathname is not necessarily unique. Hard links and bind mounts can + * expose a file system entity through many pathnames. + * + * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: + * + * 1. No case conversion is performed on case-insensitive file systems. + * 2. The maximum number of symbolic links is platform-independent and generally + * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. + * + * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * If `path` resolves to a socket or a pipe, the function will return a system + * dependent name for that object. + * @since v0.1.31 + */ + export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + export namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). + * + * The `callback` gets two arguments `(err, resolvedPath)`. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v9.2.0 + */ + function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + } + /** + * Returns the resolved pathname. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link realpath}. + * @since v0.1.31 + */ + export function realpathSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; + export namespace realpathSync { + function native(path: PathLike, options?: EncodingOption): string; + function native(path: PathLike, options: BufferEncodingOption): Buffer; + function native(path: PathLike, options?: EncodingOption): string | Buffer; + } + /** + * Asynchronously removes a file or symbolic link. No arguments other than a + * possible exception are given to the completion callback. + * + * ```js + * import { unlink } from 'fs'; + * // Assuming that 'path/file.txt' is a regular file. + * unlink('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was deleted'); + * }); + * ``` + * + * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a + * directory, use {@link rmdir}. + * + * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. + * @since v0.0.2 + */ + export function unlink(path: PathLike, callback: NoParamCallback): void; + export namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. + * @since v0.1.21 + */ + export function unlinkSync(path: PathLike): void; + export interface RmDirOptions { + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number | undefined; + /** + * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning + * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. + * Use `fs.rm(path, { recursive: true, force: true })` instead. + * + * If `true`, perform a recursive directory removal. In + * recursive mode, operations are retried on failure. + * @default false + */ + recursive?: boolean | undefined; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number | undefined; + } + /** + * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given + * to the completion callback. + * + * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on + * Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. + * @since v0.0.2 + */ + export function rmdir(path: PathLike, callback: NoParamCallback): void; + export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; + export namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, options?: RmDirOptions): Promise; + } + /** + * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. + * + * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error + * on Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. + * @since v0.1.21 + */ + export function rmdirSync(path: PathLike, options?: RmDirOptions): void; + export interface RmOptions { + /** + * When `true`, exceptions will be ignored if `path` does not exist. + * @default false + */ + force?: boolean | undefined; + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number | undefined; + /** + * If `true`, perform a recursive directory removal. In + * recursive mode, operations are retried on failure. + * @default false + */ + recursive?: boolean | undefined; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number | undefined; + } + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the + * completion callback. + * @since v14.14.0 + */ + export function rm(path: PathLike, callback: NoParamCallback): void; + export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; + export namespace rm { + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). + */ + function __promisify__(path: PathLike, options?: RmOptions): Promise; + } + /** + * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. + * @since v14.14.0 + */ + export function rmSync(path: PathLike, options?: RmOptions): void; + export interface MakeDirectoryOptions { + /** + * Indicates whether parent folders should be created. + * If a folder was created, the path to the first created folder will be returned. + * @default false + */ + recursive?: boolean | undefined; + /** + * A file mode. If a string is passed, it is parsed as an octal integer. If not specified + * @default 0o777 + */ + mode?: Mode | undefined; + } + /** + * Asynchronously creates a directory. + * + * The callback is given a possible exception and, if `recursive` is `true`, the + * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was + * created. + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that + * exists results in an error only + * when `recursive` is false. + * + * ```js + * import { mkdir } from 'fs'; + * + * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. + * mkdir('/tmp/a/apple', { recursive: true }, (err) => { + * if (err) throw err; + * }); + * ``` + * + * On Windows, using `fs.mkdir()` on the root directory even with recursion will + * result in an error: + * + * ```js + * import { mkdir } from 'fs'; + * + * mkdir('/', { recursive: true }, (err) => { + * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] + * }); + * ``` + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.8 + */ + export function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + }, + callback: (err: NodeJS.ErrnoException | null, path?: string) => void + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir( + path: PathLike, + options: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + | undefined, + callback: NoParamCallback + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void; + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function mkdir(path: PathLike, callback: NoParamCallback): void; + export namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + } + /** + * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. + * This is the synchronous version of {@link mkdir}. + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.21 + */ + export function mkdirSync( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): string | undefined; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): void; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; + /** + * Creates a unique temporary directory. + * + * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform + * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, + * notably the BSDs, can return more than six random characters, and replace + * trailing `X` characters in `prefix` with random characters. + * + * The created directory path is passed as a string to the callback's second + * parameter. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'fs'; + * + * mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 + * }); + * ``` + * + * The `fs.mkdtemp()` method will append the six randomly selected characters + * directly to the `prefix` string. For instance, given a directory `/tmp`, if the + * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator + * (`require('path').sep`). + * + * ```js + * import { tmpdir } from 'os'; + * import { mkdtemp } from 'fs'; + * + * // The parent directory for the new temporary directory + * const tmpDir = tmpdir(); + * + * // This method is *INCORRECT*: + * mkdtemp(tmpDir, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmpabc123`. + * // A new temporary directory is created at the file system root + * // rather than *within* the /tmp directory. + * }); + * + * // This method is *CORRECT*: + * import { sep } from 'path'; + * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmp/abc123`. + * // A new temporary directory is created within + * // the /tmp directory. + * }); + * ``` + * @since v5.10.0 + */ + export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp( + prefix: string, + options: + | 'buffer' + | { + encoding: 'buffer'; + }, + callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void + ): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + export namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + } + /** + * Returns the created directory path. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link mkdtemp}. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * @since v5.10.0 + */ + export function mkdtempSync(prefix: string, options?: EncodingOption): string; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; + /** + * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. + * @since v0.1.8 + */ + export function readdir( + path: PathLike, + options: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + } + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + } + | 'buffer', + callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + }, + callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void + ): void; + export namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + } + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options: + | 'buffer' + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + } + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent + */ + function __promisify__( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + } + ): Promise; + } + /** + * Reads the contents of the directory. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames returned. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. + * @since v0.1.21 + */ + export function readdirSync( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + } + | BufferEncoding + | null + ): string[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + } + | 'buffer' + ): Buffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | null + ): string[] | Buffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdirSync( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + } + ): Dirent[]; + /** + * Closes the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.0.2 + */ + export function close(fd: number, callback?: NoParamCallback): void; + export namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Closes the file descriptor. Returns `undefined`. + * + * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.1.21 + */ + export function closeSync(fd: number): void; + /** + * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. + * + * `mode` sets the file mode (permission and sticky bits), but only if the file was + * created. On Windows, only the write permission can be manipulated; see {@link chmod}. + * + * The callback gets two arguments `(err, fd)`. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * + * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. + * @since v0.0.2 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] + */ + export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param [flags='r'] See `support of file system `flags``. + */ + export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + + export namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; + } + /** + * Returns an integer representing the file descriptor. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link open}. + * @since v0.1.21 + * @param [flags='r'] + * @param [mode=0o666] + */ + export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. + * @since v0.4.2 + */ + export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link utimes}. + * @since v0.4.2 + */ + export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Change the file system timestamps of the object referenced by the supplied file + * descriptor. See {@link utimes}. + * @since v0.4.2 + */ + export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Synchronous version of {@link futimes}. Returns `undefined`. + * @since v0.4.2 + */ + export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other + * than a possible exception are given to the completion callback. + * @since v0.1.96 + */ + export function fsync(fd: number, callback: NoParamCallback): void; + export namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.96 + */ + export function fsyncSync(fd: number): void; + /** + * Write `buffer` to the file specified by `fd`. + * + * `offset` determines the part of the buffer to be written, and `length` is + * an integer specifying the number of bytes to write. + * + * `position` refers to the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). + * + * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesWritten` and `buffer` properties. + * + * It is unsafe to use `fs.write()` multiple times on the same file without waiting + * for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v0.0.2 + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + position: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function write( + fd: number, + string: string, + position: number | undefined | null, + encoding: BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void + ): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + */ + export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + export namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function __promisify__( + fd: number, + buffer?: TBuffer, + offset?: number, + length?: number, + position?: number | null + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function __promisify__( + fd: number, + string: string, + position?: number | null, + encoding?: BufferEncoding | null + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link write}. + * @since v0.1.21 + * @return The number of bytes written. + */ + export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number; + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; + export type ReadPosition = number | bigint; + export interface ReadSyncOptions { + /** + * @default 0 + */ + offset?: number | undefined; + /** + * @default `length of buffer` + */ + length?: number | undefined; + /** + * @default null + */ + position?: ReadPosition | null | undefined; + } + export interface ReadAsyncOptions extends ReadSyncOptions { + buffer?: TBuffer; + } + /** + * Read data from the file specified by `fd`. + * + * The callback is given the three arguments, `(err, bytesRead, buffer)`. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffer` properties. + * @since v0.0.2 + * @param buffer The buffer that the data will be written to. + * @param offset The position in `buffer` to write the data to. + * @param length The number of bytes to read. + * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If + * `position` is an integer, the file position will be unchanged. + */ + export function read( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: ReadPosition | null, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void + ): void; + /** + * Similar to the above `fs.read` function, this version takes an optional `options` object. + * If not otherwise specified in an `options` object, + * `buffer` defaults to `Buffer.alloc(16384)`, + * `offset` defaults to `0`, + * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 + * `position` defaults to `null` + * @since v12.17.0, 13.11.0 + */ + export function read( + fd: number, + options: ReadAsyncOptions, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void + ): void; + export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void; + export namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + function __promisify__( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: number | null + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__( + fd: number, + options: ReadAsyncOptions + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__(fd: number): Promise<{ + bytesRead: number; + buffer: NodeJS.ArrayBufferView; + }>; + } + /** + * Returns the number of `bytesRead`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link read}. + * @since v0.1.21 + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number; + /** + * Similar to the above `fs.readSync` function, this version takes an optional `options` object. + * If no `options` object is specified, it will default with the above values. + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; + /** + * Asynchronously reads the entire contents of a file. + * + * ```js + * import { readFile } from 'fs'; + * + * readFile('/etc/passwd', (err, data) => { + * if (err) throw err; + * console.log(data); + * }); + * ``` + * + * The callback is passed two arguments `(err, data)`, where `data` is the + * contents of the file. + * + * If no encoding is specified, then the raw buffer is returned. + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { readFile } from 'fs'; + * + * readFile('/etc/passwd', 'utf8', callback); + * ``` + * + * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an + * error will be returned. On FreeBSD, a representation of the directory's contents + * will be returned. + * + * ```js + * import { readFile } from 'fs'; + * + * // macOS, Linux, and Windows + * readFile('', (err, data) => { + * // => [Error: EISDIR: illegal operation on a directory, read ] + * }); + * + * // FreeBSD + * readFile('', (err, data) => { + * // => null, + * }); + * ``` + * + * It is possible to abort an ongoing request using an `AbortSignal`. If a + * request is aborted the callback is called with an `AbortError`: + * + * ```js + * import { readFile } from 'fs'; + * + * const controller = new AbortController(); + * const signal = controller.signal; + * readFile(fileInfo[0].name, { signal }, (err, buf) => { + * // ... + * }); + * // When you want to abort the request + * controller.abort(); + * ``` + * + * The `fs.readFile()` function buffers the entire file. To minimize memory costs, + * when possible prefer streaming via `fs.createReadStream()`. + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * @since v0.1.29 + * @param path filename or file descriptor + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding?: null | undefined; + flag?: string | undefined; + } & Abortable) + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding: BufferEncoding; + flag?: string | undefined; + } & Abortable) + | BufferEncoding, + callback: (err: NodeJS.ErrnoException | null, data: string) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | (ObjectEncodingOptions & { + flag?: string | undefined; + } & Abortable) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; + export namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null + ): Promise; + } + /** + * Returns the contents of the `path`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readFile}. + * + * If the `encoding` option is specified then this function returns a + * string. Otherwise it returns a buffer. + * + * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. + * + * ```js + * import { readFileSync } from 'fs'; + * + * // macOS, Linux, and Windows + * readFileSync(''); + * // => [Error: EISDIR: illegal operation on a directory, read ] + * + * // FreeBSD + * readFileSync(''); // => + * ``` + * @since v0.1.8 + * @param path filename or file descriptor + */ + export function readFileSync( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null + ): Buffer; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding + ): string; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null + ): string | Buffer; + export type WriteFileOptions = + | (ObjectEncodingOptions & + Abortable & { + mode?: Mode | undefined; + flag?: string | undefined; + }) + | BufferEncoding + | null; + /** + * When `file` is a filename, asynchronously writes data to the file, replacing the + * file if it already exists. `data` can be a string or a buffer. + * + * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using + * a file descriptor. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { writeFile } from 'fs'; + * import { Buffer } from 'buffer'; + * + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, (err) => { + * if (err) throw err; + * console.log('The file has been saved!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { writeFile } from 'fs'; + * + * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); + * ``` + * + * It is unsafe to use `fs.writeFile()` multiple times on the same file without + * waiting for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that + * performs multiple `write` calls internally to write the buffer passed to it. + * For performance sensitive code consider using {@link createWriteStream}. + * + * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'fs'; + * import { Buffer } from 'buffer'; + * + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, { signal }, (err) => { + * // When a request is aborted - the callback is called with an AbortError + * }); + * // When the request should be aborted + * controller.abort(); + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v0.1.29 + * @param file filename or file descriptor + */ + export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; + export namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function __promisify__(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; + } + /** + * Returns `undefined`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writeFile}. + * @since v0.1.29 + * @param file filename or file descriptor + */ + export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFile } from 'fs'; + * + * appendFile('message.txt', 'data to append', (err) => { + * if (err) throw err; + * console.log('The "data to append" was appended to file!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFile } from 'fs'; + * + * appendFile('message.txt', 'data to append', 'utf8', callback); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { open, close, appendFile } from 'fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('message.txt', 'a', (err, fd) => { + * if (err) throw err; + * + * try { + * appendFile(fd, 'data to append', 'utf8', (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * throw err; + * } + * }); + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void; + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; + export namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function __promisify__(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise; + } + /** + * Synchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFileSync } from 'fs'; + * + * try { + * appendFileSync('message.txt', 'data to append'); + * console.log('The "data to append" was appended to file!'); + * } catch (err) { + * // Handle the error + * } + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFileSync } from 'fs'; + * + * appendFileSync('message.txt', 'data to append', 'utf8'); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { openSync, closeSync, appendFileSync } from 'fs'; + * + * let fd; + * + * try { + * fd = openSync('message.txt', 'a'); + * appendFileSync(fd, 'data to append', 'utf8'); + * } catch (err) { + * // Handle the error + * } finally { + * if (fd !== undefined) + * closeSync(fd); + * } + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void; + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + export interface WatchFileOptions { + bigint?: boolean | undefined; + persistent?: boolean | undefined; + interval?: number | undefined; + } + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + export function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint?: false | undefined; + }) + | undefined, + listener: (curr: Stats, prev: Stats) => void + ): StatWatcher; + export function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint: true; + }) + | undefined, + listener: (curr: BigIntStats, prev: BigIntStats) => void + ): StatWatcher; + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): StatWatcher; + /** + * Stop watching for changes on `filename`. If `listener` is specified, only that + * particular listener is removed. Otherwise, _all_ listeners are removed, + * effectively stopping watching of `filename`. + * + * Calling `fs.unwatchFile()` with a filename that is not being watched is a + * no-op, not an error. + * + * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. + * @since v0.1.31 + * @param listener Optional, a listener previously attached using `fs.watchFile()` + */ + export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; + export interface WatchOptions extends Abortable { + encoding?: BufferEncoding | 'buffer' | undefined; + persistent?: boolean | undefined; + recursive?: boolean | undefined; + } + export type WatchEventType = 'rename' | 'change'; + export type WatchListener = (event: WatchEventType, filename: T) => void; + /** + * Watch for changes on `filename`, where `filename` is either a file or a + * directory. + * + * The second argument is optional. If `options` is provided as a string, it + * specifies the `encoding`. Otherwise `options` should be passed as an object. + * + * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file + * which triggered the event. + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. + * + * If a `signal` is passed, aborting the corresponding AbortController will close + * the returned `fs.FSWatcher`. + * @since v0.5.10 + * @param listener + */ + export function watch( + filename: PathLike, + options: + | (WatchOptions & { + encoding: 'buffer'; + }) + | 'buffer', + listener?: WatchListener + ): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; + /** + * Test whether or not the given path exists by checking with the file system. + * Then call the `callback` argument with either true or false: + * + * ```js + * import { exists } from 'fs'; + * + * exists('/etc/passwd', (e) => { + * console.log(e ? 'it exists' : 'no passwd!'); + * }); + * ``` + * + * **The parameters for this callback are not consistent with other Node.js** + * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback + * has only one boolean parameter. This is one reason `fs.access()` is recommended + * instead of `fs.exists()`. + * + * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file does not exist. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { exists, open, close } from 'fs'; + * + * exists('myfile', (e) => { + * if (e) { + * console.error('myfile already exists'); + * } else { + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'fs'; + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { open, close, exists } from 'fs'; + * + * exists('myfile', (e) => { + * if (e) { + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } else { + * console.error('myfile does not exist'); + * } + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for existence and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the existence of a file only if the file won’t be + * used directly, for example when its existence is a signal from another + * process. + * @since v0.0.2 + * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. + */ + export function exists(path: PathLike, callback: (exists: boolean) => void): void; + /** @deprecated */ + export namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Returns `true` if the path exists, `false` otherwise. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link exists}. + * + * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other + * Node.js callbacks. `fs.existsSync()` does not use a callback. + * + * ```js + * import { existsSync } from 'fs'; + * + * if (existsSync('/etc/passwd')) + * console.log('The path exists.'); + * ``` + * @since v0.1.21 + */ + export function existsSync(path: PathLike): boolean; + export namespace constants { + // File Access Constants + /** Constant for fs.access(). File is visible to the calling process. */ + const F_OK: number; + /** Constant for fs.access(). File can be read by the calling process. */ + const R_OK: number; + /** Constant for fs.access(). File can be written by the calling process. */ + const W_OK: number; + /** Constant for fs.access(). File can be executed by the calling process. */ + const X_OK: number; + // File Copy Constants + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + const COPYFILE_EXCL: number; + /** + * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. + */ + const COPYFILE_FICLONE: number; + /** + * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then the operation will fail with an error. + */ + const COPYFILE_FICLONE_FORCE: number; + // File Open Constants + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + const O_RDONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + const O_WRONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + const O_RDWR: number; + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + const O_CREAT: number; + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + const O_EXCL: number; + /** + * Constant for fs.open(). Flag indicating that if path identifies a terminal device, + * opening the path shall not cause that terminal to become the controlling terminal for the process + * (if the process does not already have one). + */ + const O_NOCTTY: number; + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + const O_TRUNC: number; + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + const O_APPEND: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + const O_DIRECTORY: number; + /** + * constant for fs.open(). + * Flag indicating reading accesses to the file system will no longer result in + * an update to the atime information associated with the file. + * This flag is available on Linux operating systems only. + */ + const O_NOATIME: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + const O_NOFOLLOW: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + const O_SYNC: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + const O_DSYNC: number; + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + const O_SYMLINK: number; + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + const O_DIRECT: number; + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + const O_NONBLOCK: number; + // File Type Constants + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + const S_IFMT: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + const S_IFREG: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + const S_IFDIR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + const S_IFCHR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + const S_IFBLK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + const S_IFIFO: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + const S_IFLNK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + const S_IFSOCK: number; + // File Mode Constants + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + const S_IRWXU: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + const S_IRUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + const S_IWUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + const S_IXUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + const S_IRWXG: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + const S_IRGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + const S_IWGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + const S_IXGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + const S_IRWXO: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + const S_IROTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + const S_IWOTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + const S_IXOTH: number; + /** + * When set, a memory file mapping is used to access the file. This flag + * is available on Windows operating systems only. On other operating systems, + * this flag is ignored. + */ + const UV_FS_O_FILEMAP: number; + } + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * The final argument, `callback`, is a callback function that is invoked with + * a possible error argument. If any of the accessibility checks fail, the error + * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. + * + * ```js + * import { access, constants } from 'fs'; + * + * const file = 'package.json'; + * + * // Check if the file exists in the current directory. + * access(file, constants.F_OK, (err) => { + * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); + * }); + * + * // Check if the file is readable. + * access(file, constants.R_OK, (err) => { + * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); + * }); + * + * // Check if the file is writable. + * access(file, constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); + * }); + * + * // Check if the file is readable and writable. + * access(file, constants.R_OK | constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); + * }); + * ``` + * + * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file is not accessible. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'fs'; + * + * access('myfile', (err) => { + * if (!err) { + * console.error('myfile already exists'); + * return; + * } + * + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'fs'; + * + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'fs'; + * access('myfile', (err) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for accessibility and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the accessibility of a file only if the file will not be + * used directly, for example when its accessibility is a signal from another + * process. + * + * On Windows, access-control policies (ACLs) on a directory may limit access to + * a file or directory. The `fs.access()` function, however, does not check the + * ACL and therefore may report that a path is accessible even if the ACL restricts + * the user from reading or writing to it. + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function access(path: PathLike, callback: NoParamCallback): void; + export namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike, mode?: number): Promise; + } + /** + * Synchronously tests a user's permissions for the file or directory specified + * by `path`. The `mode` argument is an optional integer that specifies the + * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and + * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, + * the method will return `undefined`. + * + * ```js + * import { accessSync, constants } from 'fs'; + * + * try { + * accessSync('etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can read/write'); + * } catch (err) { + * console.error('no access!'); + * } + * ``` + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + export function accessSync(path: PathLike, mode?: number): void; + interface StreamOptions { + flags?: string | undefined; + encoding?: BufferEncoding | undefined; + fd?: number | promises.FileHandle | undefined; + mode?: number | undefined; + autoClose?: boolean | undefined; + /** + * @default false + */ + emitClose?: boolean | undefined; + start?: number | undefined; + highWaterMark?: number | undefined; + } + interface ReadStreamOptions extends StreamOptions { + end?: number | undefined; + } + /** + * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream + * returned by this method has a default `highWaterMark` of 64 kb. + * + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is + * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the + * current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use + * the specified file descriptor. This means that no `'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. + * + * If `fd` points to a character device that only supports blocking reads + * (such as keyboard or sound card), read operations do not finish until data is + * available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, + * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is + * also required. + * + * ```js + * import { createReadStream } from 'fs'; + * + * // Create a stream from some character device. + * const stream = createReadStream('/dev/input/event0'); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * `mode` sets the file mode (permission and sticky bits), but only if the + * file was created. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { createReadStream } from 'fs'; + * + * createReadStream('sample.txt', { start: 90, end: 99 }); + * ``` + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` option to be set to `r+` rather than the + * default `w`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce + * performance as some optimizations (`_writev()`) + * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override + * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. + * + * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s + * should be passed to `net.Socket`. + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other + * than a possible + * exception are given to the completion callback. + * @since v0.1.96 + */ + export function fdatasync(fd: number, callback: NoParamCallback): void; + export namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. + * @since v0.1.96 + */ + export function fdatasyncSync(fd: number): void; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. No arguments other than a possible exception are given to the + * callback function. Node.js makes no guarantees about the atomicity of the copy + * operation. If an error occurs after the destination file has been opened for + * writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFile, constants } from 'fs'; + * + * function callback(err) { + * if (err) throw err; + * console.log('source.txt was copied to destination.txt'); + * } + * + * // destination.txt will be created or overwritten by default. + * copyFile('source.txt', 'destination.txt', callback); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; + export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; + export namespace copyFile { + function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; + } + /** + * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. Returns `undefined`. Node.js makes no guarantees about the + * atomicity of the copy operation. If an error occurs after the destination file + * has been opened for writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFileSync, constants } from 'fs'; + * + * // destination.txt will be created or overwritten by default. + * copyFileSync('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; + /** + * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. + * + * `position` is the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. + * + * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. + * + * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. + * + * It is unsafe to use `fs.writev()` multiple times on the same file without + * waiting for the callback. For this scenario, use {@link createWriteStream}. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + */ + export function writev(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; + export function writev( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export interface WriteVResult { + bytesWritten: number; + buffers: NodeJS.ArrayBufferView[]; + } + export namespace writev { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writev}. + * @since v12.9.0 + * @return The number of bytes written. + */ + export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; + /** + * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s + * using `readv()`. + * + * `position` is the offset from the beginning of the file from where data + * should be read. If `typeof position !== 'number'`, the data will be read + * from the current position. + * + * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffers` properties. + * @since v13.13.0, v12.17.0 + */ + export function readv(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void; + export function readv( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export interface ReadVResult { + bytesRead: number; + buffers: NodeJS.ArrayBufferView[]; + } + export namespace readv { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readv}. + * @since v13.13.0, v12.17.0 + * @return The number of bytes read. + */ + export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; + export interface OpenDirOptions { + encoding?: BufferEncoding | undefined; + /** + * Number of directory entries that are buffered + * internally when reading from the directory. Higher values lead to better + * performance but higher memory usage. + * @default 32 + */ + bufferSize?: number | undefined; + } + /** + * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; + /** + * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for + * more details. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + export function opendir(path: PathLike, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + export namespace opendir { + function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; + } + export interface BigIntStats extends StatsBase { + atimeNs: bigint; + mtimeNs: bigint; + ctimeNs: bigint; + birthtimeNs: bigint; + } + export interface BigIntOptions { + bigint: true; + } + export interface StatOptions { + bigint?: boolean | undefined; + } + export interface StatSyncOptions extends StatOptions { + throwIfNoEntry?: boolean | undefined; + } + interface CopyOptionsBase { + /** + * Dereference symlinks + * @default false + */ + dereference?: boolean; + /** + * When `force` is `false`, and the destination + * exists, throw an error. + * @default false + */ + errorOnExist?: boolean; + /** + * Overwrite existing file or directory. _The copy + * operation will ignore errors if you set this to false and the destination + * exists. Use the `errorOnExist` option to change this behavior. + * @default true + */ + force?: boolean; + /** + * When `true` timestamps from `src` will + * be preserved. + * @default false + */ + preserveTimestamps?: boolean; + /** + * Copy directories recursively. + * @default false + */ + recursive?: boolean; + /** + * When true, path resolution for symlinks will be skipped + * @default false + */ + verbatimSymlinks?: boolean; + } + export interface CopyOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?(source: string, destination: string): boolean | Promise; + } + export interface CopySyncOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?(source: string, destination: string): boolean; + } + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + export function cp(source: string | URL, destination: string | URL, callback: (err: NodeJS.ErrnoException | null) => void): void; + export function cp(source: string | URL, destination: string | URL, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; + /** + * Synchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; +} +declare module 'node:fs' { + export * from 'fs'; +} diff --git a/server/node_modules/@types/node/fs/promises.d.ts b/server/node_modules/@types/node/fs/promises.d.ts new file mode 100755 index 0000000000..aca2fd51b2 --- /dev/null +++ b/server/node_modules/@types/node/fs/promises.d.ts @@ -0,0 +1,1138 @@ +/** + * The `fs/promises` API provides asynchronous file system methods that return + * promises. + * + * The promise APIs use the underlying Node.js threadpool to perform file + * system operations off the event loop thread. These operations are not + * synchronized or threadsafe. Care must be taken when performing multiple + * concurrent modifications on the same file or data corruption may occur. + * @since v10.0.0 + */ +declare module 'fs/promises' { + import { Abortable } from 'node:events'; + import { Stream } from 'node:stream'; + import { ReadableStream } from 'node:stream/web'; + import { + BigIntStats, + BufferEncodingOption, + constants as fsConstants, + CopyOptions, + Dir, + Dirent, + MakeDirectoryOptions, + Mode, + ObjectEncodingOptions, + OpenDirOptions, + OpenMode, + PathLike, + ReadStream, + ReadVResult, + RmDirOptions, + RmOptions, + StatOptions, + Stats, + TimeLike, + WatchEventType, + WatchOptions, + WriteStream, + WriteVResult, + } from 'node:fs'; + import { Interface as ReadlineInterface } from 'node:readline'; + + interface FileChangeInfo { + eventType: WatchEventType; + filename: T; + } + interface FlagAndOpenMode { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + } + interface FileReadResult { + bytesRead: number; + buffer: T; + } + interface FileReadOptions { + /** + * @default `Buffer.alloc(0xffff)` + */ + buffer?: T; + /** + * @default 0 + */ + offset?: number | null; + /** + * @default `buffer.byteLength` + */ + length?: number | null; + position?: number | null; + } + interface CreateReadStreamOptions { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + end?: number | undefined; + highWaterMark?: number | undefined; + } + interface CreateWriteStreamOptions { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + } + // TODO: Add `EventEmitter` close + interface FileHandle { + /** + * The numeric file descriptor managed by the {FileHandle} object. + * @since v10.0.0 + */ + readonly fd: number; + /** + * Alias of `filehandle.writeFile()`. + * + * When operating on file handles, the mode cannot be changed from what it was set + * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; + /** + * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). + * @since v10.0.0 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + * @return Fulfills with `undefined` upon success. + */ + chown(uid: number, gid: number): Promise; + /** + * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). + * @since v10.0.0 + * @param mode the file mode bit mask. + * @return Fulfills with `undefined` upon success. + */ + chmod(mode: Mode): Promise; + /** + * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream + * returned by this method has a default `highWaterMark` of 64 kb. + * + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is + * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from + * the current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If the `FileHandle` points to a character device that only supports blocking + * reads (such as keyboard or sound card), read operations do not finish until data + * is available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * ```js + * import { open } from 'fs/promises'; + * + * const fd = await open('/dev/input/event0'); + * // Create a stream from some character device. + * const stream = fd.createReadStream(); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { open } from 'fs/promises'; + * + * const fd = await open('sample.txt'); + * fd.createReadStream({ start: 90, end: 99 }); + * ``` + * @since v16.11.0 + */ + createReadStream(options?: CreateReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` `open` option to be set to `r+` rather than + * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * @since v16.11.0 + */ + createWriteStream(options?: CreateWriteStreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. + * + * Unlike `filehandle.sync` this method does not flush modified metadata. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + datasync(): Promise; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fufills with `undefined` upon success. + */ + sync(): Promise; + /** + * Reads data from the file and stores that in the given buffer. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * @since v10.0.0 + * @param buffer A buffer that will be filled with the file data read. + * @param offset The location in the buffer at which to start filling. + * @param length The number of bytes to read. + * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an + * integer, the current file position will remain unchanged. + * @return Fulfills upon success with an object with two properties: + */ + read(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise>; + read(options?: FileReadOptions): Promise>; + /** + * Returns a `ReadableStream` that may be used to read the files data. + * + * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed + * or closing. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const chunk of file.readableWebStream()) + * console.log(chunk); + * + * await file.close(); + * ``` + * + * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method. + * + * @since v17.0.0 + * @experimental + */ + readableWebStream(): ReadableStream; + /** + * Asynchronously reads the entire contents of a file. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support reading. + * + * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current + * position till the end of the file. It doesn't always read from the beginning + * of the file. + * @since v10.0.0 + * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the + * data will be a string. + */ + readFile( + options?: { + encoding?: null | undefined; + flag?: OpenMode | undefined; + } | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile( + options: + | { + encoding: BufferEncoding; + flag?: OpenMode | undefined; + } + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile( + options?: + | (ObjectEncodingOptions & { + flag?: OpenMode | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Convenience method to create a `readline` interface and stream over the file. For example: + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const line of file.readLines()) { + * console.log(line); + * } + * ``` + * + * @since v18.11.0 + * @param options See `filehandle.createReadStream()` for the options. + */ + readLines(options?: CreateReadStreamOptions): ReadlineInterface; + /** + * @since v10.0.0 + * @return Fulfills with an {fs.Stats} for the file. + */ + stat( + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + stat( + opts: StatOptions & { + bigint: true; + } + ): Promise; + stat(opts?: StatOptions): Promise; + /** + * Truncates the file. + * + * If the file was larger than `len` bytes, only the first `len` bytes will be + * retained in the file. + * + * The following example retains only the first four bytes of the file: + * + * ```js + * import { open } from 'fs/promises'; + * + * let filehandle = null; + * try { + * filehandle = await open('temp.txt', 'r+'); + * await filehandle.truncate(4); + * } finally { + * await filehandle?.close(); + * } + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + truncate(len?: number): Promise; + /** + * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. + * @since v10.0.0 + */ + utimes(atime: TimeLike, mtime: TimeLike): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * The promise is resolved with no arguments upon success. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support writing. + * + * It is unsafe to use `filehandle.writeFile()` multiple times on the same file + * without waiting for the promise to be resolved (or rejected). + * + * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the + * current position till the end of the file. It doesn't always write from the + * beginning of the file. + * @since v10.0.0 + */ + writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise; + /** + * Write `buffer` to the file. + * + * The promise is resolved with an object containing two properties: + * + * It is unsafe to use `filehandle.write()` multiple times on the same file + * without waiting for the promise to be resolved (or rejected). For this + * scenario, use `filehandle.createWriteStream()`. + * + * On Linux, positional writes do not work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v10.0.0 + * @param [offset=0] The start position from within `buffer` where the data to write begins. + * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. + * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. + * See the POSIX pwrite(2) documentation for more detail. + */ + write( + buffer: TBuffer, + offset?: number | null, + length?: number | null, + position?: number | null + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + write( + data: string, + position?: number | null, + encoding?: BufferEncoding | null + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + /** + * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. + * + * The promise is resolved with an object containing a two properties: + * + * It is unsafe to call `writev()` multiple times on the same file without waiting + * for the promise to be resolved (or rejected). + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current + * position. + */ + writev(buffers: ReadonlyArray, position?: number): Promise; + /** + * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s + * @since v13.13.0, v12.17.0 + * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. + * @return Fulfills upon success an object containing two properties: + */ + readv(buffers: ReadonlyArray, position?: number): Promise; + /** + * Closes the file handle after waiting for any pending operation on the handle to + * complete. + * + * ```js + * import { open } from 'fs/promises'; + * + * let filehandle; + * try { + * filehandle = await open('thefile.txt', 'r'); + * } finally { + * await filehandle?.close(); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + close(): Promise; + } + + const constants: typeof fsConstants; + + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If the accessibility check is successful, the promise is resolved with no + * value. If any of the accessibility checks fail, the promise is rejected + * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and + * written by the current process. + * + * ```js + * import { access } from 'fs/promises'; + * import { constants } from 'fs'; + * + * try { + * await access('/etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can access'); + * } catch { + * console.error('cannot access'); + * } + * ``` + * + * Using `fsPromises.access()` to check for the accessibility of a file before + * calling `fsPromises.open()` is not recommended. Doing so introduces a race + * condition, since other processes may change the file's state between the two + * calls. Instead, user code should open/read/write the file directly and handle + * the error raised if the file is not accessible. + * @since v10.0.0 + * @param [mode=fs.constants.F_OK] + * @return Fulfills with `undefined` upon success. + */ + function access(path: PathLike, mode?: number): Promise; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. + * + * No guarantees are made about the atomicity of the copy operation. If an + * error occurs after the destination file has been opened for writing, an attempt + * will be made to remove the destination. + * + * ```js + * import { constants } from 'fs'; + * import { copyFile } from 'fs/promises'; + * + * try { + * await copyFile('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.log('The file could not be copied'); + * } + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * try { + * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.log('The file could not be copied'); + * } + * ``` + * @since v10.0.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. + * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) + * @return Fulfills with `undefined` upon success. + */ + function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; + /** + * Opens a `FileHandle`. + * + * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * @since v10.0.0 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. + * @return Fulfills with a {FileHandle} object. + */ + function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; + /** + * Renames `oldPath` to `newPath`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + /** + * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + function truncate(path: PathLike, len?: number): Promise; + /** + * Removes the directory identified by `path`. + * + * Using `fsPromises.rmdir()` on a file (not a directory) results in the + * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rmdir(path: PathLike, options?: RmDirOptions): Promise; + /** + * Removes files and directories (modeled on the standard POSIX `rm` utility). + * @since v14.14.0 + * @return Fulfills with `undefined` upon success. + */ + function rm(path: PathLike, options?: RmOptions): Promise; + /** + * Asynchronously creates a directory. + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory + * that exists results in a + * rejection only when `recursive` is false. + * @since v10.0.0 + * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. + */ + function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + /** + * Reads the contents of a directory. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned + * will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. + * + * ```js + * import { readdir } from 'fs/promises'; + * + * try { + * const files = await readdir(path); + * for (const file of files) + * console.log(file); + * } catch (err) { + * console.error(err); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + } + | 'buffer' + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + } + ): Promise; + /** + * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is + * resolved with the`linkString` upon success. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, the link path + * returned will be passed as a `Buffer` object. + * @since v10.0.0 + * @return Fulfills with the `linkString` upon success. + */ + function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; + /** + * Creates a symbolic link. + * + * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path + * to be absolute. When using `'junction'`, the `target` argument will + * automatically be normalized to absolute path. + * @since v10.0.0 + * @param [type='file'] + * @return Fulfills with `undefined` upon success. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + /** + * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, + * in which case the link itself is stat-ed, not the file that it refers to. + * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. + */ + function lstat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function lstat( + path: PathLike, + opts: StatOptions & { + bigint: true; + } + ): Promise; + function lstat(path: PathLike, opts?: StatOptions): Promise; + /** + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given `path`. + */ + function stat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function stat( + path: PathLike, + opts: StatOptions & { + bigint: true; + } + ): Promise; + function stat(path: PathLike, opts?: StatOptions): Promise; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + /** + * If `path` refers to a symbolic link, then the link is removed without affecting + * the file or directory to which that link refers. If the `path` refers to a file + * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function unlink(path: PathLike): Promise; + /** + * Changes the permissions of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the permissions on a symbolic link. + * + * This method is only implemented on macOS. + * @deprecated Since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the ownership on a symbolic link. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a + * symbolic link, then the link is not dereferenced: instead, the timestamps of + * the symbolic link itself are changed. + * @since v14.5.0, v12.19.0 + * @return Fulfills with `undefined` upon success. + */ + function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Changes the ownership of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time, `Date`s, or a + * numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path. If the `encoding` is set to `'buffer'`, the path returned will be + * passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v10.0.0 + * @return Fulfills with the resolved path upon success. + */ + function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Creates a unique temporary directory. A unique directory name is generated by + * appending six random characters to the end of the provided `prefix`. Due to + * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some + * platforms, notably the BSDs, can return more than six random characters, and + * replace trailing `X` characters in `prefix` with random characters. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'fs/promises'; + * + * try { + * await mkdtemp(path.join(os.tmpdir(), 'foo-')); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * The `fsPromises.mkdtemp()` method will append the six randomly selected + * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing + * platform-specific path separator + * (`require('path').sep`). + * @since v10.0.0 + * @return Fulfills with a string containing the filesystem path of the newly created temporary directory. + */ + function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * If `options` is a string, then it specifies the encoding. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * Any specified `FileHandle` has to support writing. + * + * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file + * without waiting for the promise to be settled. + * + * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience + * method that performs multiple `write` calls internally to write the buffer + * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. + * + * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'fs/promises'; + * import { Buffer } from 'buffer'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * const promise = writeFile('message.txt', data, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v10.0.0 + * @param file filename or `FileHandle` + * @return Fulfills with `undefined` upon success. + */ + function writeFile( + file: PathLike | FileHandle, + data: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | Stream, + options?: + | (ObjectEncodingOptions & { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + } & Abortable) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * The `path` may be specified as a `FileHandle` that has been opened + * for appending (using `fsPromises.open()`). + * @since v10.0.0 + * @param path filename or {FileHandle} + * @return Fulfills with `undefined` upon success. + */ + function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; + /** + * Asynchronously reads the entire contents of a file. + * + * If no encoding is specified (using `options.encoding`), the data is returned + * as a `Buffer` object. Otherwise, the data will be a string. + * + * If `options` is a string, then it specifies the encoding. + * + * When the `path` is a directory, the behavior of `fsPromises.readFile()` is + * platform-specific. On macOS, Linux, and Windows, the promise will be rejected + * with an error. On FreeBSD, a representation of the directory's contents will be + * returned. + * + * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a + * request is aborted the promise returned is rejected with an `AbortError`: + * + * ```js + * import { readFile } from 'fs/promises'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const promise = readFile(fileName, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * + * Any specified `FileHandle` has to support reading. + * @since v10.0.0 + * @param path filename or `FileHandle` + * @return Fulfills with the contents of the file. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | ({ + encoding?: null | undefined; + flag?: OpenMode | undefined; + } & Abortable) + | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options: + | ({ + encoding: BufferEncoding; + flag?: OpenMode | undefined; + } & Abortable) + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | (ObjectEncodingOptions & + Abortable & { + flag?: OpenMode | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * + * Example using async iteration: + * + * ```js + * import { opendir } from 'fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + * @return Fulfills with an {fs.Dir}. + */ + function opendir(path: PathLike, options?: OpenDirOptions): Promise; + /** + * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. + * + * ```js + * const { watch } = require('fs/promises'); + * + * const ac = new AbortController(); + * const { signal } = ac; + * setTimeout(() => ac.abort(), 10000); + * + * (async () => { + * try { + * const watcher = watch(__filename, { signal }); + * for await (const event of watcher) + * console.log(event); + * } catch (err) { + * if (err.name === 'AbortError') + * return; + * throw err; + * } + * })(); + * ``` + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. + * @since v15.9.0, v14.18.0 + * @return of objects with the properties: + */ + function watch( + filename: PathLike, + options: + | (WatchOptions & { + encoding: 'buffer'; + }) + | 'buffer' + ): AsyncIterable>; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable> | AsyncIterable>; + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + * @return Fulfills with `undefined` upon success. + */ + function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; +} +declare module 'node:fs/promises' { + export * from 'fs/promises'; +} diff --git a/server/node_modules/@types/node/globals.d.ts b/server/node_modules/@types/node/globals.d.ts new file mode 100755 index 0000000000..80fd4cf3aa --- /dev/null +++ b/server/node_modules/@types/node/globals.d.ts @@ -0,0 +1,300 @@ +// Declare "static" methods in Error +interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; + + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; + + stackTraceLimit: number; +} + +/*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ + +// For backwards compability +interface NodeRequire extends NodeJS.Require { } +interface RequireResolve extends NodeJS.RequireResolve { } +interface NodeModule extends NodeJS.Module { } + +declare var process: NodeJS.Process; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare var require: NodeRequire; +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; + +/** + * Only available if `--expose-gc` is passed to the process. + */ +declare var gc: undefined | (() => void); + +//#region borrowed +// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib +/** A controller object that allows you to abort one or more DOM requests as and when desired. */ +interface AbortController { + /** + * Returns the AbortSignal object associated with this object. + */ + + readonly signal: AbortSignal; + /** + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. + */ + abort(): void; +} + +/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ +interface AbortSignal extends EventTarget { + /** + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. + */ + readonly aborted: boolean; +} + +declare var AbortController: typeof globalThis extends {onmessage: any; AbortController: infer T} + ? T + : { + prototype: AbortController; + new(): AbortController; + }; + +declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal: infer T} + ? T + : { + prototype: AbortSignal; + new(): AbortSignal; + abort(reason?: any): AbortSignal; + timeout(milliseconds: number): AbortSignal; + }; +//#endregion borrowed + +//#region ArrayLike.at() +interface RelativeIndexable { + /** + * Takes an integer value and returns the item at that index, + * allowing for positive and negative integers. + * Negative integers count back from the last item in the array. + */ + at(index: number): T | undefined; +} +interface String extends RelativeIndexable {} +interface Array extends RelativeIndexable {} +interface ReadonlyArray extends RelativeIndexable {} +interface Int8Array extends RelativeIndexable {} +interface Uint8Array extends RelativeIndexable {} +interface Uint8ClampedArray extends RelativeIndexable {} +interface Int16Array extends RelativeIndexable {} +interface Uint16Array extends RelativeIndexable {} +interface Int32Array extends RelativeIndexable {} +interface Uint32Array extends RelativeIndexable {} +interface Float32Array extends RelativeIndexable {} +interface Float64Array extends RelativeIndexable {} +interface BigInt64Array extends RelativeIndexable {} +interface BigUint64Array extends RelativeIndexable {} +//#endregion ArrayLike.at() end + +/** + * @since v17.0.0 + * + * Creates a deep clone of an object. + */ +declare function structuredClone( + value: T, + transfer?: { transfer: ReadonlyArray }, +): T; + +/*----------------------------------------------* +* * +* GLOBAL INTERFACES * +* * +*-----------------------------------------------*/ +declare namespace NodeJS { + interface CallSite { + /** + * Value of "this" + */ + getThis(): unknown; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | null; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined; }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + + interface ReadWriteStream extends ReadableStream, WritableStream { } + + interface RefCounted { + ref(): this; + unref(): this; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[] | undefined; }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + '.js': (m: Module, filename: string) => any; + '.json': (m: Module, filename: string) => any; + '.node': (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since v11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } +} diff --git a/server/node_modules/@types/node/globals.global.d.ts b/server/node_modules/@types/node/globals.global.d.ts new file mode 100755 index 0000000000..ef1198c050 --- /dev/null +++ b/server/node_modules/@types/node/globals.global.d.ts @@ -0,0 +1 @@ +declare var global: typeof globalThis; diff --git a/server/node_modules/@types/node/http.d.ts b/server/node_modules/@types/node/http.d.ts new file mode 100755 index 0000000000..e14de6cf46 --- /dev/null +++ b/server/node_modules/@types/node/http.d.ts @@ -0,0 +1,1651 @@ +/** + * To use the HTTP server and client one must `require('http')`. + * + * The HTTP interfaces in Node.js are designed to support many features + * of the protocol which have been traditionally difficult to use. + * In particular, large, possibly chunk-encoded, messages. The interface is + * careful to never buffer entire requests or responses, so the + * user is able to stream data. + * + * HTTP message headers are represented by an object like this: + * + * ```js + * { 'content-length': '123', + * 'content-type': 'text/plain', + * 'connection': 'keep-alive', + * 'host': 'example.com', + * 'accept': '*' } + * ``` + * + * Keys are lowercased. Values are not modified. + * + * In order to support the full spectrum of possible HTTP applications, the Node.js + * HTTP API is very low-level. It deals with stream handling and message + * parsing only. It parses a message into headers and body but it does not + * parse the actual headers or the body. + * + * See `message.headers` for details on how duplicate headers are handled. + * + * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For + * example, the previous message header object might have a `rawHeaders`list like the following: + * + * ```js + * [ 'ConTent-Length', '123456', + * 'content-LENGTH', '123', + * 'content-type', 'text/plain', + * 'CONNECTION', 'keep-alive', + * 'Host', 'example.com', + * 'accepT', '*' ] + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http.js) + */ +declare module 'http' { + import * as stream from 'node:stream'; + import { URL } from 'node:url'; + import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net'; + import { LookupOptions } from 'node:dns'; + // incoming headers will never contain number + interface IncomingHttpHeaders extends NodeJS.Dict { + accept?: string | undefined; + 'accept-language'?: string | undefined; + 'accept-patch'?: string | undefined; + 'accept-ranges'?: string | undefined; + 'access-control-allow-credentials'?: string | undefined; + 'access-control-allow-headers'?: string | undefined; + 'access-control-allow-methods'?: string | undefined; + 'access-control-allow-origin'?: string | undefined; + 'access-control-expose-headers'?: string | undefined; + 'access-control-max-age'?: string | undefined; + 'access-control-request-headers'?: string | undefined; + 'access-control-request-method'?: string | undefined; + age?: string | undefined; + allow?: string | undefined; + 'alt-svc'?: string | undefined; + authorization?: string | undefined; + 'cache-control'?: string | undefined; + connection?: string | undefined; + 'content-disposition'?: string | undefined; + 'content-encoding'?: string | undefined; + 'content-language'?: string | undefined; + 'content-length'?: string | undefined; + 'content-location'?: string | undefined; + 'content-range'?: string | undefined; + 'content-type'?: string | undefined; + cookie?: string | undefined; + date?: string | undefined; + etag?: string | undefined; + expect?: string | undefined; + expires?: string | undefined; + forwarded?: string | undefined; + from?: string | undefined; + host?: string | undefined; + 'if-match'?: string | undefined; + 'if-modified-since'?: string | undefined; + 'if-none-match'?: string | undefined; + 'if-unmodified-since'?: string | undefined; + 'last-modified'?: string | undefined; + location?: string | undefined; + origin?: string | undefined; + pragma?: string | undefined; + 'proxy-authenticate'?: string | undefined; + 'proxy-authorization'?: string | undefined; + 'public-key-pins'?: string | undefined; + range?: string | undefined; + referer?: string | undefined; + 'retry-after'?: string | undefined; + 'sec-websocket-accept'?: string | undefined; + 'sec-websocket-extensions'?: string | undefined; + 'sec-websocket-key'?: string | undefined; + 'sec-websocket-protocol'?: string | undefined; + 'sec-websocket-version'?: string | undefined; + 'set-cookie'?: string[] | undefined; + 'strict-transport-security'?: string | undefined; + tk?: string | undefined; + trailer?: string | undefined; + 'transfer-encoding'?: string | undefined; + upgrade?: string | undefined; + 'user-agent'?: string | undefined; + vary?: string | undefined; + via?: string | undefined; + warning?: string | undefined; + 'www-authenticate'?: string | undefined; + } + // outgoing headers allows numbers (as they are converted internally to strings) + type OutgoingHttpHeader = number | string | string[]; + interface OutgoingHttpHeaders extends NodeJS.Dict {} + interface ClientRequestArgs { + _defaultAgent?: Agent | undefined; + agent?: Agent | boolean | undefined; + auth?: string | null | undefined; + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 + createConnection?: + | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) + | undefined; + defaultPort?: number | string | undefined; + family?: number | undefined; + headers?: OutgoingHttpHeaders | undefined; + hints?: LookupOptions['hints']; + host?: string | null | undefined; + hostname?: string | null | undefined; + insecureHTTPParser?: boolean | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + lookup?: LookupFunction | undefined; + /** + * @default 16384 + */ + maxHeaderSize?: number | undefined; + method?: string | undefined; + path?: string | null | undefined; + port?: number | string | null | undefined; + protocol?: string | null | undefined; + setHost?: boolean | undefined; + signal?: AbortSignal | undefined; + socketPath?: string | undefined; + timeout?: number | undefined; + uniqueHeaders?: Array | undefined; + } + interface ServerOptions< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > { + /** + * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. + */ + IncomingMessage?: Request | undefined; + /** + * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. + */ + ServerResponse?: Response | undefined; + /** + * Sets the timeout value in milliseconds for receiving the entire request from the client. + * @see Server.requestTimeout for more information. + * @default 300000 + * @since v18.0.0 + */ + requestTimeout?: number | undefined; + /** + * The number of milliseconds of inactivity a server needs to wait for additional incoming data, + * after it has finished writing the last response, before a socket will be destroyed. + * @see Server.keepAliveTimeout for more information. + * @default 5000 + * @since v18.0.0 + */ + keepAliveTimeout?: number | undefined; + /** + * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. + * @default 30000 + */ + connectionsCheckingInterval?: number | undefined; + /** + * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. + * Using the insecure parser should be avoided. + * See --insecure-http-parser for more information. + * @default false + */ + insecureHTTPParser?: boolean | undefined; + /** + * Optionally overrides the value of + * `--max-http-header-size` for requests received by this server, i.e. + * the maximum length of request headers in bytes. + * @default 16384 + * @since v13.3.0 + */ + maxHeaderSize?: number | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default true + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + /** + * A list of response headers that should be sent only once. + * If the header's value is an array, the items will be joined using `; `. + */ + uniqueHeaders?: Array | undefined; + } + type RequestListener< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; + /** + * @since v0.1.17 + */ + class Server< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > extends NetServer { + constructor(requestListener?: RequestListener); + constructor(options: ServerOptions, requestListener?: RequestListener); + /** + * Sets the timeout value for sockets, and emits a `'timeout'` event on + * the Server object, passing the socket as an argument, if a timeout + * occurs. + * + * If there is a `'timeout'` event listener on the Server object, then it + * will be called with the timed-out socket as an argument. + * + * By default, the Server does not timeout sockets. However, if a callback + * is assigned to the Server's `'timeout'` event, timeouts must be handled + * explicitly. + * @since v0.9.12 + * @param [msecs=0 (no timeout)] + */ + setTimeout(msecs?: number, callback?: () => void): this; + setTimeout(callback: () => void): this; + /** + * Limits maximum incoming headers count. If set to 0, no limit will be applied. + * @since v0.7.0 + */ + maxHeadersCount: number | null; + /** + * The maximum number of requests socket can handle + * before closing keep alive connection. + * + * A value of `0` will disable the limit. + * + * When the limit is reached it will set the `Connection` header value to `close`, + * but will not actually close the connection, subsequent requests sent + * after the limit is reached will get `503 Service Unavailable` as a response. + * @since v16.10.0 + */ + maxRequestsPerSocket: number | null; + /** + * The number of milliseconds of inactivity before a socket is presumed + * to have timed out. + * + * A value of `0` will disable the timeout behavior on incoming connections. + * + * The socket timeout logic is set up on connection, so changing this + * value only affects new connections to the server, not any existing connections. + * @since v0.9.12 + */ + timeout: number; + /** + * Limit the amount of time the parser will wait to receive the complete HTTP + * headers. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v11.3.0, v10.14.0 + */ + headersTimeout: number; + /** + * The number of milliseconds of inactivity a server needs to wait for additional + * incoming data, after it has finished writing the last response, before a socket + * will be destroyed. If the server receives new data before the keep-alive + * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. + * + * A value of `0` will disable the keep-alive timeout behavior on incoming + * connections. + * A value of `0` makes the http server behave similarly to Node.js versions prior + * to 8.0.0, which did not have a keep-alive timeout. + * + * The socket timeout logic is set up on connection, so changing this value only + * affects new connections to the server, not any existing connections. + * @since v8.0.0 + */ + keepAliveTimeout: number; + /** + * Sets the timeout value in milliseconds for receiving the entire request from + * the client. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v14.11.0 + */ + requestTimeout: number; + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Socket) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'checkContinue', listener: RequestListener): this; + addListener(event: 'checkExpectation', listener: RequestListener): this; + addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + addListener( + event: 'connect', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + addListener(event: 'request', listener: RequestListener): this; + addListener( + event: 'upgrade', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + emit(event: string, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Socket): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit( + event: 'checkContinue', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit( + event: 'checkExpectation', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean; + emit(event: 'connect', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; + emit( + event: 'request', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'upgrade', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Socket) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'checkContinue', listener: RequestListener): this; + on(event: 'checkExpectation', listener: RequestListener): this; + on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + on(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + on(event: 'request', listener: RequestListener): this; + on(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Socket) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'checkContinue', listener: RequestListener): this; + once(event: 'checkExpectation', listener: RequestListener): this; + once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + once( + event: 'connect', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + once(event: 'request', listener: RequestListener): this; + once( + event: 'upgrade', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Socket) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'checkContinue', listener: RequestListener): this; + prependListener(event: 'checkExpectation', listener: RequestListener): this; + prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + prependListener( + event: 'connect', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + prependListener(event: 'request', listener: RequestListener): this; + prependListener( + event: 'upgrade', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'checkContinue', listener: RequestListener): this; + prependOnceListener(event: 'checkExpectation', listener: RequestListener): this; + prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + prependOnceListener( + event: 'connect', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + prependOnceListener(event: 'request', listener: RequestListener): this; + prependOnceListener( + event: 'upgrade', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + } + /** + * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract of outgoing message from + * the perspective of the participants of HTTP transaction. + * @since v0.1.17 + */ + class OutgoingMessage extends stream.Writable { + readonly req: Request; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + /** + * @deprecated Use `writableEnded` instead. + */ + finished: boolean; + /** + * Read-only. `true` if the headers were sent, otherwise `false`. + * @since v0.9.3 + */ + readonly headersSent: boolean; + /** + * Aliases of `outgoingMessage.socket` + * @since v0.3.0 + * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. + */ + readonly connection: Socket | null; + /** + * Reference to the underlying socket. Usually, users will not want to access + * this property. + * + * After calling `outgoingMessage.end()`, this property will be nulled. + * @since v0.3.0 + */ + readonly socket: Socket | null; + constructor(); + /** + * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. + * @since v0.9.12 + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * Sets a single header value for the header object. + * @since v0.4.0 + * @param name Header name + * @param value Header value + */ + setHeader(name: string, value: number | string | ReadonlyArray): this; + /** + * Gets the value of HTTP header with the given name. If such a name doesn't + * exist in message, it will be `undefined`. + * @since v0.4.0 + * @param name Name of header + */ + getHeader(name: string): number | string | string[] | undefined; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow + * copy is used, array values may be mutated without additional calls to + * various header-related HTTP module methods. The keys of the returned + * object are the header names and the values are the respective header + * values. All header names are lowercase. + * + * The object returned by the `outgoingMessage.getHeaders()` method does + * not prototypically inherit from the JavaScript Object. This means that + * typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`, + * and others are not defined and will not work. + * + * ```js + * outgoingMessage.setHeader('Foo', 'bar'); + * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = outgoingMessage.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v7.7.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns an array of names of headers of the outgoing outgoingMessage. All + * names are lowercase. + * @since v7.7.0 + */ + getHeaderNames(): string[]; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name is case-insensitive. + * + * ```js + * const hasContentType = outgoingMessage.hasHeader('content-type'); + * ``` + * @since v7.7.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that is queued for implicit sending. + * + * ```js + * outgoingMessage.removeHeader('Content-Encoding'); + * ``` + * @since v0.4.0 + * @param name Header name + */ + removeHeader(name: string): void; + /** + * Adds HTTP trailers (headers but at the end of the message) to the message. + * + * Trailers are **only** be emitted if the message is chunked encoded. If not, + * the trailer will be silently discarded. + * + * HTTP requires the `Trailer` header to be sent to emit trailers, + * with a list of header fields in its value, e.g. + * + * ```js + * message.writeHead(200, { 'Content-Type': 'text/plain', + * 'Trailer': 'Content-MD5' }); + * message.write(fileData); + * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); + * message.end(); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v0.3.0 + */ + addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; + /** + * Compulsorily flushes the message headers + * + * For efficiency reason, Node.js normally buffers the message headers + * until `outgoingMessage.end()` is called or the first chunk of message data + * is written. It then tries to pack the headers and data into a single TCP + * packet. + * + * It is usually desired (it saves a TCP round-trip), but not when the first + * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the request. + * @since v1.6.0 + */ + flushHeaders(): void; + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v0.1.17 + */ + class ServerResponse extends OutgoingMessage { + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v0.4.0 + */ + statusCode: number; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status message that will be sent to the client when + * the headers get flushed. If this is left as `undefined` then the standard + * message for the status code will be used. + * + * ```js + * response.statusMessage = 'Not found'; + * ``` + * + * After response header was sent to the client, this property indicates the + * status message which was sent out. + * @since v0.11.8 + */ + statusMessage: string; + constructor(req: Request); + assignSocket(socket: Socket): void; + detachSocket(socket: Socket): void; + /** + * Sends an HTTP/1.1 100 Continue message to the client, indicating that + * the request body should be sent. See the `'checkContinue'` event on`Server`. + * @since v0.3.0 + */ + writeContinue(callback?: () => void): void; + /** + * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. The optional `callback` argument will be called when + * the response message has been written. + * + * Example: + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * 'x-trace-id': 'id for diagnostics' + * }); + * + * const earlyHintsCallback = () => console.log('early hints message sent'); + * response.writeEarlyHints({ + * 'link': earlyHintsLinks + * }, earlyHintsCallback); + * ``` + * + * @since v18.11.0 + * @param hints An object containing the values of headers + * @param callback Will be called when the response message has been written + */ + writeEarlyHints(hints: Record, callback?: () => void): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * Optionally one can give a human-readable `statusMessage` as the second + * argument. + * + * `headers` may be an `Array` where the keys and values are in the same list. + * It is _not_ a list of tuples. So, the even-numbered offsets are key values, + * and the odd-numbered offsets are the associated values. The array is in the same + * format as `request.rawHeaders`. + * + * Returns a reference to the `ServerResponse`, so that calls can be chained. + * + * ```js + * const body = 'hello world'; + * response + * .writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain' + * }) + * .end(body); + * ``` + * + * This method must only be called once on a message and it must + * be called before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * If this method is called and `response.setHeader()` has not been called, + * it will directly write the supplied header values onto the network channel + * without caching internally, and the `response.getHeader()` on the header + * will not yield the expected result. If progressive population of headers is + * desired with potential future retrieval and modification, use `response.setHeader()` instead. + * + * ```js + * // Returns content-type = text/plain + * const server = http.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain' }); + * res.end('ok'); + * }); + * ``` + * + * `Content-Length` is given in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js + * does not check whether `Content-Length` and the length of the body which has + * been transmitted are equal or not. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v0.1.30 + */ + writeHead( + statusCode: number, + statusMessage?: string, + headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], + ): this; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; + /** + * Sends an HTTP/1.1 102 Processing message to the client, indicating that + * the request body should be sent. + * @since v10.0.0 + */ + writeProcessing(): void; + } + interface InformationEvent { + statusCode: number; + statusMessage: string; + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + } + /** + * This object is created internally and returned from {@link request}. It + * represents an _in-progress_ request whose header has already been queued. The + * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will + * be sent along with the first data chunk or when calling `request.end()`. + * + * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response + * headers have been received. The `'response'` event is executed with one + * argument which is an instance of {@link IncomingMessage}. + * + * During the `'response'` event, one can add listeners to the + * response object; particularly to listen for the `'data'` event. + * + * If no `'response'` handler is added, then the response will be + * entirely discarded. However, if a `'response'` event handler is added, + * then the data from the response object **must** be consumed, either by + * calling `response.read()` whenever there is a `'readable'` event, or + * by adding a `'data'` handler, or by calling the `.resume()` method. + * Until the data is consumed, the `'end'` event will not fire. Also, until + * the data is read it will consume memory that can eventually lead to a + * 'process out of memory' error. + * + * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. + * + * Node.js does not check whether Content-Length and the length of the + * body which has been transmitted are equal or not. + * @since v0.1.17 + */ + class ClientRequest extends OutgoingMessage { + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v0.11.14 + * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. + */ + aborted: boolean; + /** + * The request host. + * @since v14.5.0, v12.19.0 + */ + host: string; + /** + * The request protocol. + * @since v14.5.0, v12.19.0 + */ + protocol: string; + /** + * When sending request through a keep-alive enabled agent, the underlying socket + * might be reused. But if server closes connection at unfortunate time, client + * may run into a 'ECONNRESET' error. + * + * ```js + * const http = require('http'); + * + * // Server has a 5 seconds keep-alive timeout by default + * http + * .createServer((req, res) => { + * res.write('hello\n'); + * res.end(); + * }) + * .listen(3000); + * + * setInterval(() => { + * // Adapting a keep-alive agent + * http.get('http://localhost:3000', { agent }, (res) => { + * res.on('data', (data) => { + * // Do nothing + * }); + * }); + * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout + * ``` + * + * By marking a request whether it reused socket or not, we can do + * automatic error retry base on it. + * + * ```js + * const http = require('http'); + * const agent = new http.Agent({ keepAlive: true }); + * + * function retriableRequest() { + * const req = http + * .get('http://localhost:3000', { agent }, (res) => { + * // ... + * }) + * .on('error', (err) => { + * // Check if retry is needed + * if (req.reusedSocket && err.code === 'ECONNRESET') { + * retriableRequest(); + * } + * }); + * } + * + * retriableRequest(); + * ``` + * @since v13.0.0, v12.16.0 + */ + reusedSocket: boolean; + /** + * Limits maximum response headers count. If set to 0, no limit will be applied. + */ + maxHeadersCount: number; + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + /** + * The request method. + * @since v0.1.97 + */ + method: string; + /** + * The request path. + * @since v0.4.0 + */ + path: string; + /** + * Marks the request as aborting. Calling this will cause remaining data + * in the response to be dropped and the socket to be destroyed. + * @since v0.3.8 + * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. + */ + abort(): void; + onSocket(socket: Socket): void; + /** + * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. + * @since v0.5.9 + * @param timeout Milliseconds before a request times out. + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. + * @since v0.5.9 + */ + setNoDelay(noDelay?: boolean): void; + /** + * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. + * @since v0.5.9 + */ + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + /** + * Returns an array containing the unique names of the current outgoing raw + * headers. Header names are returned with their exact casing being set. + * + * ```js + * request.setHeader('Foo', 'bar'); + * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = request.getRawHeaderNames(); + * // headerNames === ['Foo', 'Set-Cookie'] + * ``` + * @since v15.13.0, v14.17.0 + */ + getRawHeaderNames(): string[]; + /** + * @deprecated + */ + addListener(event: 'abort', listener: () => void): this; + addListener( + event: 'connect', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + addListener(event: 'continue', listener: () => void): this; + addListener(event: 'information', listener: (info: InformationEvent) => void): this; + addListener(event: 'response', listener: (response: IncomingMessage) => void): this; + addListener(event: 'socket', listener: (socket: Socket) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener( + event: 'upgrade', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + on(event: 'abort', listener: () => void): this; + on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'continue', listener: () => void): this; + on(event: 'information', listener: (info: InformationEvent) => void): this; + on(event: 'response', listener: (response: IncomingMessage) => void): this; + on(event: 'socket', listener: (socket: Socket) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + once(event: 'abort', listener: () => void): this; + once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'continue', listener: () => void): this; + once(event: 'information', listener: (info: InformationEvent) => void): this; + once(event: 'response', listener: (response: IncomingMessage) => void): this; + once(event: 'socket', listener: (socket: Socket) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + prependListener(event: 'abort', listener: () => void): this; + prependListener( + event: 'connect', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + prependListener(event: 'continue', listener: () => void): this; + prependListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependListener(event: 'socket', listener: (socket: Socket) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener( + event: 'upgrade', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + prependOnceListener(event: 'abort', listener: () => void): this; + prependOnceListener( + event: 'connect', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + prependOnceListener(event: 'continue', listener: () => void): this; + prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener( + event: 'upgrade', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to + * access response + * status, headers and data. + * + * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to + * parse and emit the incoming HTTP headers and payload, as the underlying socket + * may be reused multiple times in case of keep-alive. + * @since v0.1.17 + */ + class IncomingMessage extends stream.Readable { + constructor(socket: Socket); + /** + * The `message.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. + */ + aborted: boolean; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. + * Probably either `'1.1'` or `'1.0'`. + * + * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * @since v0.1.1 + */ + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + /** + * The `message.complete` property will be `true` if a complete HTTP message has + * been received and successfully parsed. + * + * This property is particularly useful as a means of determining if a client or + * server fully transmitted a message before a connection was terminated: + * + * ```js + * const req = http.request({ + * host: '127.0.0.1', + * port: 8080, + * method: 'POST' + * }, (res) => { + * res.resume(); + * res.on('end', () => { + * if (!res.complete) + * console.error( + * 'The connection was terminated while the message was still being sent'); + * }); + * }); + * ``` + * @since v0.3.0 + */ + complete: boolean; + /** + * Alias for `message.socket`. + * @since v0.1.90 + * @deprecated Since v16.0.0 - Use `socket`. + */ + connection: Socket; + /** + * The `net.Socket` object associated with the connection. + * + * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the + * client's authentication details. + * + * This property is guaranteed to be an instance of the `net.Socket` class, + * a subclass of `stream.Duplex`, unless the user specified a socket + * type other than `net.Socket` or internally nulled. + * @since v0.3.0 + */ + socket: Socket; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.getHeaders()); + * ``` + * + * Duplicates in raw headers are handled in the following ways, depending on the + * header name: + * + * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, + * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. + * * `set-cookie` is always an array. Duplicates are added to the array. + * * For duplicate `cookie` headers, the values are joined together with '; '. + * * For all other headers, the values are joined together with ', '. + * @since v0.1.5 + */ + headers: IncomingHttpHeaders; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v0.11.6 + */ + rawHeaders: string[]; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v0.3.0 + */ + trailers: NodeJS.Dict; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v0.11.6 + */ + rawTrailers: string[]; + /** + * Calls `message.socket.setTimeout(msecs, callback)`. + * @since v0.5.9 + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * **Only valid for request obtained from {@link Server}.** + * + * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. + * @since v0.1.1 + */ + method?: string | undefined; + /** + * **Only valid for request obtained from {@link Server}.** + * + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. Take the following request: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * To parse the URL into its parts: + * + * ```js + * new URL(request.url, `http://${request.getHeaders().host}`); + * ``` + * + * When `request.url` is `'/status?name=ryan'` and`request.getHeaders().host` is `'localhost:3000'`: + * + * ```console + * $ node + * > new URL(request.url, `http://${request.getHeaders().host}`) + * URL { + * href: 'http://localhost:3000/status?name=ryan', + * origin: 'http://localhost:3000', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'localhost:3000', + * hostname: 'localhost', + * port: '3000', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * @since v0.1.90 + */ + url?: string | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The 3-digit HTTP response status code. E.G. `404`. + * @since v0.1.1 + */ + statusCode?: number | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. + * @since v0.11.10 + */ + statusMessage?: string | undefined; + /** + * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed + * as an argument to any listeners on the event. + * @since v0.3.0 + */ + destroy(error?: Error): this; + } + interface AgentOptions extends Partial { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean | undefined; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number | undefined; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number | undefined; + /** + * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. + */ + maxTotalSockets?: number | undefined; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number | undefined; + /** + * Socket timeout in milliseconds. This will set the timeout after the socket is connected. + */ + timeout?: number | undefined; + /** + * Scheduling strategy to apply when picking the next free socket to use. + * @default `lifo` + */ + scheduling?: 'fifo' | 'lifo' | undefined; + } + /** + * An `Agent` is responsible for managing connection persistence + * and reuse for HTTP clients. It maintains a queue of pending requests + * for a given host and port, reusing a single socket connection for each + * until the queue is empty, at which time the socket is either destroyed + * or put into a pool where it is kept to be used again for requests to the + * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. + * + * Pooled connections have TCP Keep-Alive enabled for them, but servers may + * still close idle connections, in which case they will be removed from the + * pool and a new connection will be made when a new HTTP request is made for + * that host and port. Servers may also refuse to allow multiple requests + * over the same connection, in which case the connection will have to be + * remade for every request and cannot be pooled. The `Agent` will still make + * the requests to that server, but each one will occur over a new connection. + * + * When a connection is closed by the client or the server, it is removed + * from the pool. Any unused sockets in the pool will be unrefed so as not + * to keep the Node.js process running when there are no outstanding requests. + * (see `socket.unref()`). + * + * It is good practice, to `destroy()` an `Agent` instance when it is no + * longer in use, because unused sockets consume OS resources. + * + * Sockets are removed from an agent when the socket emits either + * a `'close'` event or an `'agentRemove'` event. When intending to keep one + * HTTP request open for a long time without keeping it in the agent, something + * like the following may be done: + * + * ```js + * http.get(options, (res) => { + * // Do stuff + * }).on('socket', (socket) => { + * socket.emit('agentRemove'); + * }); + * ``` + * + * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options + * will be used + * for the client connection. + * + * `agent:false`: + * + * ```js + * http.get({ + * hostname: 'localhost', + * port: 80, + * path: '/', + * agent: false // Create a new agent just for this one request + * }, (res) => { + * // Do stuff with response + * }); + * ``` + * @since v0.3.4 + */ + class Agent { + /** + * By default set to 256\. For agents with `keepAlive` enabled, this + * sets the maximum number of sockets that will be left open in the free + * state. + * @since v0.11.7 + */ + maxFreeSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open per origin. Origin is the returned value of `agent.getName()`. + * @since v0.3.6 + */ + maxSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open. Unlike `maxSockets`, this parameter applies across all origins. + * @since v14.5.0, v12.19.0 + */ + maxTotalSockets: number; + /** + * An object which contains arrays of sockets currently awaiting use by + * the agent when `keepAlive` is enabled. Do not modify. + * + * Sockets in the `freeSockets` list will be automatically destroyed and + * removed from the array on `'timeout'`. + * @since v0.11.4 + */ + readonly freeSockets: NodeJS.ReadOnlyDict; + /** + * An object which contains arrays of sockets currently in use by the + * agent. Do not modify. + * @since v0.3.6 + */ + readonly sockets: NodeJS.ReadOnlyDict; + /** + * An object which contains queues of requests that have not yet been assigned to + * sockets. Do not modify. + * @since v0.5.9 + */ + readonly requests: NodeJS.ReadOnlyDict; + constructor(opts?: AgentOptions); + /** + * Destroy any sockets that are currently in use by the agent. + * + * It is usually not necessary to do this. However, if using an + * agent with `keepAlive` enabled, then it is best to explicitly shut down + * the agent when it is no longer needed. Otherwise, + * sockets might stay open for quite a long time before the server + * terminates them. + * @since v0.11.4 + */ + destroy(): void; + } + const METHODS: string[]; + const STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + /** + * Returns a new instance of {@link Server}. + * + * The `requestListener` is a function which is automatically + * added to the `'request'` event. + * @since v0.1.13 + */ + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + >(requestListener?: RequestListener): Server; + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + >( + options: ServerOptions, + requestListener?: RequestListener, + ): Server; + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + interface RequestOptions extends ClientRequestArgs {} + /** + * `options` in `socket.connect()` are also supported. + * + * Node.js maintains several connections per server to make HTTP requests. + * This function allows one to transparently issue requests. + * + * `url` can be a string or a `URL` object. If `url` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. + * + * The optional `callback` parameter will be added as a one-time listener for + * the `'response'` event. + * + * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * const http = require('http'); + * + * const postData = JSON.stringify({ + * 'msg': 'Hello World!' + * }); + * + * const options = { + * hostname: 'www.google.com', + * port: 80, + * path: '/upload', + * method: 'POST', + * headers: { + * 'Content-Type': 'application/json', + * 'Content-Length': Buffer.byteLength(postData) + * } + * }; + * + * const req = http.request(options, (res) => { + * console.log(`STATUS: ${res.statusCode}`); + * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); + * res.setEncoding('utf8'); + * res.on('data', (chunk) => { + * console.log(`BODY: ${chunk}`); + * }); + * res.on('end', () => { + * console.log('No more data in response.'); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(`problem with request: ${e.message}`); + * }); + * + * // Write data to request body + * req.write(postData); + * req.end(); + * ``` + * + * In the example `req.end()` was called. With `http.request()` one + * must always call `req.end()` to signify the end of the request - + * even if there is no data being written to the request body. + * + * If any error is encountered during the request (be that with DNS resolution, + * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted + * on the returned request object. As with all `'error'` events, if no listeners + * are registered the error will be thrown. + * + * There are a few special headers that should be noted. + * + * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to + * the server should be persisted until the next request. + * * Sending a 'Content-Length' header will disable the default chunked encoding. + * * Sending an 'Expect' header will immediately send the request headers. + * Usually, when sending 'Expect: 100-continue', both a timeout and a listener + * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more + * information. + * * Sending an Authorization header will override using the `auth` option + * to compute basic authentication. + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('http://abc:xyz@example.com'); + * + * const req = http.request(options, (res) => { + * // ... + * }); + * ``` + * + * In a successful request, the following events will be emitted in the following + * order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * (`'data'` will not be emitted at all if the response body is empty, for + * instance, in most redirects) + * * `'end'` on the `res` object + * * `'close'` + * + * In the case of a connection error, the following events will be emitted: + * + * * `'socket'` + * * `'error'` + * * `'close'` + * + * In the case of a premature connection close before the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * In the case of a premature connection close after the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (connection closed here) + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. + * * `'close'` + * * `'close'` on the `res` object + * + * If `req.destroy()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * If `req.destroy()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * If `req.destroy()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.destroy()` called here) + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. + * * `'close'` + * * `'close'` on the `res` object + * + * If `req.abort()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.abort()` called here) + * * `'abort'` + * * `'close'` + * + * If `req.abort()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.abort()` called here) + * * `'abort'` + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * If `req.abort()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.abort()` called here) + * * `'abort'` + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. + * * `'close'` + * * `'close'` on the `res` object + * + * Setting the `timeout` option or using the `setTimeout()` function will + * not abort the request or do anything besides add a `'timeout'` event. + * + * Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the + * request itself. + * @since v0.3.6 + */ + function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function request( + url: string | URL, + options: RequestOptions, + callback?: (res: IncomingMessage) => void, + ): ClientRequest; + /** + * Since most requests are GET requests without bodies, Node.js provides this + * convenience method. The only difference between this method and {@link request} is that it sets the method to GET and calls `req.end()`automatically. The callback must take care to consume the + * response + * data for reasons stated in {@link ClientRequest} section. + * + * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. + * + * JSON fetching example: + * + * ```js + * http.get('http://localhost:8000/', (res) => { + * const { statusCode } = res; + * const contentType = res.headers['content-type']; + * + * let error; + * // Any 2xx status code signals a successful response but + * // here we're only checking for 200. + * if (statusCode !== 200) { + * error = new Error('Request Failed.\n' + + * `Status Code: ${statusCode}`); + * } else if (!/^application\/json/.test(contentType)) { + * error = new Error('Invalid content-type.\n' + + * `Expected application/json but received ${contentType}`); + * } + * if (error) { + * console.error(error.message); + * // Consume response data to free up memory + * res.resume(); + * return; + * } + * + * res.setEncoding('utf8'); + * let rawData = ''; + * res.on('data', (chunk) => { rawData += chunk; }); + * res.on('end', () => { + * try { + * const parsedData = JSON.parse(rawData); + * console.log(parsedData); + * } catch (e) { + * console.error(e.message); + * } + * }); + * }).on('error', (e) => { + * console.error(`Got error: ${e.message}`); + * }); + * + * // Create a local server to receive data from + * const server = http.createServer((req, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!' + * })); + * }); + * + * server.listen(8000); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored. + */ + function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + + /** + * Performs the low-level validations on the provided name that are done when `res.setHeader(name, value)` is called. + * Passing illegal value as name will result in a TypeError being thrown, identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. + * @param name Header name + * @since v14.3.0 + */ + function validateHeaderName(name: string): void; + /** + * Performs the low-level validations on the provided value that are done when `res.setHeader(name, value)` is called. + * Passing illegal value as value will result in a TypeError being thrown. + * - Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. + * - Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. + * @param name Header name + * @param value Header value + * @since v14.3.0 + */ + function validateHeaderValue(name: string, value: string): void; + + /** + * Set the maximum number of idle HTTP parsers. Default: 1000. + * @param count + * @since v18.8.0, v16.18.0 + */ + function setMaxIdleHTTPParsers(count: number): void; + + let globalAgent: Agent; + /** + * Read-only property specifying the maximum allowed size of HTTP headers in bytes. + * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. + */ + const maxHeaderSize: number; +} +declare module 'node:http' { + export * from 'http'; +} diff --git a/server/node_modules/@types/node/http2.d.ts b/server/node_modules/@types/node/http2.d.ts new file mode 100755 index 0000000000..0e3682609f --- /dev/null +++ b/server/node_modules/@types/node/http2.d.ts @@ -0,0 +1,2134 @@ +/** + * The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. It + * can be accessed using: + * + * ```js + * const http2 = require('http2'); + * ``` + * @since v8.4.0 + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http2.js) + */ +declare module 'http2' { + import EventEmitter = require('node:events'); + import * as fs from 'node:fs'; + import * as net from 'node:net'; + import * as stream from 'node:stream'; + import * as tls from 'node:tls'; + import * as url from 'node:url'; + import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http'; + export { OutgoingHttpHeaders } from 'node:http'; + export interface IncomingHttpStatusHeader { + ':status'?: number | undefined; + } + export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { + ':path'?: string | undefined; + ':method'?: string | undefined; + ':authority'?: string | undefined; + ':scheme'?: string | undefined; + } + // Http2Stream + export interface StreamPriorityOptions { + exclusive?: boolean | undefined; + parent?: number | undefined; + weight?: number | undefined; + silent?: boolean | undefined; + } + export interface StreamState { + localWindowSize?: number | undefined; + state?: number | undefined; + localClose?: number | undefined; + remoteClose?: number | undefined; + sumDependencyWeight?: number | undefined; + weight?: number | undefined; + } + export interface ServerStreamResponseOptions { + endStream?: boolean | undefined; + waitForTrailers?: boolean | undefined; + } + export interface StatOptions { + offset: number; + length: number; + } + export interface ServerStreamFileResponseOptions { + statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; + waitForTrailers?: boolean | undefined; + offset?: number | undefined; + length?: number | undefined; + } + export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?(err: NodeJS.ErrnoException): void; + } + export interface Http2Stream extends stream.Duplex { + /** + * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, + * the `'aborted'` event will have been emitted. + * @since v8.4.0 + */ + readonly aborted: boolean; + /** + * This property shows the number of characters currently buffered to be written. + * See `net.Socket.bufferSize` for details. + * @since v11.2.0, v10.16.0 + */ + readonly bufferSize: number; + /** + * Set to `true` if the `Http2Stream` instance has been closed. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer + * usable. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Set to `true` if the `END_STREAM` flag was set in the request or response + * HEADERS frame received, indicating that no additional data should be received + * and the readable side of the `Http2Stream` will be closed. + * @since v10.11.0 + */ + readonly endAfterHeaders: boolean; + /** + * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. + * @since v8.4.0 + */ + readonly id?: number | undefined; + /** + * Set to `true` if the `Http2Stream` instance has not yet been assigned a + * numeric stream identifier. + * @since v9.4.0 + */ + readonly pending: boolean; + /** + * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is + * destroyed after either receiving an `RST_STREAM` frame from the connected peer, + * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. + * @since v8.4.0 + */ + readonly rstCode: number; + /** + * An object containing the outbound headers sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentHeaders: OutgoingHttpHeaders; + /** + * An array of objects containing the outbound informational (additional) headers + * sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; + /** + * An object containing the outbound trailers sent for this `HttpStream`. + * @since v9.5.0 + */ + readonly sentTrailers?: OutgoingHttpHeaders | undefined; + /** + * A reference to the `Http2Session` instance that owns this `Http2Stream`. The + * value will be `undefined` after the `Http2Stream` instance is destroyed. + * @since v8.4.0 + */ + readonly session: Http2Session; + /** + * Provides miscellaneous information about the current state of the`Http2Stream`. + * + * A current state of this `Http2Stream`. + * @since v8.4.0 + */ + readonly state: StreamState; + /** + * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the + * connected HTTP/2 peer. + * @since v8.4.0 + * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. + * @param callback An optional function registered to listen for the `'close'` event. + */ + close(code?: number, callback?: () => void): void; + /** + * Updates the priority for this `Http2Stream` instance. + * @since v8.4.0 + */ + priority(options: StreamPriorityOptions): void; + /** + * ```js + * const http2 = require('http2'); + * const client = http2.connect('http://example.org:8000'); + * const { NGHTTP2_CANCEL } = http2.constants; + * const req = client.request({ ':path': '/' }); + * + * // Cancel the stream if there's no activity after 5 seconds + * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); + * ``` + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method + * will cause the `Http2Stream` to be immediately closed and must only be + * called after the `'wantTrailers'` event has been emitted. When sending a + * request or sending a response, the `options.waitForTrailers` option must be set + * in order to keep the `Http2Stream` open after the final `DATA` frame so that + * trailers can be sent. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond(undefined, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ xyz: 'abc' }); + * }); + * stream.end('Hello World'); + * }); + * ``` + * + * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header + * fields (e.g. `':method'`, `':path'`, etc). + * @since v10.0.0 + */ + sendTrailers(headers: OutgoingHttpHeaders): void; + addListener(event: 'aborted', listener: () => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'streamClosed', listener: (code: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'wantTrailers', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'aborted'): boolean; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: Buffer | string): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'frameError', frameType: number, errorCode: number): boolean; + emit(event: 'pipe', src: stream.Readable): boolean; + emit(event: 'unpipe', src: stream.Readable): boolean; + emit(event: 'streamClosed', code: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: 'trailers', trailers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'wantTrailers'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'aborted', listener: () => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: 'streamClosed', listener: (code: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'wantTrailers', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'aborted', listener: () => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: 'streamClosed', listener: (code: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'wantTrailers', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'aborted', listener: () => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'streamClosed', listener: (code: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'wantTrailers', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'aborted', listener: () => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'streamClosed', listener: (code: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'wantTrailers', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ClientHttp2Stream extends Http2Stream { + addListener(event: 'continue', listener: () => {}): this; + addListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'continue'): boolean; + emit(event: 'headers', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: 'push', headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'response', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'continue', listener: () => {}): this; + on(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'continue', listener: () => {}): this; + once(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'continue', listener: () => {}): this; + prependListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'continue', listener: () => {}): this; + prependOnceListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ServerHttp2Stream extends Http2Stream { + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote + * client's most recent `SETTINGS` frame. Will be `true` if the remote peer + * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. + * @since v8.4.0 + */ + readonly pushAllowed: boolean; + /** + * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. + * @since v8.4.0 + */ + additionalHeaders(headers: OutgoingHttpHeaders): void; + /** + * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { + * if (err) throw err; + * pushStream.respond({ ':status': 200 }); + * pushStream.end('some pushed data'); + * }); + * stream.end('some data'); + * }); + * ``` + * + * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass + * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. + * + * Calling `http2stream.pushStream()` from within a pushed stream is not permitted + * and will throw an error. + * @since v8.4.0 + * @param callback Callback that is called once the push stream has been initiated. + */ + pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + /** + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.end('some data'); + * }); + * ``` + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * stream.end('some data'); + * }); + * ``` + * @since v8.4.0 + */ + respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; + /** + * Initiates a response whose data is read from the given file descriptor. No + * validation is performed on the given file descriptor. If an error occurs while + * attempting to read data using the file descriptor, the `Http2Stream` will be + * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * ```js + * const http2 = require('http2'); + * const fs = require('fs'); + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8' + * }; + * stream.respondWithFD(fd, headers); + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to + * collect details on the provided file descriptor. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The file descriptor or `FileHandle` is not closed when the stream is closed, + * so it will need to be closed manually once it is no longer needed. + * Using the same file descriptor concurrently for multiple streams + * is not supported and may result in data loss. Re-using a file descriptor + * after a stream has finished is supported. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('http2'); + * const fs = require('fs'); + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8' + * }; + * stream.respondWithFD(fd, headers, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * @since v8.4.0 + * @param fd A readable file descriptor. + */ + respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; + /** + * Sends a regular file as the response. The `path` must specify a regular file + * or an `'error'` event will be emitted on the `Http2Stream` object. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given file: + * + * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is + * defined, then it will be called. Otherwise + * the stream will be destroyed. + * + * Example using a file path: + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * headers['last-modified'] = stat.mtime.toUTCString(); + * } + * + * function onError(err) { + * // stream.respond() can throw if the stream has been destroyed by + * // the other side. + * try { + * if (err.code === 'ENOENT') { + * stream.respond({ ':status': 404 }); + * } else { + * stream.respond({ ':status': 500 }); + * } + * } catch (err) { + * // Perform actual error handling. + * console.log(err); + * } + * stream.end(); + * } + * + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck, onError }); + * }); + * ``` + * + * The `options.statCheck` function may also be used to cancel the send operation + * by returning `false`. For instance, a conditional request may check the stat + * results to determine if the file has been modified to return an appropriate`304` response: + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * // Check the stat here... + * stream.respond({ ':status': 304 }); + * return false; // Cancel the send operation + * } + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck }); + * }); + * ``` + * + * The `content-length` header field will be automatically set. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The `options.onError` function may also be used to handle all the errors + * that could happen before the delivery of the file is initiated. The + * default behavior is to destroy the stream. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * }); + * ``` + * @since v8.4.0 + */ + respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; + } + // Http2Session + export interface Settings { + headerTableSize?: number | undefined; + enablePush?: boolean | undefined; + initialWindowSize?: number | undefined; + maxFrameSize?: number | undefined; + maxConcurrentStreams?: number | undefined; + maxHeaderListSize?: number | undefined; + enableConnectProtocol?: boolean | undefined; + } + export interface ClientSessionRequestOptions { + endStream?: boolean | undefined; + exclusive?: boolean | undefined; + parent?: number | undefined; + weight?: number | undefined; + waitForTrailers?: boolean | undefined; + signal?: AbortSignal | undefined; + } + export interface SessionState { + effectiveLocalWindowSize?: number | undefined; + effectiveRecvDataLength?: number | undefined; + nextStreamID?: number | undefined; + localWindowSize?: number | undefined; + lastProcStreamID?: number | undefined; + remoteWindowSize?: number | undefined; + outboundQueueSize?: number | undefined; + deflateDynamicTableSize?: number | undefined; + inflateDynamicTableSize?: number | undefined; + } + export interface Http2Session extends EventEmitter { + /** + * Value will be `undefined` if the `Http2Session` is not yet connected to a + * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or + * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. + * @since v9.4.0 + */ + readonly alpnProtocol?: string | undefined; + /** + * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Will be `true` if this `Http2Session` instance is still connecting, will be set + * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. + * @since v10.0.0 + */ + readonly connecting: boolean; + /** + * Will be `true` if this `Http2Session` instance has been destroyed and must no + * longer be used, otherwise `false`. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Value is `undefined` if the `Http2Session` session socket has not yet been + * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, + * and `false` if the `Http2Session` is connected to any other kind of socket + * or stream. + * @since v9.4.0 + */ + readonly encrypted?: boolean | undefined; + /** + * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. + * @since v8.4.0 + */ + readonly localSettings: Settings; + /** + * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property + * will return an `Array` of origins for which the `Http2Session` may be + * considered authoritative. + * + * The `originSet` property is only available when using a secure TLS connection. + * @since v9.4.0 + */ + readonly originSet?: string[] | undefined; + /** + * Indicates whether the `Http2Session` is currently waiting for acknowledgment of + * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. + * @since v8.4.0 + */ + readonly pendingSettingsAck: boolean; + /** + * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. + * @since v8.4.0 + */ + readonly remoteSettings: Settings; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * limits available methods to ones safe to use with HTTP/2. + * + * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw + * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. + * + * `setTimeout` method will be called on this `Http2Session`. + * + * All other interactions will be routed directly to the socket. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * Provides miscellaneous information about the current state of the`Http2Session`. + * + * An object describing the current status of this `Http2Session`. + * @since v8.4.0 + */ + readonly state: SessionState; + /** + * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a + * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a + * client. + * @since v8.4.0 + */ + readonly type: number; + /** + * Gracefully closes the `Http2Session`, allowing any existing streams to + * complete on their own and preventing new `Http2Stream` instances from being + * created. Once closed, `http2session.destroy()`_might_ be called if there + * are no open `Http2Stream` instances. + * + * If specified, the `callback` function is registered as a handler for the`'close'` event. + * @since v9.4.0 + */ + close(callback?: () => void): void; + /** + * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. + * + * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. + * + * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. + * @since v8.4.0 + * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. + * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. + */ + destroy(error?: Error, code?: number): void; + /** + * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. + * @since v9.4.0 + * @param code An HTTP/2 error code + * @param lastStreamID The numeric ID of the last processed `Http2Stream` + * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. + */ + goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; + /** + * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must + * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. + * + * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. + * + * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and + * returned with the ping acknowledgment. + * + * The callback will be invoked with three arguments: an error argument that will + * be `null` if the `PING` was successfully acknowledged, a `duration` argument + * that reports the number of milliseconds elapsed since the ping was sent and the + * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. + * + * ```js + * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { + * if (!err) { + * console.log(`Ping acknowledged in ${duration} milliseconds`); + * console.log(`With payload '${payload.toString()}'`); + * } + * }); + * ``` + * + * If the `payload` argument is not specified, the default payload will be the + * 64-bit timestamp (little endian) marking the start of the `PING` duration. + * @since v8.9.3 + * @param payload Optional ping payload. + */ + ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + /** + * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. + * @since v9.4.0 + */ + ref(): void; + /** + * Sets the local endpoint's window size. + * The `windowSize` is the total window size to set, not + * the delta. + * + * ```js + * const http2 = require('http2'); + * + * const server = http2.createServer(); + * const expectedWindowSize = 2 ** 20; + * server.on('connect', (session) => { + * + * // Set local window size to be 2 ** 20 + * session.setLocalWindowSize(expectedWindowSize); + * }); + * ``` + * @since v15.3.0, v14.18.0 + */ + setLocalWindowSize(windowSize: number): void; + /** + * Used to set a callback function that is called when there is no activity on + * the `Http2Session` after `msecs` milliseconds. The given `callback` is + * registered as a listener on the `'timeout'` event. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. + * + * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new + * settings. + * + * The new settings will not become effective until the `SETTINGS` acknowledgment + * is received and the `'localSettings'` event is emitted. It is possible to send + * multiple `SETTINGS` frames while acknowledgment is still pending. + * @since v8.4.0 + * @param callback Callback that is called once the session is connected or right away if the session is already connected. + */ + settings(settings: Settings, callback?: (err: Error | null, settings: Settings, duration: number) => void): void; + /** + * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. + * @since v9.4.0 + */ + unref(): void; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + addListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + addListener(event: 'localSettings', listener: (settings: Settings) => void): this; + addListener(event: 'ping', listener: () => void): this; + addListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'frameError', frameType: number, errorCode: number, streamID: number): boolean; + emit(event: 'goaway', errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; + emit(event: 'localSettings', settings: Settings): boolean; + emit(event: 'ping'): boolean; + emit(event: 'remoteSettings', settings: Settings): boolean; + emit(event: 'timeout'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + on(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + on(event: 'localSettings', listener: (settings: Settings) => void): this; + on(event: 'ping', listener: () => void): this; + on(event: 'remoteSettings', listener: (settings: Settings) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + once(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + once(event: 'localSettings', listener: (settings: Settings) => void): this; + once(event: 'ping', listener: () => void): this; + once(event: 'remoteSettings', listener: (settings: Settings) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependListener(event: 'localSettings', listener: (settings: Settings) => void): this; + prependListener(event: 'ping', listener: () => void): this; + prependListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependOnceListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependOnceListener(event: 'localSettings', listener: (settings: Settings) => void): this; + prependOnceListener(event: 'ping', listener: () => void): this; + prependOnceListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ClientHttp2Session extends Http2Session { + /** + * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an + * HTTP/2 request to the connected server. + * + * When a `ClientHttp2Session` is first created, the socket may not yet be + * connected. if `clienthttp2session.request()` is called during this time, the + * actual request will be deferred until the socket is ready to go. + * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. + * + * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. + * + * ```js + * const http2 = require('http2'); + * const clientSession = http2.connect('https://localhost:1234'); + * const { + * HTTP2_HEADER_PATH, + * HTTP2_HEADER_STATUS + * } = http2.constants; + * + * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); + * req.on('response', (headers) => { + * console.log(headers[HTTP2_HEADER_STATUS]); + * req.on('data', (chunk) => { // .. }); + * req.on('end', () => { // .. }); + * }); + * ``` + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * is emitted immediately after queuing the last chunk of payload data to be sent. + * The `http2stream.sendTrailers()` method can then be called to send trailing + * headers to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * When `options.signal` is set with an `AbortSignal` and then `abort` on the + * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. + * + * The `:method` and `:path` pseudo-headers are not specified within `headers`, + * they respectively default to: + * + * * `:method` \= `'GET'` + * * `:path` \= `/` + * @since v8.4.0 + */ + request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; + addListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + addListener(event: 'origin', listener: (origins: string[]) => void): this; + addListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'altsvc', alt: string, origin: string, stream: number): boolean; + emit(event: 'origin', origins: ReadonlyArray): boolean; + emit(event: 'connect', session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: 'stream', stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + on(event: 'origin', listener: (origins: string[]) => void): this; + on(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + once(event: 'origin', listener: (origins: string[]) => void): this; + once(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + prependListener(event: 'origin', listener: (origins: string[]) => void): this; + prependListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + prependOnceListener(event: 'origin', listener: (origins: string[]) => void): this; + prependOnceListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + export interface ServerHttp2Session extends Http2Session { + readonly server: Http2Server | Http2SecureServer; + /** + * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. + * + * ```js + * const http2 = require('http2'); + * + * const server = http2.createServer(); + * server.on('session', (session) => { + * // Set altsvc for origin https://example.org:80 + * session.altsvc('h2=":8000"', 'https://example.org:80'); + * }); + * + * server.on('stream', (stream) => { + * // Set altsvc for a specific stream + * stream.session.altsvc('h2=":8000"', stream.id); + * }); + * ``` + * + * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate + * service is associated with the origin of the given `Http2Stream`. + * + * The `alt` and origin string _must_ contain only ASCII bytes and are + * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given + * domain. + * + * When a string is passed for the `originOrStream` argument, it will be parsed as + * a URL and the origin will be derived. For instance, the origin for the + * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * @since v9.4.0 + * @param alt A description of the alternative service configuration as defined by `RFC 7838`. + * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the + * `http2stream.id` property. + */ + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + /** + * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client + * to advertise the set of origins for which the server is capable of providing + * authoritative responses. + * + * ```js + * const http2 = require('http2'); + * const options = getSecureOptionsSomehow(); + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * server.on('session', (session) => { + * session.origin('https://example.com', 'https://example.org'); + * }); + * ``` + * + * When a string is passed as an `origin`, it will be parsed as a URL and the + * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given + * string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as + * an `origin`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * + * Alternatively, the `origins` option may be used when creating a new HTTP/2 + * server using the `http2.createSecureServer()` method: + * + * ```js + * const http2 = require('http2'); + * const options = getSecureOptionsSomehow(); + * options.origins = ['https://example.com', 'https://example.org']; + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * ``` + * @since v10.12.0 + * @param origins One or more URL Strings passed as separate arguments. + */ + origin( + ...origins: Array< + | string + | url.URL + | { + origin: string; + } + > + ): void; + addListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'connect', session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + // Http2Server + export interface SessionOptions { + maxDeflateDynamicTableSize?: number | undefined; + maxSessionMemory?: number | undefined; + maxHeaderListPairs?: number | undefined; + maxOutstandingPings?: number | undefined; + maxSendHeaderBlockLength?: number | undefined; + paddingStrategy?: number | undefined; + peerMaxConcurrentStreams?: number | undefined; + settings?: Settings | undefined; + /** + * Specifies a timeout in milliseconds that + * a server should wait when an [`'unknownProtocol'`][] is emitted. If the + * socket has not been destroyed by that time the server will destroy it. + * @default 100000 + */ + unknownProtocolTimeout?: number | undefined; + selectPadding?(frameLen: number, maxFrameLen: number): number; + createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex; + } + export interface ClientSessionOptions extends SessionOptions { + maxReservedRemoteStreams?: number | undefined; + createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; + protocol?: 'http:' | 'https:' | undefined; + } + export interface ServerSessionOptions extends SessionOptions { + Http1IncomingMessage?: typeof IncomingMessage | undefined; + Http1ServerResponse?: typeof ServerResponse | undefined; + Http2ServerRequest?: typeof Http2ServerRequest | undefined; + Http2ServerResponse?: typeof Http2ServerResponse | undefined; + } + export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} + export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} + export interface ServerOptions extends ServerSessionOptions {} + export interface SecureServerOptions extends SecureServerSessionOptions { + allowHTTP1?: boolean | undefined; + origins?: string[] | undefined; + } + interface HTTP2ServerCommon { + setTimeout(msec?: number, callback?: () => void): this; + /** + * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. + * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. + */ + updateSettings(settings: Settings): void; + } + export interface Http2Server extends net.Server, HTTP2ServerCommon { + addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + addListener(event: 'sessionError', listener: (err: Error) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'session', session: ServerHttp2Session): boolean; + emit(event: 'sessionError', err: Error): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'session', listener: (session: ServerHttp2Session) => void): this; + on(event: 'sessionError', listener: (err: Error) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'session', listener: (session: ServerHttp2Session) => void): this; + once(event: 'sessionError', listener: (err: Error) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependListener(event: 'sessionError', listener: (err: Error) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { + addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + addListener(event: 'sessionError', listener: (err: Error) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'session', session: ServerHttp2Session): boolean; + emit(event: 'sessionError', err: Error): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: 'unknownProtocol', socket: tls.TLSSocket): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'session', listener: (session: ServerHttp2Session) => void): this; + on(event: 'sessionError', listener: (err: Error) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'session', listener: (session: ServerHttp2Session) => void): this; + once(event: 'sessionError', listener: (err: Error) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependListener(event: 'sessionError', listener: (err: Error) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, + * headers, and + * data. + * @since v8.4.0 + */ + export class Http2ServerRequest extends stream.Readable { + constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray); + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + */ + readonly aborted: boolean; + /** + * The request authority pseudo header field. Because HTTP/2 allows requests + * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. + * @since v8.4.0 + */ + readonly authority: string; + /** + * See `request.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * The `request.complete` property will be `true` if the request has + * been completed, aborted, or destroyed. + * @since v12.10.0 + */ + readonly complete: boolean; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.headers); + * ``` + * + * See `HTTP/2 Headers Object`. + * + * In HTTP/2, the request path, host name, protocol, and method are represented as + * special headers prefixed with the `:` character (e.g. `':path'`). These special + * headers will be included in the `request.headers` object. Care must be taken not + * to inadvertently modify these special headers or errors may occur. For instance, + * removing all headers from the request will cause errors to occur: + * + * ```js + * removeAllHeaders(request.headers); + * assert(request.url); // Fails because the :path header has been removed + * ``` + * @since v8.4.0 + */ + readonly headers: IncomingHttpHeaders; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. Returns`'2.0'`. + * + * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * @since v8.4.0 + */ + readonly httpVersion: string; + readonly httpVersionMinor: number; + readonly httpVersionMajor: number; + /** + * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. + * @since v8.4.0 + */ + readonly method: string; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v8.4.0 + */ + readonly rawHeaders: string[]; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly rawTrailers: string[]; + /** + * The request scheme pseudo header field indicating the scheme + * portion of the target URL. + * @since v8.4.0 + */ + readonly scheme: string; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `request.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. + * + * `setTimeout` method will be called on `request.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. With TLS support, + * use `request.socket.getPeerCertificate()` to obtain the client's + * authentication details. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the request. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly trailers: IncomingHttpHeaders; + /** + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. If the request is: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * Then `request.url` will be: + * + * ```js + * '/status?name=ryan' + * ``` + * + * To parse the url into its parts, `new URL()` can be used: + * + * ```console + * $ node + * > new URL('/status?name=ryan', 'http://example.com') + * URL { + * href: 'http://example.com/status?name=ryan', + * origin: 'http://example.com', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'example.com', + * hostname: 'example.com', + * port: '', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * @since v8.4.0 + */ + url: string; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream` s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + read(size?: number): Buffer | string | null; + addListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'aborted', hadError: boolean, code: number): boolean; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: Buffer | string): boolean; + emit(event: 'end'): boolean; + emit(event: 'readable'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v8.4.0 + */ + export class Http2ServerResponse extends stream.Writable { + constructor(stream: ServerHttp2Stream); + /** + * See `response.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * Boolean value that indicates whether the response has completed. Starts + * as `false`. After `response.end()` executes, the value will be `true`. + * @since v8.4.0 + * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. + */ + readonly finished: boolean; + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * A reference to the original HTTP2 request object. + * @since v15.7.0 + */ + readonly req: Http2ServerRequest; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `response.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. + * + * `setTimeout` method will be called on `response.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer((req, res) => { + * const ip = req.socket.remoteAddress; + * const port = req.socket.remotePort; + * res.end(`Your IP address is ${ip} and your source port is ${port}.`); + * }).listen(3000); + * ``` + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the response. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * When true, the Date header will be automatically generated and sent in + * the response if it is not already present in the headers. Defaults to true. + * + * This should only be disabled for testing; HTTP requires the Date header + * in responses. + * @since v8.4.0 + */ + sendDate: boolean; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v8.4.0 + */ + statusCode: number; + /** + * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns + * an empty string. + * @since v8.4.0 + */ + statusMessage: ''; + /** + * This method adds HTTP trailing headers (a header but at the end of the + * message) to the response. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + addTrailers(trailers: OutgoingHttpHeaders): void; + /** + * This method signals to the server that all of the response headers and body + * have been sent; that server should consider this message complete. + * The method, `response.end()`, MUST be called on each response. + * + * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. + * + * If `callback` is specified, it will be called when the response stream + * is finished. + * @since v8.4.0 + */ + end(callback?: () => void): this; + end(data: string | Uint8Array, callback?: () => void): this; + end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; + /** + * Reads out a header that has already been queued but not sent to the client. + * The name is case-insensitive. + * + * ```js + * const contentType = response.getHeader('content-type'); + * ``` + * @since v8.4.0 + */ + getHeader(name: string): string; + /** + * Returns an array containing the unique names of the current outgoing headers. + * All header names are lowercase. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = response.getHeaderNames(); + * // headerNames === ['foo', 'set-cookie'] + * ``` + * @since v8.4.0 + */ + getHeaderNames(): string[]; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow copy + * is used, array values may be mutated without additional calls to various + * header-related http module methods. The keys of the returned object are the + * header names and the values are the respective header values. All header names + * are lowercase. + * + * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = response.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v8.4.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name matching is case-insensitive. + * + * ```js + * const hasContentType = response.hasHeader('content-type'); + * ``` + * @since v8.4.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that has been queued for implicit sending. + * + * ```js + * response.removeHeader('Content-Encoding'); + * ``` + * @since v8.4.0 + */ + removeHeader(name: string): void; + /** + * Sets a single header value for implicit headers. If this header already exists + * in the to-be-sent headers, its value will be replaced. Use an array of strings + * here to send multiple headers with the same name. + * + * ```js + * response.setHeader('Content-Type', 'text/html; charset=utf-8'); + * ``` + * + * or + * + * ```js + * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * @since v8.4.0 + */ + setHeader(name: string, value: number | string | ReadonlyArray): void; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream` s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * If this method is called and `response.writeHead()` has not been called, + * it will switch to implicit header mode and flush the implicit headers. + * + * This sends a chunk of the response body. This method may + * be called multiple times to provide successive parts of the body. + * + * In the `http` module, the response body is omitted when the + * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. + * + * `chunk` can be a string or a buffer. If `chunk` is a string, + * the second parameter specifies how to encode it into a byte stream. + * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk + * of data is flushed. + * + * This is the raw HTTP body and has nothing to do with higher-level multi-part + * body encodings that may be used. + * + * The first time `response.write()` is called, it will send the buffered + * header information and the first chunk of the body to the client. The second + * time `response.write()` is called, Node.js assumes data will be streamed, + * and sends the new data separately. That is, the response is buffered up to the + * first chunk of the body. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. + * @since v8.4.0 + */ + write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; + write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; + /** + * Sends a status `100 Continue` to the client, indicating that the request body + * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. + * @since v8.4.0 + */ + writeContinue(): void; + /** + * Sends a status `103 Early Hints` to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. + * + * Example: + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * 'x-trace-id': 'id for diagnostics' + * }); + * ``` + * + * @since v18.11.0 + * @param hints An object containing the values of headers + */ + writeEarlyHints(hints: Record): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * + * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. + * + * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be + * passed as the second argument. However, because the `statusMessage` has no + * meaning within HTTP/2, the argument will have no effect and a process warning + * will be emitted. + * + * ```js + * const body = 'hello world'; + * response.writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain; charset=utf-8', + * }); + * ``` + * + * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a + * given encoding. On outbound messages, Node.js does not check if Content-Length + * and the length of the body being transmitted are equal or not. However, when + * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. + * + * This method may be called at most one time on a message before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; + writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; + /** + * Call `http2stream.pushStream()` with the given headers, and wrap the + * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback + * parameter if successful. When `Http2ServerRequest` is closed, the callback is + * called with an error `ERR_HTTP2_INVALID_STREAM`. + * @since v8.4.0 + * @param headers An object describing the headers + * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of + * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method + */ + createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'drain'): boolean; + emit(event: 'error', error: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pipe', src: stream.Readable): boolean; + emit(event: 'unpipe', src: stream.Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export namespace constants { + const NGHTTP2_SESSION_SERVER: number; + const NGHTTP2_SESSION_CLIENT: number; + const NGHTTP2_STREAM_STATE_IDLE: number; + const NGHTTP2_STREAM_STATE_OPEN: number; + const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + const NGHTTP2_STREAM_STATE_CLOSED: number; + const NGHTTP2_NO_ERROR: number; + const NGHTTP2_PROTOCOL_ERROR: number; + const NGHTTP2_INTERNAL_ERROR: number; + const NGHTTP2_FLOW_CONTROL_ERROR: number; + const NGHTTP2_SETTINGS_TIMEOUT: number; + const NGHTTP2_STREAM_CLOSED: number; + const NGHTTP2_FRAME_SIZE_ERROR: number; + const NGHTTP2_REFUSED_STREAM: number; + const NGHTTP2_CANCEL: number; + const NGHTTP2_COMPRESSION_ERROR: number; + const NGHTTP2_CONNECT_ERROR: number; + const NGHTTP2_ENHANCE_YOUR_CALM: number; + const NGHTTP2_INADEQUATE_SECURITY: number; + const NGHTTP2_HTTP_1_1_REQUIRED: number; + const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + const NGHTTP2_FLAG_NONE: number; + const NGHTTP2_FLAG_END_STREAM: number; + const NGHTTP2_FLAG_END_HEADERS: number; + const NGHTTP2_FLAG_ACK: number; + const NGHTTP2_FLAG_PADDED: number; + const NGHTTP2_FLAG_PRIORITY: number; + const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + const DEFAULT_SETTINGS_ENABLE_PUSH: number; + const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + const MAX_MAX_FRAME_SIZE: number; + const MIN_MAX_FRAME_SIZE: number; + const MAX_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_DEFAULT_WEIGHT: number; + const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + const PADDING_STRATEGY_NONE: number; + const PADDING_STRATEGY_MAX: number; + const PADDING_STRATEGY_CALLBACK: number; + const HTTP2_HEADER_STATUS: string; + const HTTP2_HEADER_METHOD: string; + const HTTP2_HEADER_AUTHORITY: string; + const HTTP2_HEADER_SCHEME: string; + const HTTP2_HEADER_PATH: string; + const HTTP2_HEADER_ACCEPT_CHARSET: string; + const HTTP2_HEADER_ACCEPT_ENCODING: string; + const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + const HTTP2_HEADER_ACCEPT_RANGES: string; + const HTTP2_HEADER_ACCEPT: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + const HTTP2_HEADER_AGE: string; + const HTTP2_HEADER_ALLOW: string; + const HTTP2_HEADER_AUTHORIZATION: string; + const HTTP2_HEADER_CACHE_CONTROL: string; + const HTTP2_HEADER_CONNECTION: string; + const HTTP2_HEADER_CONTENT_DISPOSITION: string; + const HTTP2_HEADER_CONTENT_ENCODING: string; + const HTTP2_HEADER_CONTENT_LANGUAGE: string; + const HTTP2_HEADER_CONTENT_LENGTH: string; + const HTTP2_HEADER_CONTENT_LOCATION: string; + const HTTP2_HEADER_CONTENT_MD5: string; + const HTTP2_HEADER_CONTENT_RANGE: string; + const HTTP2_HEADER_CONTENT_TYPE: string; + const HTTP2_HEADER_COOKIE: string; + const HTTP2_HEADER_DATE: string; + const HTTP2_HEADER_ETAG: string; + const HTTP2_HEADER_EXPECT: string; + const HTTP2_HEADER_EXPIRES: string; + const HTTP2_HEADER_FROM: string; + const HTTP2_HEADER_HOST: string; + const HTTP2_HEADER_IF_MATCH: string; + const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + const HTTP2_HEADER_IF_NONE_MATCH: string; + const HTTP2_HEADER_IF_RANGE: string; + const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + const HTTP2_HEADER_LAST_MODIFIED: string; + const HTTP2_HEADER_LINK: string; + const HTTP2_HEADER_LOCATION: string; + const HTTP2_HEADER_MAX_FORWARDS: string; + const HTTP2_HEADER_PREFER: string; + const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + const HTTP2_HEADER_RANGE: string; + const HTTP2_HEADER_REFERER: string; + const HTTP2_HEADER_REFRESH: string; + const HTTP2_HEADER_RETRY_AFTER: string; + const HTTP2_HEADER_SERVER: string; + const HTTP2_HEADER_SET_COOKIE: string; + const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + const HTTP2_HEADER_TRANSFER_ENCODING: string; + const HTTP2_HEADER_TE: string; + const HTTP2_HEADER_UPGRADE: string; + const HTTP2_HEADER_USER_AGENT: string; + const HTTP2_HEADER_VARY: string; + const HTTP2_HEADER_VIA: string; + const HTTP2_HEADER_WWW_AUTHENTICATE: string; + const HTTP2_HEADER_HTTP2_SETTINGS: string; + const HTTP2_HEADER_KEEP_ALIVE: string; + const HTTP2_HEADER_PROXY_CONNECTION: string; + const HTTP2_METHOD_ACL: string; + const HTTP2_METHOD_BASELINE_CONTROL: string; + const HTTP2_METHOD_BIND: string; + const HTTP2_METHOD_CHECKIN: string; + const HTTP2_METHOD_CHECKOUT: string; + const HTTP2_METHOD_CONNECT: string; + const HTTP2_METHOD_COPY: string; + const HTTP2_METHOD_DELETE: string; + const HTTP2_METHOD_GET: string; + const HTTP2_METHOD_HEAD: string; + const HTTP2_METHOD_LABEL: string; + const HTTP2_METHOD_LINK: string; + const HTTP2_METHOD_LOCK: string; + const HTTP2_METHOD_MERGE: string; + const HTTP2_METHOD_MKACTIVITY: string; + const HTTP2_METHOD_MKCALENDAR: string; + const HTTP2_METHOD_MKCOL: string; + const HTTP2_METHOD_MKREDIRECTREF: string; + const HTTP2_METHOD_MKWORKSPACE: string; + const HTTP2_METHOD_MOVE: string; + const HTTP2_METHOD_OPTIONS: string; + const HTTP2_METHOD_ORDERPATCH: string; + const HTTP2_METHOD_PATCH: string; + const HTTP2_METHOD_POST: string; + const HTTP2_METHOD_PRI: string; + const HTTP2_METHOD_PROPFIND: string; + const HTTP2_METHOD_PROPPATCH: string; + const HTTP2_METHOD_PUT: string; + const HTTP2_METHOD_REBIND: string; + const HTTP2_METHOD_REPORT: string; + const HTTP2_METHOD_SEARCH: string; + const HTTP2_METHOD_TRACE: string; + const HTTP2_METHOD_UNBIND: string; + const HTTP2_METHOD_UNCHECKOUT: string; + const HTTP2_METHOD_UNLINK: string; + const HTTP2_METHOD_UNLOCK: string; + const HTTP2_METHOD_UPDATE: string; + const HTTP2_METHOD_UPDATEREDIRECTREF: string; + const HTTP2_METHOD_VERSION_CONTROL: string; + const HTTP_STATUS_CONTINUE: number; + const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + const HTTP_STATUS_PROCESSING: number; + const HTTP_STATUS_OK: number; + const HTTP_STATUS_CREATED: number; + const HTTP_STATUS_ACCEPTED: number; + const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + const HTTP_STATUS_NO_CONTENT: number; + const HTTP_STATUS_RESET_CONTENT: number; + const HTTP_STATUS_PARTIAL_CONTENT: number; + const HTTP_STATUS_MULTI_STATUS: number; + const HTTP_STATUS_ALREADY_REPORTED: number; + const HTTP_STATUS_IM_USED: number; + const HTTP_STATUS_MULTIPLE_CHOICES: number; + const HTTP_STATUS_MOVED_PERMANENTLY: number; + const HTTP_STATUS_FOUND: number; + const HTTP_STATUS_SEE_OTHER: number; + const HTTP_STATUS_NOT_MODIFIED: number; + const HTTP_STATUS_USE_PROXY: number; + const HTTP_STATUS_TEMPORARY_REDIRECT: number; + const HTTP_STATUS_PERMANENT_REDIRECT: number; + const HTTP_STATUS_BAD_REQUEST: number; + const HTTP_STATUS_UNAUTHORIZED: number; + const HTTP_STATUS_PAYMENT_REQUIRED: number; + const HTTP_STATUS_FORBIDDEN: number; + const HTTP_STATUS_NOT_FOUND: number; + const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + const HTTP_STATUS_NOT_ACCEPTABLE: number; + const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + const HTTP_STATUS_REQUEST_TIMEOUT: number; + const HTTP_STATUS_CONFLICT: number; + const HTTP_STATUS_GONE: number; + const HTTP_STATUS_LENGTH_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_FAILED: number; + const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + const HTTP_STATUS_URI_TOO_LONG: number; + const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + const HTTP_STATUS_EXPECTATION_FAILED: number; + const HTTP_STATUS_TEAPOT: number; + const HTTP_STATUS_MISDIRECTED_REQUEST: number; + const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + const HTTP_STATUS_LOCKED: number; + const HTTP_STATUS_FAILED_DEPENDENCY: number; + const HTTP_STATUS_UNORDERED_COLLECTION: number; + const HTTP_STATUS_UPGRADE_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_REQUIRED: number; + const HTTP_STATUS_TOO_MANY_REQUESTS: number; + const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + const HTTP_STATUS_NOT_IMPLEMENTED: number; + const HTTP_STATUS_BAD_GATEWAY: number; + const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + const HTTP_STATUS_GATEWAY_TIMEOUT: number; + const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + const HTTP_STATUS_LOOP_DETECTED: number; + const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + const HTTP_STATUS_NOT_EXTENDED: number; + const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + /** + * This symbol can be set as a property on the HTTP/2 headers object with + * an array value in order to provide a list of headers considered sensitive. + */ + export const sensitiveHeaders: symbol; + /** + * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called + * so instances returned may be safely modified for use. + * @since v8.4.0 + */ + export function getDefaultSettings(): Settings; + /** + * Returns a `Buffer` instance containing serialized representation of the given + * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended + * for use with the `HTTP2-Settings` header field. + * + * ```js + * const http2 = require('http2'); + * + * const packed = http2.getPackedSettings({ enablePush: false }); + * + * console.log(packed.toString('base64')); + * // Prints: AAIAAAAA + * ``` + * @since v8.4.0 + */ + export function getPackedSettings(settings: Settings): Buffer; + /** + * Returns a `HTTP/2 Settings Object` containing the deserialized settings from + * the given `Buffer` as generated by `http2.getPackedSettings()`. + * @since v8.4.0 + * @param buf The packed settings. + */ + export function getUnpackedSettings(buf: Uint8Array): Settings; + /** + * Returns a `net.Server` instance that creates and manages `Http2Session`instances. + * + * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when + * communicating + * with browser clients. + * + * ```js + * const http2 = require('http2'); + * + * // Create an unencrypted HTTP/2 server. + * // Since there are no browsers known that support + * // unencrypted HTTP/2, the use of `http2.createSecureServer()` + * // is necessary when communicating with browser clients. + * const server = http2.createServer(); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200 + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(80); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + /** + * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. + * + * ```js + * const http2 = require('http2'); + * const fs = require('fs'); + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem') + * }; + * + * // Create a secure HTTP/2 server + * const server = http2.createSecureServer(options); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200 + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(80); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + /** + * Returns a `ClientHttp2Session` instance. + * + * ```js + * const http2 = require('http2'); + * const client = http2.connect('https://localhost:1234'); + * + * // Use the client + * + * client.close(); + * ``` + * @since v8.4.0 + * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port + * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. + * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. + */ + export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; + export function connect( + authority: string | url.URL, + options?: ClientSessionOptions | SecureClientSessionOptions, + listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void + ): ClientHttp2Session; +} +declare module 'node:http2' { + export * from 'http2'; +} diff --git a/server/node_modules/@types/node/https.d.ts b/server/node_modules/@types/node/https.d.ts new file mode 100755 index 0000000000..bda367d74c --- /dev/null +++ b/server/node_modules/@types/node/https.d.ts @@ -0,0 +1,542 @@ +/** + * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a + * separate module. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/https.js) + */ +declare module 'https' { + import { Duplex } from 'node:stream'; + import * as tls from 'node:tls'; + import * as http from 'node:http'; + import { URL } from 'node:url'; + type ServerOptions< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; + type RequestOptions = http.RequestOptions & + tls.SecureContextOptions & { + checkServerIdentity?: typeof tls.checkServerIdentity | undefined; + rejectUnauthorized?: boolean | undefined; // Defaults to true + servername?: string | undefined; // SNI TLS Extension + }; + interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + rejectUnauthorized?: boolean | undefined; + maxCachedSessions?: number | undefined; + } + /** + * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. + * @since v0.4.5 + */ + class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + } + interface Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > extends http.Server {} + /** + * See `http.Server` for more information. + * @since v0.3.4 + */ + class Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > extends tls.Server { + constructor(requestListener?: http.RequestListener); + constructor( + options: ServerOptions, + requestListener?: http.RequestListener, + ); + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + addListener( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + addListener( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + addListener( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Duplex) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'checkContinue', listener: http.RequestListener): this; + addListener(event: 'checkExpectation', listener: http.RequestListener): this; + addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + addListener( + event: 'connect', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + addListener(event: 'request', listener: http.RequestListener): this; + addListener( + event: 'upgrade', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + emit(event: string, ...args: any[]): boolean; + emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean; + emit( + event: 'newSession', + sessionId: Buffer, + sessionData: Buffer, + callback: (err: Error, resp: Buffer) => void, + ): boolean; + emit( + event: 'OCSPRequest', + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ): boolean; + emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; + emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean; + emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Duplex): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit( + event: 'checkContinue', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit( + event: 'checkExpectation', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'clientError', err: Error, socket: Duplex): boolean; + emit(event: 'connect', req: InstanceType, socket: Duplex, head: Buffer): boolean; + emit( + event: 'request', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'upgrade', req: InstanceType, socket: Duplex, head: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + on( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + on( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + on( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Duplex) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'checkContinue', listener: http.RequestListener): this; + on(event: 'checkExpectation', listener: http.RequestListener): this; + on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + on(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + on(event: 'request', listener: http.RequestListener): this; + on(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + once( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + once( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + once( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Duplex) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'checkContinue', listener: http.RequestListener): this; + once(event: 'checkExpectation', listener: http.RequestListener): this; + once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + once(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + once(event: 'request', listener: http.RequestListener): this; + once(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + prependListener( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + prependListener( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + prependListener( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Duplex) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'checkContinue', listener: http.RequestListener): this; + prependListener(event: 'checkExpectation', listener: http.RequestListener): this; + prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + prependListener( + event: 'connect', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + prependListener(event: 'request', listener: http.RequestListener): this; + prependListener( + event: 'upgrade', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + prependOnceListener( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + prependOnceListener( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this; + prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this; + prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + prependOnceListener( + event: 'connect', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + prependOnceListener(event: 'request', listener: http.RequestListener): this; + prependOnceListener( + event: 'upgrade', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + } + /** + * ```js + * // curl -k https://localhost:8000/ + * const https = require('https'); + * const fs = require('fs'); + * + * const options = { + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * + * Or + * + * ```js + * const https = require('https'); + * const fs = require('fs'); + * + * const options = { + * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), + * passphrase: 'sample' + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * @since v0.3.4 + * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. + * @param requestListener A listener to be added to the `'request'` event. + */ + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + >(requestListener?: http.RequestListener): Server; + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + >( + options: ServerOptions, + requestListener?: http.RequestListener, + ): Server; + /** + * Makes a request to a secure web server. + * + * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, + * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * const https = require('https'); + * + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET' + * }; + * + * const req = https.request(options, (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(e); + * }); + * req.end(); + * ``` + * + * Example using options from `tls.connect()`: + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') + * }; + * options.agent = new https.Agent(options); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Alternatively, opt out of connection pooling by not using an `Agent`. + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * agent: false + * }; + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('https://abc:xyz@example.com'); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): + * + * ```js + * const tls = require('tls'); + * const https = require('https'); + * const crypto = require('crypto'); + * + * function sha256(s) { + * return crypto.createHash('sha256').update(s).digest('base64'); + * } + * const options = { + * hostname: 'github.com', + * port: 443, + * path: '/', + * method: 'GET', + * checkServerIdentity: function(host, cert) { + * // Make sure the certificate is issued to the host we are connected to + * const err = tls.checkServerIdentity(host, cert); + * if (err) { + * return err; + * } + * + * // Pin the public key, similar to HPKP pin-sha25 pinning + * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; + * if (sha256(cert.pubkey) !== pubkey256) { + * const msg = 'Certificate verification error: ' + + * `The public key of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // Pin the exact certificate, rather than the pub key + * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + + * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; + * if (cert.fingerprint256 !== cert256) { + * const msg = 'Certificate verification error: ' + + * `The certificate of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // This loop is informational only. + * // Print the certificate and public key fingerprints of all certs in the + * // chain. Its common to pin the public key of the issuer on the public + * // internet, while pinning the public key of the service in sensitive + * // environments. + * do { + * console.log('Subject Common Name:', cert.subject.CN); + * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); + * + * hash = crypto.createHash('sha256'); + * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); + * + * lastprint256 = cert.fingerprint256; + * cert = cert.issuerCertificate; + * } while (cert.fingerprint256 !== lastprint256); + * + * }, + * }; + * + * options.agent = new https.Agent(options); + * const req = https.request(options, (res) => { + * console.log('All OK. Server matched our pinned cert or public key'); + * console.log('statusCode:', res.statusCode); + * // Print the HPKP values + * console.log('headers:', res.headers['public-key-pins']); + * + * res.on('data', (d) => {}); + * }); + * + * req.on('error', (e) => { + * console.error(e.message); + * }); + * req.end(); + * ``` + * + * Outputs for example: + * + * ```text + * Subject Common Name: github.com + * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 + * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= + * Subject Common Name: DigiCert SHA2 Extended Validation Server CA + * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A + * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= + * Subject Common Name: DigiCert High Assurance EV Root CA + * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF + * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= + * All OK. Server matched our pinned cert or public key + * statusCode: 200 + * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; + * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; + * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains + * ``` + * @since v0.3.6 + * @param options Accepts all `options` from `request`, with some differences in default values: + */ + function request( + options: RequestOptions | string | URL, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + function request( + url: string | URL, + options: RequestOptions, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + /** + * Like `http.get()` but for HTTPS. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * ```js + * const https = require('https'); + * + * https.get('https://encrypted.google.com/', (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * + * }).on('error', (e) => { + * console.error(e); + * }); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. + */ + function get( + options: RequestOptions | string | URL, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + function get( + url: string | URL, + options: RequestOptions, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + let globalAgent: Agent; +} +declare module 'node:https' { + export * from 'https'; +} diff --git a/server/node_modules/@types/node/index.d.ts b/server/node_modules/@types/node/index.d.ts new file mode 100755 index 0000000000..9db5f47436 --- /dev/null +++ b/server/node_modules/@types/node/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for non-npm package Node.js 18.11 +// Project: https://nodejs.org/ +// Definitions by: Microsoft TypeScript +// DefinitelyTyped +// Alberto Schiabel +// Alvis HT Tang +// Andrew Makarov +// Benjamin Toueg +// Chigozirim C. +// David Junger +// Deividas Bakanas +// Eugene Y. Q. Shen +// Hannes Magnusson +// Huw +// Kelvin Jin +// Klaus Meinhardt +// Lishude +// Mariusz Wiktorczyk +// Mohsen Azimi +// Nicolas Even +// Nikita Galkin +// Parambir Singh +// Sebastian Silbermann +// Simon Schick +// Thomas den Hollander +// Wilco Bakker +// wwwy3y3 +// Samuel Ainsworth +// Kyle Uehlein +// Thanik Bhongbhibhat +// Marcin Kopacz +// Trivikram Kamat +// Junxiao Shi +// Ilia Baryshnikov +// ExE Boss +// Piotr Błażejewicz +// Anna Henningsen +// Victor Perin +// Yongsheng Zhang +// NodeJS Contributors +// Linus Unnebäck +// wafuwafu13 +// Matteo Collina +// Dmitry Semigradsky +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * License for programmatically and manually incorporated + * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc + * + * Copyright Node.js contributors. All rights reserved. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +// NOTE: These definitions support NodeJS and TypeScript 4.9+. + +// Reference required types from the default lib: +/// +/// +/// +/// + +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +/// diff --git a/server/node_modules/@types/node/inspector.d.ts b/server/node_modules/@types/node/inspector.d.ts new file mode 100755 index 0000000000..eba0b55d8b --- /dev/null +++ b/server/node_modules/@types/node/inspector.d.ts @@ -0,0 +1,2741 @@ +// eslint-disable-next-line dt-header +// Type definitions for inspector + +// These definitions are auto-generated. +// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 +// for more information. + +// tslint:disable:max-line-length + +/** + * The `inspector` module provides an API for interacting with the V8 inspector. + * + * It can be accessed using: + * + * ```js + * const inspector = require('inspector'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/inspector.js) + */ +declare module 'inspector' { + import EventEmitter = require('node:events'); + interface InspectorNotification { + method: string; + params: T; + } + namespace Schema { + /** + * Description of the protocol domain. + */ + interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Domain[]; + } + } + namespace Runtime { + /** + * Unique script identifier. + */ + type ScriptId = string; + /** + * Unique object identifier. + */ + type RemoteObjectId = string; + /** + * Primitive value which cannot be JSON-stringified. + */ + type UnserializableValue = string; + /** + * Mirror object referencing original JavaScript object. + */ + interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * Object class (constructor) name. Specified for object type values only. + */ + className?: string | undefined; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: RemoteObjectId | undefined; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: ObjectPreview | undefined; + /** + * @experimental + */ + customPreview?: CustomPreview | undefined; + } + /** + * @experimental + */ + interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: RemoteObjectId; + bindRemoteObjectFunctionId: RemoteObjectId; + configObjectId?: RemoteObjectId | undefined; + } + /** + * Object containing abbreviated remote object value. + * @experimental + */ + interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: PropertyPreview[]; + /** + * List of the entries. Specified for map and set subtype values only. + */ + entries?: EntryPreview[] | undefined; + } + /** + * @experimental + */ + interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string | undefined; + /** + * Nested value preview. + */ + valuePreview?: ObjectPreview | undefined; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + } + /** + * @experimental + */ + interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: ObjectPreview | undefined; + /** + * Preview of the value. + */ + value: ObjectPreview; + } + /** + * Object property descriptor. + */ + interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean | undefined; + /** + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + */ + get?: RemoteObject | undefined; + /** + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + */ + set?: RemoteObject | undefined; + /** + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean | undefined; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean | undefined; + /** + * Property symbol object, if the property is of the symbol type. + */ + symbol?: RemoteObject | undefined; + } + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + } + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + interface CallArgument { + /** + * Primitive value or serializable javascript object. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * Remote object handle. + */ + objectId?: RemoteObjectId | undefined; + } + /** + * Id of an execution context. + */ + type ExecutionContextId = number; + /** + * Description of an isolated world. + */ + interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + */ + id: ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {} | undefined; + } + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: ScriptId | undefined; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string | undefined; + /** + * JavaScript stack trace if available. + */ + stackTrace?: StackTrace | undefined; + /** + * Exception object if available. + */ + exception?: RemoteObject | undefined; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: ExecutionContextId | undefined; + } + /** + * Number of milliseconds since epoch. + */ + type Timestamp = number; + /** + * Stack entry for runtime errors and assertions. + */ + interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + /** + * Call frames for assertions or error messages. + */ + interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + */ + description?: string | undefined; + /** + * JavaScript function name. + */ + callFrames: CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: StackTrace | undefined; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + * @experimental + */ + parentId?: StackTraceId | undefined; + } + /** + * Unique identifier of current debugger. + * @experimental + */ + type UniqueDebuggerId = string; + /** + * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. + * @experimental + */ + interface StackTraceId { + id: string; + debuggerId?: UniqueDebuggerId | undefined; + } + interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + contextId?: ExecutionContextId | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + } + interface CallFunctionOnParameterType { + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Identifier of the object to call function on. Either objectId or executionContextId should be specified. + */ + objectId?: RemoteObjectId | undefined; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + */ + arguments?: CallArgument[] | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + /** + * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + */ + objectGroup?: string | undefined; + } + interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype chain. + */ + ownProperties?: boolean | undefined; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean | undefined; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean | undefined; + } + interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: RemoteObjectId; + } + interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: RemoteObjectId; + } + interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: InternalPropertyDescriptor[] | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: ScriptId | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface RunScriptReturnType { + /** + * Run result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: RemoteObject; + } + interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: ExecutionContextDescription; + } + interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: ExecutionContextId; + } + interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Timestamp; + exceptionDetails: ExceptionDetails; + } + interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in exceptionThrown. + */ + exceptionId: number; + } + interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: StackTrace | undefined; + /** + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * @experimental + */ + context?: string | undefined; + } + interface InspectRequestedEventDataType { + object: RemoteObject; + hints: {}; + } + } + namespace Debugger { + /** + * Breakpoint identifier. + */ + type BreakpointId = string; + /** + * Call frame identifier. + */ + type CallFrameId = string; + /** + * Location in the source code. + */ + interface Location { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + } + /** + * Location in the source code. + * @experimental + */ + interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + */ + functionLocation?: Location | undefined; + /** + * Location in the source code. + */ + location: Location; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Scope chain for this call frame. + */ + scopeChain: Scope[]; + /** + * this object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject | undefined; + } + /** + * Scope description. + */ + interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string | undefined; + /** + * Location in the source code where scope starts + */ + startLocation?: Location | undefined; + /** + * Location in the source code where scope ends + */ + endLocation?: Location | undefined; + } + /** + * Search match for resource. + */ + interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + interface BreakLocation { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + type?: string | undefined; + } + interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string | undefined; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + */ + urlRegex?: string | undefined; + /** + * Script hash of the resources to set breakpoint on. + */ + scriptHash?: string | undefined; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number | undefined; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface RemoveBreakpointParameterType { + breakpointId: BreakpointId; + } + interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + */ + end?: Location | undefined; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean | undefined; + } + interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Location; + targetCallFrames?: string | undefined; + } + interface PauseOnAsyncCallParameterType { + /** + * Debugger will pause when async call with given stack trace is started. + */ + parentStackTraceId: Runtime.StackTraceId; + } + interface StepIntoParameterType { + /** + * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. + * @experimental + */ + breakOnAsyncCall?: boolean | undefined; + } + interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean | undefined; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean | undefined; + } + interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. + */ + dryRun?: boolean | undefined; + } + interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + } + interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). + */ + objectGroup?: string | undefined; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults to false. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + */ + throwOnSideEffect?: boolean | undefined; + } + interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: CallFrameId; + } + interface SetReturnValueParameterType { + /** + * New return value. + */ + newValue: Runtime.CallArgument; + } + interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). + */ + maxDepth: number; + } + interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: ScriptPosition[]; + } + interface EnableReturnType { + /** + * Unique identifier of the debugger. + * @experimental + */ + debuggerId: Runtime.UniqueDebuggerId; + } + interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Location[]; + } + interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Location; + } + interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: BreakLocation[]; + } + interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: SearchMatch[]; + } + interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: CallFrame[] | undefined; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + } + interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {} | undefined; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {} | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: BreakpointId; + /** + * Actual breakpoint location. + */ + location: Location; + } + interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {} | undefined; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[] | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. + * @experimental + */ + asyncCallStackTraceId?: Runtime.StackTraceId | undefined; + } + } + namespace Console { + /** + * Console message. + */ + interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string | undefined; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number | undefined; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number | undefined; + } + interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: ConsoleMessage; + } + } + namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + */ + hitCount?: number | undefined; + /** + * Child node ids. + */ + children?: number[] | undefined; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. + */ + deoptReason?: string | undefined; + /** + * An array of source position ticks. + */ + positionTicks?: PositionTickInfo[] | undefined; + } + /** + * Profile. + */ + interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[] | undefined; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. + */ + timeDeltas?: number[] | undefined; + } + /** + * Specifies a number of samples attributed to a certain source position. + */ + interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + /** + * Coverage data for a source range. + */ + interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + /** + * Coverage data for a JavaScript function. + */ + interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + /** + * Coverage data for a JavaScript script. + */ + interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: FunctionCoverage[]; + } + /** + * Describes a type collected during runtime. + * @experimental + */ + interface TypeObject { + /** + * Name of a type collected with type profiling. + */ + name: string; + } + /** + * Source offset and types for a parameter or return value. + * @experimental + */ + interface TypeProfileEntry { + /** + * Source offset of the parameter or end of function for return values. + */ + offset: number; + /** + * The types for this parameter or return value. + */ + types: TypeObject[]; + } + /** + * Type profile data collected during runtime for a JavaScript script. + * @experimental + */ + interface ScriptTypeProfile { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Type profile entries for parameters and return values of the functions in the script. + */ + entries: TypeProfileEntry[]; + } + interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean | undefined; + /** + * Collect block-based coverage. + */ + detailed?: boolean | undefined; + } + interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profile; + } + interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface TakeTypeProfileReturnType { + /** + * Type profile for all scripts since startTypeProfile() was turned on. + */ + result: ScriptTypeProfile[]; + } + interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + } + namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + type HeapSnapshotObjectId = string; + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: SamplingHeapProfileNode[]; + } + /** + * Profile. + */ + interface SamplingHeapProfile { + head: SamplingHeapProfileNode; + } + interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean | undefined; + } + interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. + */ + reportProgress?: boolean | undefined; + } + interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean | undefined; + } + interface GetObjectByHeapObjectIdParameterType { + objectId: HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + } + interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapSnapshotObjectId; + } + interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. + */ + samplingInterval?: number | undefined; + } + interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapSnapshotObjectId; + } + interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: SamplingHeapProfile; + } + interface GetSamplingProfileReturnType { + /** + * Return the sampling profile being collected. + */ + profile: SamplingHeapProfile; + } + interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean | undefined; + } + interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + } + namespace NodeTracing { + interface TraceConfig { + /** + * Controls how the trace buffer stores data. + */ + recordMode?: string | undefined; + /** + * Included category filters. + */ + includedCategories: string[]; + } + interface StartParameterType { + traceConfig: TraceConfig; + } + interface GetCategoriesReturnType { + /** + * A list of supported tracing categories. + */ + categories: string[]; + } + interface DataCollectedEventDataType { + value: Array<{}>; + } + } + namespace NodeWorker { + type WorkerID = string; + /** + * Unique identifier of attached debugging session. + */ + type SessionID = string; + interface WorkerInfo { + workerId: WorkerID; + type: string; + title: string; + url: string; + } + interface SendMessageToWorkerParameterType { + message: string; + /** + * Identifier of the session. + */ + sessionId: SessionID; + } + interface EnableParameterType { + /** + * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` + * message to run them. + */ + waitForDebuggerOnStart: boolean; + } + interface DetachParameterType { + sessionId: SessionID; + } + interface AttachedToWorkerEventDataType { + /** + * Identifier assigned to the session used to send/receive messages. + */ + sessionId: SessionID; + workerInfo: WorkerInfo; + waitingForDebugger: boolean; + } + interface DetachedFromWorkerEventDataType { + /** + * Detached session identifier. + */ + sessionId: SessionID; + } + interface ReceivedMessageFromWorkerEventDataType { + /** + * Identifier of a session which sends a message. + */ + sessionId: SessionID; + message: string; + } + } + namespace NodeRuntime { + interface NotifyWhenWaitingForDisconnectParameterType { + enabled: boolean; + } + } + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + */ + class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. + */ + constructor(); + /** + * Connects a session to the inspector back-end. + * @since v8.0.0 + */ + connect(): void; + /** + * Immediately close the session. All pending message callbacks will be called + * with an error. `session.connect()` will need to be called to be able to send + * messages again. Reconnected session will lose all inspector state, such as + * enabled agents or configured breakpoints. + * @since v8.0.0 + */ + disconnect(): void; + /** + * Posts a message to the inspector back-end. `callback` will be notified when + * a response is received. `callback` is a function that accepts two optional + * arguments: error and message-specific result. + * + * ```js + * session.post('Runtime.evaluate', { expression: '2 + 2' }, + * (error, { result }) => console.log(result)); + * // Output: { type: 'number', value: 4, description: '4' } + * ``` + * + * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). + * + * Node.js inspector supports all the Chrome DevTools Protocol domains declared + * by V8\. Chrome DevTools Protocol domain provides an interface for interacting + * with one of the runtime agents used to inspect the application state and listen + * to the run-time events. + * + * ## Example usage + * + * Apart from the debugger, various V8 Profilers are available through the DevTools + * protocol. + * @since v8.0.0 + */ + post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; + post(method: string, callback?: (err: Error | null, params?: {}) => void): void; + /** + * Returns supported domains. + */ + post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + /** + * Evaluates expression on global object. + */ + post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + /** + * Add handler to promise with given promise object id. + */ + post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + /** + * Releases remote object with given id. + */ + post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; + /** + * Releases all remote objects that belong to a given group. + */ + post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; + /** + * Disables reporting of execution contexts creation. + */ + post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; + /** + * Discards collected exceptions and console API calls. + */ + post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; + /** + * Compiles expression. + */ + post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + /** + * Runs script with given id in a given context. + */ + post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + /** + * Returns all let, const and class variables from global scope. + */ + post( + method: 'Runtime.globalLexicalScopeNames', + params?: Runtime.GlobalLexicalScopeNamesParameterType, + callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void + ): void; + post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + /** + * Disables debugger for given page. + */ + post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + /** + * Removes JavaScript breakpoint. + */ + post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + */ + post( + method: 'Debugger.getPossibleBreakpoints', + params?: Debugger.GetPossibleBreakpointsParameterType, + callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void + ): void; + post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + /** + * Continues execution until specific location is reached. + */ + post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; + /** + * Steps over the statement. + */ + post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; + /** + * Steps into the function call. + */ + post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; + /** + * Steps out of the function call. + */ + post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; + /** + * Stops on the next JavaScript statement. + */ + post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; + /** + * Resumes JavaScript execution. + */ + post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; + /** + * Returns stack trace with given stackTraceId. + * @experimental + */ + post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + /** + * Searches for given string in script content. + */ + post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + /** + * Edits JavaScript source live. + */ + post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + /** + * Restarts particular call frame from the beginning. + */ + post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + /** + * Returns source for the script with given id. + */ + post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; + /** + * Evaluates expression on a given call frame. + */ + post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; + /** + * Enables or disables async call stacks tracking. + */ + post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: 'Console.enable', callback?: (err: Error | null) => void): void; + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: 'Console.disable', callback?: (err: Error | null) => void): void; + /** + * Does nothing. + */ + post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + */ + post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + */ + post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + */ + post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + */ + post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + /** + * Enable type profile. + * @experimental + */ + post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; + /** + * Disable type profile. Disabling releases type profile data collected so far. + * @experimental + */ + post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; + /** + * Collect type profile. + * @experimental + */ + post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; + post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; + post( + method: 'HeapProfiler.getObjectByHeapObjectId', + params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, + callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void + ): void; + post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; + /** + * Gets supported tracing categories. + */ + post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; + /** + * Start trace events collection. + */ + post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; + /** + * Stop trace events collection. Remaining collected events will be sent as a sequence of + * dataCollected events followed by tracingComplete event. + */ + post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; + /** + * Sends protocol message over session with given id. + */ + post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; + /** + * Instructs the inspector to attach to running workers. Will also attach to new workers + * as they start + */ + post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; + /** + * Detaches from all running workers and disables attaching to new workers as they are started. + */ + post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; + /** + * Detached from the worker with given sessionId. + */ + post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; + /** + * Enable the `NodeRuntime.waitingForDisconnect`. + */ + post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; + // Events + addListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; + emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; + emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; + emit(event: 'Runtime.executionContextsCleared'): boolean; + emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; + emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; + emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; + emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; + emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; + emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; + emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; + emit(event: 'Debugger.paused', message: InspectorNotification): boolean; + emit(event: 'Debugger.resumed'): boolean; + emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; + emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; + emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.resetProfiles'): boolean; + emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; + emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; + emit(event: 'NodeTracing.tracingComplete'): boolean; + emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; + emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; + emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; + emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + on(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + on(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + once(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + once(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + } + /** + * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has + * started. + * + * If wait is `true`, will block until a client has connected to the inspect port + * and flow control has been passed to the debugger client. + * + * See the `security warning` regarding the `host`parameter usage. + * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. + * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. + * @param [wait=false] Block until a client has connected. Optional. + */ + function open(port?: number, host?: string, wait?: boolean): void; + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + function close(): void; + /** + * Return the URL of the active inspector, or `undefined` if there is none. + * + * ```console + * $ node --inspect -p 'inspector.url()' + * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * For help, see: https://nodejs.org/en/docs/inspector + * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * + * $ node --inspect=localhost:3000 -p 'inspector.url()' + * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * For help, see: https://nodejs.org/en/docs/inspector + * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * + * $ node -p 'inspector.url()' + * undefined + * ``` + */ + function url(): string | undefined; + /** + * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. + * + * An exception will be thrown if there is no active inspector. + * @since v12.7.0 + */ + function waitForDebugger(): void; +} +/** + * The inspector module provides an API for interacting with the V8 inspector. + */ +declare module 'node:inspector' { + import inspector = require('inspector'); + export = inspector; +} diff --git a/server/node_modules/@types/node/module.d.ts b/server/node_modules/@types/node/module.d.ts new file mode 100755 index 0000000000..d83aec94aa --- /dev/null +++ b/server/node_modules/@types/node/module.d.ts @@ -0,0 +1,114 @@ +/** + * @since v0.3.7 + */ +declare module 'module' { + import { URL } from 'node:url'; + namespace Module { + /** + * The `module.syncBuiltinESMExports()` method updates all the live bindings for + * builtin `ES Modules` to match the properties of the `CommonJS` exports. It + * does not add or remove exported names from the `ES Modules`. + * + * ```js + * const fs = require('fs'); + * const assert = require('assert'); + * const { syncBuiltinESMExports } = require('module'); + * + * fs.readFile = newAPI; + * + * delete fs.readFileSync; + * + * function newAPI() { + * // ... + * } + * + * fs.newAPI = newAPI; + * + * syncBuiltinESMExports(); + * + * import('fs').then((esmFS) => { + * // It syncs the existing readFile property with the new value + * assert.strictEqual(esmFS.readFile, newAPI); + * // readFileSync has been deleted from the required fs + * assert.strictEqual('readFileSync' in fs, false); + * // syncBuiltinESMExports() does not remove readFileSync from esmFS + * assert.strictEqual('readFileSync' in esmFS, true); + * // syncBuiltinESMExports() does not add names + * assert.strictEqual(esmFS.newAPI, undefined); + * }); + * ``` + * @since v12.12.0 + */ + function syncBuiltinESMExports(): void; + /** + * `path` is the resolved path for the file for which a corresponding source map + * should be fetched. + * @since v13.7.0, v12.17.0 + */ + function findSourceMap(path: string, error?: Error): SourceMap; + interface SourceMapPayload { + file: string; + version: number; + sources: string[]; + sourcesContent: string[]; + names: string[]; + mappings: string; + sourceRoot: string; + } + interface SourceMapping { + generatedLine: number; + generatedColumn: number; + originalSource: string; + originalLine: number; + originalColumn: number; + } + /** + * @since v13.7.0, v12.17.0 + */ + class SourceMap { + /** + * Getter for the payload used to construct the `SourceMap` instance. + */ + readonly payload: SourceMapPayload; + constructor(payload: SourceMapPayload); + /** + * Given a line number and column number in the generated source file, returns + * an object representing the position in the original file. The object returned + * consists of the following keys: + */ + findEntry(line: number, column: number): SourceMapping; + } + } + interface Module extends NodeModule {} + class Module { + static runMain(): void; + static wrap(code: string): string; + static createRequire(path: string | URL): NodeRequire; + static builtinModules: string[]; + static Module: typeof Module; + constructor(id: string, parent?: Module); + } + global { + interface ImportMeta { + url: string; + /** + * @experimental + * This feature is only available with the `--experimental-import-meta-resolve` + * command flag enabled. + * + * Provides a module-relative resolution function scoped to each module, returning + * the URL string. + * + * @param specified The module specifier to resolve relative to `parent`. + * @param parent The absolute parent module URL to resolve from. If none + * is specified, the value of `import.meta.url` is used as the default. + */ + resolve?(specified: string, parent?: string | URL): Promise; + } + } + export = Module; +} +declare module 'node:module' { + import module = require('module'); + export = module; +} diff --git a/server/node_modules/@types/node/net.d.ts b/server/node_modules/@types/node/net.d.ts new file mode 100755 index 0000000000..b7355383f9 --- /dev/null +++ b/server/node_modules/@types/node/net.d.ts @@ -0,0 +1,869 @@ +/** + * > Stability: 2 - Stable + * + * The `net` module provides an asynchronous network API for creating stream-based + * TCP or `IPC` servers ({@link createServer}) and clients + * ({@link createConnection}). + * + * It can be accessed using: + * + * ```js + * const net = require('net'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/net.js) + */ +declare module 'net' { + import * as stream from 'node:stream'; + import { Abortable, EventEmitter } from 'node:events'; + import * as dns from 'node:dns'; + type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; + interface AddressInfo { + address: string; + family: string; + port: number; + } + interface SocketConstructorOpts { + fd?: number | undefined; + allowHalfOpen?: boolean | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + signal?: AbortSignal; + } + interface OnReadOpts { + buffer: Uint8Array | (() => Uint8Array); + /** + * This function is called for every chunk of incoming data. + * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. + * Return false from this function to implicitly pause() the socket. + */ + callback(bytesWritten: number, buf: Uint8Array): boolean; + } + interface ConnectOpts { + /** + * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. + * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will + * still be emitted as normal and methods like pause() and resume() will also behave as expected. + */ + onread?: OnReadOpts | undefined; + } + interface TcpSocketConnectOpts extends ConnectOpts { + port: number; + host?: string | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + hints?: number | undefined; + family?: number | undefined; + lookup?: LookupFunction | undefined; + noDelay?: boolean | undefined; + keepAlive?: boolean | undefined; + keepAliveInitialDelay?: number | undefined; + } + interface IpcSocketConnectOpts extends ConnectOpts { + path: string; + } + type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + type SocketReadyState = 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed'; + /** + * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint + * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also + * an `EventEmitter`. + * + * A `net.Socket` can be created by the user and used directly to interact with + * a server. For example, it is returned by {@link createConnection}, + * so the user can use it to talk to the server. + * + * It can also be created by Node.js and passed to the user when a connection + * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use + * it to interact with the client. + * @since v0.3.4 + */ + class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + /** + * Sends data on the socket. The second parameter specifies the encoding in the + * case of a string. It defaults to UTF8 encoding. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. + * + * The optional `callback` parameter will be executed when the data is finally + * written out, which may not be immediately. + * + * See `Writable` stream `write()` method for more + * information. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + */ + write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; + write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; + /** + * Initiate a connection on a given socket. + * + * Possible signatures: + * + * * `socket.connect(options[, connectListener])` + * * `socket.connect(path[, connectListener])` for `IPC` connections. + * * `socket.connect(port[, host][, connectListener])` for TCP connections. + * * Returns: `net.Socket` The socket itself. + * + * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, + * instead of a `'connect'` event, an `'error'` event will be emitted with + * the error passed to the `'error'` listener. + * The last parameter `connectListener`, if supplied, will be added as a listener + * for the `'connect'` event **once**. + * + * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined + * behavior. + */ + connect(options: SocketConnectOpts, connectionListener?: () => void): this; + connect(port: number, host: string, connectionListener?: () => void): this; + connect(port: number, connectionListener?: () => void): this; + connect(path: string, connectionListener?: () => void): this; + /** + * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. + * @since v0.1.90 + * @return The socket itself. + */ + setEncoding(encoding?: BufferEncoding): this; + /** + * Pauses the reading of data. That is, `'data'` events will not be emitted. + * Useful to throttle back an upload. + * @return The socket itself. + */ + pause(): this; + /** + * Close the TCP connection by sending an RST packet and destroy the stream. + * If this TCP socket is in connecting status, it will send an RST packet + * and destroy this TCP socket once it is connected. Otherwise, it will call + * `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. If this is not a TCP socket + * (for example, a pipe), calling this method will immediately throw + * an `ERR_INVALID_HANDLE_TYPE` Error. + * @since v18.3.0 + * @return The socket itself. + */ + resetAndDestroy(): this; + /** + * Resumes reading after a call to `socket.pause()`. + * @return The socket itself. + */ + resume(): this; + /** + * Sets the socket to timeout after `timeout` milliseconds of inactivity on + * the socket. By default `net.Socket` do not have a timeout. + * + * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to + * end the connection. + * + * ```js + * socket.setTimeout(3000); + * socket.on('timeout', () => { + * console.log('socket timeout'); + * socket.end(); + * }); + * ``` + * + * If `timeout` is 0, then the existing idle timeout is disabled. + * + * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. + * @since v0.1.90 + * @return The socket itself. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Enable/disable the use of Nagle's algorithm. + * + * When a TCP connection is created, it will have Nagle's algorithm enabled. + * + * Nagle's algorithm delays data before it is sent via the network. It attempts + * to optimize throughput at the expense of latency. + * + * Passing `true` for `noDelay` or not passing an argument will disable Nagle's + * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's + * algorithm. + * @since v0.1.90 + * @param [noDelay=true] + * @return The socket itself. + */ + setNoDelay(noDelay?: boolean): this; + /** + * Enable/disable keep-alive functionality, and optionally set the initial + * delay before the first keepalive probe is sent on an idle socket. + * + * Set `initialDelay` (in milliseconds) to set the delay between the last + * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default + * (or previous) setting. + * + * Enabling the keep-alive functionality will set the following socket options: + * + * * `SO_KEEPALIVE=1` + * * `TCP_KEEPIDLE=initialDelay` + * * `TCP_KEEPCNT=10` + * * `TCP_KEEPINTVL=1` + * @since v0.1.92 + * @param [enable=false] + * @param [initialDelay=0] + * @return The socket itself. + */ + setKeepAlive(enable?: boolean, initialDelay?: number): this; + /** + * Returns the bound `address`, the address `family` name and `port` of the + * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` + * @since v0.1.90 + */ + address(): AddressInfo | {}; + /** + * Calling `unref()` on a socket will allow the program to exit if this is the only + * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + unref(): this; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). + * If the socket is `ref`ed calling `ref` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + ref(): this; + /** + * This property shows the number of characters buffered for writing. The buffer + * may contain strings whose length after encoding is not yet known. So this number + * is only an approximation of the number of bytes in the buffer. + * + * `net.Socket` has the property that `socket.write()` always works. This is to + * help users get up and running quickly. The computer cannot always keep up + * with the amount of data that is written to a socket. The network connection + * simply might be too slow. Node.js will internally queue up the data written to a + * socket and send it out over the wire when it is possible. + * + * The consequence of this internal buffering is that memory may grow. + * Users who experience large or growing `bufferSize` should attempt to + * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. + * @since v0.3.8 + * @deprecated Since v14.6.0 - Use `writableLength` instead. + */ + readonly bufferSize: number; + /** + * The amount of received bytes. + * @since v0.5.3 + */ + readonly bytesRead: number; + /** + * The amount of bytes sent. + * @since v0.5.3 + */ + readonly bytesWritten: number; + /** + * If `true`,`socket.connect(options[, connectListener])` was + * called and has not yet finished. It will stay `true` until the socket becomes + * connected, then it is set to `false` and the `'connect'` event is emitted. Note + * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. + * @since v6.1.0 + */ + readonly connecting: boolean; + /** + * See `writable.destroyed` for further details. + */ + readonly destroyed: boolean; + /** + * The string representation of the local IP address the remote client is + * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client + * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. + * @since v0.9.6 + */ + readonly localAddress?: string; + /** + * The numeric representation of the local port. For example, `80` or `21`. + * @since v0.9.6 + */ + readonly localPort?: number; + /** + * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. + * @since v18.8.0 + */ + readonly localFamily?: string; + /** + * This property represents the state of the connection as a string. + * @see {https://nodejs.org/api/net.html#socketreadystate} + * @since v0.5.0 + */ + readonly readyState: SocketReadyState; + /** + * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.5.10 + */ + readonly remoteAddress?: string | undefined; + /** + * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. + * @since v0.11.14 + */ + readonly remoteFamily?: string | undefined; + /** + * The numeric representation of the remote port. For example, `80` or `21`. + * @since v0.5.10 + */ + readonly remotePort?: number | undefined; + /** + * The socket timeout in milliseconds as set by socket.setTimeout(). It is undefined if a timeout has not been set. + * @since v10.7.0 + */ + readonly timeout?: number | undefined; + /** + * Half-closes the socket. i.e., it sends a FIN packet. It is possible the + * server will still send some data. + * + * See `writable.end()` for further details. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + * @param callback Optional callback for when the socket is finished. + * @return The socket itself. + */ + end(callback?: () => void): this; + end(buffer: Uint8Array | string, callback?: () => void): this; + end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. ready + * 9. timeout + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: (hadError: boolean) => void): this; + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'data', listener: (data: Buffer) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'timeout', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close', hadError: boolean): boolean; + emit(event: 'connect'): boolean; + emit(event: 'data', data: Buffer): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean; + emit(event: 'ready'): boolean; + emit(event: 'timeout'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (hadError: boolean) => void): this; + on(event: 'connect', listener: () => void): this; + on(event: 'data', listener: (data: Buffer) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'timeout', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: (hadError: boolean) => void): this; + once(event: 'connect', listener: () => void): this; + once(event: 'data', listener: (data: Buffer) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'timeout', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: (hadError: boolean) => void): this; + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'data', listener: (data: Buffer) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this; + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'data', listener: (data: Buffer) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + } + interface ListenOptions extends Abortable { + port?: number | undefined; + host?: string | undefined; + backlog?: number | undefined; + path?: string | undefined; + exclusive?: boolean | undefined; + readableAll?: boolean | undefined; + writableAll?: boolean | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + } + interface ServerOpts { + /** + * Indicates whether half-opened TCP connections are allowed. + * @default false + */ + allowHalfOpen?: boolean | undefined; + /** + * Indicates whether the socket should be paused on incoming connections. + * @default false + */ + pauseOnConnect?: boolean | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default false + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + } + interface DropArgument { + localAddress?: string; + localPort?: number; + localFamily?: string; + remoteAddress?: string; + remotePort?: number; + remoteFamily?: string; + } + /** + * This class is used to create a TCP or `IPC` server. + * @since v0.1.90 + */ + class Server extends EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); + /** + * Start a server listening for connections. A `net.Server` can be a TCP or + * an `IPC` server depending on what it listens to. + * + * Possible signatures: + * + * * `server.listen(handle[, backlog][, callback])` + * * `server.listen(options[, callback])` + * * `server.listen(path[, backlog][, callback])` for `IPC` servers + * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers + * + * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` + * event. + * + * All `listen()` methods can take a `backlog` parameter to specify the maximum + * length of the queue of pending connections. The actual length will be determined + * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). + * + * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for + * details). + * + * The `server.listen()` method can be called again if and only if there was an + * error during the first `server.listen()` call or `server.close()` has been + * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. + * + * One of the most common errors raised when listening is `EADDRINUSE`. + * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry + * after a certain amount of time: + * + * ```js + * server.on('error', (e) => { + * if (e.code === 'EADDRINUSE') { + * console.log('Address in use, retrying...'); + * setTimeout(() => { + * server.close(); + * server.listen(PORT, HOST); + * }, 1000); + * } + * }); + * ``` + */ + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, hostname?: string, listeningListener?: () => void): this; + listen(port?: number, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, listeningListener?: () => void): this; + listen(path: string, backlog?: number, listeningListener?: () => void): this; + listen(path: string, listeningListener?: () => void): this; + listen(options: ListenOptions, listeningListener?: () => void): this; + listen(handle: any, backlog?: number, listeningListener?: () => void): this; + listen(handle: any, listeningListener?: () => void): this; + /** + * Stops the server from accepting new connections and keeps existing + * connections. This function is asynchronous, the server is finally closed + * when all connections are ended and the server emits a `'close'` event. + * The optional `callback` will be called once the `'close'` event occurs. Unlike + * that event, it will be called with an `Error` as its only argument if the server + * was not open when it was closed. + * @since v0.1.90 + * @param callback Called when the server is closed. + */ + close(callback?: (err?: Error) => void): this; + /** + * Returns the bound `address`, the address `family` name, and `port` of the server + * as reported by the operating system if listening on an IP socket + * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. + * + * For a server listening on a pipe or Unix domain socket, the name is returned + * as a string. + * + * ```js + * const server = net.createServer((socket) => { + * socket.end('goodbye\n'); + * }).on('error', (err) => { + * // Handle errors here. + * throw err; + * }); + * + * // Grab an arbitrary unused port. + * server.listen(() => { + * console.log('opened server on', server.address()); + * }); + * ``` + * + * `server.address()` returns `null` before the `'listening'` event has been + * emitted or after calling `server.close()`. + * @since v0.1.90 + */ + address(): AddressInfo | string | null; + /** + * Asynchronously get the number of concurrent connections on the server. Works + * when sockets were sent to forks. + * + * Callback should take two arguments `err` and `count`. + * @since v0.9.7 + */ + getConnections(cb: (error: Error | null, count: number) => void): void; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). + * If the server is `ref`ed calling `ref()` again will have no effect. + * @since v0.9.1 + */ + ref(): this; + /** + * Calling `unref()` on a server will allow the program to exit if this is the only + * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + */ + unref(): this; + /** + * Set this property to reject connections when the server's connection count gets + * high. + * + * It is not recommended to use this option once a socket has been sent to a child + * with `child_process.fork()`. + * @since v0.2.0 + */ + maxConnections: number; + connections: number; + /** + * Indicates whether or not the server is listening for connections. + * @since v5.7.0 + */ + listening: boolean; + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + * 5. drop + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Socket) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'drop', listener: (data?: DropArgument) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Socket): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit(event: 'drop', data?: DropArgument): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Socket) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'drop', listener: (data?: DropArgument) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Socket) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'drop', listener: (data?: DropArgument) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Socket) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'drop', listener: (data?: DropArgument) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'drop', listener: (data?: DropArgument) => void): this; + } + type IPVersion = 'ipv4' | 'ipv6'; + /** + * The `BlockList` object can be used with some network APIs to specify rules for + * disabling inbound or outbound access to specific IP addresses, IP ranges, or + * IP subnets. + * @since v15.0.0, v14.18.0 + */ + class BlockList { + /** + * Adds a rule to block the given IP address. + * @since v15.0.0, v14.18.0 + * @param address An IPv4 or IPv6 address. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addAddress(address: string, type?: IPVersion): void; + addAddress(address: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). + * @since v15.0.0, v14.18.0 + * @param start The starting IPv4 or IPv6 address in the range. + * @param end The ending IPv4 or IPv6 address in the range. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addRange(start: string, end: string, type?: IPVersion): void; + addRange(start: SocketAddress, end: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses specified as a subnet mask. + * @since v15.0.0, v14.18.0 + * @param net The network IPv4 or IPv6 address. + * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addSubnet(net: SocketAddress, prefix: number): void; + addSubnet(net: string, prefix: number, type?: IPVersion): void; + /** + * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. + * + * ```js + * const blockList = new net.BlockList(); + * blockList.addAddress('123.123.123.123'); + * blockList.addRange('10.0.0.1', '10.0.0.10'); + * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); + * + * console.log(blockList.check('123.123.123.123')); // Prints: true + * console.log(blockList.check('10.0.0.3')); // Prints: true + * console.log(blockList.check('222.111.111.222')); // Prints: false + * + * // IPv6 notation for IPv4 addresses works: + * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true + * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true + * ``` + * @since v15.0.0, v14.18.0 + * @param address The IP address to check + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + check(address: SocketAddress): boolean; + check(address: string, type?: IPVersion): boolean; + } + interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + /** + * Creates a new TCP or `IPC` server. + * + * If `allowHalfOpen` is set to `true`, when the other end of the socket + * signals the end of transmission, the server will only send back the end of + * transmission when `socket.end()` is explicitly called. For example, in the + * context of TCP, when a FIN packed is received, a FIN packed is sent + * back only when `socket.end()` is explicitly called. Until then the + * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. + * + * If `pauseOnConnect` is set to `true`, then the socket associated with each + * incoming connection will be paused, and no data will be read from its handle. + * This allows connections to be passed between processes without any data being + * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. + * + * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. + * + * Here is an example of a TCP echo server which listens for connections + * on port 8124: + * + * ```js + * const net = require('net'); + * const server = net.createServer((c) => { + * // 'connection' listener. + * console.log('client connected'); + * c.on('end', () => { + * console.log('client disconnected'); + * }); + * c.write('hello\r\n'); + * c.pipe(c); + * }); + * server.on('error', (err) => { + * throw err; + * }); + * server.listen(8124, () => { + * console.log('server bound'); + * }); + * ``` + * + * Test this by using `telnet`: + * + * ```console + * $ telnet localhost 8124 + * ``` + * + * To listen on the socket `/tmp/echo.sock`: + * + * ```js + * server.listen('/tmp/echo.sock', () => { + * console.log('server bound'); + * }); + * ``` + * + * Use `nc` to connect to a Unix domain socket server: + * + * ```console + * $ nc -U /tmp/echo.sock + * ``` + * @since v0.5.0 + * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. + */ + function createServer(connectionListener?: (socket: Socket) => void): Server; + function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; + /** + * Aliases to {@link createConnection}. + * + * Possible signatures: + * + * * {@link connect} + * * {@link connect} for `IPC` connections. + * * {@link connect} for TCP connections. + */ + function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; + function connect(port: number, host?: string, connectionListener?: () => void): Socket; + function connect(path: string, connectionListener?: () => void): Socket; + /** + * A factory function, which creates a new {@link Socket}, + * immediately initiates connection with `socket.connect()`, + * then returns the `net.Socket` that starts the connection. + * + * When the connection is established, a `'connect'` event will be emitted + * on the returned socket. The last parameter `connectListener`, if supplied, + * will be added as a listener for the `'connect'` event **once**. + * + * Possible signatures: + * + * * {@link createConnection} + * * {@link createConnection} for `IPC` connections. + * * {@link createConnection} for TCP connections. + * + * The {@link connect} function is an alias to this function. + */ + function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; + function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; + function createConnection(path: string, connectionListener?: () => void): Socket; + /** + * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 + * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. + * + * ```js + * net.isIP('::1'); // returns 6 + * net.isIP('127.0.0.1'); // returns 4 + * net.isIP('127.000.000.001'); // returns 0 + * net.isIP('127.0.0.1/24'); // returns 0 + * net.isIP('fhqwhgads'); // returns 0 + * ``` + * @since v0.3.0 + */ + function isIP(input: string): number; + /** + * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no + * leading zeroes. Otherwise, returns `false`. + * + * ```js + * net.isIPv4('127.0.0.1'); // returns true + * net.isIPv4('127.000.000.001'); // returns false + * net.isIPv4('127.0.0.1/24'); // returns false + * net.isIPv4('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv4(input: string): boolean; + /** + * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. + * + * ```js + * net.isIPv6('::1'); // returns true + * net.isIPv6('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv6(input: string): boolean; + interface SocketAddressInitOptions { + /** + * The network address as either an IPv4 or IPv6 string. + * @default 127.0.0.1 + */ + address?: string | undefined; + /** + * @default `'ipv4'` + */ + family?: IPVersion | undefined; + /** + * An IPv6 flow-label used only if `family` is `'ipv6'`. + * @default 0 + */ + flowlabel?: number | undefined; + /** + * An IP port. + * @default 0 + */ + port?: number | undefined; + } + /** + * @since v15.14.0, v14.18.0 + */ + class SocketAddress { + constructor(options: SocketAddressInitOptions); + /** + * @since v15.14.0, v14.18.0 + */ + readonly address: string; + /** + * Either \`'ipv4'\` or \`'ipv6'\`. + * @since v15.14.0, v14.18.0 + */ + readonly family: IPVersion; + /** + * @since v15.14.0, v14.18.0 + */ + readonly port: number; + /** + * @since v15.14.0, v14.18.0 + */ + readonly flowlabel: number; + } +} +declare module 'node:net' { + export * from 'net'; +} diff --git a/server/node_modules/@types/node/os.d.ts b/server/node_modules/@types/node/os.d.ts new file mode 100755 index 0000000000..3c555992dd --- /dev/null +++ b/server/node_modules/@types/node/os.d.ts @@ -0,0 +1,466 @@ +/** + * The `os` module provides operating system-related utility methods and + * properties. It can be accessed using: + * + * ```js + * const os = require('os'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js) + */ +declare module 'os' { + interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + cidr: string | null; + } + interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: 'IPv4'; + scopeid?: undefined; + } + interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: 'IPv6'; + scopeid: number; + } + interface UserInfo { + username: T; + uid: number; + gid: number; + shell: T; + homedir: T; + } + type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + /** + * Returns the host name of the operating system as a string. + * @since v0.3.3 + */ + function hostname(): string; + /** + * Returns an array containing the 1, 5, and 15 minute load averages. + * + * The load average is a measure of system activity calculated by the operating + * system and expressed as a fractional number. + * + * The load average is a Unix-specific concept. On Windows, the return value is + * always `[0, 0, 0]`. + * @since v0.3.3 + */ + function loadavg(): number[]; + /** + * Returns the system uptime in number of seconds. + * @since v0.3.3 + */ + function uptime(): number; + /** + * Returns the amount of free system memory in bytes as an integer. + * @since v0.3.3 + */ + function freemem(): number; + /** + * Returns the total amount of system memory in bytes as an integer. + * @since v0.3.3 + */ + function totalmem(): number; + /** + * Returns an array of objects containing information about each logical CPU core. + * + * The properties included on each object include: + * + * ```js + * [ + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 252020, + * nice: 0, + * sys: 30340, + * idle: 1070356870, + * irq: 0 + * } + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 306960, + * nice: 0, + * sys: 26980, + * idle: 1071569080, + * irq: 0 + * } + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 248450, + * nice: 0, + * sys: 21750, + * idle: 1070919370, + * irq: 0 + * } + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 256880, + * nice: 0, + * sys: 19430, + * idle: 1070905480, + * irq: 20 + * } + * }, + * ] + * ``` + * + * `nice` values are POSIX-only. On Windows, the `nice` values of all processors + * are always 0. + * @since v0.3.3 + */ + function cpus(): CpuInfo[]; + /** + * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it + * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. + * + * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information + * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. + * @since v0.3.3 + */ + function type(): string; + /** + * Returns the operating system as a string. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See + * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v0.3.3 + */ + function release(): string; + /** + * Returns an object containing network interfaces that have been assigned a + * network address. + * + * Each key on the returned object identifies a network interface. The associated + * value is an array of objects that each describe an assigned network address. + * + * The properties available on the assigned network address object include: + * + * ```js + * { + * lo: [ + * { + * address: '127.0.0.1', + * netmask: '255.0.0.0', + * family: 'IPv4', + * mac: '00:00:00:00:00:00', + * internal: true, + * cidr: '127.0.0.1/8' + * }, + * { + * address: '::1', + * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', + * family: 'IPv6', + * mac: '00:00:00:00:00:00', + * scopeid: 0, + * internal: true, + * cidr: '::1/128' + * } + * ], + * eth0: [ + * { + * address: '192.168.1.108', + * netmask: '255.255.255.0', + * family: 'IPv4', + * mac: '01:02:03:0a:0b:0c', + * internal: false, + * cidr: '192.168.1.108/24' + * }, + * { + * address: 'fe80::a00:27ff:fe4e:66a1', + * netmask: 'ffff:ffff:ffff:ffff::', + * family: 'IPv6', + * mac: '01:02:03:0a:0b:0c', + * scopeid: 1, + * internal: false, + * cidr: 'fe80::a00:27ff:fe4e:66a1/64' + * } + * ] + * } + * ``` + * @since v0.6.0 + */ + function networkInterfaces(): NodeJS.Dict; + /** + * Returns the string path of the current user's home directory. + * + * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it + * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. + * + * On Windows, it uses the `USERPROFILE` environment variable if defined. + * Otherwise it uses the path to the profile directory of the current user. + * @since v2.3.0 + */ + function homedir(): string; + /** + * Returns information about the currently effective user. On POSIX platforms, + * this is typically a subset of the password file. The returned object includes + * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. + * + * The value of `homedir` returned by `os.userInfo()` is provided by the operating + * system. This differs from the result of `os.homedir()`, which queries + * environment variables for the home directory before falling back to the + * operating system response. + * + * Throws a `SystemError` if a user has no `username` or `homedir`. + * @since v6.0.0 + */ + function userInfo(options: { encoding: 'buffer' }): UserInfo; + function userInfo(options?: { encoding: BufferEncoding }): UserInfo; + type SignalConstants = { + [key in NodeJS.Signals]: number; + }; + namespace constants { + const UV_UDP_REUSEADDR: number; + namespace signals {} + const signals: SignalConstants; + namespace errno { + const E2BIG: number; + const EACCES: number; + const EADDRINUSE: number; + const EADDRNOTAVAIL: number; + const EAFNOSUPPORT: number; + const EAGAIN: number; + const EALREADY: number; + const EBADF: number; + const EBADMSG: number; + const EBUSY: number; + const ECANCELED: number; + const ECHILD: number; + const ECONNABORTED: number; + const ECONNREFUSED: number; + const ECONNRESET: number; + const EDEADLK: number; + const EDESTADDRREQ: number; + const EDOM: number; + const EDQUOT: number; + const EEXIST: number; + const EFAULT: number; + const EFBIG: number; + const EHOSTUNREACH: number; + const EIDRM: number; + const EILSEQ: number; + const EINPROGRESS: number; + const EINTR: number; + const EINVAL: number; + const EIO: number; + const EISCONN: number; + const EISDIR: number; + const ELOOP: number; + const EMFILE: number; + const EMLINK: number; + const EMSGSIZE: number; + const EMULTIHOP: number; + const ENAMETOOLONG: number; + const ENETDOWN: number; + const ENETRESET: number; + const ENETUNREACH: number; + const ENFILE: number; + const ENOBUFS: number; + const ENODATA: number; + const ENODEV: number; + const ENOENT: number; + const ENOEXEC: number; + const ENOLCK: number; + const ENOLINK: number; + const ENOMEM: number; + const ENOMSG: number; + const ENOPROTOOPT: number; + const ENOSPC: number; + const ENOSR: number; + const ENOSTR: number; + const ENOSYS: number; + const ENOTCONN: number; + const ENOTDIR: number; + const ENOTEMPTY: number; + const ENOTSOCK: number; + const ENOTSUP: number; + const ENOTTY: number; + const ENXIO: number; + const EOPNOTSUPP: number; + const EOVERFLOW: number; + const EPERM: number; + const EPIPE: number; + const EPROTO: number; + const EPROTONOSUPPORT: number; + const EPROTOTYPE: number; + const ERANGE: number; + const EROFS: number; + const ESPIPE: number; + const ESRCH: number; + const ESTALE: number; + const ETIME: number; + const ETIMEDOUT: number; + const ETXTBSY: number; + const EWOULDBLOCK: number; + const EXDEV: number; + const WSAEINTR: number; + const WSAEBADF: number; + const WSAEACCES: number; + const WSAEFAULT: number; + const WSAEINVAL: number; + const WSAEMFILE: number; + const WSAEWOULDBLOCK: number; + const WSAEINPROGRESS: number; + const WSAEALREADY: number; + const WSAENOTSOCK: number; + const WSAEDESTADDRREQ: number; + const WSAEMSGSIZE: number; + const WSAEPROTOTYPE: number; + const WSAENOPROTOOPT: number; + const WSAEPROTONOSUPPORT: number; + const WSAESOCKTNOSUPPORT: number; + const WSAEOPNOTSUPP: number; + const WSAEPFNOSUPPORT: number; + const WSAEAFNOSUPPORT: number; + const WSAEADDRINUSE: number; + const WSAEADDRNOTAVAIL: number; + const WSAENETDOWN: number; + const WSAENETUNREACH: number; + const WSAENETRESET: number; + const WSAECONNABORTED: number; + const WSAECONNRESET: number; + const WSAENOBUFS: number; + const WSAEISCONN: number; + const WSAENOTCONN: number; + const WSAESHUTDOWN: number; + const WSAETOOMANYREFS: number; + const WSAETIMEDOUT: number; + const WSAECONNREFUSED: number; + const WSAELOOP: number; + const WSAENAMETOOLONG: number; + const WSAEHOSTDOWN: number; + const WSAEHOSTUNREACH: number; + const WSAENOTEMPTY: number; + const WSAEPROCLIM: number; + const WSAEUSERS: number; + const WSAEDQUOT: number; + const WSAESTALE: number; + const WSAEREMOTE: number; + const WSASYSNOTREADY: number; + const WSAVERNOTSUPPORTED: number; + const WSANOTINITIALISED: number; + const WSAEDISCON: number; + const WSAENOMORE: number; + const WSAECANCELLED: number; + const WSAEINVALIDPROCTABLE: number; + const WSAEINVALIDPROVIDER: number; + const WSAEPROVIDERFAILEDINIT: number; + const WSASYSCALLFAILURE: number; + const WSASERVICE_NOT_FOUND: number; + const WSATYPE_NOT_FOUND: number; + const WSA_E_NO_MORE: number; + const WSA_E_CANCELLED: number; + const WSAEREFUSED: number; + } + namespace priority { + const PRIORITY_LOW: number; + const PRIORITY_BELOW_NORMAL: number; + const PRIORITY_NORMAL: number; + const PRIORITY_ABOVE_NORMAL: number; + const PRIORITY_HIGH: number; + const PRIORITY_HIGHEST: number; + } + } + const devNull: string; + const EOL: string; + /** + * Returns the operating system CPU architecture for which the Node.js binary was + * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. + * + * The return value is equivalent to `process.arch`. + * @since v0.5.0 + */ + function arch(): string; + /** + * Returns a string identifying the kernel version. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not + * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v13.11.0, v12.17.0 + */ + function version(): string; + /** + * Returns a string identifying the operating system platform for which + * the Node.js binary was compiled. The value is set at compile time. + * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. + * + * The return value is equivalent to `process.platform`. + * + * The value `'android'` may also be returned if Node.js is built on the Android + * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.5.0 + */ + function platform(): NodeJS.Platform; + /** + * Returns the machine type as a string, such as arm, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64. + * + * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). + * On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used. + * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v18.9.0 + */ + function machine(): string; + /** + * Returns the operating system's default directory for temporary files as a + * string. + * @since v0.9.9 + */ + function tmpdir(): string; + /** + * Returns a string identifying the endianness of the CPU for which the Node.js + * binary was compiled. + * + * Possible values are `'BE'` for big endian and `'LE'` for little endian. + * @since v0.9.4 + */ + function endianness(): 'BE' | 'LE'; + /** + * Returns the scheduling priority for the process specified by `pid`. If `pid` is + * not provided or is `0`, the priority of the current process is returned. + * @since v10.10.0 + * @param [pid=0] The process ID to retrieve scheduling priority for. + */ + function getPriority(pid?: number): number; + /** + * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. + * + * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows + * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range + * mapping may cause the return value to be slightly different on Windows. To avoid + * confusion, set `priority` to one of the priority constants. + * + * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user + * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. + * @since v10.10.0 + * @param [pid=0] The process ID to set scheduling priority for. + * @param priority The scheduling priority to assign to the process. + */ + function setPriority(priority: number): void; + function setPriority(pid: number, priority: number): void; +} +declare module 'node:os' { + export * from 'os'; +} diff --git a/server/node_modules/@types/node/package.json b/server/node_modules/@types/node/package.json new file mode 100755 index 0000000000..1570db1aeb --- /dev/null +++ b/server/node_modules/@types/node/package.json @@ -0,0 +1,237 @@ +{ + "name": "@types/node", + "version": "18.11.18", + "description": "TypeScript definitions for Node.js", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", + "license": "MIT", + "contributors": [ + { + "name": "Microsoft TypeScript", + "url": "https://github.com/Microsoft", + "githubUsername": "Microsoft" + }, + { + "name": "DefinitelyTyped", + "url": "https://github.com/DefinitelyTyped", + "githubUsername": "DefinitelyTyped" + }, + { + "name": "Alberto Schiabel", + "url": "https://github.com/jkomyno", + "githubUsername": "jkomyno" + }, + { + "name": "Alvis HT Tang", + "url": "https://github.com/alvis", + "githubUsername": "alvis" + }, + { + "name": "Andrew Makarov", + "url": "https://github.com/r3nya", + "githubUsername": "r3nya" + }, + { + "name": "Benjamin Toueg", + "url": "https://github.com/btoueg", + "githubUsername": "btoueg" + }, + { + "name": "Chigozirim C.", + "url": "https://github.com/smac89", + "githubUsername": "smac89" + }, + { + "name": "David Junger", + "url": "https://github.com/touffy", + "githubUsername": "touffy" + }, + { + "name": "Deividas Bakanas", + "url": "https://github.com/DeividasBakanas", + "githubUsername": "DeividasBakanas" + }, + { + "name": "Eugene Y. Q. Shen", + "url": "https://github.com/eyqs", + "githubUsername": "eyqs" + }, + { + "name": "Hannes Magnusson", + "url": "https://github.com/Hannes-Magnusson-CK", + "githubUsername": "Hannes-Magnusson-CK" + }, + { + "name": "Huw", + "url": "https://github.com/hoo29", + "githubUsername": "hoo29" + }, + { + "name": "Kelvin Jin", + "url": "https://github.com/kjin", + "githubUsername": "kjin" + }, + { + "name": "Klaus Meinhardt", + "url": "https://github.com/ajafff", + "githubUsername": "ajafff" + }, + { + "name": "Lishude", + "url": "https://github.com/islishude", + "githubUsername": "islishude" + }, + { + "name": "Mariusz Wiktorczyk", + "url": "https://github.com/mwiktorczyk", + "githubUsername": "mwiktorczyk" + }, + { + "name": "Mohsen Azimi", + "url": "https://github.com/mohsen1", + "githubUsername": "mohsen1" + }, + { + "name": "Nicolas Even", + "url": "https://github.com/n-e", + "githubUsername": "n-e" + }, + { + "name": "Nikita Galkin", + "url": "https://github.com/galkin", + "githubUsername": "galkin" + }, + { + "name": "Parambir Singh", + "url": "https://github.com/parambirs", + "githubUsername": "parambirs" + }, + { + "name": "Sebastian Silbermann", + "url": "https://github.com/eps1lon", + "githubUsername": "eps1lon" + }, + { + "name": "Simon Schick", + "url": "https://github.com/SimonSchick", + "githubUsername": "SimonSchick" + }, + { + "name": "Thomas den Hollander", + "url": "https://github.com/ThomasdenH", + "githubUsername": "ThomasdenH" + }, + { + "name": "Wilco Bakker", + "url": "https://github.com/WilcoBakker", + "githubUsername": "WilcoBakker" + }, + { + "name": "wwwy3y3", + "url": "https://github.com/wwwy3y3", + "githubUsername": "wwwy3y3" + }, + { + "name": "Samuel Ainsworth", + "url": "https://github.com/samuela", + "githubUsername": "samuela" + }, + { + "name": "Kyle Uehlein", + "url": "https://github.com/kuehlein", + "githubUsername": "kuehlein" + }, + { + "name": "Thanik Bhongbhibhat", + "url": "https://github.com/bhongy", + "githubUsername": "bhongy" + }, + { + "name": "Marcin Kopacz", + "url": "https://github.com/chyzwar", + "githubUsername": "chyzwar" + }, + { + "name": "Trivikram Kamat", + "url": "https://github.com/trivikr", + "githubUsername": "trivikr" + }, + { + "name": "Junxiao Shi", + "url": "https://github.com/yoursunny", + "githubUsername": "yoursunny" + }, + { + "name": "Ilia Baryshnikov", + "url": "https://github.com/qwelias", + "githubUsername": "qwelias" + }, + { + "name": "ExE Boss", + "url": "https://github.com/ExE-Boss", + "githubUsername": "ExE-Boss" + }, + { + "name": "Piotr Błażejewicz", + "url": "https://github.com/peterblazejewicz", + "githubUsername": "peterblazejewicz" + }, + { + "name": "Anna Henningsen", + "url": "https://github.com/addaleax", + "githubUsername": "addaleax" + }, + { + "name": "Victor Perin", + "url": "https://github.com/victorperin", + "githubUsername": "victorperin" + }, + { + "name": "Yongsheng Zhang", + "url": "https://github.com/ZYSzys", + "githubUsername": "ZYSzys" + }, + { + "name": "NodeJS Contributors", + "url": "https://github.com/NodeJS", + "githubUsername": "NodeJS" + }, + { + "name": "Linus Unnebäck", + "url": "https://github.com/LinusU", + "githubUsername": "LinusU" + }, + { + "name": "wafuwafu13", + "url": "https://github.com/wafuwafu13", + "githubUsername": "wafuwafu13" + }, + { + "name": "Matteo Collina", + "url": "https://github.com/mcollina", + "githubUsername": "mcollina" + }, + { + "name": "Dmitry Semigradsky", + "url": "https://github.com/Semigradsky", + "githubUsername": "Semigradsky" + } + ], + "main": "", + "types": "index.d.ts", + "typesVersions": { + "<=4.8": { + "*": [ + "ts4.8/*" + ] + } + }, + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/node" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "540ec74ad976942ed4b12e09fd57842adfd77a63a4ea099f15f0602ad707835c", + "typeScriptVersion": "4.2" +} \ No newline at end of file diff --git a/server/node_modules/@types/node/path.d.ts b/server/node_modules/@types/node/path.d.ts new file mode 100755 index 0000000000..1d33f79269 --- /dev/null +++ b/server/node_modules/@types/node/path.d.ts @@ -0,0 +1,191 @@ +declare module 'path/posix' { + import path = require('path'); + export = path; +} +declare module 'path/win32' { + import path = require('path'); + export = path; +} +/** + * The `path` module provides utilities for working with file and directory paths. + * It can be accessed using: + * + * ```js + * const path = require('path'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/path.js) + */ +declare module 'path' { + namespace path { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string | undefined; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string | undefined; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string | undefined; + /** + * The file extension (if any) such as '.html' + */ + ext?: string | undefined; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string | undefined; + } + interface PlatformPath { + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param path string path to normalize. + * @throws {TypeError} if `path` is not a string. + */ + normalize(path: string): string; + /** + * Join all arguments together and normalize the resulting path. + * + * @param paths paths to join. + * @throws {TypeError} if any of the path segments is not a string. + */ + join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} parameter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, + * until an absolute path is found. If after using all {from} paths still no absolute path is found, + * the current working directory is used as well. The resulting path is normalized, + * and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param paths A sequence of paths or path segments. + * @throws {TypeError} if any of the arguments is not a string. + */ + resolve(...paths: string[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * If the given {path} is a zero-length string, `false` will be returned. + * + * @param path path to test. + * @throws {TypeError} if `path` is not a string. + */ + isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to} based on the current working directory. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @throws {TypeError} if either `from` or `to` is not a string. + */ + relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + dirname(path: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param path the path to evaluate. + * @param suffix optionally, an extension to remove from the result. + * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. + */ + basename(path: string, suffix?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + extname(path: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + readonly sep: '\\' | '/'; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + readonly delimiter: ';' | ':'; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param path path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + parse(path: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathObject path to evaluate. + */ + format(pathObject: FormatInputPathObject): string; + /** + * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. + * If path is not a string, path will be returned without modifications. + * This method is meaningful only on Windows system. + * On POSIX systems, the method is non-operational and always returns path without modifications. + */ + toNamespacedPath(path: string): string; + /** + * Posix specific pathing. + * Same as parent object on posix. + */ + readonly posix: PlatformPath; + /** + * Windows specific pathing. + * Same as parent object on windows + */ + readonly win32: PlatformPath; + } + } + const path: path.PlatformPath; + export = path; +} +declare module 'node:path' { + import path = require('path'); + export = path; +} +declare module 'node:path/posix' { + import path = require('path/posix'); + export = path; +} +declare module 'node:path/win32' { + import path = require('path/win32'); + export = path; +} diff --git a/server/node_modules/@types/node/perf_hooks.d.ts b/server/node_modules/@types/node/perf_hooks.d.ts new file mode 100755 index 0000000000..5c0b228e7d --- /dev/null +++ b/server/node_modules/@types/node/perf_hooks.d.ts @@ -0,0 +1,625 @@ +/** + * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for + * Node.js-specific performance measurements. + * + * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): + * + * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) + * * [Performance Timeline](https://w3c.github.io/performance-timeline/) + * * [User Timing](https://www.w3.org/TR/user-timing/) + * + * ```js + * const { PerformanceObserver, performance } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((items) => { + * console.log(items.getEntries()[0].duration); + * performance.clearMarks(); + * }); + * obs.observe({ type: 'measure' }); + * performance.measure('Start to Now'); + * + * performance.mark('A'); + * doSomeLongRunningProcess(() => { + * performance.measure('A to Now', 'A'); + * + * performance.mark('B'); + * performance.measure('A to B', 'A', 'B'); + * }); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js) + */ +declare module 'perf_hooks' { + import { AsyncResource } from 'node:async_hooks'; + type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http'; + interface NodeGCPerformanceDetail { + /** + * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies + * the type of garbage collection operation that occurred. + * See perf_hooks.constants for valid values. + */ + readonly kind?: number | undefined; + /** + * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` + * property contains additional information about garbage collection operation. + * See perf_hooks.constants for valid values. + */ + readonly flags?: number | undefined; + } + /** + * @since v8.5.0 + */ + class PerformanceEntry { + protected constructor(); + /** + * The total number of milliseconds elapsed for this entry. This value will not + * be meaningful for all Performance Entry types. + * @since v8.5.0 + */ + readonly duration: number; + /** + * The name of the performance entry. + * @since v8.5.0 + */ + readonly name: string; + /** + * The high resolution millisecond timestamp marking the starting time of the + * Performance Entry. + * @since v8.5.0 + */ + readonly startTime: number; + /** + * The type of the performance entry. It may be one of: + * + * * `'node'` (Node.js only) + * * `'mark'` (available on the Web) + * * `'measure'` (available on the Web) + * * `'gc'` (Node.js only) + * * `'function'` (Node.js only) + * * `'http2'` (Node.js only) + * * `'http'` (Node.js only) + * @since v8.5.0 + */ + readonly entryType: EntryType; + /** + * Additional detail specific to the `entryType`. + * @since v16.0.0 + */ + readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. + toJSON(): any; + } + class PerformanceMark extends PerformanceEntry { + readonly duration: 0; + readonly entryType: 'mark'; + } + class PerformanceMeasure extends PerformanceEntry { + readonly entryType: 'measure'; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Provides timing details for Node.js itself. The constructor of this class + * is not exposed to users. + * @since v8.5.0 + */ + class PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process + * completed bootstrapping. If bootstrapping has not yet finished, the property + * has the value of -1. + * @since v8.5.0 + */ + readonly bootstrapComplete: number; + /** + * The high resolution millisecond timestamp at which the Node.js environment was + * initialized. + * @since v8.5.0 + */ + readonly environment: number; + /** + * The high resolution millisecond timestamp of the amount of time the event loop + * has been idle within the event loop's event provider (e.g. `epoll_wait`). This + * does not take CPU usage into consideration. If the event loop has not yet + * started (e.g., in the first tick of the main script), the property has the + * value of 0. + * @since v14.10.0, v12.19.0 + */ + readonly idleTime: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * exited. If the event loop has not yet exited, the property has the value of -1\. + * It can only have a value of not -1 in a handler of the `'exit'` event. + * @since v8.5.0 + */ + readonly loopExit: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * started. If the event loop has not yet started (e.g., in the first tick of the + * main script), the property has the value of -1. + * @since v8.5.0 + */ + readonly loopStart: number; + /** + * The high resolution millisecond timestamp at which the V8 platform was + * initialized. + * @since v8.5.0 + */ + readonly v8Start: number; + } + interface EventLoopUtilization { + idle: number; + active: number; + utilization: number; + } + /** + * @param util1 The result of a previous call to eventLoopUtilization() + * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 + */ + type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization; + interface MarkOptions { + /** + * Additional optional detail to include with the mark. + */ + detail?: unknown | undefined; + /** + * An optional timestamp to be used as the mark time. + * @default `performance.now()`. + */ + startTime?: number | undefined; + } + interface MeasureOptions { + /** + * Additional optional detail to include with the mark. + */ + detail?: unknown | undefined; + /** + * Duration between start and end times. + */ + duration?: number | undefined; + /** + * Timestamp to be used as the end time, or a string identifying a previously recorded mark. + */ + end?: number | string | undefined; + /** + * Timestamp to be used as the start time, or a string identifying a previously recorded mark. + */ + start?: number | string | undefined; + } + interface TimerifyOptions { + /** + * A histogram object created using + * `perf_hooks.createHistogram()` that will record runtime durations in + * nanoseconds. + */ + histogram?: RecordableHistogram | undefined; + } + interface Performance { + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + /** + * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. + * If name is provided, removes only the named measure. + * @param name + * @since v16.7.0 + */ + clearMeasures(name?: string): void; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. + * If you are only interested in performance entries of certain types or that have certain names, see + * `performance.getEntriesByType()` and `performance.getEntriesByName()`. + * @since v16.7.0 + */ + getEntries(): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` + * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. + * @param name + * @param type + * @since v16.7.0 + */ + getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` + * whose `performanceEntry.entryType` is equal to `type`. + * @param type + * @since v16.7.0 + */ + getEntriesByType(type: EntryType): PerformanceEntry[]; + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + * @return The PerformanceMark entry that was created + */ + mark(name?: string, options?: MarkOptions): PerformanceMark; + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + * @return The PerformanceMeasure entry that was created + */ + measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; + measure(name: string, options: MeasureOptions): PerformanceMeasure; + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T, options?: TimerifyOptions): T; + /** + * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. + * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). + * No other CPU idle time is taken into consideration. + */ + eventLoopUtilization: EventLoopUtilityFunction; + } + interface PerformanceObserverEntryList { + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime`. + * + * ```js + * const { + * performance, + * PerformanceObserver + * } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntries()); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 81.465639, + * * duration: 0 + * * }, + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 81.860064, + * * duration: 0 + * * } + * * ] + * + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ type: 'mark' }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntries(): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is + * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. + * + * ```js + * const { + * performance, + * PerformanceObserver + * } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntriesByName('meow')); + * + * * [ + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 98.545991, + * * duration: 0 + * * } + * * ] + * + * console.log(perfObserverList.getEntriesByName('nope')); // [] + * + * console.log(perfObserverList.getEntriesByName('test', 'mark')); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 63.518931, + * * duration: 0 + * * } + * * ] + * + * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ entryTypes: ['mark', 'measure'] }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. + * + * ```js + * const { + * performance, + * PerformanceObserver + * } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntriesByType('mark')); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 55.897834, + * * duration: 0 + * * }, + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 56.350146, + * * duration: 0 + * * } + * * ] + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ type: 'mark' }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntriesByType(type: EntryType): PerformanceEntry[]; + } + type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; + class PerformanceObserver extends AsyncResource { + constructor(callback: PerformanceObserverCallback); + /** + * Disconnects the `PerformanceObserver` instance from all notifications. + * @since v8.5.0 + */ + disconnect(): void; + /** + * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: + * + * ```js + * const { + * performance, + * PerformanceObserver + * } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((list, observer) => { + * // Called once asynchronously. `list` contains three items. + * }); + * obs.observe({ type: 'mark' }); + * + * for (let n = 0; n < 3; n++) + * performance.mark(`test${n}`); + * ``` + * @since v8.5.0 + */ + observe( + options: + | { + entryTypes: ReadonlyArray; + buffered?: boolean | undefined; + } + | { + type: EntryType; + buffered?: boolean | undefined; + } + ): void; + } + namespace constants { + const NODE_PERFORMANCE_GC_MAJOR: number; + const NODE_PERFORMANCE_GC_MINOR: number; + const NODE_PERFORMANCE_GC_INCREMENTAL: number; + const NODE_PERFORMANCE_GC_WEAKCB: number; + const NODE_PERFORMANCE_GC_FLAGS_NO: number; + const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; + const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; + const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; + const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; + } + const performance: Performance; + interface EventLoopMonitorOptions { + /** + * The sampling rate in milliseconds. + * Must be greater than zero. + * @default 10 + */ + resolution?: number | undefined; + } + interface Histogram { + /** + * Returns a `Map` object detailing the accumulated percentile distribution. + * @since v11.10.0 + */ + readonly percentiles: Map; + /** + * The number of times the event loop delay exceeded the maximum 1 hour event + * loop delay threshold. + * @since v11.10.0 + */ + readonly exceeds: number; + /** + * The minimum recorded event loop delay. + * @since v11.10.0 + */ + readonly min: number; + /** + * The maximum recorded event loop delay. + * @since v11.10.0 + */ + readonly max: number; + /** + * The mean of the recorded event loop delays. + * @since v11.10.0 + */ + readonly mean: number; + /** + * The standard deviation of the recorded event loop delays. + * @since v11.10.0 + */ + readonly stddev: number; + /** + * Resets the collected histogram data. + * @since v11.10.0 + */ + reset(): void; + /** + * Returns the value at the given percentile. + * @since v11.10.0 + * @param percentile A percentile value in the range (0, 100]. + */ + percentile(percentile: number): number; + } + interface IntervalHistogram extends Histogram { + /** + * Enables the update interval timer. Returns `true` if the timer was + * started, `false` if it was already started. + * @since v11.10.0 + */ + enable(): boolean; + /** + * Disables the update interval timer. Returns `true` if the timer was + * stopped, `false` if it was already stopped. + * @since v11.10.0 + */ + disable(): boolean; + } + interface RecordableHistogram extends Histogram { + /** + * @since v15.9.0, v14.18.0 + * @param val The amount to record in the histogram. + */ + record(val: number | bigint): void; + /** + * Calculates the amount of time (in nanoseconds) that has passed since the + * previous call to `recordDelta()` and records that amount in the histogram. + * + * ## Examples + * @since v15.9.0, v14.18.0 + */ + recordDelta(): void; + /** + * Adds the values from other to this histogram. + * @since v17.4.0, v16.14.0 + * @param other Recordable Histogram to combine with + */ + add(other: RecordableHistogram): void; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Creates an `IntervalHistogram` object that samples and reports the event loop + * delay over time. The delays will be reported in nanoseconds. + * + * Using a timer to detect approximate event loop delay works because the + * execution of timers is tied specifically to the lifecycle of the libuv + * event loop. That is, a delay in the loop will cause a delay in the execution + * of the timer, and those delays are specifically what this API is intended to + * detect. + * + * ```js + * const { monitorEventLoopDelay } = require('perf_hooks'); + * const h = monitorEventLoopDelay({ resolution: 20 }); + * h.enable(); + * // Do something. + * h.disable(); + * console.log(h.min); + * console.log(h.max); + * console.log(h.mean); + * console.log(h.stddev); + * console.log(h.percentiles); + * console.log(h.percentile(50)); + * console.log(h.percentile(99)); + * ``` + * @since v11.10.0 + */ + function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; + interface CreateHistogramOptions { + /** + * The minimum recordable value. Must be an integer value greater than 0. + * @default 1 + */ + min?: number | bigint | undefined; + /** + * The maximum recordable value. Must be an integer value greater than min. + * @default Number.MAX_SAFE_INTEGER + */ + max?: number | bigint | undefined; + /** + * The number of accuracy digits. Must be a number between 1 and 5. + * @default 3 + */ + figures?: number | undefined; + } + /** + * Returns a `RecordableHistogram`. + * @since v15.9.0, v14.18.0 + */ + function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; + + import { performance as _performance } from 'perf_hooks'; + global { + /** + * `performance` is a global reference for `require('perf_hooks').performance` + * https://nodejs.org/api/globals.html#performance + * @since v16.0.0 + */ + var performance: typeof globalThis extends { + onmessage: any; + performance: infer T; + } + ? T + : typeof _performance; + } +} +declare module 'node:perf_hooks' { + export * from 'perf_hooks'; +} diff --git a/server/node_modules/@types/node/process.d.ts b/server/node_modules/@types/node/process.d.ts new file mode 100755 index 0000000000..12148f911b --- /dev/null +++ b/server/node_modules/@types/node/process.d.ts @@ -0,0 +1,1482 @@ +declare module 'process' { + import * as tty from 'node:tty'; + import { Worker } from 'node:worker_threads'; + global { + var process: NodeJS.Process; + namespace NodeJS { + // this namespace merge is here because these are specifically used + // as the type for process.stdin, process.stdout, and process.stderr. + // they can't live in tty.d.ts because we need to disambiguate the imported name. + interface ReadStream extends tty.ReadStream {} + interface WriteStream extends tty.WriteStream {} + interface MemoryUsageFn { + /** + * The `process.memoryUsage()` method iterate over each page to gather informations about memory + * usage which can be slow depending on the program memory allocations. + */ + (): MemoryUsage; + /** + * method returns an integer representing the Resident Set Size (RSS) in bytes. + */ + rss(): number; + } + interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + external: number; + arrayBuffers: number; + } + interface CpuUsage { + user: number; + system: number; + } + interface ProcessRelease { + name: string; + sourceUrl?: string | undefined; + headersUrl?: string | undefined; + libUrl?: string | undefined; + lts?: string | undefined; + } + interface ProcessVersions extends Dict { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; + type Architecture = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x64'; + type Signals = + | 'SIGABRT' + | 'SIGALRM' + | 'SIGBUS' + | 'SIGCHLD' + | 'SIGCONT' + | 'SIGFPE' + | 'SIGHUP' + | 'SIGILL' + | 'SIGINT' + | 'SIGIO' + | 'SIGIOT' + | 'SIGKILL' + | 'SIGPIPE' + | 'SIGPOLL' + | 'SIGPROF' + | 'SIGPWR' + | 'SIGQUIT' + | 'SIGSEGV' + | 'SIGSTKFLT' + | 'SIGSTOP' + | 'SIGSYS' + | 'SIGTERM' + | 'SIGTRAP' + | 'SIGTSTP' + | 'SIGTTIN' + | 'SIGTTOU' + | 'SIGUNUSED' + | 'SIGURG' + | 'SIGUSR1' + | 'SIGUSR2' + | 'SIGVTALRM' + | 'SIGWINCH' + | 'SIGXCPU' + | 'SIGXFSZ' + | 'SIGBREAK' + | 'SIGLOST' + | 'SIGINFO'; + type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection'; + type MultipleResolveType = 'resolve' | 'reject'; + type BeforeExitListener = (code: number) => void; + type DisconnectListener = () => void; + type ExitListener = (code: number) => void; + type RejectionHandledListener = (promise: Promise) => void; + type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; + /** + * Most of the time the unhandledRejection will be an Error, but this should not be relied upon + * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. + */ + type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; + type WarningListener = (warning: Error) => void; + type MessageListener = (message: unknown, sendHandle: unknown) => void; + type SignalsListener = (signal: Signals) => void; + type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: unknown) => void; + type WorkerListener = (worker: Worker) => void; + interface Socket extends ReadWriteStream { + isTTY?: true | undefined; + } + // Alias for compatibility + interface ProcessEnv extends Dict { + /** + * Can be used to change the default timezone at runtime + */ + TZ?: string; + } + interface HRTime { + (time?: [number, number]): [number, number]; + bigint(): bigint; + } + interface ProcessReport { + /** + * Directory where the report is written. + * working directory of the Node.js process. + * @default '' indicating that reports are written to the current + */ + directory: string; + /** + * Filename where the report is written. + * The default value is the empty string. + * @default '' the output filename will be comprised of a timestamp, + * PID, and sequence number. + */ + filename: string; + /** + * Returns a JSON-formatted diagnostic report for the running process. + * The report's JavaScript stack trace is taken from err, if present. + */ + getReport(err?: Error): string; + /** + * If true, a diagnostic report is generated on fatal errors, + * such as out of memory errors or failed C++ assertions. + * @default false + */ + reportOnFatalError: boolean; + /** + * If true, a diagnostic report is generated when the process + * receives the signal specified by process.report.signal. + * @default false + */ + reportOnSignal: boolean; + /** + * If true, a diagnostic report is generated on uncaught exception. + * @default false + */ + reportOnUncaughtException: boolean; + /** + * The signal used to trigger the creation of a diagnostic report. + * @default 'SIGUSR2' + */ + signal: Signals; + /** + * Writes a diagnostic report to a file. If filename is not provided, the default filename + * includes the date, time, PID, and a sequence number. + * The report's JavaScript stack trace is taken from err, if present. + * + * @param fileName Name of the file where the report is written. + * This should be a relative path, that will be appended to the directory specified in + * `process.report.directory`, or the current working directory of the Node.js process, + * if unspecified. + * @param error A custom error used for reporting the JavaScript stack. + * @return Filename of the generated report. + */ + writeReport(fileName?: string): string; + writeReport(error?: Error): string; + writeReport(fileName?: string, err?: Error): string; + } + interface ResourceUsage { + fsRead: number; + fsWrite: number; + involuntaryContextSwitches: number; + ipcReceived: number; + ipcSent: number; + majorPageFault: number; + maxRSS: number; + minorPageFault: number; + sharedMemorySize: number; + signalsCount: number; + swappedOut: number; + systemCPUTime: number; + unsharedDataSize: number; + unsharedStackSize: number; + userCPUTime: number; + voluntaryContextSwitches: number; + } + interface EmitWarningOptions { + /** + * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. + * + * @default 'Warning' + */ + type?: string | undefined; + /** + * A unique identifier for the warning instance being emitted. + */ + code?: string | undefined; + /** + * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. + * + * @default process.emitWarning + */ + ctor?: Function | undefined; + /** + * Additional text to include with the error. + */ + detail?: string | undefined; + } + interface ProcessConfig { + readonly target_defaults: { + readonly cflags: any[]; + readonly default_configuration: string; + readonly defines: string[]; + readonly include_dirs: string[]; + readonly libraries: string[]; + }; + readonly variables: { + readonly clang: number; + readonly host_arch: string; + readonly node_install_npm: boolean; + readonly node_install_waf: boolean; + readonly node_prefix: string; + readonly node_shared_openssl: boolean; + readonly node_shared_v8: boolean; + readonly node_shared_zlib: boolean; + readonly node_use_dtrace: boolean; + readonly node_use_etw: boolean; + readonly node_use_openssl: boolean; + readonly target_arch: string; + readonly v8_no_strict_aliasing: number; + readonly v8_use_snapshot: boolean; + readonly visibility: string; + }; + } + interface Process extends EventEmitter { + /** + * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is + * a `Writable` stream. + * + * For example, to copy `process.stdin` to `process.stdout`: + * + * ```js + * import { stdin, stdout } from 'process'; + * + * stdin.pipe(stdout); + * ``` + * + * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stdout: WriteStream & { + fd: 1; + }; + /** + * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is + * a `Writable` stream. + * + * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stderr: WriteStream & { + fd: 2; + }; + /** + * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is + * a `Readable` stream. + * + * For details of how to read from `stdin` see `readable.read()`. + * + * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that + * is compatible with scripts written for Node.js prior to v0.10\. + * For more information see `Stream compatibility`. + * + * In "old" streams mode the `stdin` stream is paused by default, so one + * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. + */ + stdin: ReadStream & { + fd: 0; + }; + openStdin(): Socket; + /** + * The `process.argv` property returns an array containing the command-line + * arguments passed when the Node.js process was launched. The first element will + * be {@link execPath}. See `process.argv0` if access to the original value + * of `argv[0]` is needed. The second element will be the path to the JavaScript + * file being executed. The remaining elements will be any additional command-line + * arguments. + * + * For example, assuming the following script for `process-args.js`: + * + * ```js + * import { argv } from 'process'; + * + * // print process.argv + * argv.forEach((val, index) => { + * console.log(`${index}: ${val}`); + * }); + * ``` + * + * Launching the Node.js process as: + * + * ```console + * $ node process-args.js one two=three four + * ``` + * + * Would generate the output: + * + * ```text + * 0: /usr/local/bin/node + * 1: /Users/mjr/work/node/process-args.js + * 2: one + * 3: two=three + * 4: four + * ``` + * @since v0.1.27 + */ + argv: string[]; + /** + * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. + * + * ```console + * $ bash -c 'exec -a customArgv0 ./node' + * > process.argv[0] + * '/Volumes/code/external/node/out/Release/node' + * > process.argv0 + * 'customArgv0' + * ``` + * @since v6.4.0 + */ + argv0: string; + /** + * The `process.execArgv` property returns the set of Node.js-specific command-line + * options passed when the Node.js process was launched. These options do not + * appear in the array returned by the {@link argv} property, and do not + * include the Node.js executable, the name of the script, or any options following + * the script name. These options are useful in order to spawn child processes with + * the same execution environment as the parent. + * + * ```console + * $ node --harmony script.js --version + * ``` + * + * Results in `process.execArgv`: + * + * ```js + * ['--harmony'] + * ``` + * + * And `process.argv`: + * + * ```js + * ['/usr/local/bin/node', 'script.js', '--version'] + * ``` + * + * Refer to `Worker constructor` for the detailed behavior of worker + * threads with this property. + * @since v0.7.7 + */ + execArgv: string[]; + /** + * The `process.execPath` property returns the absolute pathname of the executable + * that started the Node.js process. Symbolic links, if any, are resolved. + * + * ```js + * '/usr/local/bin/node' + * ``` + * @since v0.1.100 + */ + execPath: string; + /** + * The `process.abort()` method causes the Node.js process to exit immediately and + * generate a core file. + * + * This feature is not available in `Worker` threads. + * @since v0.7.0 + */ + abort(): never; + /** + * The `process.chdir()` method changes the current working directory of the + * Node.js process or throws an exception if doing so fails (for instance, if + * the specified `directory` does not exist). + * + * ```js + * import { chdir, cwd } from 'process'; + * + * console.log(`Starting directory: ${cwd()}`); + * try { + * chdir('/tmp'); + * console.log(`New directory: ${cwd()}`); + * } catch (err) { + * console.error(`chdir: ${err}`); + * } + * ``` + * + * This feature is not available in `Worker` threads. + * @since v0.1.17 + */ + chdir(directory: string): void; + /** + * The `process.cwd()` method returns the current working directory of the Node.js + * process. + * + * ```js + * import { cwd } from 'process'; + * + * console.log(`Current directory: ${cwd()}`); + * ``` + * @since v0.1.8 + */ + cwd(): string; + /** + * The port used by the Node.js debugger when enabled. + * + * ```js + * import process from 'process'; + * + * process.debugPort = 5858; + * ``` + * @since v0.7.2 + */ + debugPort: number; + /** + * The `process.emitWarning()` method can be used to emit custom or application + * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. + * + * ```js + * import { emitWarning } from 'process'; + * + * // Emit a warning with a code and additional detail. + * emitWarning('Something happened!', { + * code: 'MY_WARNING', + * detail: 'This is some additional information' + * }); + * // Emits: + * // (node:56338) [MY_WARNING] Warning: Something happened! + * // This is some additional information + * ``` + * + * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. + * + * ```js + * import process from 'process'; + * + * process.on('warning', (warning) => { + * console.warn(warning.name); // 'Warning' + * console.warn(warning.message); // 'Something happened!' + * console.warn(warning.code); // 'MY_WARNING' + * console.warn(warning.stack); // Stack trace + * console.warn(warning.detail); // 'This is some additional information' + * }); + * ``` + * + * If `warning` is passed as an `Error` object, the `options` argument is ignored. + * @since v8.0.0 + * @param warning The warning to emit. + */ + emitWarning(warning: string | Error, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; + emitWarning(warning: string | Error, options?: EmitWarningOptions): void; + /** + * The `process.env` property returns an object containing the user environment. + * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). + * + * An example of this object looks like: + * + * ```js + * { + * TERM: 'xterm-256color', + * SHELL: '/usr/local/bin/bash', + * USER: 'maciej', + * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + * PWD: '/Users/maciej', + * EDITOR: 'vim', + * SHLVL: '1', + * HOME: '/Users/maciej', + * LOGNAME: 'maciej', + * _: '/usr/local/bin/node' + * } + * ``` + * + * It is possible to modify this object, but such modifications will not be + * reflected outside the Node.js process, or (unless explicitly requested) + * to other `Worker` threads. + * In other words, the following example would not work: + * + * ```console + * $ node -e 'process.env.foo = "bar"' && echo $foo + * ``` + * + * While the following will: + * + * ```js + * import { env } from 'process'; + * + * env.foo = 'bar'; + * console.log(env.foo); + * ``` + * + * Assigning a property on `process.env` will implicitly convert the value + * to a string. **This behavior is deprecated.** Future versions of Node.js may + * throw an error when the value is not a string, number, or boolean. + * + * ```js + * import { env } from 'process'; + * + * env.test = null; + * console.log(env.test); + * // => 'null' + * env.test = undefined; + * console.log(env.test); + * // => 'undefined' + * ``` + * + * Use `delete` to delete a property from `process.env`. + * + * ```js + * import { env } from 'process'; + * + * env.TEST = 1; + * delete env.TEST; + * console.log(env.TEST); + * // => undefined + * ``` + * + * On Windows operating systems, environment variables are case-insensitive. + * + * ```js + * import { env } from 'process'; + * + * env.TEST = 1; + * console.log(env.test); + * // => 1 + * ``` + * + * Unless explicitly specified when creating a `Worker` instance, + * each `Worker` thread has its own copy of `process.env`, based on its + * parent thread’s `process.env`, or whatever was specified as the `env` option + * to the `Worker` constructor. Changes to `process.env` will not be visible + * across `Worker` threads, and only the main thread can make changes that + * are visible to the operating system or to native add-ons. + * @since v0.1.27 + */ + env: ProcessEnv; + /** + * The `process.exit()` method instructs Node.js to terminate the process + * synchronously with an exit status of `code`. If `code` is omitted, exit uses + * either the 'success' code `0` or the value of `process.exitCode` if it has been + * set. Node.js will not terminate until all the `'exit'` event listeners are + * called. + * + * To exit with a 'failure' code: + * + * ```js + * import { exit } from 'process'; + * + * exit(1); + * ``` + * + * The shell that executed Node.js should see the exit code as `1`. + * + * Calling `process.exit()` will force the process to exit as quickly as possible + * even if there are still asynchronous operations pending that have not yet + * completed fully, including I/O operations to `process.stdout` and`process.stderr`. + * + * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ + * _work pending_ in the event loop. The `process.exitCode` property can be set to + * tell the process which exit code to use when the process exits gracefully. + * + * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being + * truncated and lost: + * + * ```js + * import { exit } from 'process'; + * + * // This is an example of what *not* to do: + * if (someConditionNotMet()) { + * printUsageToStdout(); + * exit(1); + * } + * ``` + * + * The reason this is problematic is because writes to `process.stdout` in Node.js + * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js + * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. + * + * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding + * scheduling any additional work for the event loop: + * + * ```js + * import process from 'process'; + * + * // How to properly set the exit code while letting + * // the process exit gracefully. + * if (someConditionNotMet()) { + * printUsageToStdout(); + * process.exitCode = 1; + * } + * ``` + * + * If it is necessary to terminate the Node.js process due to an error condition, + * throwing an _uncaught_ error and allowing the process to terminate accordingly + * is safer than calling `process.exit()`. + * + * In `Worker` threads, this function stops the current thread rather + * than the current process. + * @since v0.1.13 + * @param [code=0] The exit code. + */ + exit(code?: number): never; + /** + * A number which will be the process exit code, when the process either + * exits gracefully, or is exited via {@link exit} without specifying + * a code. + * + * Specifying a code to {@link exit} will override any + * previous setting of `process.exitCode`. + * @since v0.11.8 + */ + exitCode?: number | undefined; + /** + * The `process.getgid()` method returns the numerical group identity of the + * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getgid) { + * console.log(`Current gid: ${process.getgid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.31 + */ + getgid?: () => number; + /** + * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a + * numeric ID or a group name + * string. If a group name is specified, this method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getgid && process.setgid) { + * console.log(`Current gid: ${process.getgid()}`); + * try { + * process.setgid(501); + * console.log(`New gid: ${process.getgid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.31 + * @param id The group name or ID + */ + setgid?: (id: number | string) => void; + /** + * The `process.getuid()` method returns the numeric user identity of the process. + * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getuid) { + * console.log(`Current uid: ${process.getuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.28 + */ + getuid?: () => number; + /** + * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a + * numeric ID or a username string. + * If a username is specified, the method blocks while resolving the associated + * numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getuid && process.setuid) { + * console.log(`Current uid: ${process.getuid()}`); + * try { + * process.setuid(501); + * console.log(`New uid: ${process.getuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.28 + */ + setuid?: (id: number | string) => void; + /** + * The `process.geteuid()` method returns the numerical effective user identity of + * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.geteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + geteuid?: () => number; + /** + * The `process.seteuid()` method sets the effective user identity of the process. + * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username + * string. If a username is specified, the method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.geteuid && process.seteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * try { + * process.seteuid(501); + * console.log(`New uid: ${process.geteuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A user name or ID + */ + seteuid?: (id: number | string) => void; + /** + * The `process.getegid()` method returns the numerical effective group identity + * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getegid) { + * console.log(`Current gid: ${process.getegid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + getegid?: () => number; + /** + * The `process.setegid()` method sets the effective group identity of the process. + * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group + * name string. If a group name is specified, this method blocks while resolving + * the associated a numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getegid && process.setegid) { + * console.log(`Current gid: ${process.getegid()}`); + * try { + * process.setegid(501); + * console.log(`New gid: ${process.getegid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A group name or ID + */ + setegid?: (id: number | string) => void; + /** + * The `process.getgroups()` method returns an array with the supplementary group + * IDs. POSIX leaves it unspecified if the effective group ID is included but + * Node.js ensures it always is. + * + * ```js + * import process from 'process'; + * + * if (process.getgroups) { + * console.log(process.getgroups()); // [ 16, 21, 297 ] + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.9.4 + */ + getgroups?: () => number[]; + /** + * The `process.setgroups()` method sets the supplementary group IDs for the + * Node.js process. This is a privileged operation that requires the Node.js + * process to have `root` or the `CAP_SETGID` capability. + * + * The `groups` array can contain numeric group IDs, group names, or both. + * + * ```js + * import process from 'process'; + * + * if (process.getgroups && process.setgroups) { + * try { + * process.setgroups([501]); + * console.log(process.getgroups()); // new groups + * } catch (err) { + * console.log(`Failed to set groups: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.9.4 + */ + setgroups?: (groups: ReadonlyArray) => void; + /** + * The `process.setUncaughtExceptionCaptureCallback()` function sets a function + * that will be invoked when an uncaught exception occurs, which will receive the + * exception value itself as its first argument. + * + * If such a function is set, the `'uncaughtException'` event will + * not be emitted. If `--abort-on-uncaught-exception` was passed from the + * command line or set through `v8.setFlagsFromString()`, the process will + * not abort. Actions configured to take place on exceptions such as report + * generations will be affected too + * + * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this + * method with a non-`null` argument while another capture function is set will + * throw an error. + * + * Using this function is mutually exclusive with using the deprecated `domain` built-in module. + * @since v9.3.0 + */ + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + /** + * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. + * @since v9.3.0 + */ + hasUncaughtExceptionCaptureCallback(): boolean; + /** + * The `process.version` property contains the Node.js version string. + * + * ```js + * import { version } from 'process'; + * + * console.log(`Version: ${version}`); + * // Version: v14.8.0 + * ``` + * + * To get the version string without the prepended _v_, use`process.versions.node`. + * @since v0.1.3 + */ + readonly version: string; + /** + * The `process.versions` property returns an object listing the version strings of + * Node.js and its dependencies. `process.versions.modules` indicates the current + * ABI version, which is increased whenever a C++ API changes. Node.js will refuse + * to load modules that were compiled against a different module ABI version. + * + * ```js + * import { versions } from 'process'; + * + * console.log(versions); + * ``` + * + * Will generate an object similar to: + * + * ```console + * { node: '11.13.0', + * v8: '7.0.276.38-node.18', + * uv: '1.27.0', + * zlib: '1.2.11', + * brotli: '1.0.7', + * ares: '1.15.0', + * modules: '67', + * nghttp2: '1.34.0', + * napi: '4', + * llhttp: '1.1.1', + * openssl: '1.1.1b', + * cldr: '34.0', + * icu: '63.1', + * tz: '2018e', + * unicode: '11.0' } + * ``` + * @since v0.2.0 + */ + readonly versions: ProcessVersions; + /** + * The `process.config` property returns an `Object` containing the JavaScript + * representation of the configure options used to compile the current Node.js + * executable. This is the same as the `config.gypi` file that was produced when + * running the `./configure` script. + * + * An example of the possible output looks like: + * + * ```js + * { + * target_defaults: + * { cflags: [], + * default_configuration: 'Release', + * defines: [], + * include_dirs: [], + * libraries: [] }, + * variables: + * { + * host_arch: 'x64', + * napi_build_version: 5, + * node_install_npm: 'true', + * node_prefix: '', + * node_shared_cares: 'false', + * node_shared_http_parser: 'false', + * node_shared_libuv: 'false', + * node_shared_zlib: 'false', + * node_use_dtrace: 'false', + * node_use_openssl: 'true', + * node_shared_openssl: 'false', + * strict_aliasing: 'true', + * target_arch: 'x64', + * v8_use_snapshot: 1 + * } + * } + * ``` + * + * The `process.config` property is **not** read-only and there are existing + * modules in the ecosystem that are known to extend, modify, or entirely replace + * the value of `process.config`. + * + * Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made + * read-only in a future release. + * @since v0.7.7 + */ + readonly config: ProcessConfig; + /** + * The `process.kill()` method sends the `signal` to the process identified by`pid`. + * + * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. + * + * This method will throw an error if the target `pid` does not exist. As a special + * case, a signal of `0` can be used to test for the existence of a process. + * Windows platforms will throw an error if the `pid` is used to kill a process + * group. + * + * Even though the name of this function is `process.kill()`, it is really just a + * signal sender, like the `kill` system call. The signal sent may do something + * other than kill the target process. + * + * ```js + * import process, { kill } from 'process'; + * + * process.on('SIGHUP', () => { + * console.log('Got SIGHUP signal.'); + * }); + * + * setTimeout(() => { + * console.log('Exiting.'); + * process.exit(0); + * }, 100); + * + * kill(process.pid, 'SIGHUP'); + * ``` + * + * When `SIGUSR1` is received by a Node.js process, Node.js will start the + * debugger. See `Signal Events`. + * @since v0.0.6 + * @param pid A process ID + * @param [signal='SIGTERM'] The signal to send, either as a string or number. + */ + kill(pid: number, signal?: string | number): true; + /** + * The `process.pid` property returns the PID of the process. + * + * ```js + * import { pid } from 'process'; + * + * console.log(`This process is pid ${pid}`); + * ``` + * @since v0.1.15 + */ + readonly pid: number; + /** + * The `process.ppid` property returns the PID of the parent of the + * current process. + * + * ```js + * import { ppid } from 'process'; + * + * console.log(`The parent process is pid ${ppid}`); + * ``` + * @since v9.2.0, v8.10.0, v6.13.0 + */ + readonly ppid: number; + /** + * The `process.title` property returns the current process title (i.e. returns + * the current value of `ps`). Assigning a new value to `process.title` modifies + * the current value of `ps`. + * + * When a new value is assigned, different platforms will impose different maximum + * length restrictions on the title. Usually such restrictions are quite limited. + * For instance, on Linux and macOS, `process.title` is limited to the size of the + * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 + * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) + * cases. + * + * Assigning a value to `process.title` might not result in an accurate label + * within process manager applications such as macOS Activity Monitor or Windows + * Services Manager. + * @since v0.1.104 + */ + title: string; + /** + * The operating system CPU architecture for which the Node.js binary was compiled. + * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. + * + * ```js + * import { arch } from 'process'; + * + * console.log(`This processor architecture is ${arch}`); + * ``` + * @since v0.5.0 + */ + readonly arch: Architecture; + /** + * The `process.platform` property returns a string identifying the operating + * system platform for which the Node.js binary was compiled. + * + * Currently possible values are: + * + * * `'aix'` + * * `'darwin'` + * * `'freebsd'` + * * `'linux'` + * * `'openbsd'` + * * `'sunos'` + * * `'win32'` + * + * ```js + * import { platform } from 'process'; + * + * console.log(`This platform is ${platform}`); + * ``` + * + * The value `'android'` may also be returned if the Node.js is built on the + * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.1.16 + */ + readonly platform: Platform; + /** + * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at + * runtime, `require.main` may still refer to the original main module in + * modules that were required before the change occurred. Generally, it's + * safe to assume that the two refer to the same module. + * + * As with `require.main`, `process.mainModule` will be `undefined` if there + * is no entry script. + * @since v0.1.17 + * @deprecated Since v14.0.0 - Use `main` instead. + */ + mainModule?: Module | undefined; + memoryUsage: MemoryUsageFn; + /** + * The `process.cpuUsage()` method returns the user and system CPU time usage of + * the current process, in an object with properties `user` and `system`, whose + * values are microsecond values (millionth of a second). These values measure time + * spent in user and system code respectively, and may end up being greater than + * actual elapsed time if multiple CPU cores are performing work for this process. + * + * The result of a previous call to `process.cpuUsage()` can be passed as the + * argument to the function, to get a diff reading. + * + * ```js + * import { cpuUsage } from 'process'; + * + * const startUsage = cpuUsage(); + * // { user: 38579, system: 6986 } + * + * // spin the CPU for 500 milliseconds + * const now = Date.now(); + * while (Date.now() - now < 500); + * + * console.log(cpuUsage(startUsage)); + * // { user: 514883, system: 11226 } + * ``` + * @since v6.1.0 + * @param previousValue A previous return value from calling `process.cpuUsage()` + */ + cpuUsage(previousValue?: CpuUsage): CpuUsage; + /** + * `process.nextTick()` adds `callback` to the "next tick queue". This queue is + * fully drained after the current operation on the JavaScript stack runs to + * completion and before the event loop is allowed to continue. It's possible to + * create an infinite loop if one were to recursively call `process.nextTick()`. + * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. + * + * ```js + * import { nextTick } from 'process'; + * + * console.log('start'); + * nextTick(() => { + * console.log('nextTick callback'); + * }); + * console.log('scheduled'); + * // Output: + * // start + * // scheduled + * // nextTick callback + * ``` + * + * This is important when developing APIs in order to give users the opportunity + * to assign event handlers _after_ an object has been constructed but before any + * I/O has occurred: + * + * ```js + * import { nextTick } from 'process'; + * + * function MyThing(options) { + * this.setupOptions(options); + * + * nextTick(() => { + * this.startDoingStuff(); + * }); + * } + * + * const thing = new MyThing(); + * thing.getReadyForStuff(); + * + * // thing.startDoingStuff() gets called now, not before. + * ``` + * + * It is very important for APIs to be either 100% synchronous or 100% + * asynchronous. Consider this example: + * + * ```js + * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! + * function maybeSync(arg, cb) { + * if (arg) { + * cb(); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * + * This API is hazardous because in the following case: + * + * ```js + * const maybeTrue = Math.random() > 0.5; + * + * maybeSync(maybeTrue, () => { + * foo(); + * }); + * + * bar(); + * ``` + * + * It is not clear whether `foo()` or `bar()` will be called first. + * + * The following approach is much better: + * + * ```js + * import { nextTick } from 'process'; + * + * function definitelyAsync(arg, cb) { + * if (arg) { + * nextTick(cb); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * @since v0.1.26 + * @param args Additional arguments to pass when invoking the `callback` + */ + nextTick(callback: Function, ...args: any[]): void; + /** + * The `process.release` property returns an `Object` containing metadata related + * to the current release, including URLs for the source tarball and headers-only + * tarball. + * + * `process.release` contains the following properties: + * + * ```js + * { + * name: 'node', + * lts: 'Erbium', + * sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz', + * headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz', + * libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib' + * } + * ``` + * + * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be + * relied upon to exist. + * @since v3.0.0 + */ + readonly release: ProcessRelease; + features: { + inspector: boolean; + debug: boolean; + uv: boolean; + ipv6: boolean; + tls_alpn: boolean; + tls_sni: boolean; + tls_ocsp: boolean; + tls: boolean; + }; + /** + * `process.umask()` returns the Node.js process's file mode creation mask. Child + * processes inherit the mask from the parent process. + * @since v0.1.19 + * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * + * security vulnerability. There is no safe, cross-platform alternative API. + */ + umask(): number; + /** + * Can only be set if not in worker thread. + */ + umask(mask: string | number): number; + /** + * The `process.uptime()` method returns the number of seconds the current Node.js + * process has been running. + * + * The return value includes fractions of a second. Use `Math.floor()` to get whole + * seconds. + * @since v0.5.0 + */ + uptime(): number; + hrtime: HRTime; + /** + * If Node.js is spawned with an IPC channel, the `process.send()` method can be + * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. + * + * If Node.js was not spawned with an IPC channel, `process.send` will be`undefined`. + * + * The message goes through serialization and parsing. The resulting message might + * not be the same as what is originally sent. + * @since v0.5.9 + * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: + */ + send?( + message: any, + sendHandle?: any, + options?: { + swallowErrors?: boolean | undefined; + }, + callback?: (error: Error | null) => void + ): boolean; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the + * IPC channel to the parent process, allowing the child process to exit gracefully + * once there are no other connections keeping it alive. + * + * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. + * + * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. + * @since v0.7.2 + */ + disconnect(): void; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC + * channel is connected and will return `false` after`process.disconnect()` is called. + * + * Once `process.connected` is `false`, it is no longer possible to send messages + * over the IPC channel using `process.send()`. + * @since v0.7.2 + */ + connected: boolean; + /** + * The `process.allowedNodeEnvironmentFlags` property is a special, + * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. + * + * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag + * representations. `process.allowedNodeEnvironmentFlags.has()` will + * return `true` in the following cases: + * + * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. + * * Flags passed through to V8 (as listed in `--v8-options`) may replace + * one or more _non-leading_ dashes for an underscore, or vice-versa; + * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, + * etc. + * * Flags may contain one or more equals (`=`) characters; all + * characters after and including the first equals will be ignored; + * e.g., `--stack-trace-limit=100`. + * * Flags _must_ be allowable within `NODE_OPTIONS`. + * + * When iterating over `process.allowedNodeEnvironmentFlags`, flags will + * appear only _once_; each will begin with one or more dashes. Flags + * passed through to V8 will contain underscores instead of non-leading + * dashes: + * + * ```js + * import { allowedNodeEnvironmentFlags } from 'process'; + * + * allowedNodeEnvironmentFlags.forEach((flag) => { + * // -r + * // --inspect-brk + * // --abort_on_uncaught_exception + * // ... + * }); + * ``` + * + * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail + * silently. + * + * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will + * contain what _would have_ been allowable. + * @since v10.10.0 + */ + allowedNodeEnvironmentFlags: ReadonlySet; + /** + * `process.report` is an object whose methods are used to generate diagnostic + * reports for the current process. Additional documentation is available in the `report documentation`. + * @since v11.8.0 + */ + report?: ProcessReport | undefined; + /** + * ```js + * import { resourceUsage } from 'process'; + * + * console.log(resourceUsage()); + * /* + * Will output: + * { + * userCPUTime: 82872, + * systemCPUTime: 4143, + * maxRSS: 33164, + * sharedMemorySize: 0, + * unsharedDataSize: 0, + * unsharedStackSize: 0, + * minorPageFault: 2469, + * majorPageFault: 0, + * swappedOut: 0, + * fsRead: 0, + * fsWrite: 8, + * ipcSent: 0, + * ipcReceived: 0, + * signalsCount: 0, + * voluntaryContextSwitches: 79, + * involuntaryContextSwitches: 1 + * } + * + * ``` + * @since v12.6.0 + * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. + */ + resourceUsage(): ResourceUsage; + /** + * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the + * documentation for the `'warning' event` and the `emitWarning() method` for more information about this + * flag's behavior. + * @since v0.8.0 + */ + traceDeprecation: boolean; + /* EventEmitter */ + addListener(event: 'beforeExit', listener: BeforeExitListener): this; + addListener(event: 'disconnect', listener: DisconnectListener): this; + addListener(event: 'exit', listener: ExitListener): this; + addListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + addListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + addListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + addListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + addListener(event: 'warning', listener: WarningListener): this; + addListener(event: 'message', listener: MessageListener): this; + addListener(event: Signals, listener: SignalsListener): this; + addListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + addListener(event: 'worker', listener: WorkerListener): this; + emit(event: 'beforeExit', code: number): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'exit', code: number): boolean; + emit(event: 'rejectionHandled', promise: Promise): boolean; + emit(event: 'uncaughtException', error: Error): boolean; + emit(event: 'uncaughtExceptionMonitor', error: Error): boolean; + emit(event: 'unhandledRejection', reason: unknown, promise: Promise): boolean; + emit(event: 'warning', warning: Error): boolean; + emit(event: 'message', message: unknown, sendHandle: unknown): this; + emit(event: Signals, signal?: Signals): boolean; + emit(event: 'multipleResolves', type: MultipleResolveType, promise: Promise, value: unknown): this; + emit(event: 'worker', listener: WorkerListener): this; + on(event: 'beforeExit', listener: BeforeExitListener): this; + on(event: 'disconnect', listener: DisconnectListener): this; + on(event: 'exit', listener: ExitListener): this; + on(event: 'rejectionHandled', listener: RejectionHandledListener): this; + on(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + on(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + on(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + on(event: 'warning', listener: WarningListener): this; + on(event: 'message', listener: MessageListener): this; + on(event: Signals, listener: SignalsListener): this; + on(event: 'multipleResolves', listener: MultipleResolveListener): this; + on(event: 'worker', listener: WorkerListener): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'beforeExit', listener: BeforeExitListener): this; + once(event: 'disconnect', listener: DisconnectListener): this; + once(event: 'exit', listener: ExitListener): this; + once(event: 'rejectionHandled', listener: RejectionHandledListener): this; + once(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + once(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + once(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + once(event: 'warning', listener: WarningListener): this; + once(event: 'message', listener: MessageListener): this; + once(event: Signals, listener: SignalsListener): this; + once(event: 'multipleResolves', listener: MultipleResolveListener): this; + once(event: 'worker', listener: WorkerListener): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'beforeExit', listener: BeforeExitListener): this; + prependListener(event: 'disconnect', listener: DisconnectListener): this; + prependListener(event: 'exit', listener: ExitListener): this; + prependListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + prependListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + prependListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + prependListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + prependListener(event: 'warning', listener: WarningListener): this; + prependListener(event: 'message', listener: MessageListener): this; + prependListener(event: Signals, listener: SignalsListener): this; + prependListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + prependListener(event: 'worker', listener: WorkerListener): this; + prependOnceListener(event: 'beforeExit', listener: BeforeExitListener): this; + prependOnceListener(event: 'disconnect', listener: DisconnectListener): this; + prependOnceListener(event: 'exit', listener: ExitListener): this; + prependOnceListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + prependOnceListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + prependOnceListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + prependOnceListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + prependOnceListener(event: 'warning', listener: WarningListener): this; + prependOnceListener(event: 'message', listener: MessageListener): this; + prependOnceListener(event: Signals, listener: SignalsListener): this; + prependOnceListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + prependOnceListener(event: 'worker', listener: WorkerListener): this; + listeners(event: 'beforeExit'): BeforeExitListener[]; + listeners(event: 'disconnect'): DisconnectListener[]; + listeners(event: 'exit'): ExitListener[]; + listeners(event: 'rejectionHandled'): RejectionHandledListener[]; + listeners(event: 'uncaughtException'): UncaughtExceptionListener[]; + listeners(event: 'uncaughtExceptionMonitor'): UncaughtExceptionListener[]; + listeners(event: 'unhandledRejection'): UnhandledRejectionListener[]; + listeners(event: 'warning'): WarningListener[]; + listeners(event: 'message'): MessageListener[]; + listeners(event: Signals): SignalsListener[]; + listeners(event: 'multipleResolves'): MultipleResolveListener[]; + listeners(event: 'worker'): WorkerListener[]; + } + } + } + export = process; +} +declare module 'node:process' { + import process = require('process'); + export = process; +} diff --git a/server/node_modules/@types/node/punycode.d.ts b/server/node_modules/@types/node/punycode.d.ts new file mode 100755 index 0000000000..87ebbb9048 --- /dev/null +++ b/server/node_modules/@types/node/punycode.d.ts @@ -0,0 +1,117 @@ +/** + * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users + * currently depending on the `punycode` module should switch to using the + * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL + * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. + * + * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It + * can be accessed using: + * + * ```js + * const punycode = require('punycode'); + * ``` + * + * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is + * primarily intended for use in Internationalized Domain Names. Because host + * names in URLs are limited to ASCII characters only, Domain Names that contain + * non-ASCII characters must be converted into ASCII using the Punycode scheme. + * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent + * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. + * + * The `punycode` module provides a simple implementation of the Punycode standard. + * + * The `punycode` module is a third-party dependency used by Node.js and + * made available to developers as a convenience. Fixes or other modifications to + * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. + * @deprecated Since v7.0.0 - Deprecated + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/punycode.js) + */ +declare module 'punycode' { + /** + * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only + * characters to the equivalent string of Unicode codepoints. + * + * ```js + * punycode.decode('maana-pta'); // 'mañana' + * punycode.decode('--dqo34k'); // '☃-⌘' + * ``` + * @since v0.5.1 + */ + function decode(string: string): string; + /** + * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. + * + * ```js + * punycode.encode('mañana'); // 'maana-pta' + * punycode.encode('☃-⌘'); // '--dqo34k' + * ``` + * @since v0.5.1 + */ + function encode(string: string): string; + /** + * The `punycode.toUnicode()` method converts a string representing a domain name + * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be + * converted. + * + * ```js + * // decode domain names + * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' + * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' + * punycode.toUnicode('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toUnicode(domain: string): string; + /** + * The `punycode.toASCII()` method converts a Unicode string representing an + * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the + * domain name will be converted. Calling `punycode.toASCII()` on a string that + * already only contains ASCII characters will have no effect. + * + * ```js + * // encode domain names + * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' + * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' + * punycode.toASCII('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toASCII(domain: string): string; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const ucs2: ucs2; + interface ucs2 { + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + decode(string: string): number[]; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + encode(codePoints: ReadonlyArray): string; + } + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const version: string; +} +declare module 'node:punycode' { + export * from 'punycode'; +} diff --git a/server/node_modules/@types/node/querystring.d.ts b/server/node_modules/@types/node/querystring.d.ts new file mode 100755 index 0000000000..e118547846 --- /dev/null +++ b/server/node_modules/@types/node/querystring.d.ts @@ -0,0 +1,131 @@ +/** + * The `querystring` module provides utilities for parsing and formatting URL + * query strings. It can be accessed using: + * + * ```js + * const querystring = require('querystring'); + * ``` + * + * `querystring` is more performant than `URLSearchParams` but is not a + * standardized API. Use `URLSearchParams` when performance is not critical + * or when compatibility with browser code is desirable. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/querystring.js) + */ +declare module 'querystring' { + interface StringifyOptions { + encodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParseOptions { + maxKeys?: number | undefined; + decodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParsedUrlQuery extends NodeJS.Dict {} + interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> {} + /** + * The `querystring.stringify()` method produces a URL query string from a + * given `obj` by iterating through the object's "own properties". + * + * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | + * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to + * empty strings. + * + * ```js + * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); + * // Returns 'foo=bar&baz=qux&baz=quux&corge=' + * + * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); + * // Returns 'foo:bar;baz:qux' + * ``` + * + * By default, characters requiring percent-encoding within the query string will + * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkEncodeURIComponent function already exists, + * + * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, + * { encodeURIComponent: gbkEncodeURIComponent }); + * ``` + * @since v0.1.25 + * @param obj The object to serialize into a URL query string + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] . The substring used to delimit keys and values in the query string. + */ + function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; + /** + * The `querystring.parse()` method parses a URL query string (`str`) into a + * collection of key and value pairs. + * + * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: + * + * ```js + * { + * foo: 'bar', + * abc: ['xyz', '123'] + * } + * ``` + * + * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * By default, percent-encoded characters within the query string will be assumed + * to use UTF-8 encoding. If an alternative character encoding is used, then an + * alternative `decodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkDecodeURIComponent function already exists... + * + * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, + * { decodeURIComponent: gbkDecodeURIComponent }); + * ``` + * @since v0.1.25 + * @param str The URL query string to parse + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] . The substring used to delimit keys and values in the query string. + */ + function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + /** + * The querystring.encode() function is an alias for querystring.stringify(). + */ + const encode: typeof stringify; + /** + * The querystring.decode() function is an alias for querystring.parse(). + */ + const decode: typeof parse; + /** + * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL + * query strings. + * + * The `querystring.escape()` method is used by `querystring.stringify()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement percent-encoding implementation if + * necessary by assigning `querystring.escape` to an alternative function. + * @since v0.1.25 + */ + function escape(str: string): string; + /** + * The `querystring.unescape()` method performs decoding of URL percent-encoded + * characters on the given `str`. + * + * The `querystring.unescape()` method is used by `querystring.parse()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement decoding implementation if + * necessary by assigning `querystring.unescape` to an alternative function. + * + * By default, the `querystring.unescape()` method will attempt to use the + * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, + * a safer equivalent that does not throw on malformed URLs will be used. + * @since v0.1.25 + */ + function unescape(str: string): string; +} +declare module 'node:querystring' { + export * from 'querystring'; +} diff --git a/server/node_modules/@types/node/readline.d.ts b/server/node_modules/@types/node/readline.d.ts new file mode 100755 index 0000000000..6ab64acbbe --- /dev/null +++ b/server/node_modules/@types/node/readline.d.ts @@ -0,0 +1,653 @@ +/** + * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. + * + * To use the promise-based APIs: + * + * ```js + * import * as readline from 'node:readline/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as readline from 'node:readline'; + * ``` + * + * The following simple example illustrates the basic use of the `readline` module. + * + * ```js + * import * as readline from 'node:readline/promises'; + * import { stdin as input, stdout as output } from 'node:process'; + * + * const rl = readline.createInterface({ input, output }); + * + * const answer = await rl.question('What do you think of Node.js? '); + * + * console.log(`Thank you for your valuable feedback: ${answer}`); + * + * rl.close(); + * ``` + * + * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be + * received on the `input` stream. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline.js) + */ +declare module 'readline' { + import { Abortable, EventEmitter } from 'node:events'; + import * as promises from 'node:readline/promises'; + + export { promises }; + export interface Key { + sequence?: string | undefined; + name?: string | undefined; + ctrl?: boolean | undefined; + meta?: boolean | undefined; + shift?: boolean | undefined; + } + /** + * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a + * single `input` `Readable` stream and a single `output` `Writable` stream. + * The `output` stream is used to print prompts for user input that arrives on, + * and is read from, the `input` stream. + * @since v0.1.104 + */ + export class Interface extends EventEmitter { + readonly terminal: boolean; + /** + * The current input data being processed by node. + * + * This can be used when collecting input from a TTY stream to retrieve the + * current value that has been processed thus far, prior to the `line` event + * being emitted. Once the `line` event has been emitted, this property will + * be an empty string. + * + * Be aware that modifying the value during the instance runtime may have + * unintended consequences if `rl.cursor` is not also controlled. + * + * **If not using a TTY stream for input, use the `'line'` event.** + * + * One possible use case would be as follows: + * + * ```js + * const values = ['lorem ipsum', 'dolor sit amet']; + * const rl = readline.createInterface(process.stdin); + * const showResults = debounce(() => { + * console.log( + * '\n', + * values.filter((val) => val.startsWith(rl.line)).join(' ') + * ); + * }, 300); + * process.stdin.on('keypress', (c, k) => { + * showResults(); + * }); + * ``` + * @since v0.1.98 + */ + readonly line: string; + /** + * The cursor position relative to `rl.line`. + * + * This will track where the current cursor lands in the input string, when + * reading input from a TTY stream. The position of cursor determines the + * portion of the input string that will be modified as input is processed, + * as well as the column where the terminal caret will be rendered. + * @since v0.1.98 + */ + readonly cursor: number; + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface + */ + protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface + */ + protected constructor(options: ReadLineOptions); + /** + * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. + * @since v15.3.0 + * @return the current prompt string + */ + getPrompt(): string; + /** + * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. + * @since v0.1.98 + */ + setPrompt(prompt: string): void; + /** + * The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new + * location at which to provide input. + * + * When called, `rl.prompt()` will resume the `input` stream if it has been + * paused. + * + * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written. + * @since v0.1.98 + * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. + */ + prompt(preserveCursor?: boolean): void; + /** + * The `rl.question()` method displays the `query` by writing it to the `output`, + * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. + * + * When called, `rl.question()` will resume the `input` stream if it has been + * paused. + * + * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written. + * + * The `callback` function passed to `rl.question()` does not follow the typical + * pattern of accepting an `Error` object or `null` as the first argument. + * The `callback` is called with the provided answer as the only argument. + * + * Example usage: + * + * ```js + * rl.question('What is your favorite food? ', (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * ``` + * + * Using an `AbortController` to cancel a question. + * + * ```js + * const ac = new AbortController(); + * const signal = ac.signal; + * + * rl.question('What is your favorite food? ', { signal }, (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * setTimeout(() => ac.abort(), 10000); + * ``` + * + * If this method is invoked as it's util.promisify()ed version, it returns a + * Promise that fulfills with the answer. If the question is canceled using + * an `AbortController` it will reject with an `AbortError`. + * + * ```js + * const util = require('util'); + * const question = util.promisify(rl.question).bind(rl); + * + * async function questionExample() { + * try { + * const answer = await question('What is you favorite food? '); + * console.log(`Oh, so your favorite food is ${answer}`); + * } catch (err) { + * console.error('Question rejected', err); + * } + * } + * questionExample(); + * ``` + * @since v0.3.3 + * @param query A statement or query to write to `output`, prepended to the prompt. + * @param callback A callback function that is invoked with the user's input in response to the `query`. + */ + question(query: string, callback: (answer: string) => void): void; + question(query: string, options: Abortable, callback: (answer: string) => void): void; + /** + * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed + * later if necessary. + * + * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance. + * @since v0.3.4 + */ + pause(): this; + /** + * The `rl.resume()` method resumes the `input` stream if it has been paused. + * @since v0.3.4 + */ + resume(): this; + /** + * The `rl.close()` method closes the `readline.Interface` instance and + * relinquishes control over the `input` and `output` streams. When called, + * the `'close'` event will be emitted. + * + * Calling `rl.close()` does not immediately stop other events (including `'line'`) + * from being emitted by the `readline.Interface` instance. + * @since v0.1.98 + */ + close(): void; + /** + * The `rl.write()` method will write either `data` or a key sequence identified + * by `key` to the `output`. The `key` argument is supported only if `output` is + * a `TTY` text terminal. See `TTY keybindings` for a list of key + * combinations. + * + * If `key` is specified, `data` is ignored. + * + * When called, `rl.write()` will resume the `input` stream if it has been + * paused. + * + * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. + * + * ```js + * rl.write('Delete this!'); + * // Simulate Ctrl+U to delete the line written previously + * rl.write(null, { ctrl: true, name: 'u' }); + * ``` + * + * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. + * @since v0.1.98 + */ + write(data: string | Buffer, key?: Key): void; + write(data: undefined | null | string | Buffer, key: Key): void; + /** + * Returns the real position of the cursor in relation to the input + * prompt + string. Long input (wrapping) strings, as well as multiple + * line prompts are included in the calculations. + * @since v13.5.0, v12.16.0 + */ + getCursorPos(): CursorPos; + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + * 8. history + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'line', listener: (input: string) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'SIGCONT', listener: () => void): this; + addListener(event: 'SIGINT', listener: () => void): this; + addListener(event: 'SIGTSTP', listener: () => void): this; + addListener(event: 'history', listener: (history: string[]) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'line', input: string): boolean; + emit(event: 'pause'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'SIGCONT'): boolean; + emit(event: 'SIGINT'): boolean; + emit(event: 'SIGTSTP'): boolean; + emit(event: 'history', history: string[]): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'line', listener: (input: string) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'SIGCONT', listener: () => void): this; + on(event: 'SIGINT', listener: () => void): this; + on(event: 'SIGTSTP', listener: () => void): this; + on(event: 'history', listener: (history: string[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'line', listener: (input: string) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'SIGCONT', listener: () => void): this; + once(event: 'SIGINT', listener: () => void): this; + once(event: 'SIGTSTP', listener: () => void): this; + once(event: 'history', listener: (history: string[]) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'line', listener: (input: string) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'SIGCONT', listener: () => void): this; + prependListener(event: 'SIGINT', listener: () => void): this; + prependListener(event: 'SIGTSTP', listener: () => void): this; + prependListener(event: 'history', listener: (history: string[]) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'line', listener: (input: string) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'SIGCONT', listener: () => void): this; + prependOnceListener(event: 'SIGINT', listener: () => void): this; + prependOnceListener(event: 'SIGTSTP', listener: () => void): this; + prependOnceListener(event: 'history', listener: (history: string[]) => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + export type ReadLine = Interface; // type forwarded for backwards compatibility + export type Completer = (line: string) => CompleterResult; + export type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void; + export type CompleterResult = [string[], string]; + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream | undefined; + completer?: Completer | AsyncCompleter | undefined; + terminal?: boolean | undefined; + /** + * Initial list of history lines. This option makes sense + * only if `terminal` is set to `true` by the user or by an internal `output` + * check, otherwise the history caching mechanism is not initialized at all. + * @default [] + */ + history?: string[] | undefined; + historySize?: number | undefined; + prompt?: string | undefined; + crlfDelay?: number | undefined; + /** + * If `true`, when a new input line added + * to the history list duplicates an older one, this removes the older line + * from the list. + * @default false + */ + removeHistoryDuplicates?: boolean | undefined; + escapeCodeTimeout?: number | undefined; + tabSize?: number | undefined; + } + /** + * The `readline.createInterface()` method creates a new `readline.Interface`instance. + * + * ```js + * const readline = require('readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout + * }); + * ``` + * + * Once the `readline.Interface` instance is created, the most common case is to + * listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get + * the best compatibility if it defines an `output.columns` property and emits + * a `'resize'` event on the `output` if or when the columns ever change + * (`process.stdout` does this automatically when it is a TTY). + * + * When creating a `readline.Interface` using `stdin` as input, the program + * will not terminate until it receives `EOF` (Ctrl+D on + * Linux/macOS, Ctrl+Z followed by Return on + * Windows). + * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream: + * + * ```js + * process.stdin.unref(); + * ``` + * @since v0.1.98 + */ + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; + export function createInterface(options: ReadLineOptions): Interface; + /** + * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. + * + * Optionally, `interface` specifies a `readline.Interface` instance for which + * autocompletion is disabled when copy-pasted input is detected. + * + * If the `stream` is a `TTY`, then it must be in raw mode. + * + * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop + * the `input` from emitting `'keypress'` events. + * + * ```js + * readline.emitKeypressEvents(process.stdin); + * if (process.stdin.isTTY) + * process.stdin.setRawMode(true); + * ``` + * + * ## Example: Tiny CLI + * + * The following example illustrates the use of `readline.Interface` class to + * implement a small command-line interface: + * + * ```js + * const readline = require('readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * prompt: 'OHAI> ' + * }); + * + * rl.prompt(); + * + * rl.on('line', (line) => { + * switch (line.trim()) { + * case 'hello': + * console.log('world!'); + * break; + * default: + * console.log(`Say what? I might have heard '${line.trim()}'`); + * break; + * } + * rl.prompt(); + * }).on('close', () => { + * console.log('Have a great day!'); + * process.exit(0); + * }); + * ``` + * + * ## Example: Read file stream line-by-Line + * + * A common use case for `readline` is to consume an input file one line at a + * time. The easiest way to do so is leveraging the `fs.ReadStream` API as + * well as a `for await...of` loop: + * + * ```js + * const fs = require('fs'); + * const readline = require('readline'); + * + * async function processLineByLine() { + * const fileStream = fs.createReadStream('input.txt'); + * + * const rl = readline.createInterface({ + * input: fileStream, + * crlfDelay: Infinity + * }); + * // Note: we use the crlfDelay option to recognize all instances of CR LF + * // ('\r\n') in input.txt as a single line break. + * + * for await (const line of rl) { + * // Each line in input.txt will be successively available here as `line`. + * console.log(`Line from file: ${line}`); + * } + * } + * + * processLineByLine(); + * ``` + * + * Alternatively, one could use the `'line'` event: + * + * ```js + * const fs = require('fs'); + * const readline = require('readline'); + * + * const rl = readline.createInterface({ + * input: fs.createReadStream('sample.txt'), + * crlfDelay: Infinity + * }); + * + * rl.on('line', (line) => { + * console.log(`Line from file: ${line}`); + * }); + * ``` + * + * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: + * + * ```js + * const { once } = require('events'); + * const { createReadStream } = require('fs'); + * const { createInterface } = require('readline'); + * + * (async function processLineByLine() { + * try { + * const rl = createInterface({ + * input: createReadStream('big-file.txt'), + * crlfDelay: Infinity + * }); + * + * rl.on('line', (line) => { + * // Process the line. + * }); + * + * await once(rl, 'close'); + * + * console.log('File processed.'); + * } catch (err) { + * console.error(err); + * } + * })(); + * ``` + * @since v0.7.7 + */ + export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; + export type Direction = -1 | 0 | 1; + export interface CursorPos { + rows: number; + cols: number; + } + /** + * The `readline.clearLine()` method clears current line of given `TTY` stream + * in a specified direction identified by `dir`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; + /** + * The `readline.clearScreenDown()` method clears the given `TTY` stream from + * the current position of the cursor down. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; + /** + * The `readline.cursorTo()` method moves cursor to the specified position in a + * given `TTY` `stream`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; + /** + * The `readline.moveCursor()` method moves the cursor _relative_ to its current + * position in a given `TTY` `stream`. + * + * ## Example: Tiny CLI + * + * The following example illustrates the use of `readline.Interface` class to + * implement a small command-line interface: + * + * ```js + * const readline = require('readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * prompt: 'OHAI> ' + * }); + * + * rl.prompt(); + * + * rl.on('line', (line) => { + * switch (line.trim()) { + * case 'hello': + * console.log('world!'); + * break; + * default: + * console.log(`Say what? I might have heard '${line.trim()}'`); + * break; + * } + * rl.prompt(); + * }).on('close', () => { + * console.log('Have a great day!'); + * process.exit(0); + * }); + * ``` + * + * ## Example: Read file stream line-by-Line + * + * A common use case for `readline` is to consume an input file one line at a + * time. The easiest way to do so is leveraging the `fs.ReadStream` API as + * well as a `for await...of` loop: + * + * ```js + * const fs = require('fs'); + * const readline = require('readline'); + * + * async function processLineByLine() { + * const fileStream = fs.createReadStream('input.txt'); + * + * const rl = readline.createInterface({ + * input: fileStream, + * crlfDelay: Infinity + * }); + * // Note: we use the crlfDelay option to recognize all instances of CR LF + * // ('\r\n') in input.txt as a single line break. + * + * for await (const line of rl) { + * // Each line in input.txt will be successively available here as `line`. + * console.log(`Line from file: ${line}`); + * } + * } + * + * processLineByLine(); + * ``` + * + * Alternatively, one could use the `'line'` event: + * + * ```js + * const fs = require('fs'); + * const readline = require('readline'); + * + * const rl = readline.createInterface({ + * input: fs.createReadStream('sample.txt'), + * crlfDelay: Infinity + * }); + * + * rl.on('line', (line) => { + * console.log(`Line from file: ${line}`); + * }); + * ``` + * + * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: + * + * ```js + * const { once } = require('events'); + * const { createReadStream } = require('fs'); + * const { createInterface } = require('readline'); + * + * (async function processLineByLine() { + * try { + * const rl = createInterface({ + * input: createReadStream('big-file.txt'), + * crlfDelay: Infinity + * }); + * + * rl.on('line', (line) => { + * // Process the line. + * }); + * + * await once(rl, 'close'); + * + * console.log('File processed.'); + * } catch (err) { + * console.error(err); + * } + * })(); + * ``` + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; +} +declare module 'node:readline' { + export * from 'readline'; +} diff --git a/server/node_modules/@types/node/readline/promises.d.ts b/server/node_modules/@types/node/readline/promises.d.ts new file mode 100755 index 0000000000..8f9f06f0b9 --- /dev/null +++ b/server/node_modules/@types/node/readline/promises.d.ts @@ -0,0 +1,143 @@ +/** + * The `readline/promise` module provides an API for reading lines of input from a Readable stream one line at a time. + * + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline/promises.js) + * @since v17.0.0 + */ +declare module 'readline/promises' { + import { Interface as _Interface, ReadLineOptions, Completer, AsyncCompleter, Direction } from 'node:readline'; + import { Abortable } from 'node:events'; + + class Interface extends _Interface { + /** + * The rl.question() method displays the query by writing it to the output, waits for user input to be provided on input, + * then invokes the callback function passing the provided input as the first argument. + * + * When called, rl.question() will resume the input stream if it has been paused. + * + * If the readlinePromises.Interface was created with output set to null or undefined the query is not written. + * + * If the question is called after rl.close(), it returns a rejected promise. + * + * Example usage: + * + * ```js + * const answer = await rl.question('What is your favorite food? '); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * + * Using an AbortSignal to cancel a question. + * + * ```js + * const signal = AbortSignal.timeout(10_000); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * const answer = await rl.question('What is your favorite food? ', { signal }); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * + * @since v17.0.0 + * @param query A statement or query to write to output, prepended to the prompt. + */ + question(query: string): Promise; + question(query: string, options: Abortable): Promise; + } + + class Readline { + /** + * @param stream A TTY stream. + */ + constructor(stream: NodeJS.WritableStream, options?: { autoCommit?: boolean }); + /** + * The `rl.clearLine()` method adds to the internal list of pending action an action that clears current line of the associated `stream` in a specified direction identified by `dir`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + */ + clearLine(dir: Direction): this; + /** + * The `rl.clearScreenDown()` method adds to the internal list of pending action an action that clears the associated `stream` from the current position of the cursor down. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + */ + clearScreenDown(): this; + /** + * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. + */ + commit(): Promise; + /** + * The `rl.cursorTo()` method adds to the internal list of pending action an action that moves cursor to the specified position in the associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + */ + cursorTo(x: number, y?: number): this; + /** + * The `rl.moveCursor()` method adds to the internal list of pending action an action that moves the cursor relative to its current position in the associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless autoCommit: true was passed to the constructor. + */ + moveCursor(dx: number, dy: number): this; + /** + * The `rl.rollback()` method clears the internal list of pending actions without sending it to the associated `stream`. + */ + rollback(): this; + } + + /** + * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. + * + * ```js + * const readlinePromises = require('node:readline/promises'); + * const rl = readlinePromises.createInterface({ + * input: process.stdin, + * output: process.stdout + * }); + * ``` + * + * Once the `readlinePromises.Interface` instance is created, the most common case is to listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property, + * and emits a `'resize'` event on the `output`, if or when the columns ever change (`process.stdout` does this automatically when it is a TTY). + * + * ## Use of the `completer` function + * + * The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries: + * + * - An Array with matching entries for the completion. + * - The substring that was used for the matching. + * + * For instance: `[[substr1, substr2, ...], originalsubstring]`. + * + * ```js + * function completer(line) { + * const completions = '.help .error .exit .quit .q'.split(' '); + * const hits = completions.filter((c) => c.startsWith(line)); + * // Show all completions if none found + * return [hits.length ? hits : completions, line]; + * } + * ``` + * + * The `completer` function can also returns a `Promise`, or be asynchronous: + * + * ```js + * async function completer(linePartial) { + * await someAsyncWork(); + * return [['123'], linePartial]; + * } + * ``` + */ + function createInterface( + input: NodeJS.ReadableStream, + output?: NodeJS.WritableStream, + completer?: Completer | AsyncCompleter, + terminal?: boolean, + ): Interface; + function createInterface(options: ReadLineOptions): Interface; +} +declare module 'node:readline/promises' { + export * from 'readline/promises'; +} diff --git a/server/node_modules/@types/node/repl.d.ts b/server/node_modules/@types/node/repl.d.ts new file mode 100755 index 0000000000..be42ccc4ae --- /dev/null +++ b/server/node_modules/@types/node/repl.d.ts @@ -0,0 +1,424 @@ +/** + * The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that + * is available both as a standalone program or includible in other applications. + * It can be accessed using: + * + * ```js + * const repl = require('repl'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/repl.js) + */ +declare module 'repl' { + import { Interface, Completer, AsyncCompleter } from 'node:readline'; + import { Context } from 'node:vm'; + import { InspectOptions } from 'node:util'; + interface ReplOptions { + /** + * The input prompt to display. + * @default "> " + */ + prompt?: string | undefined; + /** + * The `Readable` stream from which REPL input will be read. + * @default process.stdin + */ + input?: NodeJS.ReadableStream | undefined; + /** + * The `Writable` stream to which REPL output will be written. + * @default process.stdout + */ + output?: NodeJS.WritableStream | undefined; + /** + * If `true`, specifies that the output should be treated as a TTY terminal, and have + * ANSI/VT100 escape codes written to it. + * Default: checking the value of the `isTTY` property on the output stream upon + * instantiation. + */ + terminal?: boolean | undefined; + /** + * The function to be used when evaluating each given line of input. + * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can + * error with `repl.Recoverable` to indicate the input was incomplete and prompt for + * additional lines. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions + */ + eval?: REPLEval | undefined; + /** + * Defines if the repl prints output previews or not. + * @default `true` Always `false` in case `terminal` is falsy. + */ + preview?: boolean | undefined; + /** + * If `true`, specifies that the default `writer` function should include ANSI color + * styling to REPL output. If a custom `writer` function is provided then this has no + * effect. + * Default: the REPL instance's `terminal` value. + */ + useColors?: boolean | undefined; + /** + * If `true`, specifies that the default evaluation function will use the JavaScript + * `global` as the context as opposed to creating a new separate context for the REPL + * instance. The node CLI REPL sets this value to `true`. + * Default: `false`. + */ + useGlobal?: boolean | undefined; + /** + * If `true`, specifies that the default writer will not output the return value of a + * command if it evaluates to `undefined`. + * Default: `false`. + */ + ignoreUndefined?: boolean | undefined; + /** + * The function to invoke to format the output of each command before writing to `output`. + * Default: a wrapper for `util.inspect`. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output + */ + writer?: REPLWriter | undefined; + /** + * An optional function used for custom Tab auto completion. + * + * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function + */ + completer?: Completer | AsyncCompleter | undefined; + /** + * A flag that specifies whether the default evaluator executes all JavaScript commands in + * strict mode or default (sloppy) mode. + * Accepted values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; + /** + * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is + * pressed. This cannot be used together with a custom `eval` function. + * Default: `false`. + */ + breakEvalOnSigint?: boolean | undefined; + } + type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; + type REPLWriter = (this: REPLServer, obj: any) => string; + /** + * This is the default "writer" value, if none is passed in the REPL options, + * and it can be overridden by custom print functions. + */ + const writer: REPLWriter & { + options: InspectOptions; + }; + type REPLCommandAction = (this: REPLServer, text: string) => void; + interface REPLCommand { + /** + * Help text to be displayed when `.help` is entered. + */ + help?: string | undefined; + /** + * The function to execute, optionally accepting a single string argument. + */ + action: REPLCommandAction; + } + /** + * Instances of `repl.REPLServer` are created using the {@link start} method + * or directly using the JavaScript `new` keyword. + * + * ```js + * const repl = require('repl'); + * + * const options = { useColors: true }; + * + * const firstInstance = repl.start(options); + * const secondInstance = new repl.REPLServer(options); + * ``` + * @since v0.1.91 + */ + class REPLServer extends Interface { + /** + * The `vm.Context` provided to the `eval` function to be used for JavaScript + * evaluation. + */ + readonly context: Context; + /** + * @deprecated since v14.3.0 - Use `input` instead. + */ + readonly inputStream: NodeJS.ReadableStream; + /** + * @deprecated since v14.3.0 - Use `output` instead. + */ + readonly outputStream: NodeJS.WritableStream; + /** + * The `Readable` stream from which REPL input will be read. + */ + readonly input: NodeJS.ReadableStream; + /** + * The `Writable` stream to which REPL output will be written. + */ + readonly output: NodeJS.WritableStream; + /** + * The commands registered via `replServer.defineCommand()`. + */ + readonly commands: NodeJS.ReadOnlyDict; + /** + * A value indicating whether the REPL is currently in "editor mode". + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys + */ + readonly editorMode: boolean; + /** + * A value indicating whether the `_` variable has been assigned. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreAssigned: boolean; + /** + * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly last: any; + /** + * A value indicating whether the `_error` variable has been assigned. + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreErrAssigned: boolean; + /** + * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly lastError: any; + /** + * Specified in the REPL options, this is the function to be used when evaluating each + * given line of input. If not specified in the REPL options, this is an async wrapper + * for the JavaScript `eval()` function. + */ + readonly eval: REPLEval; + /** + * Specified in the REPL options, this is a value indicating whether the default + * `writer` function should include ANSI color styling to REPL output. + */ + readonly useColors: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `eval` + * function will use the JavaScript `global` as the context as opposed to creating a new + * separate context for the REPL instance. + */ + readonly useGlobal: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `writer` + * function should output the result of a command if it evaluates to `undefined`. + */ + readonly ignoreUndefined: boolean; + /** + * Specified in the REPL options, this is the function to invoke to format the output of + * each command before writing to `outputStream`. If not specified in the REPL options, + * this will be a wrapper for `util.inspect`. + */ + readonly writer: REPLWriter; + /** + * Specified in the REPL options, this is the function to use for custom Tab auto-completion. + */ + readonly completer: Completer | AsyncCompleter; + /** + * Specified in the REPL options, this is a flag that specifies whether the default `eval` + * function should execute all JavaScript commands in strict mode or default (sloppy) mode. + * Possible values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; + /** + * NOTE: According to the documentation: + * + * > Instances of `repl.REPLServer` are created using the `repl.start()` method and + * > _should not_ be created directly using the JavaScript `new` keyword. + * + * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver + */ + private constructor(); + /** + * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands + * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following + * properties: + * + * The following example shows two new commands added to the REPL instance: + * + * ```js + * const repl = require('repl'); + * + * const replServer = repl.start({ prompt: '> ' }); + * replServer.defineCommand('sayhello', { + * help: 'Say hello', + * action(name) { + * this.clearBufferedCommand(); + * console.log(`Hello, ${name}!`); + * this.displayPrompt(); + * } + * }); + * replServer.defineCommand('saybye', function saybye() { + * console.log('Goodbye!'); + * this.close(); + * }); + * ``` + * + * The new commands can then be used from within the REPL instance: + * + * ```console + * > .sayhello Node.js User + * Hello, Node.js User! + * > .saybye + * Goodbye! + * ``` + * @since v0.3.0 + * @param keyword The command keyword (_without_ a leading `.` character). + * @param cmd The function to invoke when the command is processed. + */ + defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; + /** + * The `replServer.displayPrompt()` method readies the REPL instance for input + * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. + * + * When multi-line input is being entered, an ellipsis is printed rather than the + * 'prompt'. + * + * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. + * + * The `replServer.displayPrompt` method is primarily intended to be called from + * within the action function for commands registered using the`replServer.defineCommand()` method. + * @since v0.1.91 + */ + displayPrompt(preserveCursor?: boolean): void; + /** + * The `replServer.clearBufferedCommand()` method clears any command that has been + * buffered but not yet executed. This method is primarily intended to be + * called from within the action function for commands registered using the`replServer.defineCommand()` method. + * @since v9.0.0 + */ + clearBufferedCommand(): void; + /** + * Initializes a history log file for the REPL instance. When executing the + * Node.js binary and using the command-line REPL, a history file is initialized + * by default. However, this is not the case when creating a REPL + * programmatically. Use this method to initialize a history log file when working + * with REPL instances programmatically. + * @since v11.10.0 + * @param historyPath the path to the history file + * @param callback called when history writes are ready or upon error + */ + setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; + /** + * events.EventEmitter + * 1. close - inherited from `readline.Interface` + * 2. line - inherited from `readline.Interface` + * 3. pause - inherited from `readline.Interface` + * 4. resume - inherited from `readline.Interface` + * 5. SIGCONT - inherited from `readline.Interface` + * 6. SIGINT - inherited from `readline.Interface` + * 7. SIGTSTP - inherited from `readline.Interface` + * 8. exit + * 9. reset + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'line', listener: (input: string) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'SIGCONT', listener: () => void): this; + addListener(event: 'SIGINT', listener: () => void): this; + addListener(event: 'SIGTSTP', listener: () => void): this; + addListener(event: 'exit', listener: () => void): this; + addListener(event: 'reset', listener: (context: Context) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'line', input: string): boolean; + emit(event: 'pause'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'SIGCONT'): boolean; + emit(event: 'SIGINT'): boolean; + emit(event: 'SIGTSTP'): boolean; + emit(event: 'exit'): boolean; + emit(event: 'reset', context: Context): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'line', listener: (input: string) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'SIGCONT', listener: () => void): this; + on(event: 'SIGINT', listener: () => void): this; + on(event: 'SIGTSTP', listener: () => void): this; + on(event: 'exit', listener: () => void): this; + on(event: 'reset', listener: (context: Context) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'line', listener: (input: string) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'SIGCONT', listener: () => void): this; + once(event: 'SIGINT', listener: () => void): this; + once(event: 'SIGTSTP', listener: () => void): this; + once(event: 'exit', listener: () => void): this; + once(event: 'reset', listener: (context: Context) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'line', listener: (input: string) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'SIGCONT', listener: () => void): this; + prependListener(event: 'SIGINT', listener: () => void): this; + prependListener(event: 'SIGTSTP', listener: () => void): this; + prependListener(event: 'exit', listener: () => void): this; + prependListener(event: 'reset', listener: (context: Context) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'line', listener: (input: string) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'SIGCONT', listener: () => void): this; + prependOnceListener(event: 'SIGINT', listener: () => void): this; + prependOnceListener(event: 'SIGTSTP', listener: () => void): this; + prependOnceListener(event: 'exit', listener: () => void): this; + prependOnceListener(event: 'reset', listener: (context: Context) => void): this; + } + /** + * A flag passed in the REPL options. Evaluates expressions in sloppy mode. + */ + const REPL_MODE_SLOPPY: unique symbol; + /** + * A flag passed in the REPL options. Evaluates expressions in strict mode. + * This is equivalent to prefacing every repl statement with `'use strict'`. + */ + const REPL_MODE_STRICT: unique symbol; + /** + * The `repl.start()` method creates and starts a {@link REPLServer} instance. + * + * If `options` is a string, then it specifies the input prompt: + * + * ```js + * const repl = require('repl'); + * + * // a Unix style prompt + * repl.start('$ '); + * ``` + * @since v0.1.91 + */ + function start(options?: string | ReplOptions): REPLServer; + /** + * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors + */ + class Recoverable extends SyntaxError { + err: Error; + constructor(err: Error); + } +} +declare module 'node:repl' { + export * from 'repl'; +} diff --git a/server/node_modules/@types/node/stream.d.ts b/server/node_modules/@types/node/stream.d.ts new file mode 100755 index 0000000000..711fd9ca59 --- /dev/null +++ b/server/node_modules/@types/node/stream.d.ts @@ -0,0 +1,1340 @@ +/** + * A stream is an abstract interface for working with streaming data in Node.js. + * The `stream` module provides an API for implementing the stream interface. + * + * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. + * + * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. + * + * To access the `stream` module: + * + * ```js + * const stream = require('stream'); + * ``` + * + * The `stream` module is useful for creating new types of stream instances. It is + * usually not necessary to use the `stream` module to consume streams. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/stream.js) + */ +declare module 'stream' { + import { EventEmitter, Abortable } from 'node:events'; + import { Blob as NodeBlob } from "node:buffer"; + import * as streamPromises from 'node:stream/promises'; + import * as streamConsumers from 'node:stream/consumers'; + import * as streamWeb from 'node:stream/web'; + class internal extends EventEmitter { + pipe( + destination: T, + options?: { + end?: boolean | undefined; + } + ): T; + } + namespace internal { + class Stream extends internal { + constructor(opts?: ReadableOptions); + } + interface StreamOptions extends Abortable { + emitClose?: boolean | undefined; + highWaterMark?: number | undefined; + objectMode?: boolean | undefined; + construct?(this: T, callback: (error?: Error | null) => void): void; + destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; + autoDestroy?: boolean | undefined; + } + interface ReadableOptions extends StreamOptions { + encoding?: BufferEncoding | undefined; + read?(this: Readable, size: number): void; + } + /** + * @since v0.9.4 + */ + class Readable extends Stream implements NodeJS.ReadableStream { + /** + * A utility method for creating Readable Streams out of iterators. + */ + static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; + /** + * A utility method for creating a `Readable` from a web `ReadableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick): Readable; + /** + * Returns whether the stream has been read from or cancelled. + * @since v16.8.0 + */ + static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; + /** + * A utility method for creating a web `ReadableStream` from a `Readable`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamReadable: Readable): streamWeb.ReadableStream; + /** + * Returns whether the stream was destroyed or errored before emitting `'end'`. + * @since v16.8.0 + * @experimental + */ + readonly readableAborted: boolean; + /** + * Is `true` if it is safe to call `readable.read()`, which means + * the stream has not been destroyed or emitted `'error'` or `'end'`. + * @since v11.4.0 + */ + readable: boolean; + /** + * Returns whether `'data'` has been emitted. + * @since v16.7.0, v14.18.0 + * @experimental + */ + readonly readableDidRead: boolean; + /** + * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. + * @since v12.7.0 + */ + readonly readableEncoding: BufferEncoding | null; + /** + * Becomes `true` when `'end'` event is emitted. + * @since v12.9.0 + */ + readonly readableEnded: boolean; + /** + * This property reflects the current state of a `Readable` stream as described + * in the `Three states` section. + * @since v9.4.0 + */ + readonly readableFlowing: boolean | null; + /** + * Returns the value of `highWaterMark` passed when creating this `Readable`. + * @since v9.3.0 + */ + readonly readableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be read. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly readableLength: number; + /** + * Getter for the property `objectMode` of a given `Readable` stream. + * @since v12.3.0 + */ + readonly readableObjectMode: boolean; + /** + * Is `true` after `readable.destroy()` has been called. + * @since v8.0.0 + */ + destroyed: boolean; + /** + * Is true after 'close' has been emitted. + * @since v18.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + constructor(opts?: ReadableOptions); + _construct?(callback: (error?: Error | null) => void): void; + _read(size: number): void; + /** + * The `readable.read()` method reads data out of the internal buffer and + * returns it. If no data is available to be read, `null` is returned. By default, + * the data is returned as a `Buffer` object unless an encoding has been + * specified using the `readable.setEncoding()` method or the stream is operating + * in object mode. + * + * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which + * case all of the data remaining in the internal + * buffer will be returned. + * + * If the `size` argument is not specified, all of the data contained in the + * internal buffer will be returned. + * + * The `size` argument must be less than or equal to 1 GiB. + * + * The `readable.read()` method should only be called on `Readable` streams + * operating in paused mode. In flowing mode, `readable.read()` is called + * automatically until the internal buffer is fully drained. + * + * ```js + * const readable = getReadableStreamSomehow(); + * + * // 'readable' may be triggered multiple times as data is buffered in + * readable.on('readable', () => { + * let chunk; + * console.log('Stream is readable (new data received in buffer)'); + * // Use a loop to make sure we read all currently available data + * while (null !== (chunk = readable.read())) { + * console.log(`Read ${chunk.length} bytes of data...`); + * } + * }); + * + * // 'end' will be triggered once when there is no more data available + * readable.on('end', () => { + * console.log('Reached end of stream.'); + * }); + * ``` + * + * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks + * are not concatenated. A `while` loop is necessary to consume all data + * currently in the buffer. When reading a large file `.read()` may return `null`, + * having consumed all buffered content so far, but there is still more data to + * come not yet buffered. In this case a new `'readable'` event will be emitted + * when there is more data in the buffer. Finally the `'end'` event will be + * emitted when there is no more data to come. + * + * Therefore to read a file's whole contents from a `readable`, it is necessary + * to collect chunks across multiple `'readable'` events: + * + * ```js + * const chunks = []; + * + * readable.on('readable', () => { + * let chunk; + * while (null !== (chunk = readable.read())) { + * chunks.push(chunk); + * } + * }); + * + * readable.on('end', () => { + * const content = chunks.join(''); + * }); + * ``` + * + * A `Readable` stream in object mode will always return a single item from + * a call to `readable.read(size)`, regardless of the value of the`size` argument. + * + * If the `readable.read()` method returns a chunk of data, a `'data'` event will + * also be emitted. + * + * Calling {@link read} after the `'end'` event has + * been emitted will return `null`. No runtime error will be raised. + * @since v0.9.4 + * @param size Optional argument to specify how much data to read. + */ + read(size?: number): any; + /** + * The `readable.setEncoding()` method sets the character encoding for + * data read from the `Readable` stream. + * + * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data + * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the + * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal + * string format. + * + * The `Readable` stream will properly handle multi-byte characters delivered + * through the stream that would otherwise become improperly decoded if simply + * pulled from the stream as `Buffer` objects. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.setEncoding('utf8'); + * readable.on('data', (chunk) => { + * assert.equal(typeof chunk, 'string'); + * console.log('Got %d characters of string data:', chunk.length); + * }); + * ``` + * @since v0.9.4 + * @param encoding The encoding to use. + */ + setEncoding(encoding: BufferEncoding): this; + /** + * The `readable.pause()` method will cause a stream in flowing mode to stop + * emitting `'data'` events, switching out of flowing mode. Any data that + * becomes available will remain in the internal buffer. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.on('data', (chunk) => { + * console.log(`Received ${chunk.length} bytes of data.`); + * readable.pause(); + * console.log('There will be no additional data for 1 second.'); + * setTimeout(() => { + * console.log('Now data will start flowing again.'); + * readable.resume(); + * }, 1000); + * }); + * ``` + * + * The `readable.pause()` method has no effect if there is a `'readable'`event listener. + * @since v0.9.4 + */ + pause(): this; + /** + * The `readable.resume()` method causes an explicitly paused `Readable` stream to + * resume emitting `'data'` events, switching the stream into flowing mode. + * + * The `readable.resume()` method can be used to fully consume the data from a + * stream without actually processing any of that data: + * + * ```js + * getReadableStreamSomehow() + * .resume() + * .on('end', () => { + * console.log('Reached the end, but did not read anything.'); + * }); + * ``` + * + * The `readable.resume()` method has no effect if there is a `'readable'`event listener. + * @since v0.9.4 + */ + resume(): this; + /** + * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most + * typical cases, there will be no reason to + * use this method directly. + * + * ```js + * const readable = new stream.Readable(); + * + * readable.isPaused(); // === false + * readable.pause(); + * readable.isPaused(); // === true + * readable.resume(); + * readable.isPaused(); // === false + * ``` + * @since v0.11.14 + */ + isPaused(): boolean; + /** + * The `readable.unpipe()` method detaches a `Writable` stream previously attached + * using the {@link pipe} method. + * + * If the `destination` is not specified, then _all_ pipes are detached. + * + * If the `destination` is specified, but no pipe is set up for it, then + * the method does nothing. + * + * ```js + * const fs = require('fs'); + * const readable = getReadableStreamSomehow(); + * const writable = fs.createWriteStream('file.txt'); + * // All the data from readable goes into 'file.txt', + * // but only for the first second. + * readable.pipe(writable); + * setTimeout(() => { + * console.log('Stop writing to file.txt.'); + * readable.unpipe(writable); + * console.log('Manually close the file stream.'); + * writable.end(); + * }, 1000); + * ``` + * @since v0.9.4 + * @param destination Optional specific stream to unpipe + */ + unpipe(destination?: NodeJS.WritableStream): this; + /** + * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the + * same as `readable.push(null)`, after which no more data can be written. The EOF + * signal is put at the end of the buffer and any buffered data will still be + * flushed. + * + * The `readable.unshift()` method pushes a chunk of data back into the internal + * buffer. This is useful in certain situations where a stream is being consumed by + * code that needs to "un-consume" some amount of data that it has optimistically + * pulled out of the source, so that the data can be passed on to some other party. + * + * The `stream.unshift(chunk)` method cannot be called after the `'end'` event + * has been emitted or a runtime error will be thrown. + * + * Developers using `stream.unshift()` often should consider switching to + * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. + * + * ```js + * // Pull off a header delimited by \n\n. + * // Use unshift() if we get too much. + * // Call the callback with (error, header, stream). + * const { StringDecoder } = require('string_decoder'); + * function parseHeader(stream, callback) { + * stream.on('error', callback); + * stream.on('readable', onReadable); + * const decoder = new StringDecoder('utf8'); + * let header = ''; + * function onReadable() { + * let chunk; + * while (null !== (chunk = stream.read())) { + * const str = decoder.write(chunk); + * if (str.includes('\n\n')) { + * // Found the header boundary. + * const split = str.split(/\n\n/); + * header += split.shift(); + * const remaining = split.join('\n\n'); + * const buf = Buffer.from(remaining, 'utf8'); + * stream.removeListener('error', callback); + * // Remove the 'readable' listener before unshifting. + * stream.removeListener('readable', onReadable); + * if (buf.length) + * stream.unshift(buf); + * // Now the body of the message can be read from the stream. + * callback(null, header, stream); + * return; + * } + * // Still reading the header. + * header += str; + * } + * } + * } + * ``` + * + * Unlike {@link push}, `stream.unshift(chunk)` will not + * end the reading process by resetting the internal reading state of the stream. + * This can cause unexpected results if `readable.unshift()` is called during a + * read (i.e. from within a {@link _read} implementation on a + * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, + * however it is best to simply avoid calling `readable.unshift()` while in the + * process of performing a read. + * @since v0.9.11 + * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array` or `null`. For object mode + * streams, `chunk` may be any JavaScript value. + * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. + */ + unshift(chunk: any, encoding?: BufferEncoding): void; + /** + * Prior to Node.js 0.10, streams did not implement the entire `stream` module API + * as it is currently defined. (See `Compatibility` for more information.) + * + * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` + * stream that uses + * the old stream as its data source. + * + * It will rarely be necessary to use `readable.wrap()` but the method has been + * provided as a convenience for interacting with older Node.js applications and + * libraries. + * + * ```js + * const { OldReader } = require('./old-api-module.js'); + * const { Readable } = require('stream'); + * const oreader = new OldReader(); + * const myReader = new Readable().wrap(oreader); + * + * myReader.on('readable', () => { + * myReader.read(); // etc. + * }); + * ``` + * @since v0.9.4 + * @param stream An "old style" readable stream + */ + wrap(stream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: BufferEncoding): boolean; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable + * stream will release any internal resources and subsequent calls to `push()`will be ignored. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, but instead implement `readable._destroy()`. + * @since v8.0.0 + * @param error Error which will be passed as payload in `'error'` event + */ + destroy(error?: Error): this; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. error + * 5. pause + * 6. readable + * 7. resume + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: any) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: any): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'pause'): boolean; + emit(event: 'readable'): boolean; + emit(event: 'resume'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: any) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: any) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: any) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: any) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'data', listener: (chunk: any) => void): this; + removeListener(event: 'end', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'pause', listener: () => void): this; + removeListener(event: 'readable', listener: () => void): this; + removeListener(event: 'resume', listener: () => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + interface WritableOptions extends StreamOptions { + decodeStrings?: boolean | undefined; + defaultEncoding?: BufferEncoding | undefined; + write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Writable, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Writable, callback: (error?: Error | null) => void): void; + } + /** + * @since v0.9.4 + */ + class Writable extends Stream implements NodeJS.WritableStream { + /** + * A utility method for creating a `Writable` from a web `WritableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb(writableStream: streamWeb.WritableStream, options?: Pick): Writable; + /** + * A utility method for creating a web `WritableStream` from a `Writable`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamWritable: Writable): streamWeb.WritableStream; + /** + * Is `true` if it is safe to call `writable.write()`, which means + * the stream has not been destroyed, errored or ended. + * @since v11.4.0 + */ + readonly writable: boolean; + /** + * Is `true` after `writable.end()` has been called. This property + * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. + * @since v12.9.0 + */ + readonly writableEnded: boolean; + /** + * Is set to `true` immediately before the `'finish'` event is emitted. + * @since v12.6.0 + */ + readonly writableFinished: boolean; + /** + * Return the value of `highWaterMark` passed when creating this `Writable`. + * @since v9.3.0 + */ + readonly writableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be written. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly writableLength: number; + /** + * Getter for the property `objectMode` of a given `Writable` stream. + * @since v12.3.0 + */ + readonly writableObjectMode: boolean; + /** + * Number of times `writable.uncork()` needs to be + * called in order to fully uncork the stream. + * @since v13.2.0, v12.16.0 + */ + readonly writableCorked: number; + /** + * Is `true` after `writable.destroy()` has been called. + * @since v8.0.0 + */ + destroyed: boolean; + /** + * Is true after 'close' has been emitted. + * @since v18.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + /** + * Is `true` if the stream's buffer has been full and stream will emit 'drain'. + * @since v15.2.0, v14.17.0 + */ + readonly writableNeedDrain: boolean; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?( + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + _construct?(callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + /** + * The `writable.write()` method writes some data to the stream, and calls the + * supplied `callback` once the data has been fully handled. If an error + * occurs, the `callback` will be called with the error as its + * first argument. The `callback` is called asynchronously and before `'error'` is + * emitted. + * + * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. + * If `false` is returned, further attempts to write data to the stream should + * stop until the `'drain'` event is emitted. + * + * While a stream is not draining, calls to `write()` will buffer `chunk`, and + * return false. Once all currently buffered chunks are drained (accepted for + * delivery by the operating system), the `'drain'` event will be emitted. + * Once `write()` returns false, do not write more chunks + * until the `'drain'` event is emitted. While calling `write()` on a stream that + * is not draining is allowed, Node.js will buffer all written chunks until + * maximum memory usage occurs, at which point it will abort unconditionally. + * Even before it aborts, high memory usage will cause poor garbage collector + * performance and high RSS (which is not typically released back to the system, + * even after the memory is no longer required). Since TCP sockets may never + * drain if the remote peer does not read the data, writing a socket that is + * not draining may lead to a remotely exploitable vulnerability. + * + * Writing data while the stream is not draining is particularly + * problematic for a `Transform`, because the `Transform` streams are paused + * by default until they are piped or a `'data'` or `'readable'` event handler + * is added. + * + * If the data to be written can be generated or fetched on demand, it is + * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is + * possible to respect backpressure and avoid memory issues using the `'drain'` event: + * + * ```js + * function write(data, cb) { + * if (!stream.write(data)) { + * stream.once('drain', cb); + * } else { + * process.nextTick(cb); + * } + * } + * + * // Wait for cb to be called before doing any other write. + * write('hello', () => { + * console.log('Write completed, do more writes now.'); + * }); + * ``` + * + * A `Writable` stream in object mode will always ignore the `encoding` argument. + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any + * JavaScript value other than `null`. + * @param [encoding='utf8'] The encoding, if `chunk` is a string. + * @param callback Callback for when this chunk of data is flushed. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; + /** + * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. + * @since v0.11.15 + * @param encoding The new default encoding + */ + setDefaultEncoding(encoding: BufferEncoding): this; + /** + * Calling the `writable.end()` method signals that no more data will be written + * to the `Writable`. The optional `chunk` and `encoding` arguments allow one + * final additional chunk of data to be written immediately before closing the + * stream. + * + * Calling the {@link write} method after calling {@link end} will raise an error. + * + * ```js + * // Write 'hello, ' and then end with 'world!'. + * const fs = require('fs'); + * const file = fs.createWriteStream('example.txt'); + * file.write('hello, '); + * file.end('world!'); + * // Writing more now is not allowed! + * ``` + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any + * JavaScript value other than `null`. + * @param encoding The encoding if `chunk` is a string + * @param callback Callback for when the stream is finished. + */ + end(cb?: () => void): this; + end(chunk: any, cb?: () => void): this; + end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; + /** + * The `writable.cork()` method forces all written data to be buffered in memory. + * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. + * + * The primary intent of `writable.cork()` is to accommodate a situation in which + * several small chunks are written to the stream in rapid succession. Instead of + * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them + * all to `writable._writev()`, if present. This prevents a head-of-line blocking + * situation where data is being buffered while waiting for the first small chunk + * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. + * + * See also: `writable.uncork()`, `writable._writev()`. + * @since v0.11.2 + */ + cork(): void; + /** + * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. + * + * When using `writable.cork()` and `writable.uncork()` to manage the buffering + * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event + * loop phase. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.write('data '); + * process.nextTick(() => stream.uncork()); + * ``` + * + * If the `writable.cork()` method is called multiple times on a stream, the + * same number of calls to `writable.uncork()` must be called to flush the buffered + * data. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.cork(); + * stream.write('data '); + * process.nextTick(() => { + * stream.uncork(); + * // The data will not be flushed until uncork() is called a second time. + * stream.uncork(); + * }); + * ``` + * + * See also: `writable.cork()`. + * @since v0.11.2 + */ + uncork(): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable + * stream has ended and subsequent calls to `write()` or `end()` will result in + * an `ERR_STREAM_DESTROYED` error. + * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. + * Use `end()` instead of destroy if data should flush before close, or wait for + * the `'drain'` event before destroying the stream. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, + * but instead implement `writable._destroy()`. + * @since v8.0.0 + * @param error Optional, an error to emit with `'error'` event. + */ + destroy(error?: Error): this; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: Readable) => void): this; + addListener(event: 'unpipe', listener: (src: Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'drain'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pipe', src: Readable): boolean; + emit(event: 'unpipe', src: Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: Readable) => void): this; + on(event: 'unpipe', listener: (src: Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: Readable) => void): this; + once(event: 'unpipe', listener: (src: Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'drain', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'finish', listener: () => void): this; + removeListener(event: 'pipe', listener: (src: Readable) => void): this; + removeListener(event: 'unpipe', listener: (src: Readable) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean | undefined; + readableObjectMode?: boolean | undefined; + writableObjectMode?: boolean | undefined; + readableHighWaterMark?: number | undefined; + writableHighWaterMark?: number | undefined; + writableCorked?: number | undefined; + construct?(this: Duplex, callback: (error?: Error | null) => void): void; + read?(this: Duplex, size: number): void; + write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Duplex, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Duplex, callback: (error?: Error | null) => void): void; + destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; + } + /** + * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Duplex` streams include: + * + * * `TCP sockets` + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Duplex extends Readable implements Writable { + readonly writable: boolean; + readonly writableEnded: boolean; + readonly writableFinished: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + readonly writableObjectMode: boolean; + readonly writableCorked: number; + readonly writableNeedDrain: boolean; + readonly closed: boolean; + readonly errored: Error | null; + /** + * If `false` then the stream will automatically end the writable side when the + * readable side ends. Set initially by the `allowHalfOpen` constructor option, + * which defaults to `false`. + * + * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is + * emitted. + * @since v0.9.4 + */ + allowHalfOpen: boolean; + constructor(opts?: DuplexOptions); + /** + * A utility method for creating duplex streams. + * + * - `Stream` converts writable stream into writable `Duplex` and readable stream + * to `Duplex`. + * - `Blob` converts into readable `Duplex`. + * - `string` converts into readable `Duplex`. + * - `ArrayBuffer` converts into readable `Duplex`. + * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. + * - `AsyncGeneratorFunction` converts into a readable/writable transform + * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield + * `null`. + * - `AsyncFunction` converts into a writable `Duplex`. Must return + * either `null` or `undefined` + * - `Object ({ writable, readable })` converts `readable` and + * `writable` into `Stream` and then combines them into `Duplex` where the + * `Duplex` will write to the `writable` and read from the `readable`. + * - `Promise` converts into readable `Duplex`. Value `null` is ignored. + * + * @since v16.8.0 + */ + static from(src: Stream | NodeBlob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?( + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + _destroy(error: Error | null, callback: (error: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: BufferEncoding): this; + end(cb?: () => void): this; + end(chunk: any, cb?: () => void): this; + end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; + cork(): void; + uncork(): void; + } + type TransformCallback = (error?: Error | null, data?: any) => void; + interface TransformOptions extends DuplexOptions { + construct?(this: Transform, callback: (error?: Error | null) => void): void; + read?(this: Transform, size: number): void; + write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Transform, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Transform, callback: (error?: Error | null) => void): void; + destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; + transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + flush?(this: Transform, callback: TransformCallback): void; + } + /** + * Transform streams are `Duplex` streams where the output is in some way + * related to the input. Like all `Duplex` streams, `Transform` streams + * implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Transform` streams include: + * + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; + } + /** + * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is + * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. + */ + class PassThrough extends Transform {} + /** + * Attaches an AbortSignal to a readable or writeable stream. This lets code + * control stream destruction using an `AbortController`. + * + * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream. + * + * ```js + * const fs = require('fs'); + * + * const controller = new AbortController(); + * const read = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')) + * ); + * // Later, abort the operation closing the stream + * controller.abort(); + * ``` + * + * Or using an `AbortSignal` with a readable stream as an async iterable: + * + * ```js + * const controller = new AbortController(); + * setTimeout(() => controller.abort(), 10_000); // set a timeout + * const stream = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')) + * ); + * (async () => { + * try { + * for await (const chunk of stream) { + * await process(chunk); + * } + * } catch (e) { + * if (e.name === 'AbortError') { + * // The operation was cancelled + * } else { + * throw e; + * } + * } + * })(); + * ``` + * @since v15.4.0 + * @param signal A signal representing possible cancellation + * @param stream a stream to attach a signal to + */ + function addAbortSignal(signal: AbortSignal, stream: T): T; + interface FinishedOptions extends Abortable { + error?: boolean | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + } + /** + * A function to get notified when a stream is no longer readable, writable + * or has experienced an error or a premature close event. + * + * ```js + * const { finished } = require('stream'); + * + * const rs = fs.createReadStream('archive.tar'); + * + * finished(rs, (err) => { + * if (err) { + * console.error('Stream failed.', err); + * } else { + * console.log('Stream is done reading.'); + * } + * }); + * + * rs.resume(); // Drain the stream. + * ``` + * + * Especially useful in error handling scenarios where a stream is destroyed + * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. + * + * The `finished` API provides promise version: + * + * ```js + * const { finished } = require('stream/promises'); + * + * const rs = fs.createReadStream('archive.tar'); + * + * async function run() { + * await finished(rs); + * console.log('Stream is done reading.'); + * } + * + * run().catch(console.error); + * rs.resume(); // Drain the stream. + * ``` + * + * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been + * invoked. The reason for this is so that unexpected `'error'` events (due to + * incorrect stream implementations) do not cause unexpected crashes. + * If this is unwanted behavior then the returned cleanup function needs to be + * invoked in the callback: + * + * ```js + * const cleanup = finished(rs, (err) => { + * cleanup(); + * // ... + * }); + * ``` + * @since v10.0.0 + * @param stream A readable and/or writable stream. + * @param callback A callback function that takes an optional error argument. + * @return A cleanup function which removes all registered listeners. + */ + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + namespace finished { + function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + } + type PipelineSourceFunction = () => Iterable | AsyncIterable; + type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; + type PipelineTransform, U> = + | NodeJS.ReadWriteStream + | ((source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable : S) => AsyncIterable); + type PipelineTransformSource = PipelineSource | PipelineTransform; + type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; + type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; + type PipelineDestination, P> = S extends PipelineTransformSource + ? NodeJS.WritableStream | PipelineDestinationIterableFunction | PipelineDestinationPromiseFunction + : never; + type PipelineCallback> = S extends PipelineDestinationPromiseFunction + ? (err: NodeJS.ErrnoException | null, value: P) => void + : (err: NodeJS.ErrnoException | null) => void; + type PipelinePromise> = S extends PipelineDestinationPromiseFunction ? Promise

: Promise; + interface PipelineOptions { + signal: AbortSignal; + } + /** + * A module method to pipe between streams and generators forwarding errors and + * properly cleaning up and provide a callback when the pipeline is complete. + * + * ```js + * const { pipeline } = require('stream'); + * const fs = require('fs'); + * const zlib = require('zlib'); + * + * // Use the pipeline API to easily pipe a series of streams + * // together and get notified when the pipeline is fully done. + * + * // A pipeline to gzip a potentially huge tar file efficiently: + * + * pipeline( + * fs.createReadStream('archive.tar'), + * zlib.createGzip(), + * fs.createWriteStream('archive.tar.gz'), + * (err) => { + * if (err) { + * console.error('Pipeline failed.', err); + * } else { + * console.log('Pipeline succeeded.'); + * } + * } + * ); + * ``` + * + * The `pipeline` API provides a promise version, which can also + * receive an options argument as the last parameter with a`signal` `AbortSignal` property. When the signal is aborted,`destroy` will be called on the underlying pipeline, with + * an`AbortError`. + * + * ```js + * const { pipeline } = require('stream/promises'); + * + * async function run() { + * await pipeline( + * fs.createReadStream('archive.tar'), + * zlib.createGzip(), + * fs.createWriteStream('archive.tar.gz') + * ); + * console.log('Pipeline succeeded.'); + * } + * + * run().catch(console.error); + * ``` + * + * To use an `AbortSignal`, pass it inside an options object, + * as the last argument: + * + * ```js + * const { pipeline } = require('stream/promises'); + * + * async function run() { + * const ac = new AbortController(); + * const signal = ac.signal; + * + * setTimeout(() => ac.abort(), 1); + * await pipeline( + * fs.createReadStream('archive.tar'), + * zlib.createGzip(), + * fs.createWriteStream('archive.tar.gz'), + * { signal }, + * ); + * } + * + * run().catch(console.error); // AbortError + * ``` + * + * The `pipeline` API also supports async generators: + * + * ```js + * const { pipeline } = require('stream/promises'); + * const fs = require('fs'); + * + * async function run() { + * await pipeline( + * fs.createReadStream('lowercase.txt'), + * async function* (source, { signal }) { + * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s. + * for await (const chunk of source) { + * yield await processChunk(chunk, { signal }); + * } + * }, + * fs.createWriteStream('uppercase.txt') + * ); + * console.log('Pipeline succeeded.'); + * } + * + * run().catch(console.error); + * ``` + * + * Remember to handle the `signal` argument passed into the async generator. + * Especially in the case where the async generator is the source for the + * pipeline (i.e. first argument) or the pipeline will never complete. + * + * ```js + * const { pipeline } = require('stream/promises'); + * const fs = require('fs'); + * + * async function run() { + * await pipeline( + * async function* ({ signal }) { + * await someLongRunningfn({ signal }); + * yield 'asd'; + * }, + * fs.createWriteStream('uppercase.txt') + * ); + * console.log('Pipeline succeeded.'); + * } + * + * run().catch(console.error); + * ``` + * + * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: + * + * * `Readable` streams which have emitted `'end'` or `'close'`. + * * `Writable` streams which have emitted `'finish'` or `'close'`. + * + * `stream.pipeline()` leaves dangling event listeners on the streams + * after the `callback` has been invoked. In the case of reuse of streams after + * failure, this can cause event listener leaks and swallowed errors. If the last + * stream is readable, dangling event listeners will be removed so that the last + * stream can be consumed later. + * + * `stream.pipeline()` closes all the streams when an error is raised. + * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior + * once it would destroy the socket without sending the expected response. + * See the example below: + * + * ```js + * const fs = require('fs'); + * const http = require('http'); + * const { pipeline } = require('stream'); + * + * const server = http.createServer((req, res) => { + * const fileStream = fs.createReadStream('./fileNotExist.txt'); + * pipeline(fileStream, res, (err) => { + * if (err) { + * console.log(err); // No such file + * // this message can't be sent once `pipeline` already destroyed the socket + * return res.end('error!!!'); + * } + * }); + * }); + * ``` + * @since v10.0.0 + * @param callback Called when the pipeline is fully done. + */ + function pipeline, B extends PipelineDestination>( + source: A, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline( + streams: ReadonlyArray, + callback?: (err: NodeJS.ErrnoException | null) => void + ): NodeJS.WritableStream; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array void)> + ): NodeJS.WritableStream; + namespace pipeline { + function __promisify__, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__(streams: ReadonlyArray, options?: PipelineOptions): Promise; + function __promisify__( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array + ): Promise; + } + interface Pipe { + close(): void; + hasRef(): boolean; + ref(): void; + unref(): void; + } + + /** + * Returns whether the stream has encountered an error. + * @since v17.3.0 + */ + function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; + + /** + * Returns whether the stream is readable. + * @since v17.4.0 + */ + function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; + + const promises: typeof streamPromises; + const consumers: typeof streamConsumers; + } + export = internal; +} +declare module 'node:stream' { + import stream = require('stream'); + export = stream; +} diff --git a/server/node_modules/@types/node/stream/consumers.d.ts b/server/node_modules/@types/node/stream/consumers.d.ts new file mode 100755 index 0000000000..1ebf12e1fa --- /dev/null +++ b/server/node_modules/@types/node/stream/consumers.d.ts @@ -0,0 +1,12 @@ +declare module 'stream/consumers' { + import { Blob as NodeBlob } from "node:buffer"; + import { Readable } from 'node:stream'; + function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; +} +declare module 'node:stream/consumers' { + export * from 'stream/consumers'; +} diff --git a/server/node_modules/@types/node/stream/promises.d.ts b/server/node_modules/@types/node/stream/promises.d.ts new file mode 100755 index 0000000000..b427073de5 --- /dev/null +++ b/server/node_modules/@types/node/stream/promises.d.ts @@ -0,0 +1,42 @@ +declare module 'stream/promises' { + import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream'; + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + function pipeline, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline(streams: ReadonlyArray, options?: PipelineOptions): Promise; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array + ): Promise; +} +declare module 'node:stream/promises' { + export * from 'stream/promises'; +} diff --git a/server/node_modules/@types/node/stream/web.d.ts b/server/node_modules/@types/node/stream/web.d.ts new file mode 100755 index 0000000000..f9ef0570dc --- /dev/null +++ b/server/node_modules/@types/node/stream/web.d.ts @@ -0,0 +1,330 @@ +declare module 'stream/web' { + // stub module, pending copy&paste from .d.ts or manual impl + // copy from lib.dom.d.ts + interface ReadableWritablePair { + readable: ReadableStream; + /** + * Provides a convenient, chainable way of piping this readable stream + * through a transform stream (or any other { writable, readable } + * pair). It simply pipes the stream into the writable side of the + * supplied pair, and returns the readable side for further use. + * + * Piping a stream will lock it for the duration of the pipe, preventing + * any other consumer from acquiring a reader. + */ + writable: WritableStream; + } + interface StreamPipeOptions { + preventAbort?: boolean; + preventCancel?: boolean; + /** + * Pipes this readable stream to a given writable stream destination. + * The way in which the piping process behaves under various error + * conditions can be customized with a number of passed options. It + * returns a promise that fulfills when the piping process completes + * successfully, or rejects if any errors were encountered. + * + * Piping a stream will lock it for the duration of the pipe, preventing + * any other consumer from acquiring a reader. + * + * Errors and closures of the source and destination streams propagate + * as follows: + * + * An error in this source readable stream will abort destination, + * unless preventAbort is truthy. The returned promise will be rejected + * with the source's error, or with any error that occurs during + * aborting the destination. + * + * An error in destination will cancel this source readable stream, + * unless preventCancel is truthy. The returned promise will be rejected + * with the destination's error, or with any error that occurs during + * canceling the source. + * + * When this source readable stream closes, destination will be closed, + * unless preventClose is truthy. The returned promise will be fulfilled + * once this process completes, unless an error is encountered while + * closing the destination, in which case it will be rejected with that + * error. + * + * If destination starts out closed or closing, this source readable + * stream will be canceled, unless preventCancel is true. The returned + * promise will be rejected with an error indicating piping to a closed + * stream failed, or with any error that occurs during canceling the + * source. + * + * The signal option can be set to an AbortSignal to allow aborting an + * ongoing pipe operation via the corresponding AbortController. In this + * case, this source readable stream will be canceled, and destination + * aborted, unless the respective options preventCancel or preventAbort + * are set. + */ + preventClose?: boolean; + signal?: AbortSignal; + } + interface ReadableStreamGenericReader { + readonly closed: Promise; + cancel(reason?: any): Promise; + } + interface ReadableStreamDefaultReadValueResult { + done: false; + value: T; + } + interface ReadableStreamDefaultReadDoneResult { + done: true; + value?: undefined; + } + type ReadableStreamController = ReadableStreamDefaultController; + type ReadableStreamDefaultReadResult = ReadableStreamDefaultReadValueResult | ReadableStreamDefaultReadDoneResult; + interface ReadableByteStreamControllerCallback { + (controller: ReadableByteStreamController): void | PromiseLike; + } + interface UnderlyingSinkAbortCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSinkCloseCallback { + (): void | PromiseLike; + } + interface UnderlyingSinkStartCallback { + (controller: WritableStreamDefaultController): any; + } + interface UnderlyingSinkWriteCallback { + (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; + } + interface UnderlyingSourceCancelCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSourcePullCallback { + (controller: ReadableStreamController): void | PromiseLike; + } + interface UnderlyingSourceStartCallback { + (controller: ReadableStreamController): any; + } + interface TransformerFlushCallback { + (controller: TransformStreamDefaultController): void | PromiseLike; + } + interface TransformerStartCallback { + (controller: TransformStreamDefaultController): any; + } + interface TransformerTransformCallback { + (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; + } + interface UnderlyingByteSource { + autoAllocateChunkSize?: number; + cancel?: ReadableStreamErrorCallback; + pull?: ReadableByteStreamControllerCallback; + start?: ReadableByteStreamControllerCallback; + type: 'bytes'; + } + interface UnderlyingSource { + cancel?: UnderlyingSourceCancelCallback; + pull?: UnderlyingSourcePullCallback; + start?: UnderlyingSourceStartCallback; + type?: undefined; + } + interface UnderlyingSink { + abort?: UnderlyingSinkAbortCallback; + close?: UnderlyingSinkCloseCallback; + start?: UnderlyingSinkStartCallback; + type?: undefined; + write?: UnderlyingSinkWriteCallback; + } + interface ReadableStreamErrorCallback { + (reason: any): void | PromiseLike; + } + /** This Streams API interface represents a readable stream of byte data. */ + interface ReadableStream { + readonly locked: boolean; + cancel(reason?: any): Promise; + getReader(): ReadableStreamDefaultReader; + pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; + pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; + tee(): [ReadableStream, ReadableStream]; + values(options?: { preventCancel?: boolean }): AsyncIterableIterator; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + const ReadableStream: { + prototype: ReadableStream; + new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; + new (underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; + }; + interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { + read(): Promise>; + releaseLock(): void; + } + const ReadableStreamDefaultReader: { + prototype: ReadableStreamDefaultReader; + new (stream: ReadableStream): ReadableStreamDefaultReader; + }; + const ReadableStreamBYOBReader: any; + const ReadableStreamBYOBRequest: any; + interface ReadableByteStreamController { + readonly byobRequest: undefined; + readonly desiredSize: number | null; + close(): void; + enqueue(chunk: ArrayBufferView): void; + error(error?: any): void; + } + const ReadableByteStreamController: { + prototype: ReadableByteStreamController; + new (): ReadableByteStreamController; + }; + interface ReadableStreamDefaultController { + readonly desiredSize: number | null; + close(): void; + enqueue(chunk?: R): void; + error(e?: any): void; + } + const ReadableStreamDefaultController: { + prototype: ReadableStreamDefaultController; + new (): ReadableStreamDefaultController; + }; + interface Transformer { + flush?: TransformerFlushCallback; + readableType?: undefined; + start?: TransformerStartCallback; + transform?: TransformerTransformCallback; + writableType?: undefined; + } + interface TransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const TransformStream: { + prototype: TransformStream; + new (transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream; + }; + interface TransformStreamDefaultController { + readonly desiredSize: number | null; + enqueue(chunk?: O): void; + error(reason?: any): void; + terminate(): void; + } + const TransformStreamDefaultController: { + prototype: TransformStreamDefaultController; + new (): TransformStreamDefaultController; + }; + /** + * This Streams API interface provides a standard abstraction for writing + * streaming data to a destination, known as a sink. This object comes with + * built-in back pressure and queuing. + */ + interface WritableStream { + readonly locked: boolean; + abort(reason?: any): Promise; + close(): Promise; + getWriter(): WritableStreamDefaultWriter; + } + const WritableStream: { + prototype: WritableStream; + new (underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; + }; + /** + * This Streams API interface is the object returned by + * WritableStream.getWriter() and once created locks the < writer to the + * WritableStream ensuring that no other streams can write to the underlying + * sink. + */ + interface WritableStreamDefaultWriter { + readonly closed: Promise; + readonly desiredSize: number | null; + readonly ready: Promise; + abort(reason?: any): Promise; + close(): Promise; + releaseLock(): void; + write(chunk?: W): Promise; + } + const WritableStreamDefaultWriter: { + prototype: WritableStreamDefaultWriter; + new (stream: WritableStream): WritableStreamDefaultWriter; + }; + /** + * This Streams API interface represents a controller allowing control of a + * WritableStream's state. When constructing a WritableStream, the + * underlying sink is given a corresponding WritableStreamDefaultController + * instance to manipulate. + */ + interface WritableStreamDefaultController { + error(e?: any): void; + } + const WritableStreamDefaultController: { + prototype: WritableStreamDefaultController; + new (): WritableStreamDefaultController; + }; + interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; + } + interface QueuingStrategySize { + (chunk?: T): number; + } + interface QueuingStrategyInit { + /** + * Creates a new ByteLengthQueuingStrategy with the provided high water + * mark. + * + * Note that the provided high water mark will not be validated ahead of + * time. Instead, if it is negative, NaN, or not a number, the resulting + * ByteLengthQueuingStrategy will cause the corresponding stream + * constructor to throw. + */ + highWaterMark: number; + } + /** + * This Streams API interface provides a built-in byte length queuing + * strategy that can be used when constructing streams. + */ + interface ByteLengthQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + const ByteLengthQueuingStrategy: { + prototype: ByteLengthQueuingStrategy; + new (init: QueuingStrategyInit): ByteLengthQueuingStrategy; + }; + /** + * This Streams API interface provides a built-in byte length queuing + * strategy that can be used when constructing streams. + */ + interface CountQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + const CountQueuingStrategy: { + prototype: CountQueuingStrategy; + new (init: QueuingStrategyInit): CountQueuingStrategy; + }; + interface TextEncoderStream { + /** Returns "utf-8". */ + readonly encoding: 'utf-8'; + readonly readable: ReadableStream; + readonly writable: WritableStream; + readonly [Symbol.toStringTag]: string; + } + const TextEncoderStream: { + prototype: TextEncoderStream; + new (): TextEncoderStream; + }; + interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; + } + type BufferSource = ArrayBufferView | ArrayBuffer; + interface TextDecoderStream { + /** Returns encoding's name, lower cased. */ + readonly encoding: string; + /** Returns `true` if error mode is "fatal", and `false` otherwise. */ + readonly fatal: boolean; + /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ + readonly ignoreBOM: boolean; + readonly readable: ReadableStream; + readonly writable: WritableStream; + readonly [Symbol.toStringTag]: string; + } + const TextDecoderStream: { + prototype: TextDecoderStream; + new (label?: string, options?: TextDecoderOptions): TextDecoderStream; + }; +} +declare module 'node:stream/web' { + export * from 'stream/web'; +} diff --git a/server/node_modules/@types/node/string_decoder.d.ts b/server/node_modules/@types/node/string_decoder.d.ts new file mode 100755 index 0000000000..a585804111 --- /dev/null +++ b/server/node_modules/@types/node/string_decoder.d.ts @@ -0,0 +1,67 @@ +/** + * The `string_decoder` module provides an API for decoding `Buffer` objects into + * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 + * characters. It can be accessed using: + * + * ```js + * const { StringDecoder } = require('string_decoder'); + * ``` + * + * The following example shows the basic use of the `StringDecoder` class. + * + * ```js + * const { StringDecoder } = require('string_decoder'); + * const decoder = new StringDecoder('utf8'); + * + * const cent = Buffer.from([0xC2, 0xA2]); + * console.log(decoder.write(cent)); + * + * const euro = Buffer.from([0xE2, 0x82, 0xAC]); + * console.log(decoder.write(euro)); + * ``` + * + * When a `Buffer` instance is written to the `StringDecoder` instance, an + * internal buffer is used to ensure that the decoded string does not contain + * any incomplete multibyte characters. These are held in the buffer until the + * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. + * + * In the following example, the three UTF-8 encoded bytes of the European Euro + * symbol (`€`) are written over three separate operations: + * + * ```js + * const { StringDecoder } = require('string_decoder'); + * const decoder = new StringDecoder('utf8'); + * + * decoder.write(Buffer.from([0xE2])); + * decoder.write(Buffer.from([0x82])); + * console.log(decoder.end(Buffer.from([0xAC]))); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/string_decoder.js) + */ +declare module 'string_decoder' { + class StringDecoder { + constructor(encoding?: BufferEncoding); + /** + * Returns a decoded string, ensuring that any incomplete multibyte characters at + * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the + * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. + * @since v0.1.99 + * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. + */ + write(buffer: Buffer): string; + /** + * Returns any remaining input stored in the internal buffer as a string. Bytes + * representing incomplete UTF-8 and UTF-16 characters will be replaced with + * substitution characters appropriate for the character encoding. + * + * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. + * After `end()` is called, the `stringDecoder` object can be reused for new input. + * @since v0.9.3 + * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. + */ + end(buffer?: Buffer): string; + } +} +declare module 'node:string_decoder' { + export * from 'string_decoder'; +} diff --git a/server/node_modules/@types/node/test.d.ts b/server/node_modules/@types/node/test.d.ts new file mode 100755 index 0000000000..8e20710eca --- /dev/null +++ b/server/node_modules/@types/node/test.d.ts @@ -0,0 +1,446 @@ +/** + * The `node:test` module provides a standalone testing module. + * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/test.js) + */ +declare module 'node:test' { + /** + * Programmatically start the test runner. + * @since v18.9.0 + * @param options Configuration options for running tests. + * @returns A {@link TapStream} that emits events about the test execution. + */ + function run(options?: RunOptions): TapStream; + + /** + * The `test()` function is the value imported from the test module. Each invocation of this + * function results in the creation of a test point in the TAP output. + * + * The {@link TestContext} object passed to the fn argument can be used to perform actions + * related to the current test. Examples include skipping the test, adding additional TAP + * diagnostic information, or creating subtests. + * + * `test()` returns a {@link Promise} that resolves once the test completes. The return value + * can usually be discarded for top level tests. However, the return value from subtests should + * be used to prevent the parent test from finishing first and cancelling the subtest as shown + * in the following example. + * + * ```js + * test('top level test', async (t) => { + * // The setTimeout() in the following subtest would cause it to outlive its + * // parent test if 'await' is removed on the next line. Once the parent test + * // completes, it will cancel any outstanding subtests. + * await t.test('longer running subtest', async (t) => { + * return new Promise((resolve, reject) => { + * setTimeout(resolve, 1000); + * }); + * }); + * }); + * ``` + * @since v18.0.0 + * @param name The name of the test, which is displayed when reporting test results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the test + * @param fn The function under test. The first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is + * passed as the second argument. Default: A no-op function. + * @returns A {@link Promise} resolved with `undefined` once the test completes. + */ + function test(name?: string, fn?: TestFn): Promise; + function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function test(options?: TestOptions, fn?: TestFn): Promise; + function test(fn?: TestFn): Promise; + + /** + * @since v18.6.0 + * @param name The name of the suite, which is displayed when reporting suite results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the suite + * @param fn The function under suite. Default: A no-op function. + */ + function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void; + function describe(name?: string, fn?: SuiteFn): void; + function describe(options?: TestOptions, fn?: SuiteFn): void; + function describe(fn?: SuiteFn): void; + namespace describe { + // Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`. + function skip(name?: string, options?: TestOptions, fn?: SuiteFn): void; + function skip(name?: string, fn?: SuiteFn): void; + function skip(options?: TestOptions, fn?: SuiteFn): void; + function skip(fn?: SuiteFn): void; + + // Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`. + function todo(name?: string, options?: TestOptions, fn?: SuiteFn): void; + function todo(name?: string, fn?: SuiteFn): void; + function todo(options?: TestOptions, fn?: SuiteFn): void; + function todo(fn?: SuiteFn): void; + } + + /** + * @since v18.6.0 + * @param name The name of the test, which is displayed when reporting test results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the test + * @param fn The function under test. If the test uses callbacks, the callback function is + * passed as the second argument. Default: A no-op function. + */ + function it(name?: string, options?: TestOptions, fn?: ItFn): void; + function it(name?: string, fn?: ItFn): void; + function it(options?: TestOptions, fn?: ItFn): void; + function it(fn?: ItFn): void; + namespace it { + // Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. + function skip(name?: string, options?: TestOptions, fn?: ItFn): void; + function skip(name?: string, fn?: ItFn): void; + function skip(options?: TestOptions, fn?: ItFn): void; + function skip(fn?: ItFn): void; + + // Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. + function todo(name?: string, options?: TestOptions, fn?: ItFn): void; + function todo(name?: string, fn?: ItFn): void; + function todo(options?: TestOptions, fn?: ItFn): void; + function todo(fn?: ItFn): void; + } + + /** + * The type of a function under test. The first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is passed as + * the second argument. + */ + type TestFn = (t: TestContext, done: (result?: any) => void) => any; + + /** + * The type of a function under Suite. + * If the test uses callbacks, the callback function is passed as an argument + */ + type SuiteFn = (done: (result?: any) => void) => void; + + /** + * The type of a function under test. + * If the test uses callbacks, the callback function is passed as an argument + */ + type ItFn = (done: (result?: any) => void) => any; + + interface RunOptions { + /** + * If a number is provided, then that many files would run in parallel. + * If truthy, it would run (number of cpu cores - 1) files in parallel. + * If falsy, it would only run one file at a time. + * If unspecified, subtests inherit this value from their parent. + * @default true + */ + concurrency?: number | boolean | undefined; + + /** + * An array containing the list of files to run. + * If unspecified, the test runner execution model will be used. + */ + files?: readonly string[] | undefined; + + /** + * Allows aborting an in-progress test execution. + * @default undefined + */ + signal?: AbortSignal | undefined; + + /** + * A number of milliseconds the test will fail after. + * If unspecified, subtests inherit this value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + + /** + * Sets inspector port of test child process. + * If a nullish value is provided, each process gets its own port, + * incremented from the primary's `process.debugPort`. + */ + inspectPort?: number | (() => number) | undefined; + } + + /** + * A successful call of the `run()` method will return a new `TapStream` object, + * streaming a [TAP](https://testanything.org/) output. + * `TapStream` will emit events in the order of the tests' definitions. + * @since v18.9.0 + */ + interface TapStream extends NodeJS.ReadableStream { + addListener(event: 'test:diagnostic', listener: (message: string) => void): this; + addListener(event: 'test:fail', listener: (data: TestFail) => void): this; + addListener(event: 'test:pass', listener: (data: TestPass) => void): this; + addListener(event: string, listener: (...args: any[]) => void): this; + emit(event: 'test:diagnostic', message: string): boolean; + emit(event: 'test:fail', data: TestFail): boolean; + emit(event: 'test:pass', data: TestPass): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'test:diagnostic', listener: (message: string) => void): this; + on(event: 'test:fail', listener: (data: TestFail) => void): this; + on(event: 'test:pass', listener: (data: TestPass) => void): this; + on(event: string, listener: (...args: any[]) => void): this; + once(event: 'test:diagnostic', listener: (message: string) => void): this; + once(event: 'test:fail', listener: (data: TestFail) => void): this; + once(event: 'test:pass', listener: (data: TestPass) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'test:diagnostic', listener: (message: string) => void): this; + prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; + prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'test:diagnostic', listener: (message: string) => void): this; + prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; + prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + } + + interface TestFail { + /** + * The test duration. + */ + duration: number; + + /** + * The failure casing test to fail. + */ + error: Error; + + /** + * The test name. + */ + name: string; + + /** + * The ordinal number of the test. + */ + testNumber: number; + + /** + * Present if `context.todo` is called. + */ + todo?: string; + + /** + * Present if `context.skip` is called. + */ + skip?: string; + } + + interface TestPass { + /** + * The test duration. + */ + duration: number; + + /** + * The test name. + */ + name: string; + + /** + * The ordinal number of the test. + */ + testNumber: number; + + /** + * Present if `context.todo` is called. + */ + todo?: string; + + /** + * Present if `context.skip` is called. + */ + skip?: string; + } + + /** + * An instance of `TestContext` is passed to each test function in order to interact with the + * test runner. However, the `TestContext` constructor is not exposed as part of the API. + * @since v18.0.0 + */ + interface TestContext { + /** + * This function is used to create a hook running before each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + beforeEach: typeof beforeEach; + + /** + * This function is used to create a hook running after each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + afterEach: typeof afterEach; + + /** + * This function is used to write TAP diagnostics to the output. Any diagnostic information is + * included at the end of the test's results. This function does not return a value. + * @param message Message to be displayed as a TAP diagnostic. + * @since v18.0.0 + */ + diagnostic(message: string): void; + + /** + * The name of the test. + * @since v18.8.0 + */ + readonly name: string; + + /** + * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only` + * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only` + * command-line option, this function is a no-op. + * @param shouldRunOnlyTests Whether or not to run `only` tests. + * @since v18.0.0 + */ + runOnly(shouldRunOnlyTests: boolean): void; + + /** + * Can be used to abort test subtasks when the test has been aborted. + * @since v18.7.0 + */ + readonly signal: AbortSignal; + + /** + * This function causes the test's output to indicate the test as skipped. If `message` is + * provided, it is included in the TAP output. Calling `skip()` does not terminate execution of + * the test function. This function does not return a value. + * @param message Optional skip message to be displayed in TAP output. + * @since v18.0.0 + */ + skip(message?: string): void; + + /** + * This function adds a `TODO` directive to the test's output. If `message` is provided, it is + * included in the TAP output. Calling `todo()` does not terminate execution of the test + * function. This function does not return a value. + * @param message Optional `TODO` message to be displayed in TAP output. + * @since v18.0.0 + */ + todo(message?: string): void; + + /** + * This function is used to create subtests under the current test. This function behaves in + * the same fashion as the top level {@link test} function. + * @since v18.0.0 + * @param name The name of the test, which is displayed when reporting test results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the test + * @param fn The function under test. This first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is + * passed as the second argument. Default: A no-op function. + * @returns A {@link Promise} resolved with `undefined` once the test completes. + */ + test: typeof test; + } + + interface TestOptions { + /** + * If a number is provided, then that many tests would run in parallel. + * If truthy, it would run (number of cpu cores - 1) tests in parallel. + * For subtests, it will be `Infinity` tests in parallel. + * If falsy, it would only run one test at a time. + * If unspecified, subtests inherit this value from their parent. + * @default false + */ + concurrency?: number | boolean | undefined; + + /** + * If truthy, and the test context is configured to run `only` tests, then this test will be + * run. Otherwise, the test is skipped. + * @default false + */ + only?: boolean | undefined; + + /** + * Allows aborting an in-progress test. + * @since v18.8.0 + */ + signal?: AbortSignal | undefined; + + /** + * If truthy, the test is skipped. If a string is provided, that string is displayed in the + * test results as the reason for skipping the test. + * @default false + */ + skip?: boolean | string | undefined; + + /** + * A number of milliseconds the test will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + * @since v18.7.0 + */ + timeout?: number | undefined; + + /** + * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in + * the test results as the reason why the test is `TODO`. + * @default false + */ + todo?: boolean | string | undefined; + } + + /** + * This function is used to create a hook running before running a suite. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + function before(fn?: HookFn, options?: HookOptions): void; + + /** + * This function is used to create a hook running after running a suite. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + function after(fn?: HookFn, options?: HookOptions): void; + + /** + * This function is used to create a hook running before each subtest of the current suite. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + function beforeEach(fn?: HookFn, options?: HookOptions): void; + + /** + * This function is used to create a hook running after each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + function afterEach(fn?: HookFn, options?: HookOptions): void; + + /** + * The hook function. If the hook uses callbacks, the callback function is passed as the + * second argument. + */ + type HookFn = (done: (result?: any) => void) => any; + + /** + * Configuration options for hooks. + * @since v18.8.0 + */ + interface HookOptions { + /** + * Allows aborting an in-progress hook. + */ + signal?: AbortSignal | undefined; + + /** + * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + } + + export { test as default, run, test, describe, it, before, after, beforeEach, afterEach }; +} diff --git a/server/node_modules/@types/node/timers.d.ts b/server/node_modules/@types/node/timers.d.ts new file mode 100755 index 0000000000..b26f3cedab --- /dev/null +++ b/server/node_modules/@types/node/timers.d.ts @@ -0,0 +1,94 @@ +/** + * The `timer` module exposes a global API for scheduling functions to + * be called at some future period of time. Because the timer functions are + * globals, there is no need to call `require('timers')` to use the API. + * + * The timer functions within Node.js implement a similar API as the timers API + * provided by Web Browsers but use a different internal implementation that is + * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/timers.js) + */ +declare module 'timers' { + import { Abortable } from 'node:events'; + import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises'; + interface TimerOptions extends Abortable { + /** + * Set to `false` to indicate that the scheduled `Timeout` + * should not require the Node.js event loop to remain active. + * @default true + */ + ref?: boolean | undefined; + } + let setTimeout: typeof global.setTimeout; + let clearTimeout: typeof global.clearTimeout; + let setInterval: typeof global.setInterval; + let clearInterval: typeof global.clearInterval; + let setImmediate: typeof global.setImmediate; + let clearImmediate: typeof global.clearImmediate; + global { + namespace NodeJS { + // compatibility with older typings + interface Timer extends RefCounted { + hasRef(): boolean; + refresh(): this; + [Symbol.toPrimitive](): number; + } + interface Immediate extends RefCounted { + /** + * If true, the `Immediate` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + _onImmediate: Function; // to distinguish it from the Timeout class + } + interface Timeout extends Timer { + /** + * If true, the `Timeout` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + /** + * Sets the timer's start time to the current time, and reschedules the timer to + * call its callback at the previously specified duration adjusted to the current + * time. This is useful for refreshing a timer without allocating a new + * JavaScript object. + * + * Using this on a timer that has already called its callback will reactivate the + * timer. + * @since v10.2.0 + * @return a reference to `timeout` + */ + refresh(): this; + [Symbol.toPrimitive](): number; + } + } + function setTimeout(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; + namespace setTimeout { + const __promisify__: typeof setTimeoutPromise; + } + function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; + function setInterval(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer; + namespace setInterval { + const __promisify__: typeof setIntervalPromise; + } + function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; + function setImmediate(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setImmediate(callback: (args: void) => void): NodeJS.Immediate; + namespace setImmediate { + const __promisify__: typeof setImmediatePromise; + } + function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; + function queueMicrotask(callback: () => void): void; + } +} +declare module 'node:timers' { + export * from 'timers'; +} diff --git a/server/node_modules/@types/node/timers/promises.d.ts b/server/node_modules/@types/node/timers/promises.d.ts new file mode 100755 index 0000000000..c1450684d6 --- /dev/null +++ b/server/node_modules/@types/node/timers/promises.d.ts @@ -0,0 +1,93 @@ +/** + * The `timers/promises` API provides an alternative set of timer functions + * that return `Promise` objects. The API is accessible via`require('timers/promises')`. + * + * ```js + * import { + * setTimeout, + * setImmediate, + * setInterval, + * } from 'timers/promises'; + * ``` + * @since v15.0.0 + */ +declare module 'timers/promises' { + import { TimerOptions } from 'node:timers'; + /** + * ```js + * import { + * setTimeout, + * } from 'timers/promises'; + * + * const res = await setTimeout(100, 'result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. + * @param value A value with which the promise is fulfilled. + */ + function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; + /** + * ```js + * import { + * setImmediate, + * } from 'timers/promises'; + * + * const res = await setImmediate('result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param value A value with which the promise is fulfilled. + */ + function setImmediate(value?: T, options?: TimerOptions): Promise; + /** + * Returns an async iterator that generates values in an interval of `delay` ms. + * + * ```js + * import { + * setInterval, + * } from 'timers/promises'; + * + * const interval = 100; + * for await (const startTime of setInterval(interval, Date.now())) { + * const now = Date.now(); + * console.log(now); + * if ((now - startTime) > 1000) + * break; + * } + * console.log(Date.now()); + * ``` + * @since v15.9.0 + */ + function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; + + interface Scheduler { + /** + * ```js + * import { scheduler } from 'node:timers/promises'; + * + * await scheduler.wait(1000); // Wait one second before continuing + * ``` + * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. + * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported. + * @since v16.14.0 + * @experimental + * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. + */ + wait: (delay?: number, options?: TimerOptions) => Promise; + /** + * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. + * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments. + * @since v16.14.0 + * @experimental + */ + yield: () => Promise; + } + + const scheduler: Scheduler; +} +declare module 'node:timers/promises' { + export * from 'timers/promises'; +} diff --git a/server/node_modules/@types/node/tls.d.ts b/server/node_modules/@types/node/tls.d.ts new file mode 100755 index 0000000000..2cbc716580 --- /dev/null +++ b/server/node_modules/@types/node/tls.d.ts @@ -0,0 +1,1028 @@ +/** + * The `tls` module provides an implementation of the Transport Layer Security + * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. + * The module can be accessed using: + * + * ```js + * const tls = require('tls'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tls.js) + */ +declare module 'tls' { + import { X509Certificate } from 'node:crypto'; + import * as net from 'node:net'; + import * as stream from 'stream'; + const CLIENT_RENEG_LIMIT: number; + const CLIENT_RENEG_WINDOW: number; + interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + interface PeerCertificate { + subject: Certificate; + issuer: Certificate; + subjectaltname: string; + infoAccess: NodeJS.Dict; + modulus: string; + exponent: string; + valid_from: string; + valid_to: string; + fingerprint: string; + fingerprint256: string; + ext_key_usage: string[]; + serialNumber: string; + raw: Buffer; + } + interface DetailedPeerCertificate extends PeerCertificate { + issuerCertificate: DetailedPeerCertificate; + } + interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + /** + * IETF name for the cipher suite. + */ + standardName: string; + } + interface EphemeralKeyInfo { + /** + * The supported types are 'DH' and 'ECDH'. + */ + type: string; + /** + * The name property is available only when type is 'ECDH'. + */ + name?: string | undefined; + /** + * The size of parameter of an ephemeral key exchange. + */ + size: number; + } + interface KeyObject { + /** + * Private keys in PEM format. + */ + pem: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface PxfObject { + /** + * PFX or PKCS12 encoded private key and certificate chain. + */ + buf: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean | undefined; + /** + * An optional net.Server instance. + */ + server?: net.Server | undefined; + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer | undefined; + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean | undefined; + } + /** + * Performs transparent encryption of written data and all required TLS + * negotiation. + * + * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. + * + * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the + * connection is open. + * @since v0.11.4 + */ + class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket, options?: TLSSocketOptions); + /** + * This property is `true` if the peer certificate was signed by one of the CAs + * specified when creating the `tls.TLSSocket` instance, otherwise `false`. + * @since v0.11.4 + */ + authorized: boolean; + /** + * Returns the reason why the peer's certificate was not been verified. This + * property is set only when `tlsSocket.authorized === false`. + * @since v0.11.4 + */ + authorizationError: Error; + /** + * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. + * @since v0.11.4 + */ + encrypted: true; + /** + * String containing the selected ALPN protocol. + * Before a handshake has completed, this value is always null. + * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. + */ + alpnProtocol: string | false | null; + /** + * Returns an object representing the local certificate. The returned object has + * some properties corresponding to the fields of the certificate. + * + * See {@link TLSSocket.getPeerCertificate} for an example of the certificate + * structure. + * + * If there is no local certificate, an empty object will be returned. If the + * socket has been destroyed, `null` will be returned. + * @since v11.2.0 + */ + getCertificate(): PeerCertificate | object | null; + /** + * Returns an object containing information on the negotiated cipher suite. + * + * For example: + * + * ```json + * { + * "name": "AES128-SHA256", + * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", + * "version": "TLSv1.2" + * } + * ``` + * + * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. + * @since v0.11.4 + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the type, name, and size of parameter of + * an ephemeral key exchange in `perfect forward secrecy` on a client + * connection. It returns an empty object when the key exchange is not + * ephemeral. As this is only supported on a client socket; `null` is returned + * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. + * + * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. + * @since v5.0.0 + */ + getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. + */ + getFinished(): Buffer | undefined; + /** + * Returns an object representing the peer's certificate. If the peer does not + * provide a certificate, an empty object will be returned. If the socket has been + * destroyed, `null` will be returned. + * + * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's + * certificate. + * @since v0.11.4 + * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. + * @return A certificate object. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so + * far. + */ + getPeerFinished(): Buffer | undefined; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the + * current connection. The value `'unknown'` will be returned for connected + * sockets that have not completed the handshaking process. The value `null` will + * be returned for server sockets or disconnected client sockets. + * + * Protocol versions are: + * + * * `'SSLv3'` + * * `'TLSv1'` + * * `'TLSv1.1'` + * * `'TLSv1.2'` + * * `'TLSv1.3'` + * + * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. + * @since v5.7.0 + */ + getProtocol(): string | null; + /** + * Returns the TLS session data or `undefined` if no session was + * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful + * for debugging. + * + * See `Session Resumption` for more information. + * + * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications + * must use the `'session'` event (it also works for TLSv1.2 and below). + * @since v0.11.4 + */ + getSession(): Buffer | undefined; + /** + * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. + * @since v12.11.0 + * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. + */ + getSharedSigalgs(): string[]; + /** + * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. + * + * It may be useful for debugging. + * + * See `Session Resumption` for more information. + * @since v0.11.4 + */ + getTLSTicket(): Buffer | undefined; + /** + * See `Session Resumption` for more information. + * @since v0.5.6 + * @return `true` if the session was reused, `false` otherwise. + */ + isSessionReused(): boolean; + /** + * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. + * Upon completion, the `callback` function will be passed a single argument + * that is either an `Error` (if the request failed) or `null`. + * + * This method can be used to request a peer's certificate after the secure + * connection has been established. + * + * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. + * + * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the + * protocol. + * @since v0.11.8 + * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with + * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. + * @return `true` if renegotiation was initiated, `false` otherwise. + */ + renegotiate( + options: { + rejectUnauthorized?: boolean | undefined; + requestCert?: boolean | undefined; + }, + callback: (err: Error | null) => void + ): undefined | boolean; + /** + * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. + * Returns `true` if setting the limit succeeded; `false` otherwise. + * + * Smaller fragment sizes decrease the buffering latency on the client: larger + * fragments are buffered by the TLS layer until the entire fragment is received + * and its integrity is verified; large fragments can span multiple roundtrips + * and their processing can be delayed due to packet loss or reordering. However, + * smaller fragments add extra TLS framing bytes and CPU overhead, which may + * decrease overall server throughput. + * @since v0.11.11 + * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. + */ + setMaxSendFragment(size: number): boolean; + /** + * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts + * to renegotiate will trigger an `'error'` event on the `TLSSocket`. + * @since v8.4.0 + */ + disableRenegotiation(): void; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * + * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by + * OpenSSL's `SSL_trace()` function, the format is undocumented, can change + * without notice, and should not be relied on. + * @since v12.2.0 + */ + enableTrace(): void; + /** + * Returns the peer certificate as an `X509Certificate` object. + * + * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getPeerX509Certificate(): X509Certificate | undefined; + /** + * Returns the local certificate as an `X509Certificate` object. + * + * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getX509Certificate(): X509Certificate | undefined; + /** + * Keying material is used for validations to prevent different kind of attacks in + * network protocols, for example in the specifications of IEEE 802.1X. + * + * Example + * + * ```js + * const keyingMaterial = tlsSocket.exportKeyingMaterial( + * 128, + * 'client finished'); + * + * /* + * Example return value of keyingMaterial: + * + * + * ``` + * + * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more + * information. + * @since v13.10.0, v12.17.0 + * @param length number of bytes to retrieve from keying material + * @param label an application specific label, typically this will be a value from the [IANA Exporter Label + * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). + * @param context Optionally provide a context. + * @return requested bytes of the keying material + */ + exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + addListener(event: 'secureConnect', listener: () => void): this; + addListener(event: 'session', listener: (session: Buffer) => void): this; + addListener(event: 'keylog', listener: (line: Buffer) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'OCSPResponse', response: Buffer): boolean; + emit(event: 'secureConnect'): boolean; + emit(event: 'session', session: Buffer): boolean; + emit(event: 'keylog', line: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + on(event: 'secureConnect', listener: () => void): this; + on(event: 'session', listener: (session: Buffer) => void): this; + on(event: 'keylog', listener: (line: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + once(event: 'secureConnect', listener: () => void): this; + once(event: 'session', listener: (session: Buffer) => void): this; + once(event: 'keylog', listener: (line: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + prependListener(event: 'secureConnect', listener: () => void): this; + prependListener(event: 'session', listener: (session: Buffer) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + prependOnceListener(event: 'secureConnect', listener: () => void): this; + prependOnceListener(event: 'session', listener: (session: Buffer) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer) => void): this; + } + interface CommonConnectionOptions { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext | undefined; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * @default false + */ + enableTrace?: boolean | undefined; + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean | undefined; + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) + */ + ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. + * @default true + */ + rejectUnauthorized?: boolean | undefined; + } + interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { + /** + * Abort the connection if the SSL/TLS handshake does not finish in the + * specified number of milliseconds. A 'tlsClientError' is emitted on + * the tls.Server object whenever a handshake times out. Default: + * 120000 (120 seconds). + */ + handshakeTimeout?: number | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + */ + ticketKeys?: Buffer | undefined; + /** + * + * @param socket + * @param identity identity parameter sent from the client. + * @return pre-shared key that must either be + * a buffer or `null` to stop the negotiation process. Returned PSK must be + * compatible with the selected cipher's digest. + * + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with the identity provided by the client. + * If the return value is `null` the negotiation process will stop and an + * "unknown_psk_identity" alert message will be sent to the other party. + * If the server wishes to hide the fact that the PSK identity was not known, + * the callback must provide some random data as `psk` to make the connection + * fail with "decrypt_error" before negotiation is finished. + * PSK ciphers are disabled by default, and using TLS-PSK thus + * requires explicitly specifying a cipher suite with the `ciphers` option. + * More information can be found in the RFC 4279. + */ + pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; + /** + * hint to send to a client to help + * with selecting the identity during TLS-PSK negotiation. Will be ignored + * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be + * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. + */ + pskIdentityHint?: string | undefined; + } + interface PSKCallbackNegotation { + psk: DataView | NodeJS.TypedArray; + identity: string; + } + interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { + host?: string | undefined; + port?: number | undefined; + path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket + checkServerIdentity?: typeof checkServerIdentity | undefined; + servername?: string | undefined; // SNI TLS Extension + session?: Buffer | undefined; + minDHSize?: number | undefined; + lookup?: net.LookupFunction | undefined; + timeout?: number | undefined; + /** + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with optional identity `hint` provided by the server or `null` + * in case of TLS 1.3 where `hint` was removed. + * It will be necessary to provide a custom `tls.checkServerIdentity()` + * for the connection as the default one will try to check hostname/IP + * of the server against the certificate but that's not applicable for PSK + * because there won't be a certificate present. + * More information can be found in the RFC 4279. + * + * @param hint message sent from the server to help client + * decide which identity to use during negotiation. + * Always `null` if TLS 1.3 is used. + * @returns Return `null` to stop the negotiation process. `psk` must be + * compatible with the selected cipher's digest. + * `identity` must use UTF-8 encoding. + */ + pskCallback?(hint: string | null): PSKCallbackNegotation | null; + } + /** + * Accepts encrypted connections using TLS or SSL. + * @since v0.3.2 + */ + class Server extends net.Server { + constructor(secureConnectionListener?: (socket: TLSSocket) => void); + constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); + /** + * The `server.addContext()` method adds a secure context that will be used if + * the client request's SNI name matches the supplied `hostname` (or wildcard). + * + * When there are multiple matching contexts, the most recently added one is + * used. + * @since v0.5.3 + * @param hostname A SNI host name or wildcard (e.g. `'*'`) + * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). + */ + addContext(hostname: string, context: SecureContextOptions): void; + /** + * Returns the session ticket keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @return A 48-byte buffer containing the session ticket keys. + */ + getTicketKeys(): Buffer; + /** + * The `server.setSecureContext()` method replaces the secure context of an + * existing server. Existing connections to the server are not interrupted. + * @since v11.0.0 + * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). + */ + setSecureContext(options: SecureContextOptions): void; + /** + * Sets the session ticket keys. + * + * Changes to the ticket keys are effective only for future server connections. + * Existing or currently pending server connections will use the previous keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @param keys A 48-byte buffer containing the session ticket keys. + */ + setTicketKeys(keys: Buffer): void; + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + * 6. keylog + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean; + emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; + emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; + emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void): boolean; + emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean; + emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + } + /** + * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. + */ + interface SecurePair { + encrypted: TLSSocket; + cleartext: TLSSocket; + } + type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; + interface SecureContextOptions { + /** + * Optionally override the trusted CA certificates. Default is to trust + * the well-known CAs curated by Mozilla. Mozilla's CAs are completely + * replaced when CAs are explicitly specified using this option. + */ + ca?: string | Buffer | Array | undefined; + /** + * Cert chains in PEM format. One cert chain should be provided per + * private key. Each cert chain should consist of the PEM formatted + * certificate for a provided private key, followed by the PEM + * formatted intermediate certificates (if any), in order, and not + * including the root CA (the root CA must be pre-known to the peer, + * see ca). When providing multiple cert chains, they do not have to + * be in the same order as their private keys in key. If the + * intermediate certificates are not provided, the peer will not be + * able to validate the certificate, and the handshake will fail. + */ + cert?: string | Buffer | Array | undefined; + /** + * Colon-separated list of supported signature algorithms. The list + * can contain digest algorithms (SHA256, MD5 etc.), public key + * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g + * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). + */ + sigalgs?: string | undefined; + /** + * Cipher suite specification, replacing the default. For more + * information, see modifying the default cipher suite. Permitted + * ciphers can be obtained via tls.getCiphers(). Cipher names must be + * uppercased in order for OpenSSL to accept them. + */ + ciphers?: string | undefined; + /** + * Name of an OpenSSL engine which can provide the client certificate. + */ + clientCertEngine?: string | undefined; + /** + * PEM formatted CRLs (Certificate Revocation Lists). + */ + crl?: string | Buffer | Array | undefined; + /** + * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use + * openssl dhparam to create the parameters. The key length must be + * greater than or equal to 1024 bits or else an error will be thrown. + * Although 1024 bits is permissible, use 2048 bits or larger for + * stronger security. If omitted or invalid, the parameters are + * silently discarded and DHE ciphers will not be available. + */ + dhparam?: string | Buffer | undefined; + /** + * A string describing a named curve or a colon separated list of curve + * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key + * agreement. Set to auto to select the curve automatically. Use + * crypto.getCurves() to obtain a list of available curve names. On + * recent releases, openssl ecparam -list_curves will also display the + * name and description of each available elliptic curve. Default: + * tls.DEFAULT_ECDH_CURVE. + */ + ecdhCurve?: string | undefined; + /** + * Attempt to use the server's cipher suite preferences instead of the + * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be + * set in secureOptions + */ + honorCipherOrder?: boolean | undefined; + /** + * Private keys in PEM format. PEM allows the option of private keys + * being encrypted. Encrypted keys will be decrypted with + * options.passphrase. Multiple keys using different algorithms can be + * provided either as an array of unencrypted key strings or buffers, + * or an array of objects in the form {pem: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted keys will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + key?: string | Buffer | Array | undefined; + /** + * Name of an OpenSSL engine to get private key from. Should be used + * together with privateKeyIdentifier. + */ + privateKeyEngine?: string | undefined; + /** + * Identifier of a private key managed by an OpenSSL engine. Should be + * used together with privateKeyEngine. Should not be set together with + * key, because both options define a private key in different ways. + */ + privateKeyIdentifier?: string | undefined; + /** + * Optionally set the maximum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. + * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using + * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to + * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. + */ + maxVersion?: SecureVersion | undefined; + /** + * Optionally set the minimum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. It is not recommended to use + * less than TLSv1.2, but it may be required for interoperability. + * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using + * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to + * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. + */ + minVersion?: SecureVersion | undefined; + /** + * Shared passphrase used for a single private key and/or a PFX. + */ + passphrase?: string | undefined; + /** + * PFX or PKCS12 encoded private key and certificate chain. pfx is an + * alternative to providing key and cert individually. PFX is usually + * encrypted, if it is, passphrase will be used to decrypt it. Multiple + * PFX can be provided either as an array of unencrypted PFX buffers, + * or an array of objects in the form {buf: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted PFX will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + pfx?: string | Buffer | Array | undefined; + /** + * Optionally affect the OpenSSL protocol behavior, which is not + * usually necessary. This should be used carefully if at all! Value is + * a numeric bitmask of the SSL_OP_* options from OpenSSL Options + */ + secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options + /** + * Legacy mechanism to select the TLS protocol version to use, it does + * not support independent control of the minimum and maximum version, + * and does not support limiting the protocol to TLSv1.3. Use + * minVersion and maxVersion instead. The possible values are listed as + * SSL_METHODS, use the function names as strings. For example, use + * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow + * any TLS protocol version up to TLSv1.3. It is not recommended to use + * TLS versions less than 1.2, but it may be required for + * interoperability. Default: none, see minVersion. + */ + secureProtocol?: string | undefined; + /** + * Opaque identifier used by servers to ensure session state is not + * shared between applications. Unused by clients. + */ + sessionIdContext?: string | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + * See Session Resumption for more information. + */ + ticketKeys?: Buffer | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + } + interface SecureContext { + context: any; + } + /** + * Verifies the certificate `cert` is issued to `hostname`. + * + * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on + * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). + * + * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as + * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. + * + * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The + * overwriting function can call `tls.checkServerIdentity()` of course, to augment + * the checks done with additional verification. + * + * This function is only called if the certificate passed all other checks, such as + * being issued by trusted CA (`options.ca`). + * + * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name + * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use + * a custom`options.checkServerIdentity` function that implements the desired behavior. + * @since v0.8.4 + * @param hostname The host name or IP address to verify the certificate against. + * @param cert A `certificate object` representing the peer's certificate. + */ + function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; + /** + * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is + * automatically set as a listener for the `'secureConnection'` event. + * + * The `ticketKeys` options is automatically shared between `cluster` module + * workers. + * + * The following illustrates a simple echo server: + * + * ```js + * const tls = require('tls'); + * const fs = require('fs'); + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem'), + * + * // This is necessary only if using client certificate authentication. + * requestCert: true, + * + * // This is necessary only if the client uses a self-signed certificate. + * ca: [ fs.readFileSync('client-cert.pem') ] + * }; + * + * const server = tls.createServer(options, (socket) => { + * console.log('server connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * socket.write('welcome!\n'); + * socket.setEncoding('utf8'); + * socket.pipe(socket); + * }); + * server.listen(8000, () => { + * console.log('server bound'); + * }); + * ``` + * + * The server can be tested by connecting to it using the example client from {@link connect}. + * @since v0.3.2 + */ + function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; + function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + /** + * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. + * + * `tls.connect()` returns a {@link TLSSocket} object. + * + * Unlike the `https` API, `tls.connect()` does not enable the + * SNI (Server Name Indication) extension by default, which may cause some + * servers to return an incorrect certificate or reject the connection + * altogether. To enable SNI, set the `servername` option in addition + * to `host`. + * + * The following illustrates a client for the echo server example from {@link createServer}: + * + * ```js + * // Assumes an echo server that is listening on port 8000. + * const tls = require('tls'); + * const fs = require('fs'); + * + * const options = { + * // Necessary only if the server requires client certificate authentication. + * key: fs.readFileSync('client-key.pem'), + * cert: fs.readFileSync('client-cert.pem'), + * + * // Necessary only if the server uses a self-signed certificate. + * ca: [ fs.readFileSync('server-cert.pem') ], + * + * // Necessary only if the server's cert isn't for "localhost". + * checkServerIdentity: () => { return null; }, + * }; + * + * const socket = tls.connect(8000, options, () => { + * console.log('client connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * process.stdin.pipe(socket); + * process.stdin.resume(); + * }); + * socket.setEncoding('utf8'); + * socket.on('data', (data) => { + * console.log(data); + * }); + * socket.on('end', () => { + * console.log('server ends connection'); + * }); + * ``` + * @since v0.11.3 + */ + function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + /** + * Creates a new secure pair object with two streams, one of which reads and writes + * the encrypted data and the other of which reads and writes the cleartext data. + * Generally, the encrypted stream is piped to/from an incoming encrypted data + * stream and the cleartext one is used as a replacement for the initial encrypted + * stream. + * + * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. + * + * Using `cleartext` has the same API as {@link TLSSocket}. + * + * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: + * + * ```js + * pair = tls.createSecurePair(// ... ); + * pair.encrypted.pipe(socket); + * socket.pipe(pair.encrypted); + * ``` + * + * can be replaced by: + * + * ```js + * secureSocket = tls.TLSSocket(socket, options); + * ``` + * + * where `secureSocket` has the same API as `pair.cleartext`. + * @since v0.3.2 + * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. + * @param context A secure context object as returned by `tls.createSecureContext()` + * @param isServer `true` to specify that this TLS connection should be opened as a server. + * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. + * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. + */ + function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + /** + * {@link createServer} sets the default value of the `honorCipherOrder` option + * to `true`, other APIs that create secure contexts leave it unset. + * + * {@link createServer} uses a 128 bit truncated SHA1 hash value generated + * from `process.argv` as the default value of the `sessionIdContext` option, other + * APIs that create secure contexts have no default value. + * + * The `tls.createSecureContext()` method creates a `SecureContext` object. It is + * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods. + * + * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. + * + * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of + * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). + * @since v0.11.13 + */ + function createSecureContext(options?: SecureContextOptions): SecureContext; + /** + * Returns an array with the names of the supported TLS ciphers. The names are + * lower-case for historical reasons, but must be uppercased to be used in + * the `ciphers` option of {@link createSecureContext}. + * + * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. + * + * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for + * TLSv1.2 and below. + * + * ```js + * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] + * ``` + * @since v0.10.2 + */ + function getCiphers(): string[]; + /** + * The default curve name to use for ECDH key agreement in a tls server. + * The default value is 'auto'. See tls.createSecureContext() for further + * information. + */ + let DEFAULT_ECDH_CURVE: string; + /** + * The default value of the maxVersion option of + * tls.createSecureContext(). It can be assigned any of the supported TLS + * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: + * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets + * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the highest maximum + * is used. + */ + let DEFAULT_MAX_VERSION: SecureVersion; + /** + * The default value of the minVersion option of tls.createSecureContext(). + * It can be assigned any of the supported TLS protocol versions, + * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless + * changed using CLI options. Using --tls-min-v1.0 sets the default to + * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using + * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options + * are provided, the lowest minimum is used. + */ + let DEFAULT_MIN_VERSION: SecureVersion; + /** + * An immutable array of strings representing the root certificates (in PEM + * format) used for verifying peer certificates. This is the default value + * of the ca option to tls.createSecureContext(). + */ + const rootCertificates: ReadonlyArray; +} +declare module 'node:tls' { + export * from 'tls'; +} diff --git a/server/node_modules/@types/node/trace_events.d.ts b/server/node_modules/@types/node/trace_events.d.ts new file mode 100755 index 0000000000..d47aa9311e --- /dev/null +++ b/server/node_modules/@types/node/trace_events.d.ts @@ -0,0 +1,171 @@ +/** + * The `trace_events` module provides a mechanism to centralize tracing information + * generated by V8, Node.js core, and userspace code. + * + * Tracing can be enabled with the `--trace-event-categories` command-line flag + * or by using the `trace_events` module. The `--trace-event-categories` flag + * accepts a list of comma-separated category names. + * + * The available categories are: + * + * * `node`: An empty placeholder. + * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. + * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. + * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. + * * `node.console`: Enables capture of `console.time()` and `console.count()`output. + * * `node.dns.native`: Enables capture of trace data for DNS queries. + * * `node.environment`: Enables capture of Node.js Environment milestones. + * * `node.fs.sync`: Enables capture of trace data for file system sync methods. + * * `node.perf`: Enables capture of `Performance API` measurements. + * * `node.perf.usertiming`: Enables capture of only Performance API User Timing + * measures and marks. + * * `node.perf.timerify`: Enables capture of only Performance API timerify + * measurements. + * * `node.promises.rejections`: Enables capture of trace data tracking the number + * of unhandled Promise rejections and handled-after-rejections. + * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. + * * `v8`: The `V8` events are GC, compiling, and execution related. + * + * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. + * + * ```bash + * node --trace-event-categories v8,node,node.async_hooks server.js + * ``` + * + * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be + * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. + * + * ```bash + * node --trace-events-enabled + * + * # is equivalent to + * + * node --trace-event-categories v8,node,node.async_hooks + * ``` + * + * Alternatively, trace events may be enabled using the `trace_events` module: + * + * ```js + * const trace_events = require('trace_events'); + * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); + * tracing.enable(); // Enable trace event capture for the 'node.perf' category + * + * // do work + * + * tracing.disable(); // Disable trace event capture for the 'node.perf' category + * ``` + * + * Running Node.js with tracing enabled will produce log files that can be opened + * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. + * + * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can + * be specified with `--trace-event-file-pattern` that accepts a template + * string that supports `${rotation}` and `${pid}`: + * + * ```bash + * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js + * ``` + * + * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers + * in your code, such as: + * + * ```js + * process.on('SIGINT', function onSigint() { + * console.info('Received SIGINT.'); + * process.exit(130); // Or applicable exit code depending on OS and signal + * }); + * ``` + * + * The tracing system uses the same time source + * as the one used by `process.hrtime()`. + * However the trace-event timestamps are expressed in microseconds, + * unlike `process.hrtime()` which returns nanoseconds. + * + * The features from this module are not available in `Worker` threads. + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js) + */ +declare module 'trace_events' { + /** + * The `Tracing` object is used to enable or disable tracing for sets of + * categories. Instances are created using the + * `trace_events.createTracing()` method. + * + * When created, the `Tracing` object is disabled. Calling the + * `tracing.enable()` method adds the categories to the set of enabled trace + * event categories. Calling `tracing.disable()` will remove the categories + * from the set of enabled trace event categories. + */ + interface Tracing { + /** + * A comma-separated list of the trace event categories covered by this + * `Tracing` object. + */ + readonly categories: string; + /** + * Disables this `Tracing` object. + * + * Only trace event categories _not_ covered by other enabled `Tracing` + * objects and _not_ specified by the `--trace-event-categories` flag + * will be disabled. + */ + disable(): void; + /** + * Enables this `Tracing` object for the set of categories covered by + * the `Tracing` object. + */ + enable(): void; + /** + * `true` only if the `Tracing` object has been enabled. + */ + readonly enabled: boolean; + } + interface CreateTracingOptions { + /** + * An array of trace category names. Values included in the array are + * coerced to a string when possible. An error will be thrown if the + * value cannot be coerced. + */ + categories: string[]; + } + /** + * Creates and returns a `Tracing` object for the given set of `categories`. + * + * ```js + * const trace_events = require('trace_events'); + * const categories = ['node.perf', 'node.async_hooks']; + * const tracing = trace_events.createTracing({ categories }); + * tracing.enable(); + * // do stuff + * tracing.disable(); + * ``` + * @since v10.0.0 + * @return . + */ + function createTracing(options: CreateTracingOptions): Tracing; + /** + * Returns a comma-separated list of all currently-enabled trace event + * categories. The current set of enabled trace event categories is determined + * by the _union_ of all currently-enabled `Tracing` objects and any categories + * enabled using the `--trace-event-categories` flag. + * + * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. + * + * ```js + * const trace_events = require('trace_events'); + * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); + * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); + * const t3 = trace_events.createTracing({ categories: ['v8'] }); + * + * t1.enable(); + * t2.enable(); + * + * console.log(trace_events.getEnabledCategories()); + * ``` + * @since v10.0.0 + */ + function getEnabledCategories(): string | undefined; +} +declare module 'node:trace_events' { + export * from 'trace_events'; +} diff --git a/server/node_modules/@types/node/ts4.8/assert.d.ts b/server/node_modules/@types/node/ts4.8/assert.d.ts new file mode 100755 index 0000000000..e8595e6371 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/assert.d.ts @@ -0,0 +1,961 @@ +/** + * The `assert` module provides a set of assertion functions for verifying + * invariants. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/assert.js) + */ +declare module 'assert' { + /** + * An alias of {@link ok}. + * @since v0.5.9 + * @param value The input that is checked for being truthy. + */ + function assert(value: unknown, message?: string | Error): asserts value; + namespace assert { + /** + * Indicates the failure of an assertion. All errors thrown by the `assert` module + * will be instances of the `AssertionError` class. + */ + class AssertionError extends Error { + actual: unknown; + expected: unknown; + operator: string; + generatedMessage: boolean; + code: 'ERR_ASSERTION'; + constructor(options?: { + /** If provided, the error message is set to this value. */ + message?: string | undefined; + /** The `actual` property on the error instance. */ + actual?: unknown | undefined; + /** The `expected` property on the error instance. */ + expected?: unknown | undefined; + /** The `operator` property on the error instance. */ + operator?: string | undefined; + /** If provided, the generated stack trace omits frames before this function. */ + // tslint:disable-next-line:ban-types + stackStartFn?: Function | undefined; + }); + } + /** + * This feature is currently experimental and behavior might still change. + * @since v14.2.0, v12.19.0 + * @experimental + */ + class CallTracker { + /** + * The wrapper function is expected to be called exactly `exact` times. If the + * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an + * error. + * + * ```js + * import assert from 'assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func); + * ``` + * @since v14.2.0, v12.19.0 + * @param [fn='A no-op function'] + * @param [exact=1] + * @return that wraps `fn`. + */ + calls(exact?: number): () => void; + calls any>(fn?: Func, exact?: number): Func; + /** + * Example: + * + * ```js + * import assert from 'node:assert'; + * + * const tracker = new assert.CallTracker(); + * + * function func() {} + * const callsfunc = tracker.calls(func); + * callsfunc(1, 2, 3); + * + * assert.deepStrictEqual(tracker.getCalls(callsfunc), + * [{ thisArg: this, arguments: [1, 2, 3 ] }]); + * ``` + * + * @since v18.8.0, v16.18.0 + * @params fn + * @returns An Array with the calls to a tracked function. + */ + getCalls(fn: Function): CallTrackerCall[]; + /** + * The arrays contains information about the expected and actual number of calls of + * the functions that have not been called the expected number of times. + * + * ```js + * import assert from 'assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * function foo() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func, 2); + * + * // Returns an array containing information on callsfunc() + * tracker.report(); + * // [ + * // { + * // message: 'Expected the func function to be executed 2 time(s) but was + * // executed 0 time(s).', + * // actual: 0, + * // expected: 2, + * // operator: 'func', + * // stack: stack trace + * // } + * // ] + * ``` + * @since v14.2.0, v12.19.0 + * @return of objects containing information about the wrapper functions returned by `calls`. + */ + report(): CallTrackerReportInformation[]; + /** + * Reset calls of the call tracker. + * If a tracked function is passed as an argument, the calls will be reset for it. + * If no arguments are passed, all tracked functions will be reset. + * + * ```js + * import assert from 'node:assert'; + * + * const tracker = new assert.CallTracker(); + * + * function func() {} + * const callsfunc = tracker.calls(func); + * + * callsfunc(); + * // Tracker was called once + * tracker.getCalls(callsfunc).length === 1; + * + * tracker.reset(callsfunc); + * tracker.getCalls(callsfunc).length === 0; + * ``` + * + * @since v18.8.0, v16.18.0 + * @param fn a tracked function to reset. + */ + reset(fn?: Function): void; + /** + * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that + * have not been called the expected number of times. + * + * ```js + * import assert from 'assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func, 2); + * + * callsfunc(); + * + * // Will throw an error since callsfunc() was only called once. + * tracker.verify(); + * ``` + * @since v14.2.0, v12.19.0 + */ + verify(): void; + } + interface CallTrackerCall { + thisArg: object; + arguments: unknown[]; + } + interface CallTrackerReportInformation { + message: string; + /** The actual number of times the function was called. */ + actual: number; + /** The number of times the function was expected to be called. */ + expected: number; + /** The name of the function that is wrapped. */ + operator: string; + /** A stack trace of the function. */ + stack: object; + } + type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error; + /** + * Throws an `AssertionError` with the provided error message or a default + * error message. If the `message` parameter is an instance of an `Error` then + * it will be thrown instead of the `AssertionError`. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.fail(); + * // AssertionError [ERR_ASSERTION]: Failed + * + * assert.fail('boom'); + * // AssertionError [ERR_ASSERTION]: boom + * + * assert.fail(new TypeError('need array')); + * // TypeError: need array + * ``` + * + * Using `assert.fail()` with more than two arguments is possible but deprecated. + * See below for further details. + * @since v0.1.21 + * @param [message='Failed'] + */ + function fail(message?: string | Error): never; + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ + function fail( + actual: unknown, + expected: unknown, + message?: string | Error, + operator?: string, + // tslint:disable-next-line:ban-types + stackStartFn?: Function + ): never; + /** + * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. + * + * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default + * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. + * + * Be aware that in the `repl` the error message will be different to the one + * thrown in a file! See below for further details. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.ok(true); + * // OK + * assert.ok(1); + * // OK + * + * assert.ok(); + * // AssertionError: No value argument passed to `assert.ok()` + * + * assert.ok(false, 'it\'s false'); + * // AssertionError: it's false + * + * // In the repl: + * assert.ok(typeof 123 === 'string'); + * // AssertionError: false == true + * + * // In a file (e.g. test.js): + * assert.ok(typeof 123 === 'string'); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(typeof 123 === 'string') + * + * assert.ok(false); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(false) + * + * assert.ok(0); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(0) + * ``` + * + * ```js + * import assert from 'assert/strict'; + * + * // Using `assert()` works the same: + * assert(0); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert(0) + * ``` + * @since v0.1.21 + */ + function ok(value: unknown, message?: string | Error): asserts value; + /** + * **Strict assertion mode** + * + * An alias of {@link strictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link strictEqual} instead. + * + * Tests shallow, coercive equality between the `actual` and `expected` parameters + * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled + * and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'assert'; + * + * assert.equal(1, 1); + * // OK, 1 == 1 + * assert.equal(1, '1'); + * // OK, 1 == '1' + * assert.equal(NaN, NaN); + * // OK + * + * assert.equal(1, 2); + * // AssertionError: 1 == 2 + * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); + * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } + * ``` + * + * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default + * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * @since v0.1.21 + */ + function equal(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. + * + * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is + * specially handled and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'assert'; + * + * assert.notEqual(1, 2); + * // OK + * + * assert.notEqual(1, 1); + * // AssertionError: 1 != 1 + * + * assert.notEqual(1, '1'); + * // AssertionError: 1 != '1' + * ``` + * + * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error + * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * @since v0.1.21 + */ + function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link deepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. + * + * Tests for deep equality between the `actual` and `expected` parameters. Consider + * using {@link deepStrictEqual} instead. {@link deepEqual} can have + * surprising results. + * + * _Deep equality_ means that the enumerable "own" properties of child objects + * are also recursively evaluated by the following rules. + * @since v0.1.21 + */ + function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notDeepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. + * + * Tests for any deep inequality. Opposite of {@link deepEqual}. + * + * ```js + * import assert from 'assert'; + * + * const obj1 = { + * a: { + * b: 1 + * } + * }; + * const obj2 = { + * a: { + * b: 2 + * } + * }; + * const obj3 = { + * a: { + * b: 1 + * } + * }; + * const obj4 = Object.create(obj1); + * + * assert.notDeepEqual(obj1, obj1); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj2); + * // OK + * + * assert.notDeepEqual(obj1, obj3); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj4); + * // OK + * ``` + * + * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default + * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests strict equality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'assert/strict'; + * + * assert.strictEqual(1, 2); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + * // 1 !== 2 + * + * assert.strictEqual(1, 1); + * // OK + * + * assert.strictEqual('Hello foobar', 'Hello World!'); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + actual - expected + * // + * // + 'Hello foobar' + * // - 'Hello World!' + * // ^ + * + * const apples = 1; + * const oranges = 2; + * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); + * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 + * + * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); + * // TypeError: Inputs are not identical + * ``` + * + * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a + * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests strict inequality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'assert/strict'; + * + * assert.notStrictEqual(1, 2); + * // OK + * + * assert.notStrictEqual(1, 1); + * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: + * // + * // 1 + * + * assert.notStrictEqual(1, '1'); + * // OK + * ``` + * + * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a + * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests for deep equality between the `actual` and `expected` parameters. + * "Deep" equality means that the enumerable "own" properties of child objects + * are recursively evaluated also by the following rules. + * @since v1.2.0 + */ + function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); + * // OK + * ``` + * + * If the values are deeply and strictly equal, an `AssertionError` is thrown + * with a `message` property set equal to the value of the `message` parameter. If + * the `message` parameter is undefined, a default error message is assigned. If + * the `message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v1.2.0 + */ + function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Expects the function `fn` to throw an error. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * a validation object where each property will be tested for strict deep equality, + * or an instance of error where each property will be tested for strict deep + * equality including the non-enumerable `message` and `name` properties. When + * using an object, it is also possible to use a regular expression, when + * validating against a string property. See below for examples. + * + * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation + * fails. + * + * Custom validation object/error instance: + * + * ```js + * import assert from 'assert/strict'; + * + * const err = new TypeError('Wrong value'); + * err.code = 404; + * err.foo = 'bar'; + * err.info = { + * nested: true, + * baz: 'text' + * }; + * err.reg = /abc/i; + * + * assert.throws( + * () => { + * throw err; + * }, + * { + * name: 'TypeError', + * message: 'Wrong value', + * info: { + * nested: true, + * baz: 'text' + * } + * // Only properties on the validation object will be tested for. + * // Using nested objects requires all properties to be present. Otherwise + * // the validation is going to fail. + * } + * ); + * + * // Using regular expressions to validate error properties: + * throws( + * () => { + * throw err; + * }, + * { + * // The `name` and `message` properties are strings and using regular + * // expressions on those will match against the string. If they fail, an + * // error is thrown. + * name: /^TypeError$/, + * message: /Wrong/, + * foo: 'bar', + * info: { + * nested: true, + * // It is not possible to use regular expressions for nested properties! + * baz: 'text' + * }, + * // The `reg` property contains a regular expression and only if the + * // validation object contains an identical regular expression, it is going + * // to pass. + * reg: /abc/i + * } + * ); + * + * // Fails due to the different `message` and `name` properties: + * throws( + * () => { + * const otherErr = new Error('Not found'); + * // Copy all enumerable properties from `err` to `otherErr`. + * for (const [key, value] of Object.entries(err)) { + * otherErr[key] = value; + * } + * throw otherErr; + * }, + * // The error's `message` and `name` properties will also be checked when using + * // an error as validation object. + * err + * ); + * ``` + * + * Validate instanceof using constructor: + * + * ```js + * import assert from 'assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * Error + * ); + * ``` + * + * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): + * + * Using a regular expression runs `.toString` on the error object, and will + * therefore also include the error name. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * /^Error: Wrong value$/ + * ); + * ``` + * + * Custom error validation: + * + * The function must return `true` to indicate all internal validations passed. + * It will otherwise fail with an `AssertionError`. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * (err) => { + * assert(err instanceof Error); + * assert(/value/.test(err)); + * // Avoid returning anything from validation functions besides `true`. + * // Otherwise, it's not clear what part of the validation failed. Instead, + * // throw an error about the specific validation that failed (as done in this + * // example) and add as much helpful debugging information to that error as + * // possible. + * return true; + * }, + * 'unexpected error' + * ); + * ``` + * + * `error` cannot be a string. If a string is provided as the second + * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same + * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using + * a string as the second argument gets considered: + * + * ```js + * import assert from 'assert/strict'; + * + * function throwingFirst() { + * throw new Error('First'); + * } + * + * function throwingSecond() { + * throw new Error('Second'); + * } + * + * function notThrowing() {} + * + * // The second argument is a string and the input function threw an Error. + * // The first case will not throw as it does not match for the error message + * // thrown by the input function! + * assert.throws(throwingFirst, 'Second'); + * // In the next example the message has no benefit over the message from the + * // error and since it is not clear if the user intended to actually match + * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. + * assert.throws(throwingSecond, 'Second'); + * // TypeError [ERR_AMBIGUOUS_ARGUMENT] + * + * // The string is only used (as message) in case the function does not throw: + * assert.throws(notThrowing, 'Second'); + * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second + * + * // If it was intended to match for the error message do this instead: + * // It does not throw because the error messages match. + * assert.throws(throwingSecond, /Second$/); + * + * // If the error message does not match, an AssertionError is thrown. + * assert.throws(throwingFirst, /Second$/); + * // AssertionError [ERR_ASSERTION] + * ``` + * + * Due to the confusing error-prone notation, avoid a string as the second + * argument. + * @since v0.1.21 + */ + function throws(block: () => unknown, message?: string | Error): void; + function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Asserts that the function `fn` does not throw an error. + * + * Using `assert.doesNotThrow()` is actually not useful because there + * is no benefit in catching an error and then rethrowing it. Instead, consider + * adding a comment next to the specific code path that should not throw and keep + * error messages as expressive as possible. + * + * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. + * + * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a + * different type, or if the `error` parameter is undefined, the error is + * propagated back to the caller. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation + * function. See {@link throws} for more details. + * + * The following, for instance, will throw the `TypeError` because there is no + * matching error type in the assertion: + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError + * ); + * ``` + * + * However, the following will result in an `AssertionError` with the message + * 'Got unwanted exception...': + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * TypeError + * ); + * ``` + * + * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * /Wrong value/, + * 'Whoops' + * ); + * // Throws: AssertionError: Got unwanted exception: Whoops + * ``` + * @since v0.1.21 + */ + function doesNotThrow(block: () => unknown, message?: string | Error): void; + function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Throws `value` if `value` is not `undefined` or `null`. This is useful when + * testing the `error` argument in callbacks. The stack trace contains all frames + * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.ifError(null); + * // OK + * assert.ifError(0); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 + * assert.ifError('error'); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' + * assert.ifError(new Error()); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error + * + * // Create some random error frames. + * let err; + * (function errorFrame() { + * err = new Error('test error'); + * })(); + * + * (function ifErrorFrame() { + * assert.ifError(err); + * })(); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error + * // at ifErrorFrame + * // at errorFrame + * ``` + * @since v0.1.97 + */ + function ifError(value: unknown): asserts value is null | undefined; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is rejected. + * + * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the + * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error + * handler is skipped. + * + * Besides the async nature to await the completion behaves identically to {@link throws}. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * an object where each property will be tested for, or an instance of error where + * each property will be tested for including the non-enumerable `message` and`name` properties. + * + * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. + * + * ```js + * import assert from 'assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * { + * name: 'TypeError', + * message: 'Wrong value' + * } + * ); + * ``` + * + * ```js + * import assert from 'assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * (err) => { + * assert.strictEqual(err.name, 'TypeError'); + * assert.strictEqual(err.message, 'Wrong value'); + * return true; + * } + * ); + * ``` + * + * ```js + * import assert from 'assert/strict'; + * + * assert.rejects( + * Promise.reject(new Error('Wrong value')), + * Error + * ).then(() => { + * // ... + * }); + * ``` + * + * `error` cannot be a string. If a string is provided as the second + * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the + * example in {@link throws} carefully if using a string as the second + * argument gets considered. + * @since v10.0.0 + */ + function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; + function rejects(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is not rejected. + * + * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If + * the function does not return a promise, `assert.doesNotReject()` will return a + * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases + * the error handler is skipped. + * + * Using `assert.doesNotReject()` is actually not useful because there is little + * benefit in catching a rejection and then rejecting it again. Instead, consider + * adding a comment next to the specific code path that should not reject and keep + * error messages as expressive as possible. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation + * function. See {@link throws} for more details. + * + * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. + * + * ```js + * import assert from 'assert/strict'; + * + * await assert.doesNotReject( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError + * ); + * ``` + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) + * .then(() => { + * // ... + * }); + * ``` + * @since v10.0.0 + */ + function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; + function doesNotReject(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; + /** + * Expects the `string` input to match the regular expression. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.match('I will fail', /pass/); + * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... + * + * assert.match(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.match('I will pass', /pass/); + * // OK + * ``` + * + * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v13.6.0, v12.16.0 + */ + function match(value: string, regExp: RegExp, message?: string | Error): void; + /** + * Expects the `string` input not to match the regular expression. + * + * ```js + * import assert from 'assert/strict'; + * + * assert.doesNotMatch('I will fail', /fail/); + * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... + * + * assert.doesNotMatch(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.doesNotMatch('I will pass', /different/); + * // OK + * ``` + * + * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v13.6.0, v12.16.0 + */ + function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; + const strict: Omit & { + (value: unknown, message?: string | Error): asserts value; + equal: typeof strictEqual; + notEqual: typeof notStrictEqual; + deepEqual: typeof deepStrictEqual; + notDeepEqual: typeof notDeepStrictEqual; + // Mapped types and assertion functions are incompatible? + // TS2775: Assertions require every name in the call target + // to be declared with an explicit type annotation. + ok: typeof ok; + strictEqual: typeof strictEqual; + deepStrictEqual: typeof deepStrictEqual; + ifError: typeof ifError; + strict: typeof strict; + }; + } + export = assert; +} +declare module 'node:assert' { + import assert = require('assert'); + export = assert; +} diff --git a/server/node_modules/@types/node/ts4.8/assert/strict.d.ts b/server/node_modules/@types/node/ts4.8/assert/strict.d.ts new file mode 100755 index 0000000000..b4319b9748 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/assert/strict.d.ts @@ -0,0 +1,8 @@ +declare module 'assert/strict' { + import { strict } from 'node:assert'; + export = strict; +} +declare module 'node:assert/strict' { + import { strict } from 'node:assert'; + export = strict; +} diff --git a/server/node_modules/@types/node/ts4.8/async_hooks.d.ts b/server/node_modules/@types/node/ts4.8/async_hooks.d.ts new file mode 100755 index 0000000000..0bf4739650 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/async_hooks.d.ts @@ -0,0 +1,501 @@ +/** + * The `async_hooks` module provides an API to track asynchronous resources. It + * can be accessed using: + * + * ```js + * import async_hooks from 'async_hooks'; + * ``` + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/async_hooks.js) + */ +declare module 'async_hooks' { + /** + * ```js + * import { executionAsyncId } from 'async_hooks'; + * + * console.log(executionAsyncId()); // 1 - bootstrap + * fs.open(path, 'r', (err, fd) => { + * console.log(executionAsyncId()); // 6 - open() + * }); + * ``` + * + * The ID returned from `executionAsyncId()` is related to execution timing, not + * causality (which is covered by `triggerAsyncId()`): + * + * ```js + * const server = net.createServer((conn) => { + * // Returns the ID of the server, not of the new connection, because the + * // callback runs in the execution scope of the server's MakeCallback(). + * async_hooks.executionAsyncId(); + * + * }).listen(port, () => { + * // Returns the ID of a TickObject (process.nextTick()) because all + * // callbacks passed to .listen() are wrapped in a nextTick(). + * async_hooks.executionAsyncId(); + * }); + * ``` + * + * Promise contexts may not get precise `executionAsyncIds` by default. + * See the section on `promise execution tracking`. + * @since v8.1.0 + * @return The `asyncId` of the current execution context. Useful to track when something calls. + */ + function executionAsyncId(): number; + /** + * Resource objects returned by `executionAsyncResource()` are most often internal + * Node.js handle objects with undocumented APIs. Using any functions or properties + * on the object is likely to crash your application and should be avoided. + * + * Using `executionAsyncResource()` in the top-level execution context will + * return an empty object as there is no handle or request object to use, + * but having an object representing the top-level can be helpful. + * + * ```js + * import { open } from 'fs'; + * import { executionAsyncId, executionAsyncResource } from 'async_hooks'; + * + * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} + * open(new URL(import.meta.url), 'r', (err, fd) => { + * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap + * }); + * ``` + * + * This can be used to implement continuation local storage without the + * use of a tracking `Map` to store the metadata: + * + * ```js + * import { createServer } from 'http'; + * import { + * executionAsyncId, + * executionAsyncResource, + * createHook + * } from 'async_hooks'; + * const sym = Symbol('state'); // Private symbol to avoid pollution + * + * createHook({ + * init(asyncId, type, triggerAsyncId, resource) { + * const cr = executionAsyncResource(); + * if (cr) { + * resource[sym] = cr[sym]; + * } + * } + * }).enable(); + * + * const server = createServer((req, res) => { + * executionAsyncResource()[sym] = { state: req.url }; + * setTimeout(function() { + * res.end(JSON.stringify(executionAsyncResource()[sym])); + * }, 100); + * }).listen(3000); + * ``` + * @since v13.9.0, v12.17.0 + * @return The resource representing the current execution. Useful to store data within the resource. + */ + function executionAsyncResource(): object; + /** + * ```js + * const server = net.createServer((conn) => { + * // The resource that caused (or triggered) this callback to be called + * // was that of the new connection. Thus the return value of triggerAsyncId() + * // is the asyncId of "conn". + * async_hooks.triggerAsyncId(); + * + * }).listen(port, () => { + * // Even though all callbacks passed to .listen() are wrapped in a nextTick() + * // the callback itself exists because the call to the server's .listen() + * // was made. So the return value would be the ID of the server. + * async_hooks.triggerAsyncId(); + * }); + * ``` + * + * Promise contexts may not get valid `triggerAsyncId`s by default. See + * the section on `promise execution tracking`. + * @return The ID of the resource responsible for calling the callback that is currently being executed. + */ + function triggerAsyncId(): number; + interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId a unique ID for the async resource + * @param type the type of the async resource + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created + * @param resource reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + /** + * Called immediately after the callback specified in before is completed. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + /** + * Registers functions to be called for different lifetime events of each async + * operation. + * + * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the + * respective asynchronous event during a resource's lifetime. + * + * All callbacks are optional. For example, if only resource cleanup needs to + * be tracked, then only the `destroy` callback needs to be passed. The + * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. + * + * ```js + * import { createHook } from 'async_hooks'; + * + * const asyncHook = createHook({ + * init(asyncId, type, triggerAsyncId, resource) { }, + * destroy(asyncId) { } + * }); + * ``` + * + * The callbacks will be inherited via the prototype chain: + * + * ```js + * class MyAsyncCallbacks { + * init(asyncId, type, triggerAsyncId, resource) { } + * destroy(asyncId) {} + * } + * + * class MyAddedCallbacks extends MyAsyncCallbacks { + * before(asyncId) { } + * after(asyncId) { } + * } + * + * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); + * ``` + * + * Because promises are asynchronous resources whose lifecycle is tracked + * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. + * @since v8.1.0 + * @param callbacks The `Hook Callbacks` to register + * @return Instance used for disabling and enabling hooks + */ + function createHook(callbacks: HookCallbacks): AsyncHook; + interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * @default executionAsyncId() + */ + triggerAsyncId?: number | undefined; + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * @default false + */ + requireManualDestroy?: boolean | undefined; + } + /** + * The class `AsyncResource` is designed to be extended by the embedder's async + * resources. Using this, users can easily trigger the lifetime events of their + * own resources. + * + * The `init` hook will trigger when an `AsyncResource` is instantiated. + * + * The following is an overview of the `AsyncResource` API. + * + * ```js + * import { AsyncResource, executionAsyncId } from 'async_hooks'; + * + * // AsyncResource() is meant to be extended. Instantiating a + * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * // async_hook.executionAsyncId() is used. + * const asyncResource = new AsyncResource( + * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false } + * ); + * + * // Run a function in the execution context of the resource. This will + * // * establish the context of the resource + * // * trigger the AsyncHooks before callbacks + * // * call the provided function `fn` with the supplied arguments + * // * trigger the AsyncHooks after callbacks + * // * restore the original execution context + * asyncResource.runInAsyncScope(fn, thisArg, ...args); + * + * // Call AsyncHooks destroy callbacks. + * asyncResource.emitDestroy(); + * + * // Return the unique ID assigned to the AsyncResource instance. + * asyncResource.asyncId(); + * + * // Return the trigger ID for the AsyncResource instance. + * asyncResource.triggerAsyncId(); + * ``` + */ + class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since v9.3.0) + */ + constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); + /** + * Binds the given function to the current execution context. + * + * The returned function will have an `asyncResource` property referencing + * the `AsyncResource` to which the function is bound. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current execution context. + * @param type An optional name to associate with the underlying `AsyncResource`. + */ + static bind any, ThisArg>( + fn: Func, + type?: string, + thisArg?: ThisArg + ): Func & { + asyncResource: AsyncResource; + }; + /** + * Binds the given function to execute to this `AsyncResource`'s scope. + * + * The returned function will have an `asyncResource` property referencing + * the `AsyncResource` to which the function is bound. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current `AsyncResource`. + */ + bind any>( + fn: Func + ): Func & { + asyncResource: AsyncResource; + }; + /** + * Call the provided function with the provided arguments in the execution context + * of the async resource. This will establish the context, trigger the AsyncHooks + * before callbacks, call the function, trigger the AsyncHooks after callbacks, and + * then restore the original execution context. + * @since v9.6.0 + * @param fn The function to call in the execution context of this async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; + /** + * Call all `destroy` hooks. This should only ever be called once. An error will + * be thrown if it is called more than once. This **must** be manually called. If + * the resource is left to be collected by the GC then the `destroy` hooks will + * never be called. + * @return A reference to `asyncResource`. + */ + emitDestroy(): this; + /** + * @return The unique `asyncId` assigned to the resource. + */ + asyncId(): number; + /** + * + * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. + */ + triggerAsyncId(): number; + } + /** + * This class creates stores that stay coherent through asynchronous operations. + * + * While you can create your own implementation on top of the `async_hooks` module,`AsyncLocalStorage` should be preferred as it is a performant and memory safe + * implementation that involves significant optimizations that are non-obvious to + * implement. + * + * The following example uses `AsyncLocalStorage` to build a simple logger + * that assigns IDs to incoming HTTP requests and includes them in messages + * logged within each request. + * + * ```js + * import http from 'http'; + * import { AsyncLocalStorage } from 'async_hooks'; + * + * const asyncLocalStorage = new AsyncLocalStorage(); + * + * function logWithId(msg) { + * const id = asyncLocalStorage.getStore(); + * console.log(`${id !== undefined ? id : '-'}:`, msg); + * } + * + * let idSeq = 0; + * http.createServer((req, res) => { + * asyncLocalStorage.run(idSeq++, () => { + * logWithId('start'); + * // Imagine any chain of async operations here + * setImmediate(() => { + * logWithId('finish'); + * res.end(); + * }); + * }); + * }).listen(8080); + * + * http.get('http://localhost:8080'); + * http.get('http://localhost:8080'); + * // Prints: + * // 0: start + * // 1: start + * // 0: finish + * // 1: finish + * ``` + * + * Each instance of `AsyncLocalStorage` maintains an independent storage context. + * Multiple instances can safely exist simultaneously without risk of interfering + * with each other's data. + * @since v13.10.0, v12.17.0 + */ + class AsyncLocalStorage { + /** + * Disables the instance of `AsyncLocalStorage`. All subsequent calls + * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. + * + * When calling `asyncLocalStorage.disable()`, all current contexts linked to the + * instance will be exited. + * + * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores + * provided by the `asyncLocalStorage`, as those objects are garbage collected + * along with the corresponding async resources. + * + * Use this method when the `asyncLocalStorage` is not in use anymore + * in the current process. + * @since v13.10.0, v12.17.0 + * @experimental + */ + disable(): void; + /** + * Returns the current store. + * If called outside of an asynchronous context initialized by + * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it + * returns `undefined`. + * @since v13.10.0, v12.17.0 + */ + getStore(): T | undefined; + /** + * Runs a function synchronously within a context and returns its + * return value. The store is not accessible outside of the callback function. + * The store is accessible to any asynchronous operations created within the + * callback. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `run()` too. + * The stacktrace is not impacted by this call and the context is exited. + * + * Example: + * + * ```js + * const store = { id: 2 }; + * try { + * asyncLocalStorage.run(store, () => { + * asyncLocalStorage.getStore(); // Returns the store object + * setTimeout(() => { + * asyncLocalStorage.getStore(); // Returns the store object + * }, 200); + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns undefined + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + */ + run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Runs a function synchronously outside of a context and returns its + * return value. The store is not accessible within the callback function or + * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `exit()` too. + * The stacktrace is not impacted by this call and the context is re-entered. + * + * Example: + * + * ```js + * // Within a call to run + * try { + * asyncLocalStorage.getStore(); // Returns the store object or value + * asyncLocalStorage.exit(() => { + * asyncLocalStorage.getStore(); // Returns undefined + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns the same object or value + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + * @experimental + */ + exit(callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Transitions into the context for the remainder of the current + * synchronous execution and then persists the store through any following + * asynchronous calls. + * + * Example: + * + * ```js + * const store = { id: 1 }; + * // Replaces previous store with the given store object + * asyncLocalStorage.enterWith(store); + * asyncLocalStorage.getStore(); // Returns the store object + * someAsyncOperation(() => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * ``` + * + * This transition will continue for the _entire_ synchronous execution. + * This means that if, for example, the context is entered within an event + * handler subsequent event handlers will also run within that context unless + * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons + * to use the latter method. + * + * ```js + * const store = { id: 1 }; + * + * emitter.on('my-event', () => { + * asyncLocalStorage.enterWith(store); + * }); + * emitter.on('my-event', () => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * + * asyncLocalStorage.getStore(); // Returns undefined + * emitter.emit('my-event'); + * asyncLocalStorage.getStore(); // Returns the same object + * ``` + * @since v13.11.0, v12.17.0 + * @experimental + */ + enterWith(store: T): void; + } +} +declare module 'node:async_hooks' { + export * from 'async_hooks'; +} diff --git a/server/node_modules/@types/node/ts4.8/buffer.d.ts b/server/node_modules/@types/node/ts4.8/buffer.d.ts new file mode 100755 index 0000000000..ea859cd2f3 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/buffer.d.ts @@ -0,0 +1,2259 @@ +/** + * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many + * Node.js APIs support `Buffer`s. + * + * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and + * extends it with methods that cover additional use cases. Node.js APIs accept + * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. + * + * While the `Buffer` class is available within the global scope, it is still + * recommended to explicitly reference it via an import or require statement. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Creates a zero-filled Buffer of length 10. + * const buf1 = Buffer.alloc(10); + * + * // Creates a Buffer of length 10, + * // filled with bytes which all have the value `1`. + * const buf2 = Buffer.alloc(10, 1); + * + * // Creates an uninitialized buffer of length 10. + * // This is faster than calling Buffer.alloc() but the returned + * // Buffer instance might contain old data that needs to be + * // overwritten using fill(), write(), or other functions that fill the Buffer's + * // contents. + * const buf3 = Buffer.allocUnsafe(10); + * + * // Creates a Buffer containing the bytes [1, 2, 3]. + * const buf4 = Buffer.from([1, 2, 3]); + * + * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries + * // are all truncated using `(value & 255)` to fit into the range 0–255. + * const buf5 = Buffer.from([257, 257.5, -255, '1']); + * + * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': + * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) + * // [116, 195, 169, 115, 116] (in decimal notation) + * const buf6 = Buffer.from('tést'); + * + * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. + * const buf7 = Buffer.from('tést', 'latin1'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/buffer.js) + */ +declare module 'buffer' { + import { BinaryLike } from 'node:crypto'; + import { ReadableStream as WebReadableStream } from 'node:stream/web'; + export const INSPECT_MAX_BYTES: number; + export const kMaxLength: number; + export const kStringMaxLength: number; + export const constants: { + MAX_LENGTH: number; + MAX_STRING_LENGTH: number; + }; + export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary'; + /** + * Re-encodes the given `Buffer` or `Uint8Array` instance from one character + * encoding to another. Returns a new `Buffer` instance. + * + * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if + * conversion from `fromEnc` to `toEnc` is not permitted. + * + * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. + * + * The transcoding process will use substitution characters if a given byte + * sequence cannot be adequately represented in the target encoding. For instance: + * + * ```js + * import { Buffer, transcode } from 'buffer'; + * + * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); + * console.log(newBuf.toString('ascii')); + * // Prints: '?' + * ``` + * + * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced + * with `?` in the transcoded `Buffer`. + * @since v7.1.0 + * @param source A `Buffer` or `Uint8Array` instance. + * @param fromEnc The current encoding. + * @param toEnc To target encoding. + */ + export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; + export const SlowBuffer: { + /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ + new (size: number): Buffer; + prototype: Buffer; + }; + /** + * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using + * a prior call to `URL.createObjectURL()`. + * @since v16.7.0 + * @experimental + * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. + */ + export function resolveObjectURL(id: string): Blob | undefined; + export { Buffer }; + /** + * @experimental + */ + export interface BlobOptions { + /** + * @default 'utf8' + */ + encoding?: BufferEncoding | undefined; + /** + * The Blob content-type. The intent is for `type` to convey + * the MIME media type of the data, however no validation of the type format + * is performed. + */ + type?: string | undefined; + } + /** + * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across + * multiple worker threads. + * @since v15.7.0, v14.18.0 + */ + export class Blob { + /** + * The total size of the `Blob` in bytes. + * @since v15.7.0, v14.18.0 + */ + readonly size: number; + /** + * The content-type of the `Blob`. + * @since v15.7.0, v14.18.0 + */ + readonly type: string; + /** + * Creates a new `Blob` object containing a concatenation of the given sources. + * + * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into + * the 'Blob' and can therefore be safely modified after the 'Blob' is created. + * + * String sources are also copied into the `Blob`. + */ + constructor(sources: Array, options?: BlobOptions); + /** + * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of + * the `Blob` data. + * @since v15.7.0, v14.18.0 + */ + arrayBuffer(): Promise; + /** + * Creates and returns a new `Blob` containing a subset of this `Blob` objects + * data. The original `Blob` is not altered. + * @since v15.7.0, v14.18.0 + * @param start The starting index. + * @param end The ending index. + * @param type The content-type for the new `Blob` + */ + slice(start?: number, end?: number, type?: string): Blob; + /** + * Returns a promise that fulfills with the contents of the `Blob` decoded as a + * UTF-8 string. + * @since v15.7.0, v14.18.0 + */ + text(): Promise; + /** + * Returns a new (WHATWG) `ReadableStream` that allows the content of the `Blob` to be read. + * @since v16.7.0 + */ + stream(): WebReadableStream; + } + export import atob = globalThis.atob; + export import btoa = globalThis.btoa; + + import { Blob as NodeBlob } from 'buffer'; + // This conditional type will be the existing global Blob in a browser, or + // the copy below in a Node environment. + type __Blob = typeof globalThis extends { onmessage: any, Blob: any } + ? {} : NodeBlob; + + global { + // Buffer class + type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; + type WithImplicitCoercion = + | T + | { + valueOf(): T; + }; + /** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' + */ + interface BufferConstructor { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + */ + new (str: string, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + */ + new (size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new (array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}/{SharedArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + */ + new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new (array: ReadonlyArray): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. + */ + new (buffer: Buffer): Buffer; + /** + * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. + * Array entries outside that range will be truncated to fit into it. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. + * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + * ``` + * + * A `TypeError` will be thrown if `array` is not an `Array` or another type + * appropriate for `Buffer.from()` variants. + * + * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v5.10.0 + */ + from(arrayBuffer: WithImplicitCoercion, byteOffset?: number, length?: number): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer + */ + from(data: Uint8Array | ReadonlyArray): Buffer; + from(data: WithImplicitCoercion | string>): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + */ + from( + str: + | WithImplicitCoercion + | { + [Symbol.toPrimitive](hint: 'string'): string; + }, + encoding?: BufferEncoding + ): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param values to create a new Buffer + */ + of(...items: number[]): Buffer; + /** + * Returns `true` if `obj` is a `Buffer`, `false` otherwise. + * + * ```js + * import { Buffer } from 'buffer'; + * + * Buffer.isBuffer(Buffer.alloc(10)); // true + * Buffer.isBuffer(Buffer.from('foo')); // true + * Buffer.isBuffer('a string'); // false + * Buffer.isBuffer([]); // false + * Buffer.isBuffer(new Uint8Array(1024)); // false + * ``` + * @since v0.1.101 + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns `true` if `encoding` is the name of a supported character encoding, + * or `false` otherwise. + * + * ```js + * import { Buffer } from 'buffer'; + * + * console.log(Buffer.isEncoding('utf8')); + * // Prints: true + * + * console.log(Buffer.isEncoding('hex')); + * // Prints: true + * + * console.log(Buffer.isEncoding('utf/8')); + * // Prints: false + * + * console.log(Buffer.isEncoding('')); + * // Prints: false + * ``` + * @since v0.9.1 + * @param encoding A character encoding name to check. + */ + isEncoding(encoding: string): encoding is BufferEncoding; + /** + * Returns the byte length of a string when encoded using `encoding`. + * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account + * for the encoding that is used to convert the string into bytes. + * + * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. + * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the + * return value might be greater than the length of a `Buffer` created from the + * string. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const str = '\u00bd + \u00bc = \u00be'; + * + * console.log(`${str}: ${str.length} characters, ` + + * `${Buffer.byteLength(str, 'utf8')} bytes`); + * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes + * ``` + * + * When `string` is a + * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- + * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- + * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. + * @since v0.1.90 + * @param string A value to calculate the length of. + * @param [encoding='utf8'] If `string` is a string, this is its encoding. + * @return The number of bytes contained within `string`. + */ + byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; + /** + * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. + * + * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. + * + * If `totalLength` is not provided, it is calculated from the `Buffer` instances + * in `list` by adding their lengths. + * + * If `totalLength` is provided, it is coerced to an unsigned integer. If the + * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is + * truncated to `totalLength`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Create a single `Buffer` from a list of three `Buffer` instances. + * + * const buf1 = Buffer.alloc(10); + * const buf2 = Buffer.alloc(14); + * const buf3 = Buffer.alloc(18); + * const totalLength = buf1.length + buf2.length + buf3.length; + * + * console.log(totalLength); + * // Prints: 42 + * + * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); + * + * console.log(bufA); + * // Prints: + * console.log(bufA.length); + * // Prints: 42 + * ``` + * + * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v0.7.11 + * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. + * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. + */ + concat(list: ReadonlyArray, totalLength?: number): Buffer; + /** + * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from('1234'); + * const buf2 = Buffer.from('0123'); + * const arr = [buf1, buf2]; + * + * console.log(arr.sort(Buffer.compare)); + * // Prints: [ , ] + * // (This result is equal to: [buf2, buf1].) + * ``` + * @since v0.11.13 + * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. + */ + compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; + /** + * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.alloc(5); + * + * console.log(buf); + * // Prints: + * ``` + * + * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. + * + * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.alloc(5, 'a'); + * + * console.log(buf); + * // Prints: + * ``` + * + * If both `fill` and `encoding` are specified, the allocated `Buffer` will be + * initialized by calling `buf.fill(fill, encoding)`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); + * + * console.log(buf); + * // Prints: + * ``` + * + * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance + * contents will never contain sensitive data from previous allocations, including + * data that might not have been allocated for `Buffer`s. + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + * @param [fill=0] A value to pre-fill the new `Buffer` with. + * @param [encoding='utf8'] If `fill` is a string, this is its encoding. + */ + alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(10); + * + * console.log(buf); + * // Prints (contents may vary): + * + * buf.fill(0); + * + * console.log(buf); + * // Prints: + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * + * The `Buffer` module pre-allocates an internal `Buffer` instance of + * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the + * deprecated`new Buffer(size)` constructor only when `size` is less than or equal + * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + * + * Use of this pre-allocated internal memory pool is a key difference between + * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. + * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less + * than or equal to half `Buffer.poolSize`. The + * difference is subtle but can be important when an application requires the + * additional performance that `Buffer.allocUnsafe()` provides. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created + * if `size` is 0. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize + * such `Buffer` instances with zeroes. + * + * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, + * allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This + * allows applications to avoid the garbage collection overhead of creating many + * individually allocated `Buffer` instances. This approach improves both + * performance and memory usage by eliminating the need to track and clean up as + * many individual `ArrayBuffer` objects. + * + * However, in the case where a developer may need to retain a small chunk of + * memory from a pool for an indeterminate amount of time, it may be appropriate + * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and + * then copying out the relevant bits. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Need to keep around a few small chunks of memory. + * const store = []; + * + * socket.on('readable', () => { + * let data; + * while (null !== (data = readable.read())) { + * // Allocate for retained data. + * const sb = Buffer.allocUnsafeSlow(10); + * + * // Copy the data into the new allocation. + * data.copy(sb, 0, 0, 10); + * + * store.push(sb); + * } + * }); + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.12.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafeSlow(size: number): Buffer; + /** + * This is the size (in bytes) of pre-allocated internal `Buffer` instances used + * for pooling. This value may be modified. + * @since v0.11.3 + */ + poolSize: number; + } + interface Buffer extends Uint8Array { + /** + * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did + * not contain enough space to fit the entire string, only part of `string` will be + * written. However, partially encoded characters will not be written. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.alloc(256); + * + * const len = buf.write('\u00bd + \u00bc = \u00be', 0); + * + * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); + * // Prints: 12 bytes: ½ + ¼ = ¾ + * + * const buffer = Buffer.alloc(10); + * + * const length = buffer.write('abcd', 8); + * + * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); + * // Prints: 2 bytes : ab + * ``` + * @since v0.1.90 + * @param string String to write to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write `string`. + * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). + * @param [encoding='utf8'] The character encoding of `string`. + * @return Number of bytes written. + */ + write(string: string, encoding?: BufferEncoding): number; + write(string: string, offset: number, encoding?: BufferEncoding): number; + write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; + /** + * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. + * + * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, + * then each invalid byte is replaced with the replacement character `U+FFFD`. + * + * The maximum length of a string instance (in UTF-16 code units) is available + * as {@link constants.MAX_STRING_LENGTH}. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * console.log(buf1.toString('utf8')); + * // Prints: abcdefghijklmnopqrstuvwxyz + * console.log(buf1.toString('utf8', 0, 5)); + * // Prints: abcde + * + * const buf2 = Buffer.from('tést'); + * + * console.log(buf2.toString('hex')); + * // Prints: 74c3a97374 + * console.log(buf2.toString('utf8', 0, 3)); + * // Prints: té + * console.log(buf2.toString(undefined, 0, 3)); + * // Prints: té + * ``` + * @since v0.1.90 + * @param [encoding='utf8'] The character encoding to use. + * @param [start=0] The byte offset to start decoding at. + * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). + */ + toString(encoding?: BufferEncoding, start?: number, end?: number): string; + /** + * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls + * this function when stringifying a `Buffer` instance. + * + * `Buffer.from()` accepts objects in the format returned from this method. + * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); + * const json = JSON.stringify(buf); + * + * console.log(json); + * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} + * + * const copy = JSON.parse(json, (key, value) => { + * return value && value.type === 'Buffer' ? + * Buffer.from(value) : + * value; + * }); + * + * console.log(copy); + * // Prints: + * ``` + * @since v0.9.2 + */ + toJSON(): { + type: 'Buffer'; + data: number[]; + }; + /** + * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('414243', 'hex'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.equals(buf2)); + * // Prints: true + * console.log(buf1.equals(buf3)); + * // Prints: false + * ``` + * @since v0.11.13 + * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. + */ + equals(otherBuffer: Uint8Array): boolean; + /** + * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. + * Comparison is based on the actual sequence of bytes in each `Buffer`. + * + * * `0` is returned if `target` is the same as `buf` + * * `1` is returned if `target` should come _before_`buf` when sorted. + * * `-1` is returned if `target` should come _after_`buf` when sorted. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('BCD'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.compare(buf1)); + * // Prints: 0 + * console.log(buf1.compare(buf2)); + * // Prints: -1 + * console.log(buf1.compare(buf3)); + * // Prints: -1 + * console.log(buf2.compare(buf1)); + * // Prints: 1 + * console.log(buf2.compare(buf3)); + * // Prints: 1 + * console.log([buf1, buf2, buf3].sort(Buffer.compare)); + * // Prints: [ , , ] + * // (This result is equal to: [buf1, buf3, buf2].) + * ``` + * + * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); + * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); + * + * console.log(buf1.compare(buf2, 5, 9, 0, 4)); + * // Prints: 0 + * console.log(buf1.compare(buf2, 0, 6, 4)); + * // Prints: -1 + * console.log(buf1.compare(buf2, 5, 6, 5)); + * // Prints: 1 + * ``` + * + * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. + * @since v0.11.13 + * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. + * @param [targetStart=0] The offset within `target` at which to begin comparison. + * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). + * @param [sourceStart=0] The offset within `buf` at which to begin comparison. + * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). + */ + compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1; + /** + * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. + * + * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available + * for all TypedArrays, including Node.js `Buffer`s, although it takes + * different function arguments. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Create two `Buffer` instances. + * const buf1 = Buffer.allocUnsafe(26); + * const buf2 = Buffer.allocUnsafe(26).fill('!'); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. + * buf1.copy(buf2, 8, 16, 20); + * // This is equivalent to: + * // buf2.set(buf1.subarray(16, 20), 8); + * + * console.log(buf2.toString('ascii', 0, 25)); + * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! + * ``` + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Create a `Buffer` and copy data from one region to an overlapping region + * // within the same `Buffer`. + * + * const buf = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf[i] = i + 97; + * } + * + * buf.copy(buf, 0, 4, 10); + * + * console.log(buf.toString()); + * // Prints: efghijghijklmnopqrstuvwxyz + * ``` + * @since v0.1.90 + * @param target A `Buffer` or {@link Uint8Array} to copy into. + * @param [targetStart=0] The offset within `target` at which to begin writing. + * @param [sourceStart=0] The offset within `buf` from which to begin copying. + * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). + * @return The number of bytes copied. + */ + copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * This method is not compatible with the `Uint8Array.prototype.slice()`, + * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('buffer'); + * + * const copiedBuf = Uint8Array.prototype.slice.call(buf); + * copiedBuf[0]++; + * console.log(copiedBuf.toString()); + * // Prints: cuffer + * + * console.log(buf.toString()); + * // Prints: buffer + * + * // With buf.slice(), the original buffer is modified. + * const notReallyCopiedBuf = buf.slice(); + * notReallyCopiedBuf[0]++; + * console.log(notReallyCopiedBuf.toString()); + * // Prints: cuffer + * console.log(buf.toString()); + * // Also prints: cuffer (!) + * ``` + * @since v0.3.0 + * @deprecated Use `subarray` instead. + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + slice(start?: number, end?: number): Buffer; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * Specifying `end` greater than `buf.length` will return the same result as + * that of `end` equal to `buf.length`. + * + * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). + * + * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte + * // from the original `Buffer`. + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * const buf2 = buf1.subarray(0, 3); + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: abc + * + * buf1[0] = 33; + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: !bc + * ``` + * + * Specifying negative indexes causes the slice to be generated relative to the + * end of `buf` rather than the beginning. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('buffer'); + * + * console.log(buf.subarray(-6, -1).toString()); + * // Prints: buffe + * // (Equivalent to buf.subarray(0, 5).) + * + * console.log(buf.subarray(-6, -2).toString()); + * // Prints: buff + * // (Equivalent to buf.subarray(0, 4).) + * + * console.log(buf.subarray(-5, -2).toString()); + * // Prints: uff + * // (Equivalent to buf.subarray(1, 4).) + * ``` + * @since v3.0.0 + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + subarray(start?: number, end?: number): Buffer; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64BE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64LE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64LE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * This function is also available under the `writeBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64BE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * + * This function is also available under the `writeBigUint64LE` alias. + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64LE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64LE(value: bigint, offset?: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintLE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntLE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntLE + * @since v14.9.0, v12.19.0 + */ + writeUintLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintBE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntBE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntBE + * @since v14.9.0, v12.19.0 + */ + writeUintBE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than a signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a + * signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntBE(value: number, offset: number, byteLength: number): number; + /** + * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64BE(0)); + * // Prints: 4294967295n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64BE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + readBigUint64BE(offset?: number): bigint; + /** + * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64LE(0)); + * // Prints: 18446744069414584320n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64LE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + readBigUint64LE(offset?: number): bigint; + /** + * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64BE(offset?: number): bigint; + /** + * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64LE(offset?: number): bigint; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintLE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntLE(0, 6).toString(16)); + * // Prints: ab9078563412 + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntLE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntLE + * @since v14.9.0, v12.19.0 + */ + readUintLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintBE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readUIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntBE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntBE + * @since v14.9.0, v12.19.0 + */ + readUintBE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntLE(0, 6).toString(16)); + * // Prints: -546f87a9cbee + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * console.log(buf.readIntBE(1, 0).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntBE(offset: number, byteLength: number): number; + /** + * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. + * + * This function is also available under the `readUint8` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, -2]); + * + * console.log(buf.readUInt8(0)); + * // Prints: 1 + * console.log(buf.readUInt8(1)); + * // Prints: 254 + * console.log(buf.readUInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readUInt8(offset?: number): number; + /** + * @alias Buffer.readUInt8 + * @since v14.9.0, v12.19.0 + */ + readUint8(offset?: number): number; + /** + * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint16LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16LE(0).toString(16)); + * // Prints: 3412 + * console.log(buf.readUInt16LE(1).toString(16)); + * // Prints: 5634 + * console.log(buf.readUInt16LE(2).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16LE(offset?: number): number; + /** + * @alias Buffer.readUInt16LE + * @since v14.9.0, v12.19.0 + */ + readUint16LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint16BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16BE(0).toString(16)); + * // Prints: 1234 + * console.log(buf.readUInt16BE(1).toString(16)); + * // Prints: 3456 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16BE(offset?: number): number; + /** + * @alias Buffer.readUInt16BE + * @since v14.9.0, v12.19.0 + */ + readUint16BE(offset?: number): number; + /** + * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32LE(0).toString(16)); + * // Prints: 78563412 + * console.log(buf.readUInt32LE(1).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32LE(offset?: number): number; + /** + * @alias Buffer.readUInt32LE + * @since v14.9.0, v12.19.0 + */ + readUint32LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32BE(0).toString(16)); + * // Prints: 12345678 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32BE(offset?: number): number; + /** + * @alias Buffer.readUInt32BE + * @since v14.9.0, v12.19.0 + */ + readUint32BE(offset?: number): number; + /** + * Reads a signed 8-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([-1, 5]); + * + * console.log(buf.readInt8(0)); + * // Prints: -1 + * console.log(buf.readInt8(1)); + * // Prints: 5 + * console.log(buf.readInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readInt8(offset?: number): number; + /** + * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16LE(0)); + * // Prints: 1280 + * console.log(buf.readInt16LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16LE(offset?: number): number; + /** + * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16BE(offset?: number): number; + /** + * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32LE(0)); + * // Prints: 83886080 + * console.log(buf.readInt32LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32LE(offset?: number): number; + /** + * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32BE(offset?: number): number; + /** + * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatLE(0)); + * // Prints: 1.539989614439558e-36 + * console.log(buf.readFloatLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatLE(offset?: number): number; + /** + * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatBE(0)); + * // Prints: 2.387939260590663e-38 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatBE(offset?: number): number; + /** + * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleLE(0)); + * // Prints: 5.447603722011605e-270 + * console.log(buf.readDoubleLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleLE(offset?: number): number; + /** + * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleBE(0)); + * // Prints: 8.20788039913184e-304 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleBE(offset?: number): number; + reverse(): this; + /** + * Interprets `buf` as an array of unsigned 16-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap16(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap16(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * + * One convenient use of `buf.swap16()` is to perform a fast in-place conversion + * between UTF-16 little-endian and UTF-16 big-endian: + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); + * buf.swap16(); // Convert to big-endian UTF-16 text. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap16(): Buffer; + /** + * Interprets `buf` as an array of unsigned 32-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap32(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap32(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap32(): Buffer; + /** + * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. + * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap64(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap64(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v6.3.0 + * @return A reference to `buf`. + */ + swap64(): Buffer; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a + * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything + * other than an unsigned 8-bit integer. + * + * This function is also available under the `writeUint8` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt8(0x3, 0); + * buf.writeUInt8(0x4, 1); + * buf.writeUInt8(0x23, 2); + * buf.writeUInt8(0x42, 3); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeUInt8(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt8 + * @since v14.9.0, v12.19.0 + */ + writeUint8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 16-bit integer. + * + * This function is also available under the `writeUint16LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16LE(0xdead, 0); + * buf.writeUInt16LE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16LE + * @since v14.9.0, v12.19.0 + */ + writeUint16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 16-bit integer. + * + * This function is also available under the `writeUint16BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16BE(0xdead, 0); + * buf.writeUInt16BE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16BE + * @since v14.9.0, v12.19.0 + */ + writeUint16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 32-bit integer. + * + * This function is also available under the `writeUint32LE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32LE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32LE + * @since v14.9.0, v12.19.0 + */ + writeUint32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 32-bit integer. + * + * This function is also available under the `writeUint32BE` alias. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32BE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32BE + * @since v14.9.0, v12.19.0 + */ + writeUint32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a valid + * signed 8-bit integer. Behavior is undefined when `value` is anything other than + * a signed 8-bit integer. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt8(2, 0); + * buf.writeInt8(-2, 1); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeInt8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16LE(0x0304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16BE(0x0102, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32LE(0x05060708, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32BE(0x01020304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatLE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatBE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatBE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleLE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleBE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleBE(value: number, offset?: number): number; + /** + * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, + * the entire `buf` will be filled: + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Fill a `Buffer` with the ASCII character 'h'. + * + * const b = Buffer.allocUnsafe(50).fill('h'); + * + * console.log(b.toString()); + * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh + * ``` + * + * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or + * integer. If the resulting integer is greater than `255` (decimal), `buf` will be + * filled with `value & 255`. + * + * If the final write of a `fill()` operation falls on a multi-byte character, + * then only the bytes of that character that fit into `buf` are written: + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Fill a `Buffer` with character that takes up two bytes in UTF-8. + * + * console.log(Buffer.allocUnsafe(5).fill('\u0222')); + * // Prints: + * ``` + * + * If `value` contains invalid characters, it is truncated; if no valid + * fill data remains, an exception is thrown: + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.allocUnsafe(5); + * + * console.log(buf.fill('a')); + * // Prints: + * console.log(buf.fill('aazz', 'hex')); + * // Prints: + * console.log(buf.fill('zz', 'hex')); + * // Throws an exception. + * ``` + * @since v0.5.0 + * @param value The value with which to fill `buf`. + * @param [offset=0] Number of bytes to skip before starting to fill `buf`. + * @param [end=buf.length] Where to stop filling `buf` (not inclusive). + * @param [encoding='utf8'] The encoding for `value` if `value` is a string. + * @return A reference to `buf`. + */ + fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; + /** + * If `value` is: + * + * * a string, `value` is interpreted according to the character encoding in`encoding`. + * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. + * To compare a partial `Buffer`, use `buf.subarray`. + * * a number, `value` will be interpreted as an unsigned 8-bit integer + * value between `0` and `255`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.indexOf('this')); + * // Prints: 0 + * console.log(buf.indexOf('is')); + * // Prints: 2 + * console.log(buf.indexOf(Buffer.from('a buffer'))); + * // Prints: 8 + * console.log(buf.indexOf(97)); + * // Prints: 8 (97 is the decimal ASCII value for 'a') + * console.log(buf.indexOf(Buffer.from('a buffer example'))); + * // Prints: -1 + * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: 8 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); + * // Prints: 4 + * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); + * // Prints: 6 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. If the result + * of coercion is `NaN` or `0`, then the entire buffer will be searched. This + * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). + * + * ```js + * import { Buffer } from 'buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.indexOf(99.9)); + * console.log(b.indexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN or 0. + * // Prints: 1, searching the whole buffer. + * console.log(b.indexOf('b', undefined)); + * console.log(b.indexOf('b', {})); + * console.log(b.indexOf('b', null)); + * console.log(b.indexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer` and `byteOffset` is less + * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. + * @since v1.5.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + /** + * Identical to `buf.indexOf()`, except the last occurrence of `value` is found + * rather than the first occurrence. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('this buffer is a buffer'); + * + * console.log(buf.lastIndexOf('this')); + * // Prints: 0 + * console.log(buf.lastIndexOf('buffer')); + * // Prints: 17 + * console.log(buf.lastIndexOf(Buffer.from('buffer'))); + * // Prints: 17 + * console.log(buf.lastIndexOf(97)); + * // Prints: 15 (97 is the decimal ASCII value for 'a') + * console.log(buf.lastIndexOf(Buffer.from('yolo'))); + * // Prints: -1 + * console.log(buf.lastIndexOf('buffer', 5)); + * // Prints: 5 + * console.log(buf.lastIndexOf('buffer', 4)); + * // Prints: -1 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); + * // Prints: 6 + * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); + * // Prints: 4 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. Any arguments + * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. + * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). + * + * ```js + * import { Buffer } from 'buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.lastIndexOf(99.9)); + * console.log(b.lastIndexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN. + * // Prints: 1, searching the whole buffer. + * console.log(b.lastIndexOf('b', undefined)); + * console.log(b.lastIndexOf('b', {})); + * + * // Passing a byteOffset that coerces to 0. + * // Prints: -1, equivalent to passing 0. + * console.log(b.lastIndexOf('b', null)); + * console.log(b.lastIndexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. + * @since v6.0.0 + * @param value What to search for. + * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents + * of `buf`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * // Log the entire contents of a `Buffer`. + * + * const buf = Buffer.from('buffer'); + * + * for (const pair of buf.entries()) { + * console.log(pair); + * } + * // Prints: + * // [0, 98] + * // [1, 117] + * // [2, 102] + * // [3, 102] + * // [4, 101] + * // [5, 114] + * ``` + * @since v1.1.0 + */ + entries(): IterableIterator<[number, number]>; + /** + * Equivalent to `buf.indexOf() !== -1`. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.includes('this')); + * // Prints: true + * console.log(buf.includes('is')); + * // Prints: true + * console.log(buf.includes(Buffer.from('a buffer'))); + * // Prints: true + * console.log(buf.includes(97)); + * // Prints: true (97 is the decimal ASCII value for 'a') + * console.log(buf.includes(Buffer.from('a buffer example'))); + * // Prints: false + * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: true + * console.log(buf.includes('this', 4)); + * // Prints: false + * ``` + * @since v5.3.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is its encoding. + * @return `true` if `value` was found in `buf`, `false` otherwise. + */ + includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('buffer'); + * + * for (const key of buf.keys()) { + * console.log(key); + * } + * // Prints: + * // 0 + * // 1 + * // 2 + * // 3 + * // 4 + * // 5 + * ``` + * @since v1.1.0 + */ + keys(): IterableIterator; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is + * called automatically when a `Buffer` is used in a `for..of` statement. + * + * ```js + * import { Buffer } from 'buffer'; + * + * const buf = Buffer.from('buffer'); + * + * for (const value of buf.values()) { + * console.log(value); + * } + * // Prints: + * // 98 + * // 117 + * // 102 + * // 102 + * // 101 + * // 114 + * + * for (const value of buf) { + * console.log(value); + * } + * // Prints: + * // 98 + * // 117 + * // 102 + * // 102 + * // 101 + * // 114 + * ``` + * @since v1.1.0 + */ + values(): IterableIterator; + } + var Buffer: BufferConstructor; + /** + * Decodes a string of Base64-encoded data into bytes, and encodes those bytes + * into a string using Latin-1 (ISO-8859-1). + * + * The `data` may be any JavaScript-value that can be coerced into a string. + * + * **This function is only provided for compatibility with legacy web platform APIs** + * **and should never be used in new code, because they use strings to represent** + * **binary data and predate the introduction of typed arrays in JavaScript.** + * **For code running using Node.js APIs, converting between base64-encoded strings** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * @since v15.13.0, v14.17.0 + * @deprecated Use `Buffer.from(data, 'base64')` instead. + * @param data The Base64-encoded input string. + */ + function atob(data: string): string; + /** + * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes + * into a string using Base64. + * + * The `data` may be any JavaScript-value that can be coerced into a string. + * + * **This function is only provided for compatibility with legacy web platform APIs** + * **and should never be used in new code, because they use strings to represent** + * **binary data and predate the introduction of typed arrays in JavaScript.** + * **For code running using Node.js APIs, converting between base64-encoded strings** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * @since v15.13.0, v14.17.0 + * @deprecated Use `buf.toString('base64')` instead. + * @param data An ASCII (Latin1) string. + */ + function btoa(data: string): string; + + interface Blob extends __Blob {} + /** + * `Blob` class is a global reference for `require('node:buffer').Blob` + * https://nodejs.org/api/buffer.html#class-blob + * @since v18.0.0 + */ + var Blob: typeof globalThis extends { + onmessage: any; + Blob: infer T; + } + ? T + : typeof NodeBlob; + } +} +declare module 'node:buffer' { + export * from 'buffer'; +} diff --git a/server/node_modules/@types/node/ts4.8/child_process.d.ts b/server/node_modules/@types/node/ts4.8/child_process.d.ts new file mode 100755 index 0000000000..c537d6d621 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/child_process.d.ts @@ -0,0 +1,1369 @@ +/** + * The `child_process` module provides the ability to spawn subprocesses in + * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability + * is primarily provided by the {@link spawn} function: + * + * ```js + * const { spawn } = require('child_process'); + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * ls.on('close', (code) => { + * console.log(`child process exited with code ${code}`); + * }); + * ``` + * + * By default, pipes for `stdin`, `stdout`, and `stderr` are established between + * the parent Node.js process and the spawned subprocess. These pipes have + * limited (and platform-specific) capacity. If the subprocess writes to + * stdout in excess of that limit without the output being captured, the + * subprocess blocks waiting for the pipe buffer to accept more data. This is + * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. + * + * The command lookup is performed using the `options.env.PATH` environment + * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is + * used. If `options.env` is set without `PATH`, lookup on Unix is performed + * on a default search path search of `/usr/bin:/bin` (see your operating system's + * manual for execvpe/execvp), on Windows the current processes environment + * variable `PATH` is used. + * + * On Windows, environment variables are case-insensitive. Node.js + * lexicographically sorts the `env` keys and uses the first one that + * case-insensitively matches. Only first (in lexicographic order) entry will be + * passed to the subprocess. This might lead to issues on Windows when passing + * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. + * + * The {@link spawn} method spawns the child process asynchronously, + * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks + * the event loop until the spawned process either exits or is terminated. + * + * For convenience, the `child_process` module provides a handful of synchronous + * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on + * top of {@link spawn} or {@link spawnSync}. + * + * * {@link exec}: spawns a shell and runs a command within that + * shell, passing the `stdout` and `stderr` to a callback function when + * complete. + * * {@link execFile}: similar to {@link exec} except + * that it spawns the command directly without first spawning a shell by + * default. + * * {@link fork}: spawns a new Node.js process and invokes a + * specified module with an IPC communication channel established that allows + * sending messages between parent and child. + * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. + * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. + * + * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, + * the synchronous methods can have significant impact on performance due to + * stalling the event loop while spawned processes complete. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/child_process.js) + */ +declare module 'child_process' { + import { ObjectEncodingOptions } from 'node:fs'; + import { EventEmitter, Abortable } from 'node:events'; + import * as net from 'node:net'; + import { Writable, Readable, Stream, Pipe } from 'node:stream'; + import { URL } from 'node:url'; + type Serializable = string | object | number | boolean | bigint; + type SendHandle = net.Socket | net.Server; + /** + * Instances of the `ChildProcess` represent spawned child processes. + * + * Instances of `ChildProcess` are not intended to be created directly. Rather, + * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create + * instances of `ChildProcess`. + * @since v2.2.0 + */ + class ChildProcess extends EventEmitter { + /** + * A `Writable Stream` that represents the child process's `stdin`. + * + * If a child process waits to read all of its input, the child will not continue + * until this stream has been closed via `end()`. + * + * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will + * refer to the same value. + * + * The `subprocess.stdin` property can be `undefined` if the child process could + * not be successfully spawned. + * @since v0.1.90 + */ + stdin: Writable | null; + /** + * A `Readable Stream` that represents the child process's `stdout`. + * + * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will + * refer to the same value. + * + * ```js + * const { spawn } = require('child_process'); + * + * const subprocess = spawn('ls'); + * + * subprocess.stdout.on('data', (data) => { + * console.log(`Received chunk ${data}`); + * }); + * ``` + * + * The `subprocess.stdout` property can be `null` if the child process could + * not be successfully spawned. + * @since v0.1.90 + */ + stdout: Readable | null; + /** + * A `Readable Stream` that represents the child process's `stderr`. + * + * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will + * refer to the same value. + * + * The `subprocess.stderr` property can be `null` if the child process could + * not be successfully spawned. + * @since v0.1.90 + */ + stderr: Readable | null; + /** + * The `subprocess.channel` property is a reference to the child's IPC channel. If + * no IPC channel currently exists, this property is `undefined`. + * @since v7.1.0 + */ + readonly channel?: Pipe | null | undefined; + /** + * A sparse array of pipes to the child process, corresponding with positions in + * the `stdio` option passed to {@link spawn} that have been set + * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, + * respectively. + * + * In the following example, only the child's fd `1` (stdout) is configured as a + * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values + * in the array are `null`. + * + * ```js + * const assert = require('assert'); + * const fs = require('fs'); + * const child_process = require('child_process'); + * + * const subprocess = child_process.spawn('ls', { + * stdio: [ + * 0, // Use parent's stdin for child. + * 'pipe', // Pipe child's stdout to parent. + * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. + * ] + * }); + * + * assert.strictEqual(subprocess.stdio[0], null); + * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); + * + * assert(subprocess.stdout); + * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); + * + * assert.strictEqual(subprocess.stdio[2], null); + * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); + * ``` + * + * The `subprocess.stdio` property can be `undefined` if the child process could + * not be successfully spawned. + * @since v0.7.10 + */ + readonly stdio: [ + Writable | null, + // stdin + Readable | null, + // stdout + Readable | null, + // stderr + Readable | Writable | null | undefined, + // extra + Readable | Writable | null | undefined // extra + ]; + /** + * The `subprocess.killed` property indicates whether the child process + * successfully received a signal from `subprocess.kill()`. The `killed` property + * does not indicate that the child process has been terminated. + * @since v0.5.10 + */ + readonly killed: boolean; + /** + * Returns the process identifier (PID) of the child process. If the child process + * fails to spawn due to errors, then the value is `undefined` and `error` is + * emitted. + * + * ```js + * const { spawn } = require('child_process'); + * const grep = spawn('grep', ['ssh']); + * + * console.log(`Spawned child pid: ${grep.pid}`); + * grep.stdin.end(); + * ``` + * @since v0.1.90 + */ + readonly pid?: number | undefined; + /** + * The `subprocess.connected` property indicates whether it is still possible to + * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. + * @since v0.7.2 + */ + readonly connected: boolean; + /** + * The `subprocess.exitCode` property indicates the exit code of the child process. + * If the child process is still running, the field will be `null`. + */ + readonly exitCode: number | null; + /** + * The `subprocess.signalCode` property indicates the signal received by + * the child process if any, else `null`. + */ + readonly signalCode: NodeJS.Signals | null; + /** + * The `subprocess.spawnargs` property represents the full list of command-line + * arguments the child process was launched with. + */ + readonly spawnargs: string[]; + /** + * The `subprocess.spawnfile` property indicates the executable file name of + * the child process that is launched. + * + * For {@link fork}, its value will be equal to `process.execPath`. + * For {@link spawn}, its value will be the name of + * the executable file. + * For {@link exec}, its value will be the name of the shell + * in which the child process is launched. + */ + readonly spawnfile: string; + /** + * The `subprocess.kill()` method sends a signal to the child process. If no + * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function + * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. + * + * ```js + * const { spawn } = require('child_process'); + * const grep = spawn('grep', ['ssh']); + * + * grep.on('close', (code, signal) => { + * console.log( + * `child process terminated due to receipt of signal ${signal}`); + * }); + * + * // Send SIGHUP to process. + * grep.kill('SIGHUP'); + * ``` + * + * The `ChildProcess` object may emit an `'error'` event if the signal + * cannot be delivered. Sending a signal to a child process that has already exited + * is not an error but may have unforeseen consequences. Specifically, if the + * process identifier (PID) has been reassigned to another process, the signal will + * be delivered to that process instead which can have unexpected results. + * + * While the function is called `kill`, the signal delivered to the child process + * may not actually terminate the process. + * + * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. + * + * On Windows, where POSIX signals do not exist, the `signal` argument will be + * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). + * See `Signal Events` for more details. + * + * On Linux, child processes of child processes will not be terminated + * when attempting to kill their parent. This is likely to happen when running a + * new process in a shell or with the use of the `shell` option of `ChildProcess`: + * + * ```js + * 'use strict'; + * const { spawn } = require('child_process'); + * + * const subprocess = spawn( + * 'sh', + * [ + * '-c', + * `node -e "setInterval(() => { + * console.log(process.pid, 'is alive') + * }, 500);"`, + * ], { + * stdio: ['inherit', 'inherit', 'inherit'] + * } + * ); + * + * setTimeout(() => { + * subprocess.kill(); // Does not terminate the Node.js process in the shell. + * }, 2000); + * ``` + * @since v0.1.90 + */ + kill(signal?: NodeJS.Signals | number): boolean; + /** + * When an IPC channel has been established between the parent and child ( + * i.e. when using {@link fork}), the `subprocess.send()` method can + * be used to send messages to the child process. When the child process is a + * Node.js instance, these messages can be received via the `'message'` event. + * + * The message goes through serialization and parsing. The resulting + * message might not be the same as what is originally sent. + * + * For example, in the parent script: + * + * ```js + * const cp = require('child_process'); + * const n = cp.fork(`${__dirname}/sub.js`); + * + * n.on('message', (m) => { + * console.log('PARENT got message:', m); + * }); + * + * // Causes the child to print: CHILD got message: { hello: 'world' } + * n.send({ hello: 'world' }); + * ``` + * + * And then the child script, `'sub.js'` might look like this: + * + * ```js + * process.on('message', (m) => { + * console.log('CHILD got message:', m); + * }); + * + * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } + * process.send({ foo: 'bar', baz: NaN }); + * ``` + * + * Child Node.js processes will have a `process.send()` method of their own + * that allows the child to send messages back to the parent. + * + * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages + * containing a `NODE_` prefix in the `cmd` property are reserved for use within + * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. + * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. + * + * The optional `sendHandle` argument that may be passed to `subprocess.send()` is + * for passing a TCP server or socket object to the child process. The child will + * receive the object as the second argument passed to the callback function + * registered on the `'message'` event. Any data that is received + * and buffered in the socket will not be sent to the child. + * + * The optional `callback` is a function that is invoked after the message is + * sent but before the child may have received it. The function is called with a + * single argument: `null` on success, or an `Error` object on failure. + * + * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can + * happen, for instance, when the child process has already exited. + * + * `subprocess.send()` will return `false` if the channel has closed or when the + * backlog of unsent messages exceeds a threshold that makes it unwise to send + * more. Otherwise, the method returns `true`. The `callback` function can be + * used to implement flow control. + * + * #### Example: sending a server object + * + * The `sendHandle` argument can be used, for instance, to pass the handle of + * a TCP server object to the child process as illustrated in the example below: + * + * ```js + * const subprocess = require('child_process').fork('subprocess.js'); + * + * // Open up the server object and send the handle. + * const server = require('net').createServer(); + * server.on('connection', (socket) => { + * socket.end('handled by parent'); + * }); + * server.listen(1337, () => { + * subprocess.send('server', server); + * }); + * ``` + * + * The child would then receive the server object as: + * + * ```js + * process.on('message', (m, server) => { + * if (m === 'server') { + * server.on('connection', (socket) => { + * socket.end('handled by child'); + * }); + * } + * }); + * ``` + * + * Once the server is now shared between the parent and child, some connections + * can be handled by the parent and some by the child. + * + * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on + * a `'message'` event instead of `'connection'` and using `server.bind()` instead + * of `server.listen()`. This is, however, currently only supported on Unix + * platforms. + * + * #### Example: sending a socket object + * + * Similarly, the `sendHandler` argument can be used to pass the handle of a + * socket to the child process. The example below spawns two children that each + * handle connections with "normal" or "special" priority: + * + * ```js + * const { fork } = require('child_process'); + * const normal = fork('subprocess.js', ['normal']); + * const special = fork('subprocess.js', ['special']); + * + * // Open up the server and send sockets to child. Use pauseOnConnect to prevent + * // the sockets from being read before they are sent to the child process. + * const server = require('net').createServer({ pauseOnConnect: true }); + * server.on('connection', (socket) => { + * + * // If this is special priority... + * if (socket.remoteAddress === '74.125.127.100') { + * special.send('socket', socket); + * return; + * } + * // This is normal priority. + * normal.send('socket', socket); + * }); + * server.listen(1337); + * ``` + * + * The `subprocess.js` would receive the socket handle as the second argument + * passed to the event callback function: + * + * ```js + * process.on('message', (m, socket) => { + * if (m === 'socket') { + * if (socket) { + * // Check that the client socket exists. + * // It is possible for the socket to be closed between the time it is + * // sent and the time it is received in the child process. + * socket.end(`Request handled with ${process.argv[2]} priority`); + * } + * } + * }); + * ``` + * + * Do not use `.maxConnections` on a socket that has been passed to a subprocess. + * The parent cannot track when the socket is destroyed. + * + * Any `'message'` handlers in the subprocess should verify that `socket` exists, + * as the connection may have been closed during the time it takes to send the + * connection to the child. + * @since v0.5.9 + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send(message: Serializable, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; + /** + * Closes the IPC channel between parent and child, allowing the child to exit + * gracefully once there are no other connections keeping it alive. After calling + * this method the `subprocess.connected` and `process.connected` properties in + * both the parent and child (respectively) will be set to `false`, and it will be + * no longer possible to pass messages between the processes. + * + * The `'disconnect'` event will be emitted when there are no messages in the + * process of being received. This will most often be triggered immediately after + * calling `subprocess.disconnect()`. + * + * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked + * within the child process to close the IPC channel as well. + * @since v0.7.2 + */ + disconnect(): void; + /** + * By default, the parent will wait for the detached child to exit. To prevent the + * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not + * include the child in its reference count, allowing the parent to exit + * independently of the child, unless there is an established IPC channel between + * the child and the parent. + * + * ```js + * const { spawn } = require('child_process'); + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore' + * }); + * + * subprocess.unref(); + * ``` + * @since v0.7.10 + */ + unref(): void; + /** + * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will + * restore the removed reference count for the child process, forcing the parent + * to wait for the child to exit before exiting itself. + * + * ```js + * const { spawn } = require('child_process'); + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore' + * }); + * + * subprocess.unref(); + * subprocess.ref(); + * ``` + * @since v0.7.10 + */ + ref(): void; + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + * 6. spawn + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: 'disconnect', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + addListener(event: 'spawn', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean; + emit(event: 'spawn', listener: () => void): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: 'disconnect', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + on(event: 'spawn', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: 'disconnect', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + once(event: 'spawn', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: 'disconnect', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependListener(event: 'spawn', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: 'disconnect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependOnceListener(event: 'spawn', listener: () => void): this; + } + // return this object when stdio option is undefined or not specified + interface ChildProcessWithoutNullStreams extends ChildProcess { + stdin: Writable; + stdout: Readable; + stderr: Readable; + readonly stdio: [ + Writable, + Readable, + Readable, + // stderr + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + // return this object when stdio option is a tuple of 3 + interface ChildProcessByStdio extends ChildProcess { + stdin: I; + stdout: O; + stderr: E; + readonly stdio: [ + I, + O, + E, + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + interface MessageOptions { + keepOpen?: boolean | undefined; + } + type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit'; + type StdioOptions = IOType | Array; + type SerializationType = 'json' | 'advanced'; + interface MessagingOptions extends Abortable { + /** + * Specify the kind of serialization used for sending messages between processes. + * @default 'json' + */ + serialization?: SerializationType | undefined; + /** + * The signal value to be used when the spawned process will be killed by the abort signal. + * @default 'SIGTERM' + */ + killSignal?: NodeJS.Signals | number | undefined; + /** + * In milliseconds the maximum amount of time the process is allowed to run. + */ + timeout?: number | undefined; + } + interface ProcessEnvOptions { + uid?: number | undefined; + gid?: number | undefined; + cwd?: string | URL | undefined; + env?: NodeJS.ProcessEnv | undefined; + } + interface CommonOptions extends ProcessEnvOptions { + /** + * @default false + */ + windowsHide?: boolean | undefined; + /** + * @default 0 + */ + timeout?: number | undefined; + } + interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { + argv0?: string | undefined; + stdio?: StdioOptions | undefined; + shell?: boolean | string | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + interface SpawnOptions extends CommonSpawnOptions { + detached?: boolean | undefined; + } + interface SpawnOptionsWithoutStdio extends SpawnOptions { + stdio?: StdioPipeNamed | StdioPipe[] | undefined; + } + type StdioNull = 'inherit' | 'ignore' | Stream; + type StdioPipeNamed = 'pipe' | 'overlapped'; + type StdioPipe = undefined | null | StdioPipeNamed; + interface SpawnOptionsWithStdioTuple extends SpawnOptions { + stdio: [Stdin, Stdout, Stderr]; + } + /** + * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults + * to an empty array. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * A third argument may be used to specify additional options, with these defaults: + * + * ```js + * const defaults = { + * cwd: undefined, + * env: process.env + * }; + * ``` + * + * Use `cwd` to specify the working directory from which the process is spawned. + * If not given, the default is to inherit the current working directory. If given, + * but the path does not exist, the child process emits an `ENOENT` error + * and exits immediately. `ENOENT` is also emitted when the command + * does not exist. + * + * Use `env` to specify environment variables that will be visible to the new + * process, the default is `process.env`. + * + * `undefined` values in `env` will be ignored. + * + * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the + * exit code: + * + * ```js + * const { spawn } = require('child_process'); + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * ls.on('close', (code) => { + * console.log(`child process exited with code ${code}`); + * }); + * ``` + * + * Example: A very elaborate way to run `ps ax | grep ssh` + * + * ```js + * const { spawn } = require('child_process'); + * const ps = spawn('ps', ['ax']); + * const grep = spawn('grep', ['ssh']); + * + * ps.stdout.on('data', (data) => { + * grep.stdin.write(data); + * }); + * + * ps.stderr.on('data', (data) => { + * console.error(`ps stderr: ${data}`); + * }); + * + * ps.on('close', (code) => { + * if (code !== 0) { + * console.log(`ps process exited with code ${code}`); + * } + * grep.stdin.end(); + * }); + * + * grep.stdout.on('data', (data) => { + * console.log(data.toString()); + * }); + * + * grep.stderr.on('data', (data) => { + * console.error(`grep stderr: ${data}`); + * }); + * + * grep.on('close', (code) => { + * if (code !== 0) { + * console.log(`grep process exited with code ${code}`); + * } + * }); + * ``` + * + * Example of checking for failed `spawn`: + * + * ```js + * const { spawn } = require('child_process'); + * const subprocess = spawn('bad_command'); + * + * subprocess.on('error', (err) => { + * console.error('Failed to start subprocess.'); + * }); + * ``` + * + * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process + * title while others (Windows, SunOS) will use `command`. + * + * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent, + * retrieve it with the`process.argv0` property instead. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { spawn } = require('child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const grep = spawn('grep', ['ssh'], { signal }); + * grep.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * ``` + * @since v0.1.90 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptions): ChildProcess; + // overloads of spawn with 'args' + function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; + interface ExecOptions extends CommonOptions { + shell?: string | undefined; + signal?: AbortSignal | undefined; + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + } + interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: BufferEncoding | null; // specify `null`. + } + interface ExecException extends Error { + cmd?: string | undefined; + killed?: boolean | undefined; + code?: number | undefined; + signal?: NodeJS.Signals | undefined; + } + /** + * Spawns a shell then executes the `command` within that shell, buffering any + * generated output. The `command` string passed to the exec function is processed + * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) + * need to be dealt with accordingly: + * + * ```js + * const { exec } = require('child_process'); + * + * exec('"/path/to/test file/test.sh" arg1 arg2'); + * // Double quotes are used so that the space in the path is not interpreted as + * // a delimiter of multiple arguments. + * + * exec('echo "The \\$HOME variable is $HOME"'); + * // The $HOME variable is escaped in the first instance, but not in the second. + * ``` + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * + * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The + * `error.code` property will be + * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the + * process. + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * ```js + * const { exec } = require('child_process'); + * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { + * if (error) { + * console.error(`exec error: ${error}`); + * return; + * } + * console.log(`stdout: ${stdout}`); + * console.error(`stderr: ${stderr}`); + * }); + * ``` + * + * If `timeout` is greater than `0`, the parent will send the signal + * identified by the `killSignal` property (the default is `'SIGTERM'`) if the + * child runs longer than `timeout` milliseconds. + * + * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace + * the existing process and uses a shell to execute the command. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * const util = require('util'); + * const exec = util.promisify(require('child_process').exec); + * + * async function lsExample() { + * const { stdout, stderr } = await exec('ls'); + * console.log('stdout:', stdout); + * console.error('stderr:', stderr); + * } + * lsExample(); + * ``` + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { exec } = require('child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = exec('grep ssh', { signal }, (error) => { + * console.log(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.90 + * @param command The command to run, with space-separated arguments. + * @param callback called with the output when process terminates. + */ + function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function exec( + command: string, + options: { + encoding: 'buffer' | null; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void + ): ChildProcess; + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function exec( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function exec( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function exec( + command: string, + options: (ObjectEncodingOptions & ExecOptions) | undefined | null, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + interface PromiseWithChild extends Promise { + child: ChildProcess; + } + namespace exec { + function __promisify__(command: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: { + encoding: 'buffer' | null; + } & ExecOptions + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: ExecOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options?: (ObjectEncodingOptions & ExecOptions) | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + } + interface ExecFileOptions extends CommonOptions, Abortable { + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + windowsVerbatimArguments?: boolean | undefined; + shell?: boolean | string | undefined; + signal?: AbortSignal | undefined; + } + interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: 'buffer' | null; + } + interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + type ExecFileException = ExecException & NodeJS.ErrnoException; + /** + * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified + * executable `file` is spawned directly as a new process making it slightly more + * efficient than {@link exec}. + * + * The same options as {@link exec} are supported. Since a shell is + * not spawned, behaviors such as I/O redirection and file globbing are not + * supported. + * + * ```js + * const { execFile } = require('child_process'); + * const child = execFile('node', ['--version'], (error, stdout, stderr) => { + * if (error) { + * throw error; + * } + * console.log(stdout); + * }); + * ``` + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * const util = require('util'); + * const execFile = util.promisify(require('child_process').execFile); + * async function getVersion() { + * const { stdout } = await execFile('node', ['--version']); + * console.log(stdout); + * } + * getVersion(); + * ``` + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { execFile } = require('child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = execFile('node', ['--version'], { signal }, (error) => { + * console.log(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.91 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @param callback Called with the output when process terminates. + */ + function execFile(file: string): ChildProcess; + function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + // no `options` definitely means stdout/stderr are `string`. + function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding, + callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void + ): ChildProcess; + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding, + callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptions, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function execFile( + file: string, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null + ): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null + ): ChildProcess; + namespace execFile { + function __promisify__(file: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithBufferEncoding + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithStringEncoding + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithOtherEncoding + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + options: ExecFileOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + } + interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + execPath?: string | undefined; + execArgv?: string[] | undefined; + silent?: boolean | undefined; + stdio?: StdioOptions | undefined; + detached?: boolean | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + /** + * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. + * Like {@link spawn}, a `ChildProcess` object is returned. The + * returned `ChildProcess` will have an additional communication channel + * built-in that allows messages to be passed back and forth between the parent and + * child. See `subprocess.send()` for details. + * + * Keep in mind that spawned Node.js child processes are + * independent of the parent with exception of the IPC communication channel + * that is established between the two. Each process has its own memory, with + * their own V8 instances. Because of the additional resource allocations + * required, spawning a large number of child Node.js processes is not + * recommended. + * + * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative + * execution path to be used. + * + * Node.js processes launched with a custom `execPath` will communicate with the + * parent process using the file descriptor (fd) identified using the + * environment variable `NODE_CHANNEL_FD` on the child process. + * + * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the + * current process. + * + * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * if (process.argv[2] === 'child') { + * setTimeout(() => { + * console.log(`Hello from ${process.argv[2]}!`); + * }, 1_000); + * } else { + * const { fork } = require('child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = fork(__filename, ['child'], { signal }); + * child.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * } + * ``` + * @since v0.5.0 + * @param modulePath The module to run in the child. + * @param args List of string arguments. + */ + function fork(modulePath: string, options?: ForkOptions): ChildProcess; + function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; + interface SpawnSyncOptions extends CommonSpawnOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | 'buffer' | null | undefined; + } + interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding?: 'buffer' | null | undefined; + } + interface SpawnSyncReturns { + pid: number; + output: Array; + stdout: T; + stderr: T; + status: number | null; + signal: NodeJS.Signals | null; + error?: Error | undefined; + } + /** + * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the process intercepts and handles the `SIGTERM` signal + * and doesn't exit, the parent process will wait until the child process has + * exited. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawnSync(command: string): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; + interface CommonExecOptions extends CommonOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + stdio?: StdioOptions | undefined; + killSignal?: NodeJS.Signals | number | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | 'buffer' | null | undefined; + } + interface ExecSyncOptions extends CommonExecOptions { + shell?: string | undefined; + } + interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding?: 'buffer' | null | undefined; + } + /** + * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process + * has exited. + * + * If the process times out or has a non-zero exit code, this method will throw. + * The `Error` object will contain the entire result from {@link spawnSync}. + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @return The stdout from the command. + */ + function execSync(command: string): Buffer; + function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; + function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; + function execSync(command: string, options?: ExecSyncOptions): string | Buffer; + interface ExecFileSyncOptions extends CommonExecOptions { + shell?: boolean | string | undefined; + } + interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding?: 'buffer' | null; // specify `null`. + } + /** + * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not + * return until the child process has fully closed. When a timeout has been + * encountered and `killSignal` is sent, the method won't return until the process + * has completely exited. + * + * If the child process intercepts and handles the `SIGTERM` signal and + * does not exit, the parent process will still wait until the child process has + * exited. + * + * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @return The stdout from the command. + */ + function execFileSync(file: string): Buffer; + function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; + function execFileSync(file: string, args: ReadonlyArray): Buffer; + function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): string | Buffer; +} +declare module 'node:child_process' { + export * from 'child_process'; +} diff --git a/server/node_modules/@types/node/ts4.8/cluster.d.ts b/server/node_modules/@types/node/ts4.8/cluster.d.ts new file mode 100755 index 0000000000..37dbc57461 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/cluster.d.ts @@ -0,0 +1,410 @@ +/** + * Clusters of Node.js processes can be used to run multiple instances of Node.js + * that can distribute workloads among their application threads. When process + * isolation is not needed, use the `worker_threads` module instead, which + * allows running multiple application threads within a single Node.js instance. + * + * The cluster module allows easy creation of child processes that all share + * server ports. + * + * ```js + * import cluster from 'cluster'; + * import http from 'http'; + * import { cpus } from 'os'; + * import process from 'process'; + * + * const numCPUs = cpus().length; + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('exit', (worker, code, signal) => { + * console.log(`worker ${worker.process.pid} died`); + * }); + * } else { + * // Workers can share any TCP connection + * // In this case it is an HTTP server + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * + * console.log(`Worker ${process.pid} started`); + * } + * ``` + * + * Running Node.js will now share port 8000 between the workers: + * + * ```console + * $ node server.js + * Primary 3596 is running + * Worker 4324 started + * Worker 4520 started + * Worker 6056 started + * Worker 5644 started + * ``` + * + * On Windows, it is not yet possible to set up a named pipe server in a worker. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/cluster.js) + */ +declare module 'cluster' { + import * as child from 'node:child_process'; + import EventEmitter = require('node:events'); + import * as net from 'node:net'; + export interface ClusterSettings { + execArgv?: string[] | undefined; // default: process.execArgv + exec?: string | undefined; + args?: string[] | undefined; + silent?: boolean | undefined; + stdio?: any[] | undefined; + uid?: number | undefined; + gid?: number | undefined; + inspectPort?: number | (() => number) | undefined; + } + export interface Address { + address: string; + port: number; + addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6" + } + /** + * A `Worker` object contains all public information and method about a worker. + * In the primary it can be obtained using `cluster.workers`. In a worker + * it can be obtained using `cluster.worker`. + * @since v0.7.0 + */ + export class Worker extends EventEmitter { + /** + * Each new worker is given its own unique id, this id is stored in the`id`. + * + * While a worker is alive, this is the key that indexes it in`cluster.workers`. + * @since v0.8.0 + */ + id: number; + /** + * All workers are created using `child_process.fork()`, the returned object + * from this function is stored as `.process`. In a worker, the global `process`is stored. + * + * See: `Child Process module`. + * + * Workers will call `process.exit(0)` if the `'disconnect'` event occurs + * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against + * accidental disconnection. + * @since v0.7.0 + */ + process: child.ChildProcess; + /** + * Send a message to a worker or primary, optionally with a handle. + * + * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. + * + * In a worker, this sends a message to the primary. It is identical to`process.send()`. + * + * This example will echo back all messages from the primary: + * + * ```js + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * worker.send('hi there'); + * + * } else if (cluster.isWorker) { + * process.on('message', (msg) => { + * process.send(msg); + * }); + * } + * ``` + * @since v0.7.0 + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; + send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean; + send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean; + /** + * This function will kill the worker. In the primary worker, it does this by + * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. + * + * The `kill()` function kills the worker process without waiting for a graceful + * disconnect, it has the same behavior as `worker.process.kill()`. + * + * This method is aliased as `worker.destroy()` for backwards compatibility. + * + * In a worker, `process.kill()` exists, but it is not this function; + * it is `kill()`. + * @since v0.9.12 + * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. + */ + kill(signal?: string): void; + destroy(signal?: string): void; + /** + * In a worker, this function will close all servers, wait for the `'close'` event + * on those servers, and then disconnect the IPC channel. + * + * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. + * + * Causes `.exitedAfterDisconnect` to be set. + * + * After a server is closed, it will no longer accept new connections, + * but connections may be accepted by any other listening worker. Existing + * connections will be allowed to close as usual. When no more connections exist, + * see `server.close()`, the IPC channel to the worker will close allowing it + * to die gracefully. + * + * The above applies _only_ to server connections, client connections are not + * automatically closed by workers, and disconnect does not wait for them to close + * before exiting. + * + * In a worker, `process.disconnect` exists, but it is not this function; + * it is `disconnect()`. + * + * Because long living server connections may block workers from disconnecting, it + * may be useful to send a message, so application specific actions may be taken to + * close them. It also may be useful to implement a timeout, killing a worker if + * the `'disconnect'` event has not been emitted after some time. + * + * ```js + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * let timeout; + * + * worker.on('listening', (address) => { + * worker.send('shutdown'); + * worker.disconnect(); + * timeout = setTimeout(() => { + * worker.kill(); + * }, 2000); + * }); + * + * worker.on('disconnect', () => { + * clearTimeout(timeout); + * }); + * + * } else if (cluster.isWorker) { + * const net = require('net'); + * const server = net.createServer((socket) => { + * // Connections never end + * }); + * + * server.listen(8000); + * + * process.on('message', (msg) => { + * if (msg === 'shutdown') { + * // Initiate graceful close of any connections to server + * } + * }); + * } + * ``` + * @since v0.7.7 + * @return A reference to `worker`. + */ + disconnect(): void; + /** + * This function returns `true` if the worker is connected to its primary via its + * IPC channel, `false` otherwise. A worker is connected to its primary after it + * has been created. It is disconnected after the `'disconnect'` event is emitted. + * @since v0.11.14 + */ + isConnected(): boolean; + /** + * This function returns `true` if the worker's process has terminated (either + * because of exiting or being signaled). Otherwise, it returns `false`. + * + * ```js + * import cluster from 'cluster'; + * import http from 'http'; + * import { cpus } from 'os'; + * import process from 'process'; + * + * const numCPUs = cpus().length; + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('fork', (worker) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * + * cluster.on('exit', (worker, code, signal) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * } else { + * // Workers can share any TCP connection. In this case, it is an HTTP server. + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end(`Current process\n ${process.pid}`); + * process.kill(process.pid); + * }).listen(8000); + * } + * ``` + * @since v0.11.14 + */ + isDead(): boolean; + /** + * This property is `true` if the worker exited due to `.disconnect()`. + * If the worker exited any other way, it is `false`. If the + * worker has not exited, it is `undefined`. + * + * The boolean `worker.exitedAfterDisconnect` allows distinguishing between + * voluntary and accidental exit, the primary may choose not to respawn a worker + * based on this value. + * + * ```js + * cluster.on('exit', (worker, code, signal) => { + * if (worker.exitedAfterDisconnect === true) { + * console.log('Oh, it was just voluntary – no need to worry'); + * } + * }); + * + * // kill worker + * worker.kill(); + * ``` + * @since v6.0.0 + */ + exitedAfterDisconnect: boolean; + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'disconnect', listener: () => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'exit', listener: (code: number, signal: string) => void): this; + addListener(event: 'listening', listener: (address: Address) => void): this; + addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: 'online', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'error', error: Error): boolean; + emit(event: 'exit', code: number, signal: string): boolean; + emit(event: 'listening', address: Address): boolean; + emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean; + emit(event: 'online'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'disconnect', listener: () => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'exit', listener: (code: number, signal: string) => void): this; + on(event: 'listening', listener: (address: Address) => void): this; + on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: 'online', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'disconnect', listener: () => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'exit', listener: (code: number, signal: string) => void): this; + once(event: 'listening', listener: (address: Address) => void): this; + once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: 'online', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'disconnect', listener: () => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'exit', listener: (code: number, signal: string) => void): this; + prependListener(event: 'listening', listener: (address: Address) => void): this; + prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: 'online', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'disconnect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this; + prependOnceListener(event: 'listening', listener: (address: Address) => void): this; + prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: 'online', listener: () => void): this; + } + export interface Cluster extends EventEmitter { + disconnect(callback?: () => void): void; + fork(env?: any): Worker; + /** @deprecated since v16.0.0 - use isPrimary. */ + readonly isMaster: boolean; + readonly isPrimary: boolean; + readonly isWorker: boolean; + schedulingPolicy: number; + readonly settings: ClusterSettings; + /** @deprecated since v16.0.0 - use setupPrimary. */ + setupMaster(settings?: ClusterSettings): void; + /** + * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. + */ + setupPrimary(settings?: ClusterSettings): void; + readonly worker?: Worker | undefined; + readonly workers?: NodeJS.Dict | undefined; + readonly SCHED_NONE: number; + readonly SCHED_RR: number; + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'disconnect', listener: (worker: Worker) => void): this; + addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: 'fork', listener: (worker: Worker) => void): this; + addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: 'online', listener: (worker: Worker) => void): this; + addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'disconnect', worker: Worker): boolean; + emit(event: 'exit', worker: Worker, code: number, signal: string): boolean; + emit(event: 'fork', worker: Worker): boolean; + emit(event: 'listening', worker: Worker, address: Address): boolean; + emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + emit(event: 'online', worker: Worker): boolean; + emit(event: 'setup', settings: ClusterSettings): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'disconnect', listener: (worker: Worker) => void): this; + on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: 'fork', listener: (worker: Worker) => void): this; + on(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: 'online', listener: (worker: Worker) => void): this; + on(event: 'setup', listener: (settings: ClusterSettings) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'disconnect', listener: (worker: Worker) => void): this; + once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: 'fork', listener: (worker: Worker) => void): this; + once(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: 'online', listener: (worker: Worker) => void): this; + once(event: 'setup', listener: (settings: ClusterSettings) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'disconnect', listener: (worker: Worker) => void): this; + prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: 'fork', listener: (worker: Worker) => void): this; + prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this; + prependListener(event: 'online', listener: (worker: Worker) => void): this; + prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; + prependOnceListener(event: 'online', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + } + const cluster: Cluster; + export default cluster; +} +declare module 'node:cluster' { + export * from 'cluster'; + export { default as default } from 'cluster'; +} diff --git a/server/node_modules/@types/node/ts4.8/console.d.ts b/server/node_modules/@types/node/ts4.8/console.d.ts new file mode 100755 index 0000000000..16c9137adf --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/console.d.ts @@ -0,0 +1,412 @@ +/** + * The `console` module provides a simple debugging console that is similar to the + * JavaScript console mechanism provided by web browsers. + * + * The module exports two specific components: + * + * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. + * + * _**Warning**_: The global console object's methods are neither consistently + * synchronous like the browser APIs they resemble, nor are they consistently + * asynchronous like all other Node.js streams. See the `note on process I/O` for + * more information. + * + * Example using the global `console`: + * + * ```js + * console.log('hello world'); + * // Prints: hello world, to stdout + * console.log('hello %s', 'world'); + * // Prints: hello world, to stdout + * console.error(new Error('Whoops, something bad happened')); + * // Prints error message and stack trace to stderr: + * // Error: Whoops, something bad happened + * // at [eval]:5:15 + * // at Script.runInThisContext (node:vm:132:18) + * // at Object.runInThisContext (node:vm:309:38) + * // at node:internal/process/execution:77:19 + * // at [eval]-wrapper:6:22 + * // at evalScript (node:internal/process/execution:76:60) + * // at node:internal/main/eval_string:23:3 + * + * const name = 'Will Robinson'; + * console.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to stderr + * ``` + * + * Example using the `Console` class: + * + * ```js + * const out = getStreamSomehow(); + * const err = getStreamSomehow(); + * const myConsole = new console.Console(out, err); + * + * myConsole.log('hello world'); + * // Prints: hello world, to out + * myConsole.log('hello %s', 'world'); + * // Prints: hello world, to out + * myConsole.error(new Error('Whoops, something bad happened')); + * // Prints: [Error: Whoops, something bad happened], to err + * + * const name = 'Will Robinson'; + * myConsole.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to err + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/console.js) + */ +declare module 'console' { + import console = require('node:console'); + export = console; +} +declare module 'node:console' { + import { InspectOptions } from 'node:util'; + global { + // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build + interface Console { + Console: console.ConsoleConstructor; + /** + * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only + * writes a message and does not otherwise affect execution. The output always + * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. + * + * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. + * + * ```js + * console.assert(true, 'does nothing'); + * + * console.assert(false, 'Whoops %s work', 'didn\'t'); + * // Assertion failed: Whoops didn't work + * + * console.assert(); + * // Assertion failed + * ``` + * @since v0.1.101 + * @param value The value tested for being truthy. + * @param message All arguments besides `value` are used as error message. + */ + assert(value: any, message?: string, ...optionalParams: any[]): void; + /** + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the + * TTY. When `stdout` is not a TTY, this method does nothing. + * + * The specific operation of `console.clear()` can vary across operating systems + * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the + * current terminal viewport for the Node.js + * binary. + * @since v8.3.0 + */ + clear(): void; + /** + * Maintains an internal counter specific to `label` and outputs to `stdout` the + * number of times `console.count()` has been called with the given `label`. + * + * ```js + * > console.count() + * default: 1 + * undefined + * > console.count('default') + * default: 2 + * undefined + * > console.count('abc') + * abc: 1 + * undefined + * > console.count('xyz') + * xyz: 1 + * undefined + * > console.count('abc') + * abc: 2 + * undefined + * > console.count() + * default: 3 + * undefined + * > + * ``` + * @since v8.3.0 + * @param label The display label for the counter. + */ + count(label?: string): void; + /** + * Resets the internal counter specific to `label`. + * + * ```js + * > console.count('abc'); + * abc: 1 + * undefined + * > console.countReset('abc'); + * undefined + * > console.count('abc'); + * abc: 1 + * undefined + * > + * ``` + * @since v8.3.0 + * @param label The display label for the counter. + */ + countReset(label?: string): void; + /** + * The `console.debug()` function is an alias for {@link log}. + * @since v8.0.0 + */ + debug(message?: any, ...optionalParams: any[]): void; + /** + * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. + * This function bypasses any custom `inspect()` function defined on `obj`. + * @since v0.1.101 + */ + dir(obj: any, options?: InspectOptions): void; + /** + * This method calls `console.log()` passing it the arguments received. + * This method does not produce any XML formatting. + * @since v8.0.0 + */ + dirxml(...data: any[]): void; + /** + * Prints to `stderr` with newline. Multiple arguments can be passed, with the + * first used as the primary message and all additional used as substitution + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * + * ```js + * const code = 5; + * console.error('error #%d', code); + * // Prints: error #5, to stderr + * console.error('error', code); + * // Prints: error 5, to stderr + * ``` + * + * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string + * values are concatenated. See `util.format()` for more information. + * @since v0.1.100 + */ + error(message?: any, ...optionalParams: any[]): void; + /** + * Increases indentation of subsequent lines by spaces for `groupIndentation`length. + * + * If one or more `label`s are provided, those are printed first without the + * additional indentation. + * @since v8.5.0 + */ + group(...label: any[]): void; + /** + * An alias for {@link group}. + * @since v8.5.0 + */ + groupCollapsed(...label: any[]): void; + /** + * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. + * @since v8.5.0 + */ + groupEnd(): void; + /** + * The `console.info()` function is an alias for {@link log}. + * @since v0.1.100 + */ + info(message?: any, ...optionalParams: any[]): void; + /** + * Prints to `stdout` with newline. Multiple arguments can be passed, with the + * first used as the primary message and all additional used as substitution + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * + * ```js + * const count = 5; + * console.log('count: %d', count); + * // Prints: count: 5, to stdout + * console.log('count:', count); + * // Prints: count: 5, to stdout + * ``` + * + * See `util.format()` for more information. + * @since v0.1.100 + */ + log(message?: any, ...optionalParams: any[]): void; + /** + * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just + * logging the argument if it can’t be parsed as tabular. + * + * ```js + * // These can't be parsed as tabular data + * console.table(Symbol()); + * // Symbol() + * + * console.table(undefined); + * // undefined + * + * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); + * // ┌─────────┬─────┬─────┐ + * // │ (index) │ a │ b │ + * // ├─────────┼─────┼─────┤ + * // │ 0 │ 1 │ 'Y' │ + * // │ 1 │ 'Z' │ 2 │ + * // └─────────┴─────┴─────┘ + * + * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); + * // ┌─────────┬─────┐ + * // │ (index) │ a │ + * // ├─────────┼─────┤ + * // │ 0 │ 1 │ + * // │ 1 │ 'Z' │ + * // └─────────┴─────┘ + * ``` + * @since v10.0.0 + * @param properties Alternate properties for constructing the table. + */ + table(tabularData: any, properties?: ReadonlyArray): void; + /** + * Starts a timer that can be used to compute the duration of an operation. Timers + * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in + * suitable time units to `stdout`. For example, if the elapsed + * time is 3869ms, `console.timeEnd()` displays "3.869s". + * @since v0.1.104 + */ + time(label?: string): void; + /** + * Stops a timer that was previously started by calling {@link time} and + * prints the result to `stdout`: + * + * ```js + * console.time('100-elements'); + * for (let i = 0; i < 100; i++) {} + * console.timeEnd('100-elements'); + * // prints 100-elements: 225.438ms + * ``` + * @since v0.1.104 + */ + timeEnd(label?: string): void; + /** + * For a timer that was previously started by calling {@link time}, prints + * the elapsed time and other `data` arguments to `stdout`: + * + * ```js + * console.time('process'); + * const value = expensiveProcess1(); // Returns 42 + * console.timeLog('process', value); + * // Prints "process: 365.227ms 42". + * doExpensiveProcess2(value); + * console.timeEnd('process'); + * ``` + * @since v10.7.0 + */ + timeLog(label?: string, ...data: any[]): void; + /** + * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. + * + * ```js + * console.trace('Show me'); + * // Prints: (stack trace will vary based on where trace is called) + * // Trace: Show me + * // at repl:2:9 + * // at REPLServer.defaultEval (repl.js:248:27) + * // at bound (domain.js:287:14) + * // at REPLServer.runBound [as eval] (domain.js:300:12) + * // at REPLServer. (repl.js:412:12) + * // at emitOne (events.js:82:20) + * // at REPLServer.emit (events.js:169:7) + * // at REPLServer.Interface._onLine (readline.js:210:10) + * // at REPLServer.Interface._line (readline.js:549:8) + * // at REPLServer.Interface._ttyWrite (readline.js:826:14) + * ``` + * @since v0.1.104 + */ + trace(message?: any, ...optionalParams: any[]): void; + /** + * The `console.warn()` function is an alias for {@link error}. + * @since v0.1.100 + */ + warn(message?: any, ...optionalParams: any[]): void; + // --- Inspector mode only --- + /** + * This method does not display anything unless used in the inspector. + * Starts a JavaScript CPU profile with an optional label. + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + */ + profileEnd(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Adds an event with the label `label` to the Timeline panel of the inspector. + */ + timeStamp(label?: string): void; + } + /** + * The `console` module provides a simple debugging console that is similar to the + * JavaScript console mechanism provided by web browsers. + * + * The module exports two specific components: + * + * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. + * + * _**Warning**_: The global console object's methods are neither consistently + * synchronous like the browser APIs they resemble, nor are they consistently + * asynchronous like all other Node.js streams. See the `note on process I/O` for + * more information. + * + * Example using the global `console`: + * + * ```js + * console.log('hello world'); + * // Prints: hello world, to stdout + * console.log('hello %s', 'world'); + * // Prints: hello world, to stdout + * console.error(new Error('Whoops, something bad happened')); + * // Prints error message and stack trace to stderr: + * // Error: Whoops, something bad happened + * // at [eval]:5:15 + * // at Script.runInThisContext (node:vm:132:18) + * // at Object.runInThisContext (node:vm:309:38) + * // at node:internal/process/execution:77:19 + * // at [eval]-wrapper:6:22 + * // at evalScript (node:internal/process/execution:76:60) + * // at node:internal/main/eval_string:23:3 + * + * const name = 'Will Robinson'; + * console.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to stderr + * ``` + * + * Example using the `Console` class: + * + * ```js + * const out = getStreamSomehow(); + * const err = getStreamSomehow(); + * const myConsole = new console.Console(out, err); + * + * myConsole.log('hello world'); + * // Prints: hello world, to out + * myConsole.log('hello %s', 'world'); + * // Prints: hello world, to out + * myConsole.error(new Error('Whoops, something bad happened')); + * // Prints: [Error: Whoops, something bad happened], to err + * + * const name = 'Will Robinson'; + * myConsole.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to err + * ``` + * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) + */ + namespace console { + interface ConsoleConstructorOptions { + stdout: NodeJS.WritableStream; + stderr?: NodeJS.WritableStream | undefined; + ignoreErrors?: boolean | undefined; + colorMode?: boolean | 'auto' | undefined; + inspectOptions?: InspectOptions | undefined; + /** + * Set group indentation + * @default 2 + */ + groupIndentation?: number | undefined; + } + interface ConsoleConstructor { + prototype: Console; + new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; + new (options: ConsoleConstructorOptions): Console; + } + } + var console: Console; + } + export = globalThis.console; +} diff --git a/server/node_modules/@types/node/ts4.8/constants.d.ts b/server/node_modules/@types/node/ts4.8/constants.d.ts new file mode 100755 index 0000000000..208020dcba --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/constants.d.ts @@ -0,0 +1,18 @@ +/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ +declare module 'constants' { + import { constants as osConstants, SignalConstants } from 'node:os'; + import { constants as cryptoConstants } from 'node:crypto'; + import { constants as fsConstants } from 'node:fs'; + + const exp: typeof osConstants.errno & + typeof osConstants.priority & + SignalConstants & + typeof cryptoConstants & + typeof fsConstants; + export = exp; +} + +declare module 'node:constants' { + import constants = require('constants'); + export = constants; +} diff --git a/server/node_modules/@types/node/ts4.8/crypto.d.ts b/server/node_modules/@types/node/ts4.8/crypto.d.ts new file mode 100755 index 0000000000..20d960cd6d --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/crypto.d.ts @@ -0,0 +1,3964 @@ +/** + * The `crypto` module provides cryptographic functionality that includes a set of + * wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. + * + * ```js + * const { createHmac } = await import('crypto'); + * + * const secret = 'abcdefg'; + * const hash = createHmac('sha256', secret) + * .update('I love cupcakes') + * .digest('hex'); + * console.log(hash); + * // Prints: + * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/crypto.js) + */ +declare module 'crypto' { + import * as stream from 'node:stream'; + import { PeerCertificate } from 'node:tls'; + /** + * SPKAC is a Certificate Signing Request mechanism originally implemented by + * Netscape and was specified formally as part of [HTML5's `keygen` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen). + * + * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects + * should not use this element anymore. + * + * The `crypto` module provides the `Certificate` class for working with SPKAC + * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC + * implementation](https://www.openssl.org/docs/man1.1.0/apps/openssl-spkac.html) internally. + * @since v0.11.8 + */ + class Certificate { + /** + * ```js + * const { Certificate } = await import('crypto'); + * const spkac = getSpkacSomehow(); + * const challenge = Certificate.exportChallenge(spkac); + * console.log(challenge.toString('utf8')); + * // Prints: the challenge as a UTF8 string + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportChallenge(spkac: BinaryLike): Buffer; + /** + * ```js + * const { Certificate } = await import('crypto'); + * const spkac = getSpkacSomehow(); + * const publicKey = Certificate.exportPublicKey(spkac); + * console.log(publicKey); + * // Prints: the public key as + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * ```js + * import { Buffer } from 'buffer'; + * const { Certificate } = await import('crypto'); + * + * const spkac = getSpkacSomehow(); + * console.log(Certificate.verifySpkac(Buffer.from(spkac))); + * // Prints: true or false + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return `true` if the given `spkac` data structure is valid, `false` otherwise. + */ + static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + /** + * @deprecated + * @param spkac + * @returns The challenge component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportChallenge(spkac: BinaryLike): Buffer; + /** + * @deprecated + * @param spkac + * @param encoding The encoding of the spkac string. + * @returns The public key component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * @deprecated + * @param spkac + * @returns `true` if the given `spkac` data structure is valid, + * `false` otherwise. + */ + verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + } + namespace constants { + // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants + const OPENSSL_VERSION_NUMBER: number; + /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ + const SSL_OP_ALL: number; + /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_CIPHER_SERVER_PREFERENCE: number; + /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ + const SSL_OP_CISCO_ANYCONNECT: number; + /** Instructs OpenSSL to turn on cookie exchange. */ + const SSL_OP_COOKIE_EXCHANGE: number; + /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ + const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ + const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */ + const SSL_OP_EPHEMERAL_RSA: number; + /** Allows initial connection to servers that do not support RI. */ + const SSL_OP_LEGACY_SERVER_CONNECT: number; + const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + const SSL_OP_MICROSOFT_SESS_ID_BUG: number; + /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */ + const SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + const SSL_OP_NETSCAPE_CA_DN_BUG: number; + const SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + /** Instructs OpenSSL to disable support for SSL/TLS compression. */ + const SSL_OP_NO_COMPRESSION: number; + const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to always start a new session when performing renegotiation. */ + const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + const SSL_OP_NO_SSLv2: number; + const SSL_OP_NO_SSLv3: number; + const SSL_OP_NO_TICKET: number; + const SSL_OP_NO_TLSv1: number; + const SSL_OP_NO_TLSv1_1: number; + const SSL_OP_NO_TLSv1_2: number; + const SSL_OP_PKCS1_CHECK_1: number; + const SSL_OP_PKCS1_CHECK_2: number; + /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */ + const SSL_OP_SINGLE_DH_USE: number; + /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */ + const SSL_OP_SINGLE_ECDH_USE: number; + const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + const SSL_OP_TLS_BLOCK_PADDING_BUG: number; + const SSL_OP_TLS_D5_BUG: number; + /** Instructs OpenSSL to disable version rollback attack detection. */ + const SSL_OP_TLS_ROLLBACK_BUG: number; + const ENGINE_METHOD_RSA: number; + const ENGINE_METHOD_DSA: number; + const ENGINE_METHOD_DH: number; + const ENGINE_METHOD_RAND: number; + const ENGINE_METHOD_EC: number; + const ENGINE_METHOD_CIPHERS: number; + const ENGINE_METHOD_DIGESTS: number; + const ENGINE_METHOD_PKEY_METHS: number; + const ENGINE_METHOD_PKEY_ASN1_METHS: number; + const ENGINE_METHOD_ALL: number; + const ENGINE_METHOD_NONE: number; + const DH_CHECK_P_NOT_SAFE_PRIME: number; + const DH_CHECK_P_NOT_PRIME: number; + const DH_UNABLE_TO_CHECK_GENERATOR: number; + const DH_NOT_SUITABLE_GENERATOR: number; + const ALPN_ENABLED: number; + const RSA_PKCS1_PADDING: number; + const RSA_SSLV23_PADDING: number; + const RSA_NO_PADDING: number; + const RSA_PKCS1_OAEP_PADDING: number; + const RSA_X931_PADDING: number; + const RSA_PKCS1_PSS_PADDING: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ + const RSA_PSS_SALTLEN_DIGEST: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ + const RSA_PSS_SALTLEN_MAX_SIGN: number; + /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ + const RSA_PSS_SALTLEN_AUTO: number; + const POINT_CONVERSION_COMPRESSED: number; + const POINT_CONVERSION_UNCOMPRESSED: number; + const POINT_CONVERSION_HYBRID: number; + /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ + const defaultCoreCipherList: string; + /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ + const defaultCipherList: string; + } + interface HashOptions extends stream.TransformOptions { + /** + * For XOF hash functions such as `shake256`, the + * outputLength option can be used to specify the desired output length in bytes. + */ + outputLength?: number | undefined; + } + /** @deprecated since v10.0.0 */ + const fips: boolean; + /** + * Creates and returns a `Hash` object that can be used to generate hash digests + * using the given `algorithm`. Optional `options` argument controls stream + * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option + * can be used to specify the desired output length in bytes. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * Example: generating the sha256 sum of a file + * + * ```js + * import { + * createReadStream + * } from 'fs'; + * import { argv } from 'process'; + * const { + * createHash + * } = await import('crypto'); + * + * const filename = argv[2]; + * + * const hash = createHash('sha256'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hash.update(data); + * else { + * console.log(`${hash.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.92 + * @param options `stream.transform` options + */ + function createHash(algorithm: string, options?: HashOptions): Hash; + /** + * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. + * Optional `options` argument controls stream behavior. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is + * a `KeyObject`, its type must be `secret`. + * + * Example: generating the sha256 HMAC of a file + * + * ```js + * import { + * createReadStream + * } from 'fs'; + * import { argv } from 'process'; + * const { + * createHmac + * } = await import('crypto'); + * + * const filename = argv[2]; + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hmac.update(data); + * else { + * console.log(`${hmac.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; + // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings + type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'; + type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1'; + type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2'; + type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; + type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'; + /** + * The `Hash` class is a utility for creating hash digests of data. It can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed hash digest on the readable side, or + * * Using the `hash.update()` and `hash.digest()` methods to produce the + * computed hash. + * + * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hash` objects as streams: + * + * ```js + * const { + * createHash + * } = await import('crypto'); + * + * const hash = createHash('sha256'); + * + * hash.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hash.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * } + * }); + * + * hash.write('some data to hash'); + * hash.end(); + * ``` + * + * Example: Using `Hash` and piped streams: + * + * ```js + * import { createReadStream } from 'fs'; + * import { stdout } from 'process'; + * const { createHash } = await import('crypto'); + * + * const hash = createHash('sha256'); + * + * const input = createReadStream('test.js'); + * input.pipe(hash).setEncoding('hex').pipe(stdout); + * ``` + * + * Example: Using the `hash.update()` and `hash.digest()` methods: + * + * ```js + * const { + * createHash + * } = await import('crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('some data to hash'); + * console.log(hash.digest('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * ``` + * @since v0.1.92 + */ + class Hash extends stream.Transform { + private constructor(); + /** + * Creates a new `Hash` object that contains a deep copy of the internal state + * of the current `Hash` object. + * + * The optional `options` argument controls stream behavior. For XOF hash + * functions such as `'shake256'`, the `outputLength` option can be used to + * specify the desired output length in bytes. + * + * An error is thrown when an attempt is made to copy the `Hash` object after + * its `hash.digest()` method has been called. + * + * ```js + * // Calculate a rolling hash. + * const { + * createHash + * } = await import('crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('one'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('two'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('three'); + * console.log(hash.copy().digest('hex')); + * + * // Etc. + * ``` + * @since v13.1.0 + * @param options `stream.transform` options + */ + copy(options?: stream.TransformOptions): Hash; + /** + * Updates the hash content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hash; + update(data: string, inputEncoding: Encoding): Hash; + /** + * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). + * If `encoding` is provided a string will be returned; otherwise + * a `Buffer` is returned. + * + * The `Hash` object can not be used again after `hash.digest()` method has been + * called. Multiple calls will cause an error to be thrown. + * @since v0.1.92 + * @param encoding The `encoding` of the return value. + */ + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + /** + * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can + * be used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed HMAC digest on the readable side, or + * * Using the `hmac.update()` and `hmac.digest()` methods to produce the + * computed HMAC digest. + * + * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hmac` objects as streams: + * + * ```js + * const { + * createHmac + * } = await import('crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hmac.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * } + * }); + * + * hmac.write('some data to hash'); + * hmac.end(); + * ``` + * + * Example: Using `Hmac` and piped streams: + * + * ```js + * import { createReadStream } from 'fs'; + * import { stdout } from 'process'; + * const { + * createHmac + * } = await import('crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream('test.js'); + * input.pipe(hmac).pipe(stdout); + * ``` + * + * Example: Using the `hmac.update()` and `hmac.digest()` methods: + * + * ```js + * const { + * createHmac + * } = await import('crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.update('some data to hash'); + * console.log(hmac.digest('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * ``` + * @since v0.1.94 + */ + class Hmac extends stream.Transform { + private constructor(); + /** + * Updates the `Hmac` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hmac; + update(data: string, inputEncoding: Encoding): Hmac; + /** + * Calculates the HMAC digest of all of the data passed using `hmac.update()`. + * If `encoding` is + * provided a string is returned; otherwise a `Buffer` is returned; + * + * The `Hmac` object can not be used again after `hmac.digest()` has been + * called. Multiple calls to `hmac.digest()` will result in an error being thrown. + * @since v0.1.94 + * @param encoding The `encoding` of the return value. + */ + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + type KeyObjectType = 'secret' | 'public' | 'private'; + interface KeyExportOptions { + type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; + format: T; + cipher?: string | undefined; + passphrase?: string | Buffer | undefined; + } + interface JwkKeyExportOptions { + format: 'jwk'; + } + interface JsonWebKey { + crv?: string | undefined; + d?: string | undefined; + dp?: string | undefined; + dq?: string | undefined; + e?: string | undefined; + k?: string | undefined; + kty?: string | undefined; + n?: string | undefined; + p?: string | undefined; + q?: string | undefined; + qi?: string | undefined; + x?: string | undefined; + y?: string | undefined; + [key: string]: unknown; + } + interface AsymmetricKeyDetails { + /** + * Key size in bits (RSA, DSA). + */ + modulusLength?: number | undefined; + /** + * Public exponent (RSA). + */ + publicExponent?: bigint | undefined; + /** + * Name of the message digest (RSA-PSS). + */ + hashAlgorithm?: string | undefined; + /** + * Name of the message digest used by MGF1 (RSA-PSS). + */ + mgf1HashAlgorithm?: string | undefined; + /** + * Minimal salt length in bytes (RSA-PSS). + */ + saltLength?: number | undefined; + /** + * Size of q in bits (DSA). + */ + divisorLength?: number | undefined; + /** + * Name of the curve (EC). + */ + namedCurve?: string | undefined; + } + /** + * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, + * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` + * objects are not to be created directly using the `new`keyword. + * + * Most applications should consider using the new `KeyObject` API instead of + * passing keys as strings or `Buffer`s due to improved security features. + * + * `KeyObject` instances can be passed to other threads via `postMessage()`. + * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to + * be listed in the `transferList` argument. + * @since v11.6.0 + */ + class KeyObject { + private constructor(); + /** + * Example: Converting a `CryptoKey` instance to a `KeyObject`: + * + * ```js + * const { webcrypto, KeyObject } = await import('crypto'); + * const { subtle } = webcrypto; + * + * const key = await subtle.generateKey({ + * name: 'HMAC', + * hash: 'SHA-256', + * length: 256 + * }, true, ['sign', 'verify']); + * + * const keyObject = KeyObject.from(key); + * console.log(keyObject.symmetricKeySize); + * // Prints: 32 (symmetric key size in bytes) + * ``` + * @since v15.0.0 + */ + static from(key: webcrypto.CryptoKey): KeyObject; + /** + * For asymmetric keys, this property represents the type of the key. Supported key + * types are: + * + * * `'rsa'` (OID 1.2.840.113549.1.1.1) + * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) + * * `'dsa'` (OID 1.2.840.10040.4.1) + * * `'ec'` (OID 1.2.840.10045.2.1) + * * `'x25519'` (OID 1.3.101.110) + * * `'x448'` (OID 1.3.101.111) + * * `'ed25519'` (OID 1.3.101.112) + * * `'ed448'` (OID 1.3.101.113) + * * `'dh'` (OID 1.2.840.113549.1.3.1) + * + * This property is `undefined` for unrecognized `KeyObject` types and symmetric + * keys. + * @since v11.6.0 + */ + asymmetricKeyType?: KeyType | undefined; + /** + * For asymmetric keys, this property represents the size of the embedded key in + * bytes. This property is `undefined` for symmetric keys. + */ + asymmetricKeySize?: number | undefined; + /** + * This property exists only on asymmetric keys. Depending on the type of the key, + * this object contains information about the key. None of the information obtained + * through this property can be used to uniquely identify a key or to compromise + * the security of the key. + * + * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, + * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be + * set. + * + * Other key details might be exposed via this API using additional attributes. + * @since v15.7.0 + */ + asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; + /** + * For symmetric keys, the following encoding options can be used: + * + * For public keys, the following encoding options can be used: + * + * For private keys, the following encoding options can be used: + * + * The result type depends on the selected encoding format, when PEM the + * result is a string, when DER it will be a buffer containing the data + * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. + * + * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are + * ignored. + * + * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of + * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be + * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for + * encrypted private keys. Since PKCS#8 defines its own + * encryption mechanism, PEM-level encryption is not supported when encrypting + * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for + * PKCS#1 and SEC1 encryption. + * @since v11.6.0 + */ + export(options: KeyExportOptions<'pem'>): string | Buffer; + export(options?: KeyExportOptions<'der'>): Buffer; + export(options?: JwkKeyExportOptions): JsonWebKey; + /** + * For secret keys, this property represents the size of the key in bytes. This + * property is `undefined` for asymmetric keys. + * @since v11.6.0 + */ + symmetricKeySize?: number | undefined; + /** + * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys + * or `'private'` for private (asymmetric) keys. + * @since v11.6.0 + */ + type: KeyObjectType; + } + type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; + type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; + type CipherOCBTypes = 'aes-128-ocb' | 'aes-192-ocb' | 'aes-256-ocb'; + type BinaryLike = string | NodeJS.ArrayBufferView; + type CipherKey = BinaryLike | KeyObject; + interface CipherCCMOptions extends stream.TransformOptions { + authTagLength: number; + } + interface CipherGCMOptions extends stream.TransformOptions { + authTagLength?: number | undefined; + } + interface CipherOCBOptions extends stream.TransformOptions { + authTagLength: number; + } + /** + * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication + * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `password` is used to derive the cipher key and initialization vector (IV). + * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. + * + * The implementation of `crypto.createCipher()` derives keys using the OpenSSL + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * iteration, and no salt. The lack of salt allows dictionary attacks as the same + * password always creates the same key. The low iteration count and + * non-cryptographically secure hash algorithm allow passwords to be tested very + * rapidly. + * + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that + * developers derive a key and IV on + * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode + * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when + * they are used in order to avoid the risk of IV reuse that causes + * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. + * @since v0.1.94 + * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. + * @param options `stream.transform` options + */ + function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; + /** + * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and + * initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication + * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a + * given IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): CipherCCM; + function createCipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): CipherOCB; + function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): CipherGCM; + function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher; + /** + * Instances of the `Cipher` class are used to encrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain unencrypted + * data is written to produce encrypted data on the readable side, or + * * Using the `cipher.update()` and `cipher.final()` methods to produce + * the encrypted data. + * + * The {@link createCipher} or {@link createCipheriv} methods are + * used to create `Cipher` instances. `Cipher` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Cipher` objects as streams: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * // Once we have the key and iv, we can create and use the cipher... + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = ''; + * cipher.setEncoding('hex'); + * + * cipher.on('data', (chunk) => encrypted += chunk); + * cipher.on('end', () => console.log(encrypted)); + * + * cipher.write('some clear text data'); + * cipher.end(); + * }); + * }); + * ``` + * + * Example: Using `Cipher` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'fs'; + * + * import { + * pipeline + * } from 'stream'; + * + * const { + * scrypt, + * randomFill, + * createCipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.js'); + * const output = createWriteStream('test.enc'); + * + * pipeline(input, cipher, output, (err) => { + * if (err) throw err; + * }); + * }); + * }); + * ``` + * + * Example: Using the `cipher.update()` and `cipher.final()` methods: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); + * encrypted += cipher.final('hex'); + * console.log(encrypted); + * }); + * }); + * ``` + * @since v0.1.94 + */ + class Cipher extends stream.Transform { + private constructor(); + /** + * Updates the cipher with `data`. If the `inputEncoding` argument is given, + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, + * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * + * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being + * thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the data. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: BinaryLike): Buffer; + update(data: string, inputEncoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `cipher.final()` method has been called, the `Cipher` object can no + * longer be used to encrypt data. Attempts to call `cipher.final()` more than + * once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): Buffer; + final(outputEncoding: BufferEncoding): string; + /** + * When using block encryption algorithms, the `Cipher` class will automatically + * add padding to the input data to the appropriate block size. To disable the + * default padding call `cipher.setAutoPadding(false)`. + * + * When `autoPadding` is `false`, the length of the entire input data must be a + * multiple of the cipher's block size or `cipher.final()` will throw an error. + * Disabling automatic padding is useful for non-standard padding, for instance + * using `0x0` instead of PKCS padding. + * + * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(autoPadding?: boolean): this; + } + interface CipherCCM extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + interface CipherGCM extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + interface CipherOCB extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + /** + * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * iteration, and no salt. The lack of salt allows dictionary attacks as the same + * password always creates the same key. The low iteration count and + * non-cryptographically secure hash algorithm allow passwords to be tested very + * rapidly. + * + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that + * developers derive a key and IV on + * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. + * @since v0.1.94 + * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. + * @param options `stream.transform` options + */ + function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; + /** + * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags + * to those with the specified length. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a given + * IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): DecipherCCM; + function createDecipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): DecipherOCB; + function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; + /** + * Instances of the `Decipher` class are used to decrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain encrypted + * data is written to produce unencrypted data on the readable side, or + * * Using the `decipher.update()` and `decipher.final()` methods to + * produce the unencrypted data. + * + * The {@link createDecipher} or {@link createDecipheriv} methods are + * used to create `Decipher` instances. `Decipher` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Decipher` objects as streams: + * + * ```js + * import { Buffer } from 'buffer'; + * const { + * scryptSync, + * createDecipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Key length is dependent on the algorithm. In this case for aes192, it is + * // 24 bytes (192 bits). + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * let decrypted = ''; + * decipher.on('readable', () => { + * while (null !== (chunk = decipher.read())) { + * decrypted += chunk.toString('utf8'); + * } + * }); + * decipher.on('end', () => { + * console.log(decrypted); + * // Prints: some clear text data + * }); + * + * // Encrypted with same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * decipher.write(encrypted, 'hex'); + * decipher.end(); + * ``` + * + * Example: Using `Decipher` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'fs'; + * import { Buffer } from 'buffer'; + * const { + * scryptSync, + * createDecipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.enc'); + * const output = createWriteStream('test.js'); + * + * input.pipe(decipher).pipe(output); + * ``` + * + * Example: Using the `decipher.update()` and `decipher.final()` methods: + * + * ```js + * import { Buffer } from 'buffer'; + * const { + * scryptSync, + * createDecipheriv + * } = await import('crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * // Encrypted using same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); + * decrypted += decipher.final('utf8'); + * console.log(decrypted); + * // Prints: some clear text data + * ``` + * @since v0.1.94 + */ + class Decipher extends stream.Transform { + private constructor(); + /** + * Updates the decipher with `data`. If the `inputEncoding` argument is given, + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is + * ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * + * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error + * being thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: NodeJS.ArrayBufferView): Buffer; + update(data: string, inputEncoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `decipher.final()` method has been called, the `Decipher` object can + * no longer be used to decrypt data. Attempts to call `decipher.final()` more + * than once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): Buffer; + final(outputEncoding: BufferEncoding): string; + /** + * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and + * removing padding. + * + * Turning auto padding off will only work if the input data's length is a + * multiple of the ciphers block size. + * + * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(auto_padding?: boolean): this; + } + interface DecipherCCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + } + ): this; + } + interface DecipherGCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + } + interface DecipherOCB extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + } + interface PrivateKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; + passphrase?: string | Buffer | undefined; + } + interface PublicKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: 'pkcs1' | 'spki' | undefined; + } + /** + * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKey + * } = await import('crypto'); + * + * generateKey('hmac', { length: 64 }, (err, key) => { + * if (err) throw err; + * console.log(key.export().toString('hex')); // 46e..........620 + * }); + * ``` + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKey( + type: 'hmac' | 'aes', + options: { + length: number; + }, + callback: (err: Error | null, key: KeyObject) => void + ): void; + /** + * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKeySync + * } = await import('crypto'); + * + * const key = generateKeySync('hmac', { length: 64 }); + * console.log(key.export().toString('hex')); // e89..........41e + * ``` + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKeySync( + type: 'hmac' | 'aes', + options: { + length: number; + } + ): KeyObject; + interface JsonWebKeyInput { + key: JsonWebKey; + format: 'jwk'; + } + /** + * Creates and returns a new key object containing a private key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. + * + * If the private key is encrypted, a `passphrase` must be specified. The length + * of the passphrase is limited to 1024 bytes. + * @since v11.6.0 + */ + function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a public key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; + * otherwise, `key` must be an object with the properties described above. + * + * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. + * + * Because public keys can be derived from private keys, a private key may be + * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the + * returned `KeyObject` will be `'public'` and that the private key cannot be + * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned + * and it will be impossible to extract the private key from the returned object. + * @since v11.6.0 + */ + function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a secret key for symmetric + * encryption or `Hmac`. + * @since v11.6.0 + * @param encoding The string encoding when `key` is a string. + */ + function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; + function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; + /** + * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. + * Optional `options` argument controls the `stream.Writable` behavior. + * + * In some cases, a `Sign` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + function createSign(algorithm: string, options?: stream.WritableOptions): Sign; + type DSAEncoding = 'der' | 'ieee-p1363'; + interface SigningOptions { + /** + * @See crypto.constants.RSA_PKCS1_PADDING + */ + padding?: number | undefined; + saltLength?: number | undefined; + dsaEncoding?: DSAEncoding | undefined; + } + interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} + interface SignKeyObjectInput extends SigningOptions { + key: KeyObject; + } + interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} + interface VerifyKeyObjectInput extends SigningOptions { + key: KeyObject; + } + type KeyLike = string | Buffer | KeyObject; + /** + * The `Sign` class is a utility for generating signatures. It can be used in one + * of two ways: + * + * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or + * * Using the `sign.update()` and `sign.sign()` methods to produce the + * signature. + * + * The {@link createSign} method is used to create `Sign` instances. The + * argument is the string name of the hash function to use. `Sign` objects are not + * to be created directly using the `new` keyword. + * + * Example: Using `Sign` and `Verify` objects as streams: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify + * } = await import('crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('ec', { + * namedCurve: 'sect239k1' + * }); + * + * const sign = createSign('SHA256'); + * sign.write('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey, 'hex'); + * + * const verify = createVerify('SHA256'); + * verify.write('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature, 'hex')); + * // Prints: true + * ``` + * + * Example: Using the `sign.update()` and `verify.update()` methods: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify + * } = await import('crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('rsa', { + * modulusLength: 2048, + * }); + * + * const sign = createSign('SHA256'); + * sign.update('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey); + * + * const verify = createVerify('SHA256'); + * verify.update('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature)); + * // Prints: true + * ``` + * @since v0.1.92 + */ + class Sign extends stream.Writable { + private constructor(); + /** + * Updates the `Sign` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): this; + update(data: string, inputEncoding: Encoding): this; + /** + * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the following additional properties can be passed: + * + * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * The `Sign` object can not be again used after `sign.sign()` method has been + * called. Multiple calls to `sign.sign()` will result in an error being thrown. + * @since v0.1.92 + */ + sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; + sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string; + } + /** + * Creates and returns a `Verify` object that uses the given algorithm. + * Use {@link getHashes} to obtain an array of names of the available + * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. + * + * In some cases, a `Verify` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; + /** + * The `Verify` class is a utility for verifying signatures. It can be used in one + * of two ways: + * + * * As a writable `stream` where written data is used to validate against the + * supplied signature, or + * * Using the `verify.update()` and `verify.verify()` methods to verify + * the signature. + * + * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. + * + * See `Sign` for examples. + * @since v0.1.92 + */ + class Verify extends stream.Writable { + private constructor(); + /** + * Updates the `Verify` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `inputEncoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Verify; + update(data: string, inputEncoding: Encoding): Verify; + /** + * Verifies the provided data using the given `object` and `signature`. + * + * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an + * object, the following additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the data, in + * the `signatureEncoding`. + * If a `signatureEncoding` is specified, the `signature` is expected to be a + * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * The `verify` object can not be used again after `verify.verify()` has been + * called. Multiple calls to `verify.verify()` will result in an error being + * thrown. + * + * Because public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.1.92 + */ + verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; + verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; + } + /** + * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an + * optional specific `generator`. + * + * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. + * + * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise + * a `Buffer`, `TypedArray`, or `DataView` is expected. + * + * If `generatorEncoding` is specified, `generator` is expected to be a string; + * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. + * @since v0.11.12 + * @param primeEncoding The `encoding` of the `prime` string. + * @param [generator=2] + * @param generatorEncoding The `encoding` of the `generator` string. + */ + function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; + function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; + function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; + /** + * The `DiffieHellman` class is a utility for creating Diffie-Hellman key + * exchanges. + * + * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. + * + * ```js + * import assert from 'assert'; + * + * const { + * createDiffieHellman + * } = await import('crypto'); + * + * // Generate Alice's keys... + * const alice = createDiffieHellman(2048); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * // OK + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * ``` + * @since v0.5.0 + */ + class DiffieHellman { + private constructor(); + /** + * Generates private and public Diffie-Hellman key values, and returns + * the public key in the specified `encoding`. This key should be + * transferred to the other party. + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using the specified `inputEncoding`, and secret is + * encoded using specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. + * @since v0.5.0 + * @param inputEncoding The `encoding` of an `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman prime in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrime(): Buffer; + getPrime(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman generator in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getGenerator(): Buffer; + getGenerator(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman public key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPublicKey(): Buffer; + getPublicKey(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman private key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected + * to be a string. If no `encoding` is provided, `publicKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * @since v0.5.0 + * @param encoding The `encoding` of the `publicKey` string. + */ + setPublicKey(publicKey: NodeJS.ArrayBufferView): void; + setPublicKey(publicKey: string, encoding: BufferEncoding): void; + /** + * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected + * to be a string. If no `encoding` is provided, `privateKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * @since v0.5.0 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BufferEncoding): void; + /** + * A bit field containing any warnings and/or errors resulting from a check + * performed during initialization of the `DiffieHellman` object. + * + * The following values are valid for this property (as defined in `constants`module): + * + * * `DH_CHECK_P_NOT_SAFE_PRIME` + * * `DH_CHECK_P_NOT_PRIME` + * * `DH_UNABLE_TO_CHECK_GENERATOR` + * * `DH_NOT_SUITABLE_GENERATOR` + * @since v0.11.12 + */ + verifyError: number; + } + /** + * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. + * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. + * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. + * + * ```js + * const { createDiffieHellmanGroup } = await import('node:crypto'); + * const dh = createDiffieHellmanGroup('modp1'); + * ``` + * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): + * ```bash + * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h + * modp1 # 768 bits + * modp2 # 1024 bits + * modp5 # 1536 bits + * modp14 # 2048 bits + * modp15 # etc. + * modp16 + * modp17 + * modp18 + * ``` + * @since v0.7.5 + */ + const DiffieHellmanGroup: DiffieHellmanGroupConstructor; + interface DiffieHellmanGroupConstructor { + new(name: string): DiffieHellmanGroup; + (name: string): DiffieHellmanGroup; + readonly prototype: DiffieHellmanGroup; + } + type DiffieHellmanGroup = Omit; + /** + * Creates a predefined `DiffieHellmanGroup` key exchange object. The + * supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`, + * `'modp18'` (defined in [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt)). The + * returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing + * the keys (with `diffieHellman.setPublicKey()`, for example). The + * advantage of using this method is that the parties do not have to + * generate nor exchange a group modulus beforehand, saving both processor + * and communication time. + * + * Example (obtaining a shared secret): + * + * ```js + * const { + * getDiffieHellman + * } = await import('crypto'); + * const alice = getDiffieHellman('modp14'); + * const bob = getDiffieHellman('modp14'); + * + * alice.generateKeys(); + * bob.generateKeys(); + * + * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); + * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); + * + * // aliceSecret and bobSecret should be the same + * console.log(aliceSecret === bobSecret); + * ``` + * @since v0.7.5 + */ + function getDiffieHellman(groupName: string): DiffieHellmanGroup; + /** + * An alias for {@link getDiffieHellman} + * @since v0.9.3 + */ + function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; + /** + * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * + * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be + * thrown if any of the input arguments specify invalid values or types. + * + * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, + * please specify a `digest` explicitly. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2 + * } = await import('crypto'); + * + * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * ``` + * + * The `crypto.DEFAULT_ENCODING` property can be used to change the way the`derivedKey` is passed to the callback. This property, however, has been + * deprecated and use should be avoided. + * + * ```js + * import crypto from 'crypto'; + * crypto.DEFAULT_ENCODING = 'hex'; + * crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey); // '3745e48...aa39b34' + * }); + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * @since v0.5.5 + */ + function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void; + /** + * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * + * If an error occurs an `Error` will be thrown, otherwise the derived key will be + * returned as a `Buffer`. + * + * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, + * please specify a `digest` explicitly. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2Sync + * } = await import('crypto'); + * + * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); + * console.log(key.toString('hex')); // '3745e48...08d59ae' + * ``` + * + * The `crypto.DEFAULT_ENCODING` property may be used to change the way the`derivedKey` is returned. This property, however, is deprecated and use + * should be avoided. + * + * ```js + * import crypto from 'crypto'; + * crypto.DEFAULT_ENCODING = 'hex'; + * const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); + * console.log(key); // '3745e48...aa39b34' + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * @since v0.9.3 + */ + function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; + /** + * Generates cryptographically strong pseudorandom data. The `size` argument + * is a number indicating the number of bytes to generate. + * + * If a `callback` function is provided, the bytes are generated asynchronously + * and the `callback` function is invoked with two arguments: `err` and `buf`. + * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. + * + * ```js + * // Asynchronous + * const { + * randomBytes + * } = await import('crypto'); + * + * randomBytes(256, (err, buf) => { + * if (err) throw err; + * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); + * }); + * ``` + * + * If the `callback` function is not provided, the random bytes are generated + * synchronously and returned as a `Buffer`. An error will be thrown if + * there is a problem generating the bytes. + * + * ```js + * // Synchronous + * const { + * randomBytes + * } = await import('crypto'); + * + * const buf = randomBytes(256); + * console.log( + * `${buf.length} bytes of random data: ${buf.toString('hex')}`); + * ``` + * + * The `crypto.randomBytes()` method will not complete until there is + * sufficient entropy available. + * This should normally never take longer than a few milliseconds. The only time + * when generating the random bytes may conceivably block for a longer period of + * time is right after boot, when the whole system is still low on entropy. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomBytes()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomBytes` requests when doing so as part of fulfilling a client + * request. + * @since v0.5.8 + * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. + * @return if the `callback` function is not provided. + */ + function randomBytes(size: number): Buffer; + function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + function pseudoRandomBytes(size: number): Buffer; + function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + /** + * Return a random integer `n` such that `min <= n < max`. This + * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). + * + * The range (`max - min`) must be less than 2^48. `min` and `max` must + * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). + * + * If the `callback` function is not provided, the random integer is + * generated synchronously. + * + * ```js + * // Asynchronous + * const { + * randomInt + * } = await import('crypto'); + * + * randomInt(3, (err, n) => { + * if (err) throw err; + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * }); + * ``` + * + * ```js + * // Synchronous + * const { + * randomInt + * } = await import('crypto'); + * + * const n = randomInt(3); + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * ``` + * + * ```js + * // With `min` argument + * const { + * randomInt + * } = await import('crypto'); + * + * const n = randomInt(1, 7); + * console.log(`The dice rolled: ${n}`); + * ``` + * @since v14.10.0, v12.19.0 + * @param [min=0] Start of random range (inclusive). + * @param max End of random range (exclusive). + * @param callback `function(err, n) {}`. + */ + function randomInt(max: number): number; + function randomInt(min: number, max: number): number; + function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; + function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; + /** + * Synchronous version of {@link randomFill}. + * + * ```js + * import { Buffer } from 'buffer'; + * const { randomFillSync } = await import('crypto'); + * + * const buf = Buffer.alloc(10); + * console.log(randomFillSync(buf).toString('hex')); + * + * randomFillSync(buf, 5); + * console.log(buf.toString('hex')); + * + * // The above is equivalent to the following: + * randomFillSync(buf, 5, 5); + * console.log(buf.toString('hex')); + * ``` + * + * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. + * + * ```js + * import { Buffer } from 'buffer'; + * const { randomFillSync } = await import('crypto'); + * + * const a = new Uint32Array(10); + * console.log(Buffer.from(randomFillSync(a).buffer, + * a.byteOffset, a.byteLength).toString('hex')); + * + * const b = new DataView(new ArrayBuffer(10)); + * console.log(Buffer.from(randomFillSync(b).buffer, + * b.byteOffset, b.byteLength).toString('hex')); + * + * const c = new ArrayBuffer(10); + * console.log(Buffer.from(randomFillSync(c)).toString('hex')); + * ``` + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @return The object passed as `buffer` argument. + */ + function randomFillSync(buffer: T, offset?: number, size?: number): T; + /** + * This function is similar to {@link randomBytes} but requires the first + * argument to be a `Buffer` that will be filled. It also + * requires that a callback is passed in. + * + * If the `callback` function is not provided, an error will be thrown. + * + * ```js + * import { Buffer } from 'buffer'; + * const { randomFill } = await import('crypto'); + * + * const buf = Buffer.alloc(10); + * randomFill(buf, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * randomFill(buf, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * // The above is equivalent to the following: + * randomFill(buf, 5, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * ``` + * + * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. + * + * While this includes instances of `Float32Array` and `Float64Array`, this + * function should not be used to generate random floating-point numbers. The + * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array + * contains finite numbers only, they are not drawn from a uniform random + * distribution and have no meaningful lower or upper bounds. + * + * ```js + * import { Buffer } from 'buffer'; + * const { randomFill } = await import('crypto'); + * + * const a = new Uint32Array(10); + * randomFill(a, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const b = new DataView(new ArrayBuffer(10)); + * randomFill(b, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const c = new ArrayBuffer(10); + * randomFill(c, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf).toString('hex')); + * }); + * ``` + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomFill()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomFill` requests when doing so as part of fulfilling a client + * request. + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @param callback `function(err, buf) {}`. + */ + function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; + interface ScryptOptions { + cost?: number | undefined; + blockSize?: number | undefined; + parallelization?: number | undefined; + N?: number | undefined; + r?: number | undefined; + p?: number | undefined; + maxmem?: number | undefined; + } + /** + * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the + * callback as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scrypt + * } = await import('crypto'); + * + * // Using the factory defaults. + * scrypt('password', 'salt', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * // Using a custom N parameter. Must be a power of two. + * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' + * }); + * ``` + * @since v10.5.0 + */ + function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void; + function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void; + /** + * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * An exception is thrown when key derivation fails, otherwise the derived key is + * returned as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scryptSync + * } = await import('crypto'); + * // Using the factory defaults. + * + * const key1 = scryptSync('password', 'salt', 64); + * console.log(key1.toString('hex')); // '3745e48...08d59ae' + * // Using a custom N parameter. Must be a power of two. + * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); + * console.log(key2.toString('hex')); // '3745e48...aa39b34' + * ``` + * @since v10.5.0 + */ + function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; + interface RsaPublicKey { + key: KeyLike; + padding?: number | undefined; + } + interface RsaPrivateKey { + key: KeyLike; + passphrase?: string | undefined; + /** + * @default 'sha1' + */ + oaepHash?: string | undefined; + oaepLabel?: NodeJS.TypedArray | undefined; + padding?: number | undefined; + } + /** + * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using + * the corresponding private key, for example using {@link privateDecrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.11.14 + */ + function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Decrypts `buffer` with `key`.`buffer` was previously encrypted using + * the corresponding private key, for example using {@link privateEncrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v1.1.0 + */ + function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using + * the corresponding public key, for example using {@link publicEncrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * @since v0.11.14 + */ + function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using + * the corresponding public key, for example using {@link publicDecrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * @since v1.1.0 + */ + function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * ```js + * const { + * getCiphers + * } = await import('crypto'); + * + * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] + * ``` + * @since v0.9.3 + * @return An array with the names of the supported cipher algorithms. + */ + function getCiphers(): string[]; + /** + * ```js + * const { + * getCurves + * } = await import('crypto'); + * + * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] + * ``` + * @since v2.3.0 + * @return An array with the names of the supported elliptic curves. + */ + function getCurves(): string[]; + /** + * @since v10.0.0 + * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. + */ + function getFips(): 1 | 0; + /** + * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. Throws an error if FIPS mode is not available. + * @since v10.0.0 + * @param bool `true` to enable FIPS mode. + */ + function setFips(bool: boolean): void; + /** + * ```js + * const { + * getHashes + * } = await import('crypto'); + * + * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] + * ``` + * @since v0.9.3 + * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. + */ + function getHashes(): string[]; + /** + * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) + * key exchanges. + * + * Instances of the `ECDH` class can be created using the {@link createECDH} function. + * + * ```js + * import assert from 'assert'; + * + * const { + * createECDH + * } = await import('crypto'); + * + * // Generate Alice's keys... + * const alice = createECDH('secp521r1'); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createECDH('secp521r1'); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * // OK + * ``` + * @since v0.11.14 + */ + class ECDH { + private constructor(); + /** + * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the + * format specified by `format`. The `format` argument specifies point encoding + * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is + * interpreted using the specified `inputEncoding`, and the returned key is encoded + * using the specified `outputEncoding`. + * + * Use {@link getCurves} to obtain a list of available curve names. + * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display + * the name and description of each available elliptic curve. + * + * If `format` is not specified the point will be returned in `'uncompressed'`format. + * + * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * Example (uncompressing a key): + * + * ```js + * const { + * createECDH, + * ECDH + * } = await import('crypto'); + * + * const ecdh = createECDH('secp256k1'); + * ecdh.generateKeys(); + * + * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); + * + * const uncompressedKey = ECDH.convertKey(compressedKey, + * 'secp256k1', + * 'hex', + * 'hex', + * 'uncompressed'); + * + * // The converted key and the uncompressed public key should be the same + * console.log(uncompressedKey === ecdh.getPublicKey('hex')); + * ``` + * @since v10.0.0 + * @param inputEncoding The `encoding` of the `key` string. + * @param outputEncoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + static convertKey( + key: BinaryLike, + curve: string, + inputEncoding?: BinaryToTextEncoding, + outputEncoding?: 'latin1' | 'hex' | 'base64' | 'base64url', + format?: 'uncompressed' | 'compressed' | 'hybrid' + ): Buffer | string; + /** + * Generates private and public EC Diffie-Hellman key values, and returns + * the public key in the specified `format` and `encoding`. This key should be + * transferred to the other party. + * + * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. + * + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using specified `inputEncoding`, and the returned secret + * is encoded using the specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. + * + * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. + * + * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is + * usually supplied from a remote user over an insecure network, + * be sure to handle this exception accordingly. + * @since v0.11.14 + * @param inputEncoding The `encoding` of the `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; + /** + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @return The EC Diffie-Hellman in the specified `encoding`. + */ + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. + * + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param [encoding] The `encoding` of the return value. + * @param [format='uncompressed'] + * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. + */ + getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; + getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Sets the EC Diffie-Hellman private key. + * If `encoding` is provided, `privateKey` is expected + * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * If `privateKey` is not valid for the curve specified when the `ECDH` object was + * created, an error is thrown. Upon setting the private key, the associated + * public point (key) is also generated and set in the `ECDH` object. + * @since v0.11.14 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; + } + /** + * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a + * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent + * OpenSSL releases, `openssl ecparam -list_curves` will also display the name + * and description of each available elliptic curve. + * @since v0.11.14 + */ + function createECDH(curveName: string): ECDH; + /** + * This function is based on a constant-time algorithm. + * Returns true if `a` is equal to `b`, without leaking timing information that + * would allow an attacker to guess one of the values. This is suitable for + * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). + * + * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they + * must have the same byte length. An error is thrown if `a` and `b` have + * different byte lengths. + * + * If at least one of `a` and `b` is a `TypedArray` with more than one byte per + * entry, such as `Uint16Array`, the result will be computed using the platform + * byte order. + * + * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code + * is timing-safe. Care should be taken to ensure that the surrounding code does + * not introduce timing vulnerabilities. + * @since v6.6.0 + */ + function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; + /** @deprecated since v10.0.0 */ + const DEFAULT_ENCODING: BufferEncoding; + type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; + type KeyFormat = 'pem' | 'der' | 'jwk'; + interface BasePrivateKeyEncodingOptions { + format: T; + cipher?: string | undefined; + passphrase?: string | undefined; + } + interface KeyPairKeyObjectResult { + publicKey: KeyObject; + privateKey: KeyObject; + } + interface ED25519KeyPairKeyObjectOptions {} + interface ED448KeyPairKeyObjectOptions {} + interface X25519KeyPairKeyObjectOptions {} + interface X448KeyPairKeyObjectOptions {} + interface ECKeyPairKeyObjectOptions { + /** + * Name of the curve to use + */ + namedCurve: string; + } + interface RSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + } + interface RSAPSSKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + /** + * Name of the message digest + */ + hashAlgorithm?: string; + /** + * Name of the message digest used by MGF1 + */ + mgf1HashAlgorithm?: string; + /** + * Minimal salt length in bytes + */ + saltLength?: string; + } + interface DSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + } + interface RSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs1' | 'pkcs8'; + }; + } + interface RSAPSSKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + /** + * Name of the message digest + */ + hashAlgorithm?: string; + /** + * Name of the message digest used by MGF1 + */ + mgf1HashAlgorithm?: string; + /** + * Minimal salt length in bytes + */ + saltLength?: string; + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface DSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface ECKeyPairOptions { + /** + * Name of the curve to use. + */ + namedCurve: string; + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'sec1' | 'pkcs8'; + }; + } + interface ED25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface ED448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface X25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface X448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface KeyPairSyncResult { + publicKey: T1; + privateKey: T2; + } + /** + * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, + * Ed25519, Ed448, X25519, X448, and DH are currently supported. + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * When encoding public keys, it is recommended to use `'spki'`. When encoding + * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, + * and to keep the passphrase confidential. + * + * ```js + * const { + * generateKeyPairSync + * } = await import('crypto'); + * + * const { + * publicKey, + * privateKey, + * } = generateKeyPairSync('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem' + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret' + * } + * }); + * ``` + * + * The return value `{ publicKey, privateKey }` represents the generated key pair. + * When PEM encoding was selected, the respective key will be a string, otherwise + * it will be a buffer containing the data encoded as DER. + * @since v10.12.0 + * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. + */ + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + /** + * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, + * Ed25519, Ed448, X25519, X448, and DH are currently supported. + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: + * + * ```js + * const { + * generateKeyPair + * } = await import('crypto'); + * + * generateKeyPair('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem' + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret' + * } + * }, (err, publicKey, privateKey) => { + * // Handle errors and use the generated key pair. + * }); + * ``` + * + * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. + * @since v10.12.0 + * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. + */ + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + namespace generateKeyPair { + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise; + } + /** + * Calculates and returns the signature for `data` using the given private key and + * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is + * dependent upon the key type (especially Ed25519 and Ed448). + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPrivateKey}. If it is an object, the following + * additional properties can be passed: + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; + function sign( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, + callback: (error: Error | null, data: Buffer) => void + ): void; + /** + * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the + * key type (especially Ed25519 and Ed448). + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPublicKey}. If it is an object, the following + * additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the `data`. + * + * Because public keys can be derived from private keys, a private key or a public + * key may be passed for `key`. + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; + function verify( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, + signature: NodeJS.ArrayBufferView, + callback: (error: Error | null, result: boolean) => void + ): void; + /** + * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. + * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). + * @since v13.9.0, v12.17.0 + */ + function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; + type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts'; + interface CipherInfoOptions { + /** + * A test key length. + */ + keyLength?: number | undefined; + /** + * A test IV length. + */ + ivLength?: number | undefined; + } + interface CipherInfo { + /** + * The name of the cipher. + */ + name: string; + /** + * The nid of the cipher. + */ + nid: number; + /** + * The block size of the cipher in bytes. + * This property is omitted when mode is 'stream'. + */ + blockSize?: number | undefined; + /** + * The expected or default initialization vector length in bytes. + * This property is omitted if the cipher does not use an initialization vector. + */ + ivLength?: number | undefined; + /** + * The expected or default key length in bytes. + */ + keyLength: number; + /** + * The cipher mode. + */ + mode: CipherMode; + } + /** + * Returns information about a given cipher. + * + * Some ciphers accept variable length keys and initialization vectors. By default, + * the `crypto.getCipherInfo()` method will return the default values for these + * ciphers. To test if a given key length or iv length is acceptable for given + * cipher, use the `keyLength` and `ivLength` options. If the given values are + * unacceptable, `undefined` will be returned. + * @since v15.0.0 + * @param nameOrNid The name or nid of the cipher to query. + */ + function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; + /** + * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. + * + * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. The successfully generated `derivedKey` will + * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any + * of the input arguments specify invalid values or types. + * + * ```js + * import { Buffer } from 'buffer'; + * const { + * hkdf + * } = await import('crypto'); + * + * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * }); + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. It must be at least one byte in length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void; + /** + * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The + * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. + * + * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). + * + * An error will be thrown if any of the input arguments specify invalid values or + * types, or if the derived key cannot be generated. + * + * ```js + * import { Buffer } from 'buffer'; + * const { + * hkdfSync + * } = await import('crypto'); + * + * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. It must be at least one byte in length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer; + interface SecureHeapUsage { + /** + * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. + */ + total: number; + /** + * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. + */ + min: number; + /** + * The total number of bytes currently allocated from the secure heap. + */ + used: number; + /** + * The calculated ratio of `used` to `total` allocated bytes. + */ + utilization: number; + } + /** + * @since v15.6.0 + */ + function secureHeapUsed(): SecureHeapUsage; + interface RandomUUIDOptions { + /** + * By default, to improve performance, + * Node.js will pre-emptively generate and persistently cache enough + * random data to generate up to 128 random UUIDs. To generate a UUID + * without using the cache, set `disableEntropyCache` to `true`. + * + * @default `false` + */ + disableEntropyCache?: boolean | undefined; + } + /** + * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a + * cryptographic pseudorandom number generator. + * @since v15.6.0, v14.17.0 + */ + function randomUUID(options?: RandomUUIDOptions): string; + interface X509CheckOptions { + /** + * @default 'always' + */ + subject?: 'always' | 'default' | 'never'; + /** + * @default true + */ + wildcards?: boolean; + /** + * @default true + */ + partialWildcards?: boolean; + /** + * @default false + */ + multiLabelWildcards?: boolean; + /** + * @default false + */ + singleLabelSubdomains?: boolean; + } + /** + * Encapsulates an X509 certificate and provides read-only access to + * its information. + * + * ```js + * const { X509Certificate } = await import('crypto'); + * + * const x509 = new X509Certificate('{... pem encoded cert ...}'); + * + * console.log(x509.subject); + * ``` + * @since v15.6.0 + */ + class X509Certificate { + /** + * Will be \`true\` if this is a Certificate Authority (CA) certificate. + * @since v15.6.0 + */ + readonly ca: boolean; + /** + * The SHA-1 fingerprint of this certificate. + * + * Because SHA-1 is cryptographically broken and because the security of SHA-1 is + * significantly worse than that of algorithms that are commonly used to sign + * certificates, consider using `x509.fingerprint256` instead. + * @since v15.6.0 + */ + readonly fingerprint: string; + /** + * The SHA-256 fingerprint of this certificate. + * @since v15.6.0 + */ + readonly fingerprint256: string; + /** + * The SHA-512 fingerprint of this certificate. + * @since v16.14.0 + */ + readonly fingerprint512: string; + /** + * The complete subject of this certificate. + * @since v15.6.0 + */ + readonly subject: string; + /** + * The subject alternative name specified for this certificate or `undefined` + * if not available. + * @since v15.6.0 + */ + readonly subjectAltName: string | undefined; + /** + * The information access content of this certificate or `undefined` if not + * available. + * @since v15.6.0 + */ + readonly infoAccess: string | undefined; + /** + * An array detailing the key usages for this certificate. + * @since v15.6.0 + */ + readonly keyUsage: string[]; + /** + * The issuer identification included in this certificate. + * @since v15.6.0 + */ + readonly issuer: string; + /** + * The issuer certificate or `undefined` if the issuer certificate is not + * available. + * @since v15.9.0 + */ + readonly issuerCertificate?: X509Certificate | undefined; + /** + * The public key `KeyObject` for this certificate. + * @since v15.6.0 + */ + readonly publicKey: KeyObject; + /** + * A `Buffer` containing the DER encoding of this certificate. + * @since v15.6.0 + */ + readonly raw: Buffer; + /** + * The serial number of this certificate. + * + * Serial numbers are assigned by certificate authorities and do not uniquely + * identify certificates. Consider using `x509.fingerprint256` as a unique + * identifier instead. + * @since v15.6.0 + */ + readonly serialNumber: string; + /** + * The date/time from which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validFrom: string; + /** + * The date/time until which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validTo: string; + constructor(buffer: BinaryLike); + /** + * Checks whether the certificate matches the given email address. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any email addresses. + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching email + * address, the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns `email` if the certificate matches, `undefined` if it does not. + */ + checkEmail(email: string, options?: Pick): string | undefined; + /** + * Checks whether the certificate matches the given host name. + * + * If the certificate matches the given host name, the matching subject name is + * returned. The returned name might be an exact match (e.g., `foo.example.com`) + * or it might contain wildcards (e.g., `*.example.com`). Because host name + * comparisons are case-insensitive, the returned subject name might also differ + * from the given `name` in capitalization. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching DNS name, + * the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. + */ + checkHost(name: string, options?: X509CheckOptions): string | undefined; + /** + * Checks whether the certificate matches the given IP address (IPv4 or IPv6). + * + * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they + * must match the given `ip` address exactly. Other subject alternative names as + * well as the subject field of the certificate are ignored. + * @since v15.6.0 + * @return Returns `ip` if the certificate matches, `undefined` if it does not. + */ + checkIP(ip: string): string | undefined; + /** + * Checks whether this certificate was issued by the given `otherCert`. + * @since v15.6.0 + */ + checkIssued(otherCert: X509Certificate): boolean; + /** + * Checks whether the public key for this certificate is consistent with + * the given private key. + * @since v15.6.0 + * @param privateKey A private key. + */ + checkPrivateKey(privateKey: KeyObject): boolean; + /** + * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded + * certificate. + * @since v15.6.0 + */ + toJSON(): string; + /** + * Returns information about this certificate using the legacy `certificate object` encoding. + * @since v15.6.0 + */ + toLegacyObject(): PeerCertificate; + /** + * Returns the PEM-encoded certificate. + * @since v15.6.0 + */ + toString(): string; + /** + * Verifies that this certificate was signed by the given public key. + * Does not perform any other validation checks on the certificate. + * @since v15.6.0 + * @param publicKey A public key. + */ + verify(publicKey: KeyObject): boolean; + } + type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; + interface GeneratePrimeOptions { + add?: LargeNumberLike | undefined; + rem?: LargeNumberLike | undefined; + /** + * @default false + */ + safe?: boolean | undefined; + bigint?: boolean | undefined; + } + interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { + bigint: true; + } + interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { + bigint?: false | undefined; + } + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void; + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrimeSync(size: number): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; + interface CheckPrimeOptions { + /** + * The number of Miller-Rabin probabilistic primality iterations to perform. + * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. + * Care must be used when selecting a number of checks. + * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. + * + * @default 0 + */ + checks?: number | undefined; + } + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + */ + function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; + function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void; + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. + */ + function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; + /** + * Load and set the `engine` for some or all OpenSSL functions (selected by flags). + * + * `engine` could be either an id or a path to the engine's shared library. + * + * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. + * The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`): + * + * - `crypto.constants.ENGINE_METHOD_RSA` + * - `crypto.constants.ENGINE_METHOD_DSA` + * - `crypto.constants.ENGINE_METHOD_DH` + * - `crypto.constants.ENGINE_METHOD_RAND` + * - `crypto.constants.ENGINE_METHOD_EC` + * - `crypto.constants.ENGINE_METHOD_CIPHERS` + * - `crypto.constants.ENGINE_METHOD_DIGESTS` + * - `crypto.constants.ENGINE_METHOD_PKEY_METHS` + * - `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` + * - `crypto.constants.ENGINE_METHOD_ALL` + * - `crypto.constants.ENGINE_METHOD_NONE` + * + * The flags below are deprecated in OpenSSL-1.1.0. + * + * - `crypto.constants.ENGINE_METHOD_ECDH` + * - `crypto.constants.ENGINE_METHOD_ECDSA` + * - `crypto.constants.ENGINE_METHOD_STORE` + * @since v0.11.11 + * @param [flags=crypto.constants.ENGINE_METHOD_ALL] + */ + function setEngine(engine: string, flags?: number): void; + /** + * A convenient alias for `crypto.webcrypto.getRandomValues()`. + * This implementation is not compliant with the Web Crypto spec, + * to write web-compatible code use `crypto.webcrypto.getRandomValues()` instead. + * @since v17.4.0 + * @returns Returns `typedArray`. + */ + function getRandomValues(typedArray: T): T; + /** + * A convenient alias for `crypto.webcrypto.subtle`. + * @since v17.4.0 + */ + const subtle: webcrypto.SubtleCrypto; + /** + * An implementation of the Web Crypto API standard. + * + * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. + * @since v15.0.0 + */ + const webcrypto: webcrypto.Crypto; + namespace webcrypto { + type BufferSource = ArrayBufferView | ArrayBuffer; + type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki'; + type KeyType = 'private' | 'public' | 'secret'; + type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey'; + type AlgorithmIdentifier = Algorithm | string; + type HashAlgorithmIdentifier = AlgorithmIdentifier; + type NamedCurve = string; + type BigInteger = Uint8Array; + interface AesCbcParams extends Algorithm { + iv: BufferSource; + } + interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; + } + interface AesDerivedKeyParams extends Algorithm { + length: number; + } + interface AesGcmParams extends Algorithm { + additionalData?: BufferSource; + iv: BufferSource; + tagLength?: number; + } + interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; + } + interface AesKeyGenParams extends Algorithm { + length: number; + } + interface Algorithm { + name: string; + } + interface EcKeyAlgorithm extends KeyAlgorithm { + namedCurve: NamedCurve; + } + interface EcKeyGenParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcKeyImportParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; + } + interface EcdsaParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface Ed448Params extends Algorithm { + context?: BufferSource; + } + interface HkdfParams extends Algorithm { + hash: HashAlgorithmIdentifier; + info: BufferSource; + salt: BufferSource; + } + interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; + } + interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; + } + interface KeyAlgorithm { + name: string; + } + interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: BufferSource; + } + interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; + } + interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; + } + interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaOaepParams extends Algorithm { + label?: BufferSource; + } + interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; + } + interface RsaPssParams extends Algorithm { + saltLength: number; + } + /** + * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class. + * `Crypto` is a singleton that provides access to the remainder of the crypto API. + * @since v15.0.0 + */ + interface Crypto { + /** + * Provides access to the `SubtleCrypto` API. + * @since v15.0.0 + */ + readonly subtle: SubtleCrypto; + /** + * Generates cryptographically strong random values. + * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. + * + * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. + * + * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. + * @since v15.0.0 + */ + getRandomValues>(typedArray: T): T; + /** + * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. + * The UUID is generated using a cryptographic pseudorandom number generator. + * @since v16.7.0 + */ + randomUUID(): string; + CryptoKey: CryptoKeyConstructor; + } + // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. + interface CryptoKeyConstructor { + /** Illegal constructor */ + (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. + readonly length: 0; + readonly name: 'CryptoKey'; + readonly prototype: CryptoKey; + } + /** + * @since v15.0.0 + */ + interface CryptoKey { + /** + * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. + * @since v15.0.0 + */ + readonly algorithm: KeyAlgorithm; + /** + * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. + * @since v15.0.0 + */ + readonly extractable: boolean; + /** + * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. + * @since v15.0.0 + */ + readonly type: KeyType; + /** + * An array of strings identifying the operations for which the key may be used. + * + * The possible usages are: + * - `'encrypt'` - The key may be used to encrypt data. + * - `'decrypt'` - The key may be used to decrypt data. + * - `'sign'` - The key may be used to generate digital signatures. + * - `'verify'` - The key may be used to verify digital signatures. + * - `'deriveKey'` - The key may be used to derive a new key. + * - `'deriveBits'` - The key may be used to derive bits. + * - `'wrapKey'` - The key may be used to wrap another key. + * - `'unwrapKey'` - The key may be used to unwrap another key. + * + * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). + * @since v15.0.0 + */ + readonly usages: KeyUsage[]; + } + /** + * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. + * @since v15.0.0 + */ + interface CryptoKeyPair { + /** + * A {@link CryptoKey} whose type will be `'private'`. + * @since v15.0.0 + */ + privateKey: CryptoKey; + /** + * A {@link CryptoKey} whose type will be `'public'`. + * @since v15.0.0 + */ + publicKey: CryptoKey; + } + /** + * @since v15.0.0 + */ + interface SubtleCrypto { + /** + * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, + * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, + * the returned promise will be resolved with an `` containing the plaintext result. + * + * The algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * @since v15.0.0 + */ + decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; + /** + * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, + * `subtle.deriveBits()` attempts to generate `length` bits. + * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. + * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed + * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. + * If successful, the returned promise will be resolved with an `` containing the generated data. + * + * The algorithms currently supported include: + * + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HKDF'` + * - `'PBKDF2'` + * @since v15.0.0 + */ + deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; + deriveBits(algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; + /** + * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, + * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. + * + * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, + * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. + * + * The algorithms currently supported include: + * + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HKDF'` + * - `'PBKDF2'` + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + deriveKey( + algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, + baseKey: CryptoKey, + derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, + extractable: boolean, + keyUsages: ReadonlyArray + ): Promise; + /** + * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. + * If successful, the returned promise is resolved with an `` containing the computed digest. + * + * If `algorithm` is provided as a ``, it must be one of: + * + * - `'SHA-1'` + * - `'SHA-256'` + * - `'SHA-384'` + * - `'SHA-512'` + * + * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. + * @since v15.0.0 + */ + digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; + /** + * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, + * `subtle.encrypt()` attempts to encipher `data`. If successful, + * the returned promise is resolved with an `` containing the encrypted result. + * + * The algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * @since v15.0.0 + */ + encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; + /** + * Exports the given key into the specified format, if supported. + * + * If the `` is not extractable, the returned promise will reject. + * + * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, + * the returned promise will be resolved with an `` containing the exported key data. + * + * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a + * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @returns `` containing ``. + * @since v15.0.0 + */ + exportKey(format: 'jwk', key: CryptoKey): Promise; + exportKey(format: Exclude, key: CryptoKey): Promise; + /** + * Using the method and parameters provided in `algorithm`, + * `subtle.generateKey()` attempts to generate new keying material. + * Depending the method used, the method may generate either a single `` or a ``. + * + * The `` (public and private key) generating algorithms supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'RSA-OAEP'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * The `` (secret key) generating algorithms supported include: + * + * - `'HMAC'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray): Promise; + generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray): Promise; + generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; + /** + * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` + * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. + * If the import is successful, the returned promise will be resolved with the created ``. + * + * If importing a `'PBKDF2'` key, `extractable` must be `false`. + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + importKey( + format: 'jwk', + keyData: JsonWebKey, + algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: ReadonlyArray + ): Promise; + importKey( + format: Exclude, + keyData: BufferSource, + algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: KeyUsage[] + ): Promise; + /** + * Using the method and parameters given by `algorithm` and the keying material provided by `key`, + * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, + * the returned promise is resolved with an `` containing the generated signature. + * + * The algorithms currently supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'HMAC'` + * @since v15.0.0 + */ + sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise; + /** + * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. + * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. + * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) + * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. + * If successful, the returned promise is resolved with a `` object. + * + * The wrapping algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * + * The unwrapped key algorithms supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'RSA-OAEP'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HMAC'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + unwrapKey( + format: KeyFormat, + wrappedKey: BufferSource, + unwrappingKey: CryptoKey, + unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, + unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: KeyUsage[] + ): Promise; + /** + * Using the method and parameters given in `algorithm` and the keying material provided by `key`, + * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. + * The returned promise is resolved with either `true` or `false`. + * + * The algorithms currently supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'HMAC'` + * @since v15.0.0 + */ + verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise; + /** + * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. + * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, + * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. + * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, + * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. + * If successful, the returned promise will be resolved with an `` containing the encrypted key data. + * + * The wrapping algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @since v15.0.0 + */ + wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise; + } + } +} +declare module 'node:crypto' { + export * from 'crypto'; +} diff --git a/server/node_modules/@types/node/ts4.8/dgram.d.ts b/server/node_modules/@types/node/ts4.8/dgram.d.ts new file mode 100755 index 0000000000..247328d28b --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/dgram.d.ts @@ -0,0 +1,545 @@ +/** + * The `dgram` module provides an implementation of UDP datagram sockets. + * + * ```js + * import dgram from 'dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.log(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dgram.js) + */ +declare module 'dgram' { + import { AddressInfo } from 'node:net'; + import * as dns from 'node:dns'; + import { EventEmitter, Abortable } from 'node:events'; + interface RemoteInfo { + address: string; + family: 'IPv4' | 'IPv6'; + port: number; + size: number; + } + interface BindOptions { + port?: number | undefined; + address?: string | undefined; + exclusive?: boolean | undefined; + fd?: number | undefined; + } + type SocketType = 'udp4' | 'udp6'; + interface SocketOptions extends Abortable { + type: SocketType; + reuseAddr?: boolean | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + recvBufferSize?: number | undefined; + sendBufferSize?: number | undefined; + lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined; + } + /** + * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram + * messages. When `address` and `port` are not passed to `socket.bind()` the + * method will bind the socket to the "all interfaces" address on a random port + * (it does the right thing for both `udp4` and `udp6` sockets). The bound address + * and port can be retrieved using `socket.address().address` and `socket.address().port`. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: + * + * ```js + * const controller = new AbortController(); + * const { signal } = controller; + * const server = dgram.createSocket({ type: 'udp4', signal }); + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * // Later, when you want to close the server. + * controller.abort(); + * ``` + * @since v0.11.13 + * @param options Available options are: + * @param callback Attached as a listener for `'message'` events. Optional. + */ + function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + /** + * Encapsulates the datagram functionality. + * + * New instances of `dgram.Socket` are created using {@link createSocket}. + * The `new` keyword is not to be used to create `dgram.Socket` instances. + * @since v0.1.99 + */ + class Socket extends EventEmitter { + /** + * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not + * specified, the operating system will choose + * one interface and will add membership to it. To add membership to every + * available interface, call `addMembership` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * + * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: + * + * ```js + * import cluster from 'cluster'; + * import dgram from 'dgram'; + * + * if (cluster.isPrimary) { + * cluster.fork(); // Works ok. + * cluster.fork(); // Fails with EADDRINUSE. + * } else { + * const s = dgram.createSocket('udp4'); + * s.bind(1234, () => { + * s.addMembership('224.0.0.114'); + * }); + * } + * ``` + * @since v0.6.9 + */ + addMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * Returns an object containing the address information for a socket. + * For UDP sockets, this object will contain `address`, `family` and `port`properties. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.99 + */ + address(): AddressInfo; + /** + * For UDP sockets, causes the `dgram.Socket` to listen for datagram + * messages on a named `port` and optional `address`. If `port` is not + * specified or is `0`, the operating system will attempt to bind to a + * random port. If `address` is not specified, the operating system will + * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is + * called. + * + * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very + * useful. + * + * A bound datagram socket keeps the Node.js process running to receive + * datagram messages. + * + * If binding fails, an `'error'` event is generated. In rare case (e.g. + * attempting to bind with a closed socket), an `Error` may be thrown. + * + * Example of a UDP server listening on port 41234: + * + * ```js + * import dgram from 'dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.log(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @since v0.1.99 + * @param callback with no parameters. Called when binding is complete. + */ + bind(port?: number, address?: string, callback?: () => void): this; + bind(port?: number, callback?: () => void): this; + bind(callback?: () => void): this; + bind(options: BindOptions, callback?: () => void): this; + /** + * Close the underlying socket and stop listening for data on it. If a callback is + * provided, it is added as a listener for the `'close'` event. + * @since v0.1.99 + * @param callback Called when the socket has been closed. + */ + close(callback?: () => void): this; + /** + * Associates the `dgram.Socket` to a remote address and port. Every + * message sent by this handle is automatically sent to that destination. Also, + * the socket will only receive messages from that remote peer. + * Trying to call `connect()` on an already connected socket will result + * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not + * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) + * will be used by default. Once the connection is complete, a `'connect'` event + * is emitted and the optional `callback` function is called. In case of failure, + * the `callback` is called or, failing this, an `'error'` event is emitted. + * @since v12.0.0 + * @param callback Called when the connection is completed or on error. + */ + connect(port: number, address?: string, callback?: () => void): void; + connect(port: number, callback: () => void): void; + /** + * A synchronous function that disassociates a connected `dgram.Socket` from + * its remote address. Trying to call `disconnect()` on an unbound or already + * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. + * @since v12.0.0 + */ + disconnect(): void; + /** + * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the + * kernel when the socket is closed or the process terminates, so most apps will + * never have reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v0.6.9 + */ + dropMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_RCVBUF` socket receive buffer size in bytes. + */ + getRecvBufferSize(): number; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_SNDBUF` socket send buffer size in bytes. + */ + getSendBufferSize(): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active. The `socket.ref()` method adds the socket back to the reference + * counting and restores the default behavior. + * + * Calling `socket.ref()` multiples times will have no additional effect. + * + * The `socket.ref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + ref(): this; + /** + * Returns an object containing the `address`, `family`, and `port` of the remote + * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception + * if the socket is not connected. + * @since v12.0.0 + */ + remoteAddress(): AddressInfo; + /** + * Broadcasts a datagram on the socket. + * For connectionless sockets, the destination `port` and `address` must be + * specified. Connected sockets, on the other hand, will use their associated + * remote endpoint, so the `port` and `address` arguments must not be set. + * + * The `msg` argument contains the message to be sent. + * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, + * any `TypedArray` or a `DataView`, + * the `offset` and `length` specify the offset within the `Buffer` where the + * message begins and the number of bytes in the message, respectively. + * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that + * contain multi-byte characters, `offset` and `length` will be calculated with + * respect to `byte length` and not the character position. + * If `msg` is an array, `offset` and `length` must not be specified. + * + * The `address` argument is a string. If the value of `address` is a host name, + * DNS will be used to resolve the address of the host. If `address` is not + * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. + * + * If the socket has not been previously bound with a call to `bind`, the socket + * is assigned a random port number and is bound to the "all interfaces" address + * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) + * + * An optional `callback` function may be specified to as a way of reporting + * DNS errors or for determining when it is safe to reuse the `buf` object. + * DNS lookups delay the time to send for at least one tick of the + * Node.js event loop. + * + * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be + * passed as the first argument to the `callback`. If a `callback` is not given, + * the error is emitted as an `'error'` event on the `socket` object. + * + * Offset and length are optional but both _must_ be set if either are used. + * They are supported only when the first argument is a `Buffer`, a `TypedArray`, + * or a `DataView`. + * + * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. + * + * Example of sending a UDP packet to a port on `localhost`; + * + * ```js + * import dgram from 'dgram'; + * import { Buffer } from 'buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.send(message, 41234, 'localhost', (err) => { + * client.close(); + * }); + * ``` + * + * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; + * + * ```js + * import dgram from 'dgram'; + * import { Buffer } from 'buffer'; + * + * const buf1 = Buffer.from('Some '); + * const buf2 = Buffer.from('bytes'); + * const client = dgram.createSocket('udp4'); + * client.send([buf1, buf2], 41234, (err) => { + * client.close(); + * }); + * ``` + * + * Sending multiple buffers might be faster or slower depending on the + * application and operating system. Run benchmarks to + * determine the optimal strategy on a case-by-case basis. Generally speaking, + * however, sending multiple buffers is faster. + * + * Example of sending a UDP packet using a socket connected to a port on`localhost`: + * + * ```js + * import dgram from 'dgram'; + * import { Buffer } from 'buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.connect(41234, 'localhost', (err) => { + * client.send(message, (err) => { + * client.close(); + * }); + * }); + * ``` + * @since v0.1.99 + * @param msg Message to be sent. + * @param offset Offset in the buffer where the message starts. + * @param length Number of bytes in the message. + * @param port Destination port. + * @param address Destination host name or IP address. + * @param callback Called when the message has been sent. + */ + send(msg: string | Uint8Array | ReadonlyArray, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; + /** + * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP + * packets may be sent to a local interface's broadcast address. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.6.9 + */ + setBroadcast(flag: boolean): void; + /** + * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC + * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ + * _with a scope index is written as `'IP%scope'` where scope is an interface name_ + * _or interface number._ + * + * Sets the default outgoing multicast interface of the socket to a chosen + * interface or back to system interface selection. The `multicastInterface` must + * be a valid string representation of an IP from the socket's family. + * + * For IPv4 sockets, this should be the IP configured for the desired physical + * interface. All packets sent to multicast on the socket will be sent on the + * interface determined by the most recent successful use of this call. + * + * For IPv6 sockets, `multicastInterface` should include a scope to indicate the + * interface as in the examples that follow. In IPv6, individual `send` calls can + * also use explicit scope in addresses, so only packets sent to a multicast + * address without specifying an explicit scope are affected by the most recent + * successful use of this call. + * + * This method throws `EBADF` if called on an unbound socket. + * + * #### Example: IPv6 outgoing multicast interface + * + * On most systems, where scope format uses the interface name: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%eth1'); + * }); + * ``` + * + * On Windows, where scope format uses an interface number: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%2'); + * }); + * ``` + * + * #### Example: IPv4 outgoing multicast interface + * + * All systems use an IP of the host on the desired physical interface: + * + * ```js + * const socket = dgram.createSocket('udp4'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('10.0.0.2'); + * }); + * ``` + * @since v8.6.0 + */ + setMulticastInterface(multicastInterface: string): void; + /** + * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, + * multicast packets will also be received on the local interface. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastLoopback(flag: boolean): boolean; + /** + * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for + * "Time to Live", in this context it specifies the number of IP hops that a + * packet is allowed to travel through, specifically for multicast traffic. Each + * router or gateway that forwards a packet decrements the TTL. If the TTL is + * decremented to 0 by a router, it will not be forwarded. + * + * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastTTL(ttl: number): number; + /** + * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setRecvBufferSize(size: number): void; + /** + * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setSendBufferSize(size: number): void; + /** + * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", + * in this context it specifies the number of IP hops that a packet is allowed to + * travel through. Each router or gateway that forwards a packet decrements the + * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. + * Changing TTL values is typically done for network probes or when multicasting. + * + * The `ttl` argument may be between 1 and 255\. The default on most systems + * is 64. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.101 + */ + setTTL(ttl: number): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active, allowing the process to exit even if the socket is still + * listening. + * + * Calling `socket.unref()` multiple times will have no addition effect. + * + * The `socket.unref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + unref(): this; + /** + * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket + * option. If the `multicastInterface` argument + * is not specified, the operating system will choose one interface and will add + * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * @since v13.1.0, v12.16.0 + */ + addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is + * automatically called by the kernel when the + * socket is closed or the process terminates, so most apps will never have + * reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v13.1.0, v12.16.0 + */ + dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. error + * 4. listening + * 5. message + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connect'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connect', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connect', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + } +} +declare module 'node:dgram' { + export * from 'dgram'; +} diff --git a/server/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts b/server/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts new file mode 100755 index 0000000000..3dcaa035a5 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts @@ -0,0 +1,153 @@ +/** + * The `diagnostics_channel` module provides an API to create named channels + * to report arbitrary message data for diagnostics purposes. + * + * It can be accessed using: + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * ``` + * + * It is intended that a module writer wanting to report diagnostics messages + * will create one or many top-level channels to report messages through. + * Channels may also be acquired at runtime but it is not encouraged + * due to the additional overhead of doing so. Channels may be exported for + * convenience, but as long as the name is known it can be acquired anywhere. + * + * If you intend for your module to produce diagnostics data for others to + * consume it is recommended that you include documentation of what named + * channels are used along with the shape of the message data. Channel names + * should generally include the module name to avoid collisions with data from + * other modules. + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js) + */ +declare module 'diagnostics_channel' { + /** + * Check if there are active subscribers to the named channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * if (diagnostics_channel.hasSubscribers('my-channel')) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return If there are active subscribers + */ + function hasSubscribers(name: string | symbol): boolean; + /** + * This is the primary entry-point for anyone wanting to interact with a named + * channel. It produces a channel object which is optimized to reduce overhead at + * publish time as much as possible. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return The named channel object + */ + function channel(name: string | symbol): Channel; + type ChannelListener = (message: unknown, name: string | symbol) => void; + /** + * The class `Channel` represents an individual named channel within the data + * pipeline. It is use to track subscribers and to publish messages when there + * are subscribers present. It exists as a separate object to avoid channel + * lookups at publish time, enabling very fast publish speeds and allowing + * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly + * with `new Channel(name)` is not supported. + * @since v15.1.0, v14.17.0 + */ + class Channel { + readonly name: string | symbol; + /** + * Check if there are active subscribers to this channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * if (channel.hasSubscribers) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + */ + readonly hasSubscribers: boolean; + private constructor(name: string | symbol); + /** + * Publish a message to any subscribers to the channel. This will + * trigger message handlers synchronously so they will execute within + * the same context. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.publish({ + * some: 'message' + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @param message The message to send to the channel subscribers + */ + publish(message: unknown): void; + /** + * Register a message handler to subscribe to this channel. This message handler + * will be run synchronously whenever a message is published to the channel. Any + * errors thrown in the message handler will trigger an `'uncaughtException'`. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.subscribe((message, name) => { + * // Received data + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @param onMessage The handler to receive channel messages + */ + subscribe(onMessage: ChannelListener): void; + /** + * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. + * + * ```js + * import diagnostics_channel from 'diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * function onMessage(message, name) { + * // Received data + * } + * + * channel.subscribe(onMessage); + * + * channel.unsubscribe(onMessage); + * ``` + * @since v15.1.0, v14.17.0 + * @param onMessage The previous subscribed handler to remove + * @return `true` if the handler was found, `false` otherwise. + */ + unsubscribe(onMessage: ChannelListener): void; + } +} +declare module 'node:diagnostics_channel' { + export * from 'diagnostics_channel'; +} diff --git a/server/node_modules/@types/node/ts4.8/dns.d.ts b/server/node_modules/@types/node/ts4.8/dns.d.ts new file mode 100755 index 0000000000..305367b81d --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/dns.d.ts @@ -0,0 +1,659 @@ +/** + * The `dns` module enables name resolution. For example, use it to look up IP + * addresses of host names. + * + * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the + * DNS protocol for lookups. {@link lookup} uses the operating system + * facilities to perform name resolution. It may not need to perform any network + * communication. To perform name resolution the way other applications on the same + * system do, use {@link lookup}. + * + * ```js + * const dns = require('dns'); + * + * dns.lookup('example.org', (err, address, family) => { + * console.log('address: %j family: IPv%s', address, family); + * }); + * // address: "93.184.216.34" family: IPv4 + * ``` + * + * All other functions in the `dns` module connect to an actual DNS server to + * perform name resolution. They will always use the network to perform DNS + * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform + * DNS queries, bypassing other name-resolution facilities. + * + * ```js + * const dns = require('dns'); + * + * dns.resolve4('archive.org', (err, addresses) => { + * if (err) throw err; + * + * console.log(`addresses: ${JSON.stringify(addresses)}`); + * + * addresses.forEach((a) => { + * dns.reverse(a, (err, hostnames) => { + * if (err) { + * throw err; + * } + * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); + * }); + * }); + * }); + * ``` + * + * See the `Implementation considerations section` for more information. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dns.js) + */ +declare module 'dns' { + import * as dnsPromises from 'node:dns/promises'; + // Supported getaddrinfo flags. + export const ADDRCONFIG: number; + export const V4MAPPED: number; + /** + * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as + * well as IPv4 mapped IPv6 addresses. + */ + export const ALL: number; + export interface LookupOptions { + family?: number | undefined; + hints?: number | undefined; + all?: boolean | undefined; + /** + * @default true + */ + verbatim?: boolean | undefined; + } + export interface LookupOneOptions extends LookupOptions { + all?: false | undefined; + } + export interface LookupAllOptions extends LookupOptions { + all: true; + } + export interface LookupAddress { + address: string; + family: number; + } + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 + * and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the + * properties `address` and `family`. + * + * On error, `err` is an `Error` object, where `err.code` is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. + * The implementation uses an operating system facility that can associate names + * with addresses, and vice versa. This implementation can have subtle but + * important consequences on the behavior of any Node.js program. Please take some + * time to consult the `Implementation considerations section` before using`dns.lookup()`. + * + * Example usage: + * + * ```js + * const dns = require('dns'); + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * dns.lookup('example.com', options, (err, address, family) => + * console.log('address: %j family: IPv%s', address, family)); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dns.lookup('example.com', options, (err, addresses) => + * console.log('addresses: %j', addresses)); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * ``` + * + * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. + * @since v0.1.90 + */ + export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; + export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; + export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export namespace lookup { + function __promisify__(hostname: string, options: LookupAllOptions): Promise; + function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; + function __promisify__(hostname: string, options: LookupOptions): Promise; + } + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * + * On an error, `err` is an `Error` object, where `err.code` is the error code. + * + * ```js + * const dns = require('dns'); + * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { + * console.log(hostname, service); + * // Prints: localhost ssh + * }); + * ``` + * + * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. + * @since v0.11.14 + */ + export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; + export namespace lookupService { + function __promisify__( + address: string, + port: number + ): Promise<{ + hostname: string; + service: string; + }>; + } + export interface ResolveOptions { + ttl: boolean; + } + export interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + export interface RecordWithTtl { + address: string; + ttl: number; + } + /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ + export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; + export interface AnyARecord extends RecordWithTtl { + type: 'A'; + } + export interface AnyAaaaRecord extends RecordWithTtl { + type: 'AAAA'; + } + export interface CaaRecord { + critial: number; + issue?: string | undefined; + issuewild?: string | undefined; + iodef?: string | undefined; + contactemail?: string | undefined; + contactphone?: string | undefined; + } + export interface MxRecord { + priority: number; + exchange: string; + } + export interface AnyMxRecord extends MxRecord { + type: 'MX'; + } + export interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + export interface AnyNaptrRecord extends NaptrRecord { + type: 'NAPTR'; + } + export interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + export interface AnySoaRecord extends SoaRecord { + type: 'SOA'; + } + export interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + export interface AnySrvRecord extends SrvRecord { + type: 'SRV'; + } + export interface AnyTxtRecord { + type: 'TXT'; + entries: string[]; + } + export interface AnyNsRecord { + type: 'NS'; + value: string; + } + export interface AnyPtrRecord { + type: 'PTR'; + value: string; + } + export interface AnyCnameRecord { + type: 'CNAME'; + value: string; + } + export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource + * records. The type and structure of individual results varies based on `rrtype`: + * + * + * + * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. + * @since v0.1.27 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; + export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export function resolve( + hostname: string, + rrtype: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void + ): void; + export namespace resolve { + function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise; + function __promisify__(hostname: string, rrtype: 'ANY'): Promise; + function __promisify__(hostname: string, rrtype: 'MX'): Promise; + function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise; + function __promisify__(hostname: string, rrtype: 'SOA'): Promise; + function __promisify__(hostname: string, rrtype: 'SRV'): Promise; + function __promisify__(hostname: string, rrtype: 'TXT'): Promise; + function __promisify__(hostname: string, rrtype: string): Promise; + } + /** + * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + export namespace resolve4 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv6 addresses. + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + export namespace resolve6 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function + * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). + * @since v0.3.2 + */ + export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveCname { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function + * will contain an array of certification authority authorization records + * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; + export namespace resolveCaa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v0.1.27 + */ + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export namespace resolveMx { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of + * objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v0.9.12 + */ + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export namespace resolveNaptr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). + * @since v0.1.90 + */ + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveNs { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * be an array of strings containing the reply records. + * @since v6.0.0 + */ + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolvePtr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. The `address` argument passed to the `callback` function will + * be an object with the following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v0.11.10 + */ + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; + export namespace resolveSoa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * be an array of objects with the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v0.1.27 + */ + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export namespace resolveSrv { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a + * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v0.1.27 + */ + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export namespace resolveTxt { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * The `ret` argument passed to the `callback` function will be an array containing + * various types of records. Each object has a property `type` that indicates the + * type of the current record. And depending on the `type`, additional properties + * will be present on the object: + * + * + * + * Here is an example of the `ret` object passed to the callback: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * + * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC + * 8482](https://tools.ietf.org/html/rfc8482). + */ + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export namespace resolveAny { + function __promisify__(hostname: string): Promise; + } + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, `err` is an `Error` object, where `err.code` is + * one of the `DNS error codes`. + * @since v0.1.16 + */ + export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dns.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dns.setServers()` method must not be called while a DNS query is in + * progress. + * + * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v0.11.3 + * @param servers array of `RFC 5952` formatted addresses + */ + export function setServers(servers: ReadonlyArray): void; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v0.11.3 + */ + export function getServers(): string[]; + /** + * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: sets default `verbatim` `false`. + * * `verbatim`: sets default `verbatim` `true`. + * + * The default is `ipv4first` and {@link setDefaultResultOrder} have higher + * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default + * dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'` or `'verbatim'`. + */ + export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; + // Error codes + export const NODATA: string; + export const FORMERR: string; + export const SERVFAIL: string; + export const NOTFOUND: string; + export const NOTIMP: string; + export const REFUSED: string; + export const BADQUERY: string; + export const BADNAME: string; + export const BADFAMILY: string; + export const BADRESP: string; + export const CONNREFUSED: string; + export const TIMEOUT: string; + export const EOF: string; + export const FILE: string; + export const NOMEM: string; + export const DESTRUCTION: string; + export const BADSTR: string; + export const BADFLAGS: string; + export const NONAME: string; + export const BADHINTS: string; + export const NOTINITIALIZED: string; + export const LOADIPHLPAPI: string; + export const ADDRGETNETWORKPARAMS: string; + export const CANCELLED: string; + export interface ResolverOptions { + timeout?: number | undefined; + /** + * @default 4 + */ + tries?: number; + } + /** + * An independent resolver for DNS requests. + * + * Creating a new resolver uses the default server settings. Setting + * the servers used for a resolver using `resolver.setServers()` does not affect + * other resolvers: + * + * ```js + * const { Resolver } = require('dns'); + * const resolver = new Resolver(); + * resolver.setServers(['4.4.4.4']); + * + * // This request will use the server at 4.4.4.4, independent of global settings. + * resolver.resolve4('example.org', (err, addresses) => { + * // ... + * }); + * ``` + * + * The following methods from the `dns` module are available: + * + * * `resolver.getServers()` + * * `resolver.resolve()` + * * `resolver.resolve4()` + * * `resolver.resolve6()` + * * `resolver.resolveAny()` + * * `resolver.resolveCaa()` + * * `resolver.resolveCname()` + * * `resolver.resolveMx()` + * * `resolver.resolveNaptr()` + * * `resolver.resolveNs()` + * * `resolver.resolvePtr()` + * * `resolver.resolveSoa()` + * * `resolver.resolveSrv()` + * * `resolver.resolveTxt()` + * * `resolver.reverse()` + * * `resolver.setServers()` + * @since v8.3.0 + */ + export class Resolver { + constructor(options?: ResolverOptions); + /** + * Cancel all outstanding DNS queries made by this resolver. The corresponding + * callbacks will be called with an error with code `ECANCELLED`. + * @since v8.3.0 + */ + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + /** + * The resolver instance will send its requests from the specified IP address. + * This allows programs to specify outbound interfaces when used on multi-homed + * systems. + * + * If a v4 or v6 address is not specified, it is set to the default, and the + * operating system will choose a local address automatically. + * + * The resolver will use the v4 local address when making requests to IPv4 DNS + * servers, and the v6 local address when making requests to IPv6 DNS servers. + * The `rrtype` of resolution requests has no impact on the local address used. + * @since v15.1.0, v14.17.0 + * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. + * @param [ipv6='::0'] A string representation of an IPv6 address. + */ + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } + export { dnsPromises as promises }; +} +declare module 'node:dns' { + export * from 'dns'; +} diff --git a/server/node_modules/@types/node/ts4.8/dns/promises.d.ts b/server/node_modules/@types/node/ts4.8/dns/promises.d.ts new file mode 100755 index 0000000000..77cd807bd5 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/dns/promises.d.ts @@ -0,0 +1,370 @@ +/** + * The `dns.promises` API provides an alternative set of asynchronous DNS methods + * that return `Promise` objects rather than using callbacks. The API is accessible + * via `require('dns').promises` or `require('dns/promises')`. + * @since v10.6.0 + */ +declare module 'dns/promises' { + import { + LookupAddress, + LookupOneOptions, + LookupAllOptions, + LookupOptions, + AnyRecord, + CaaRecord, + MxRecord, + NaptrRecord, + SoaRecord, + SrvRecord, + ResolveWithTtlOptions, + RecordWithTtl, + ResolveOptions, + ResolverOptions, + } from 'node:dns'; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v10.6.0 + */ + function getServers(): string[]; + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 + * and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS + * protocol. The implementation uses an operating system facility that can + * associate names with addresses, and vice versa. This implementation can have + * subtle but important consequences on the behavior of any Node.js program. Please + * take some time to consult the `Implementation considerations section` before + * using `dnsPromises.lookup()`. + * + * Example usage: + * + * ```js + * const dns = require('dns'); + * const dnsPromises = dns.promises; + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('address: %j family: IPv%s', result.address, result.family); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * }); + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('addresses: %j', result); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * }); + * ``` + * @since v10.6.0 + */ + function lookup(hostname: string, family: number): Promise; + function lookup(hostname: string, options: LookupOneOptions): Promise; + function lookup(hostname: string, options: LookupAllOptions): Promise; + function lookup(hostname: string, options: LookupOptions): Promise; + function lookup(hostname: string): Promise; + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * + * ```js + * const dnsPromises = require('dns').promises; + * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { + * console.log(result.hostname, result.service); + * // Prints: localhost ssh + * }); + * ``` + * @since v10.6.0 + */ + function lookupService( + address: string, + port: number + ): Promise<{ + hostname: string; + service: string; + }>; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. When successful, the `Promise` is resolved with an + * array of resource records. The type and structure of individual results vary + * based on `rrtype`: + * + * + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * @since v10.6.0 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + function resolve(hostname: string): Promise; + function resolve(hostname: string, rrtype: 'A'): Promise; + function resolve(hostname: string, rrtype: 'AAAA'): Promise; + function resolve(hostname: string, rrtype: 'ANY'): Promise; + function resolve(hostname: string, rrtype: 'CAA'): Promise; + function resolve(hostname: string, rrtype: 'CNAME'): Promise; + function resolve(hostname: string, rrtype: 'MX'): Promise; + function resolve(hostname: string, rrtype: 'NAPTR'): Promise; + function resolve(hostname: string, rrtype: 'NS'): Promise; + function resolve(hostname: string, rrtype: 'PTR'): Promise; + function resolve(hostname: string, rrtype: 'SOA'): Promise; + function resolve(hostname: string, rrtype: 'SRV'): Promise; + function resolve(hostname: string, rrtype: 'TXT'): Promise; + function resolve(hostname: string, rrtype: string): Promise; + /** + * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 + * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve4(hostname: string): Promise; + function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve4(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 + * addresses. + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve6(hostname: string): Promise; + function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve6(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * On success, the `Promise` is resolved with an array containing various types of + * records. Each object has a property `type` that indicates the type of the + * current record. And depending on the `type`, additional properties will be + * present on the object: + * + * + * + * Here is an example of the result object: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * @since v10.6.0 + */ + function resolveAny(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, + * the `Promise` is resolved with an array of objects containing available + * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + function resolveCaa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, + * the `Promise` is resolved with an array of canonical name records available for + * the `hostname` (e.g. `['bar.example.com']`). + * @since v10.6.0 + */ + function resolveCname(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects + * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v10.6.0 + */ + function resolveMx(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array + * of objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v10.6.0 + */ + function resolveNaptr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server + * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). + * @since v10.6.0 + */ + function resolveNs(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings + * containing the reply records. + * @since v10.6.0 + */ + function resolvePtr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. On success, the `Promise` is resolved with an object with the + * following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v10.6.0 + */ + function resolveSoa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with + * the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v10.6.0 + */ + function resolveSrv(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array + * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v10.6.0 + */ + function resolveTxt(hostname: string): Promise; + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * @since v10.6.0 + */ + function reverse(ip: string): Promise; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dnsPromises.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dnsPromises.setServers()` method must not be called while a DNS query is in + * progress. + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v10.6.0 + * @param servers array of `RFC 5952` formatted addresses + */ + function setServers(servers: ReadonlyArray): void; + /** + * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: sets default `verbatim` `false`. + * * `verbatim`: sets default `verbatim` `true`. + * + * The default is `ipv4first` and `dnsPromises.setDefaultResultOrder()` have + * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the + * default dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'` or `'verbatim'`. + */ + function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; + class Resolver { + constructor(options?: ResolverOptions); + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } +} +declare module 'node:dns/promises' { + export * from 'dns/promises'; +} diff --git a/server/node_modules/@types/node/ts4.8/dom-events.d.ts b/server/node_modules/@types/node/ts4.8/dom-events.d.ts new file mode 100755 index 0000000000..b9c1c3aa4f --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/dom-events.d.ts @@ -0,0 +1,126 @@ +export {}; // Don't export anything! + +//// DOM-like Events +// NB: The Event / EventTarget / EventListener implementations below were copied +// from lib.dom.d.ts, then edited to reflect Node's documentation at +// https://nodejs.org/api/events.html#class-eventtarget. +// Please read that link to understand important implementation differences. + +// This conditional type will be the existing global Event in a browser, or +// the copy below in a Node environment. +type __Event = typeof globalThis extends { onmessage: any, Event: any } +? {} +: { + /** This is not used in Node.js and is provided purely for completeness. */ + readonly bubbles: boolean; + /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ + cancelBubble: () => void; + /** True if the event was created with the cancelable option */ + readonly cancelable: boolean; + /** This is not used in Node.js and is provided purely for completeness. */ + readonly composed: boolean; + /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ + composedPath(): [EventTarget?] + /** Alias for event.target. */ + readonly currentTarget: EventTarget | null; + /** Is true if cancelable is true and event.preventDefault() has been called. */ + readonly defaultPrevented: boolean; + /** This is not used in Node.js and is provided purely for completeness. */ + readonly eventPhase: 0 | 2; + /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ + readonly isTrusted: boolean; + /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ + preventDefault(): void; + /** This is not used in Node.js and is provided purely for completeness. */ + returnValue: boolean; + /** Alias for event.target. */ + readonly srcElement: EventTarget | null; + /** Stops the invocation of event listeners after the current one completes. */ + stopImmediatePropagation(): void; + /** This is not used in Node.js and is provided purely for completeness. */ + stopPropagation(): void; + /** The `EventTarget` dispatching the event */ + readonly target: EventTarget | null; + /** The millisecond timestamp when the Event object was created. */ + readonly timeStamp: number; + /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ + readonly type: string; +}; + +// See comment above explaining conditional type +type __EventTarget = typeof globalThis extends { onmessage: any, EventTarget: any } +? {} +: { + /** + * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. + * + * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. + * + * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. + * Specifically, the `capture` option is used as part of the key when registering a `listener`. + * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. + */ + addEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: AddEventListenerOptions | boolean, + ): void; + /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ + dispatchEvent(event: Event): boolean; + /** Removes the event listener in target's event listener list with the same type, callback, and options. */ + removeEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: EventListenerOptions | boolean, + ): void; +}; + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; + composed?: boolean; +} + +interface EventListenerOptions { + /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ + capture?: boolean; +} + +interface AddEventListenerOptions extends EventListenerOptions { + /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ + once?: boolean; + /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ + passive?: boolean; +} + +interface EventListener { + (evt: Event): void; +} + +interface EventListenerObject { + handleEvent(object: Event): void; +} + +import {} from 'events'; // Make this an ambient declaration +declare global { + /** An event which takes place in the DOM. */ + interface Event extends __Event {} + var Event: typeof globalThis extends { onmessage: any, Event: infer T } + ? T + : { + prototype: __Event; + new (type: string, eventInitDict?: EventInit): __Event; + }; + + /** + * EventTarget is a DOM interface implemented by objects that can + * receive events and may have listeners for them. + */ + interface EventTarget extends __EventTarget {} + var EventTarget: typeof globalThis extends { onmessage: any, EventTarget: infer T } + ? T + : { + prototype: __EventTarget; + new (): __EventTarget; + }; +} diff --git a/server/node_modules/@types/node/ts4.8/domain.d.ts b/server/node_modules/@types/node/ts4.8/domain.d.ts new file mode 100755 index 0000000000..fafe68a5d3 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/domain.d.ts @@ -0,0 +1,170 @@ +/** + * **This module is pending deprecation.** Once a replacement API has been + * finalized, this module will be fully deprecated. Most developers should + * **not** have cause to use this module. Users who absolutely must have + * the functionality that domains provide may rely on it for the time being + * but should expect to have to migrate to a different solution + * in the future. + * + * Domains provide a way to handle multiple different IO operations as a + * single group. If any of the event emitters or callbacks registered to a + * domain emit an `'error'` event, or throw an error, then the domain object + * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to + * exit immediately with an error code. + * @deprecated Since v1.4.2 - Deprecated + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/domain.js) + */ +declare module 'domain' { + import EventEmitter = require('node:events'); + /** + * The `Domain` class encapsulates the functionality of routing errors and + * uncaught exceptions to the active `Domain` object. + * + * To handle the errors that it catches, listen to its `'error'` event. + */ + class Domain extends EventEmitter { + /** + * An array of timers and event emitters that have been explicitly added + * to the domain. + */ + members: Array; + /** + * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly + * pushes the domain onto the domain + * stack managed by the domain module (see {@link exit} for details on the + * domain stack). The call to `enter()` delimits the beginning of a chain of + * asynchronous calls and I/O operations bound to a domain. + * + * Calling `enter()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + enter(): void; + /** + * The `exit()` method exits the current domain, popping it off the domain stack. + * Any time execution is going to switch to the context of a different chain of + * asynchronous calls, it's important to ensure that the current domain is exited. + * The call to `exit()` delimits either the end of or an interruption to the chain + * of asynchronous calls and I/O operations bound to a domain. + * + * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. + * + * Calling `exit()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + exit(): void; + /** + * Run the supplied function in the context of the domain, implicitly + * binding all event emitters, timers, and lowlevel requests that are + * created in that context. Optionally, arguments can be passed to + * the function. + * + * This is the most basic way to use a domain. + * + * ```js + * const domain = require('domain'); + * const fs = require('fs'); + * const d = domain.create(); + * d.on('error', (er) => { + * console.error('Caught error!', er); + * }); + * d.run(() => { + * process.nextTick(() => { + * setTimeout(() => { // Simulating some various async stuff + * fs.open('non-existent file', 'r', (er, fd) => { + * if (er) throw er; + * // proceed... + * }); + * }, 100); + * }); + * }); + * ``` + * + * In this example, the `d.on('error')` handler will be triggered, rather + * than crashing the program. + */ + run(fn: (...args: any[]) => T, ...args: any[]): T; + /** + * Explicitly adds an emitter to the domain. If any event handlers called by + * the emitter throw an error, or if the emitter emits an `'error'` event, it + * will be routed to the domain's `'error'` event, just like with implicit + * binding. + * + * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by + * the domain `'error'` handler. + * + * If the Timer or `EventEmitter` was already bound to a domain, it is removed + * from that one, and bound to this one instead. + * @param emitter emitter or timer to be added to the domain + */ + add(emitter: EventEmitter | NodeJS.Timer): void; + /** + * The opposite of {@link add}. Removes domain handling from the + * specified emitter. + * @param emitter emitter or timer to be removed from the domain + */ + remove(emitter: EventEmitter | NodeJS.Timer): void; + /** + * The returned function will be a wrapper around the supplied callback + * function. When the returned function is called, any errors that are + * thrown will be routed to the domain's `'error'` event. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.bind((er, data) => { + * // If this throws, it will also be passed to the domain. + * return cb(er, data ? JSON.parse(data) : null); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The bound function + */ + bind(callback: T): T; + /** + * This method is almost identical to {@link bind}. However, in + * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. + * + * In this way, the common `if (err) return callback(err);` pattern can be replaced + * with a single error handler in a single place. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.intercept((data) => { + * // Note, the first argument is never passed to the + * // callback since it is assumed to be the 'Error' argument + * // and thus intercepted by the domain. + * + * // If this throws, it will also be passed to the domain + * // so the error-handling logic can be moved to the 'error' + * // event on the domain instead of being repeated throughout + * // the program. + * return cb(null, JSON.parse(data)); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The intercepted function + */ + intercept(callback: T): T; + } + function create(): Domain; +} +declare module 'node:domain' { + export * from 'domain'; +} diff --git a/server/node_modules/@types/node/ts4.8/events.d.ts b/server/node_modules/@types/node/ts4.8/events.d.ts new file mode 100755 index 0000000000..4633df19c8 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/events.d.ts @@ -0,0 +1,678 @@ +/** + * Much of the Node.js core API is built around an idiomatic asynchronous + * event-driven architecture in which certain kinds of objects (called "emitters") + * emit named events that cause `Function` objects ("listeners") to be called. + * + * For instance: a `net.Server` object emits an event each time a peer + * connects to it; a `fs.ReadStream` emits an event when the file is opened; + * a `stream` emits an event whenever data is available to be read. + * + * All objects that emit events are instances of the `EventEmitter` class. These + * objects expose an `eventEmitter.on()` function that allows one or more + * functions to be attached to named events emitted by the object. Typically, + * event names are camel-cased strings but any valid JavaScript property key + * can be used. + * + * When the `EventEmitter` object emits an event, all of the functions attached + * to that specific event are called _synchronously_. Any values returned by the + * called listeners are _ignored_ and discarded. + * + * The following example shows a simple `EventEmitter` instance with a single + * listener. The `eventEmitter.on()` method is used to register listeners, while + * the `eventEmitter.emit()` method is used to trigger the event. + * + * ```js + * const EventEmitter = require('events'); + * + * class MyEmitter extends EventEmitter {} + * + * const myEmitter = new MyEmitter(); + * myEmitter.on('event', () => { + * console.log('an event occurred!'); + * }); + * myEmitter.emit('event'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js) + */ +declare module 'events' { + // NOTE: This class is in the docs but is **not actually exported** by Node. + // If https://github.com/nodejs/node/issues/39903 gets resolved and Node + // actually starts exporting the class, uncomment below. + + // import { EventListener, EventListenerObject } from '__dom-events'; + // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ + // interface NodeEventTarget extends EventTarget { + // /** + // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. + // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. + // */ + // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; + // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ + // eventNames(): string[]; + // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ + // listenerCount(type: string): number; + // /** Node.js-specific alias for `eventTarget.removeListener()`. */ + // off(type: string, listener: EventListener | EventListenerObject): this; + // /** Node.js-specific alias for `eventTarget.addListener()`. */ + // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; + // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ + // once(type: string, listener: EventListener | EventListenerObject): this; + // /** + // * Node.js-specific extension to the `EventTarget` class. + // * If `type` is specified, removes all registered listeners for `type`, + // * otherwise removes all registered listeners. + // */ + // removeAllListeners(type: string): this; + // /** + // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. + // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. + // */ + // removeListener(type: string, listener: EventListener | EventListenerObject): this; + // } + + interface EventEmitterOptions { + /** + * Enables automatic capturing of promise rejection. + */ + captureRejections?: boolean | undefined; + } + // Any EventTarget with a Node-style `once` function + interface _NodeEventTarget { + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + } + // Any EventTarget with a DOM-style `addEventListener` + interface _DOMEventTarget { + addEventListener( + eventName: string, + listener: (...args: any[]) => void, + opts?: { + once: boolean; + } + ): any; + } + interface StaticEventEmitterOptions { + signal?: AbortSignal | undefined; + } + interface EventEmitter extends NodeJS.EventEmitter {} + /** + * The `EventEmitter` class is defined and exposed by the `events` module: + * + * ```js + * const EventEmitter = require('events'); + * ``` + * + * All `EventEmitter`s emit the event `'newListener'` when new listeners are + * added and `'removeListener'` when existing listeners are removed. + * + * It supports the following option: + * @since v0.1.26 + */ + class EventEmitter { + constructor(options?: EventEmitterOptions); + /** + * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given + * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. + * The `Promise` will resolve with an array of all the arguments emitted to the + * given event. + * + * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event + * semantics and does not listen to the `'error'` event. + * + * ```js + * const { once, EventEmitter } = require('events'); + * + * async function run() { + * const ee = new EventEmitter(); + * + * process.nextTick(() => { + * ee.emit('myevent', 42); + * }); + * + * const [value] = await once(ee, 'myevent'); + * console.log(value); + * + * const err = new Error('kaboom'); + * process.nextTick(() => { + * ee.emit('error', err); + * }); + * + * try { + * await once(ee, 'myevent'); + * } catch (err) { + * console.log('error happened', err); + * } + * } + * + * run(); + * ``` + * + * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the + * '`error'` event itself, then it is treated as any other kind of event without + * special handling: + * + * ```js + * const { EventEmitter, once } = require('events'); + * + * const ee = new EventEmitter(); + * + * once(ee, 'error') + * .then(([err]) => console.log('ok', err.message)) + * .catch((err) => console.log('error', err.message)); + * + * ee.emit('error', new Error('boom')); + * + * // Prints: ok boom + * ``` + * + * An `AbortSignal` can be used to cancel waiting for the event: + * + * ```js + * const { EventEmitter, once } = require('events'); + * + * const ee = new EventEmitter(); + * const ac = new AbortController(); + * + * async function foo(emitter, event, signal) { + * try { + * await once(emitter, event, { signal }); + * console.log('event emitted!'); + * } catch (error) { + * if (error.name === 'AbortError') { + * console.error('Waiting for the event was canceled!'); + * } else { + * console.error('There was an error', error.message); + * } + * } + * } + * + * foo(ee, 'foo', ac.signal); + * ac.abort(); // Abort waiting for the event + * ee.emit('foo'); // Prints: Waiting for the event was canceled! + * ``` + * @since v11.13.0, v10.16.0 + */ + static once(emitter: _NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise; + static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; + /** + * ```js + * const { on, EventEmitter } = require('events'); + * + * (async () => { + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo')) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * })(); + * ``` + * + * Returns an `AsyncIterator` that iterates `eventName` events. It will throw + * if the `EventEmitter` emits `'error'`. It removes all listeners when + * exiting the loop. The `value` returned by each iteration is an array + * composed of the emitted event arguments. + * + * An `AbortSignal` can be used to cancel waiting on events: + * + * ```js + * const { on, EventEmitter } = require('events'); + * const ac = new AbortController(); + * + * (async () => { + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo', { signal: ac.signal })) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * })(); + * + * process.nextTick(() => ac.abort()); + * ``` + * @since v13.6.0, v12.16.0 + * @param eventName The name of the event being listened for + * @return that iterates `eventName` events emitted by the `emitter` + */ + static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator; + /** + * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. + * + * ```js + * const { EventEmitter, listenerCount } = require('events'); + * const myEmitter = new EventEmitter(); + * myEmitter.on('event', () => {}); + * myEmitter.on('event', () => {}); + * console.log(listenerCount(myEmitter, 'event')); + * // Prints: 2 + * ``` + * @since v0.9.12 + * @deprecated Since v3.2.0 - Use `listenerCount` instead. + * @param emitter The emitter to query + * @param eventName The event name + */ + static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the event listeners for the + * event target. This is useful for debugging and diagnostic purposes. + * + * ```js + * const { getEventListeners, EventEmitter } = require('events'); + * + * { + * const ee = new EventEmitter(); + * const listener = () => console.log('Events are fun'); + * ee.on('foo', listener); + * getEventListeners(ee, 'foo'); // [listener] + * } + * { + * const et = new EventTarget(); + * const listener = () => console.log('Events are fun'); + * et.addEventListener('foo', listener); + * getEventListeners(et, 'foo'); // [listener] + * } + * ``` + * @since v15.2.0, v14.17.0 + */ + static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; + /** + * ```js + * const { + * setMaxListeners, + * EventEmitter + * } = require('events'); + * + * const target = new EventTarget(); + * const emitter = new EventEmitter(); + * + * setMaxListeners(5, target, emitter); + * ``` + * @since v15.4.0 + * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. + * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} + * objects. + */ + static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; + /** + * This symbol shall be used to install a listener for only monitoring `'error'` + * events. Listeners installed using this symbol are called before the regular + * `'error'` listeners are called. + * + * Installing a listener using this symbol does not change the behavior once an + * `'error'` event is emitted, therefore the process will still crash if no + * regular `'error'` listener is installed. + */ + static readonly errorMonitor: unique symbol; + static readonly captureRejectionSymbol: unique symbol; + /** + * Sets or gets the default captureRejection value for all emitters. + */ + // TODO: These should be described using static getter/setter pairs: + static captureRejections: boolean; + static defaultMaxListeners: number; + } + import internal = require('node:events'); + namespace EventEmitter { + // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 + export { internal as EventEmitter }; + export interface Abortable { + /** + * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. + */ + signal?: AbortSignal | undefined; + } + } + global { + namespace NodeJS { + interface EventEmitter { + /** + * Alias for `emitter.on(eventName, listener)`. + * @since v0.1.26 + */ + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds the `listener` function to the end of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * const myEE = new EventEmitter(); + * myEE.on('foo', () => console.log('a')); + * myEE.prependListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.1.101 + * @param eventName The name of the event. + * @param listener The callback function + */ + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds a **one-time**`listener` function for the event named `eventName`. The + * next time `eventName` is triggered, this listener is removed and then invoked. + * + * ```js + * server.once('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * const myEE = new EventEmitter(); + * myEE.once('foo', () => console.log('a')); + * myEE.prependOnceListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.3.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Removes the specified `listener` from the listener array for the event named`eventName`. + * + * ```js + * const callback = (stream) => { + * console.log('someone connected!'); + * }; + * server.on('connection', callback); + * // ... + * server.removeListener('connection', callback); + * ``` + * + * `removeListener()` will remove, at most, one instance of a listener from the + * listener array. If any single listener has been added multiple times to the + * listener array for the specified `eventName`, then `removeListener()` must be + * called multiple times to remove each instance. + * + * Once an event is emitted, all listeners attached to it at the + * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution + * will not remove them from`emit()` in progress. Subsequent events behave as expected. + * + * ```js + * const myEmitter = new MyEmitter(); + * + * const callbackA = () => { + * console.log('A'); + * myEmitter.removeListener('event', callbackB); + * }; + * + * const callbackB = () => { + * console.log('B'); + * }; + * + * myEmitter.on('event', callbackA); + * + * myEmitter.on('event', callbackB); + * + * // callbackA removes listener callbackB but it will still be called. + * // Internal listener array at time of emit [callbackA, callbackB] + * myEmitter.emit('event'); + * // Prints: + * // A + * // B + * + * // callbackB is now removed. + * // Internal listener array [callbackA] + * myEmitter.emit('event'); + * // Prints: + * // A + * ``` + * + * Because listeners are managed using an internal array, calling this will + * change the position indices of any listener registered _after_ the listener + * being removed. This will not impact the order in which listeners are called, + * but it means that any copies of the listener array as returned by + * the `emitter.listeners()` method will need to be recreated. + * + * When a single function has been added as a handler multiple times for a single + * event (as in the example below), `removeListener()` will remove the most + * recently added instance. In the example the `once('ping')`listener is removed: + * + * ```js + * const ee = new EventEmitter(); + * + * function pong() { + * console.log('pong'); + * } + * + * ee.on('ping', pong); + * ee.once('ping', pong); + * ee.removeListener('ping', pong); + * + * ee.emit('ping'); + * ee.emit('ping'); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Alias for `emitter.removeListener()`. + * @since v10.0.0 + */ + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Removes all listeners, or those of the specified `eventName`. + * + * It is bad practice to remove listeners added elsewhere in the code, + * particularly when the `EventEmitter` instance was created by some other + * component or module (e.g. sockets or file streams). + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + removeAllListeners(event?: string | symbol): this; + /** + * By default `EventEmitter`s will print a warning if more than `10` listeners are + * added for a particular event. This is a useful default that helps finding + * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be + * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.3.5 + */ + setMaxListeners(n: number): this; + /** + * Returns the current max listener value for the `EventEmitter` which is either + * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. + * @since v1.0.0 + */ + getMaxListeners(): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * console.log(util.inspect(server.listeners('connection'))); + * // Prints: [ [Function] ] + * ``` + * @since v0.1.26 + */ + listeners(eventName: string | symbol): Function[]; + /** + * Returns a copy of the array of listeners for the event named `eventName`, + * including any wrappers (such as those created by `.once()`). + * + * ```js + * const emitter = new EventEmitter(); + * emitter.once('log', () => console.log('log once')); + * + * // Returns a new Array with a function `onceWrapper` which has a property + * // `listener` which contains the original listener bound above + * const listeners = emitter.rawListeners('log'); + * const logFnWrapper = listeners[0]; + * + * // Logs "log once" to the console and does not unbind the `once` event + * logFnWrapper.listener(); + * + * // Logs "log once" to the console and removes the listener + * logFnWrapper(); + * + * emitter.on('log', () => console.log('log persistently')); + * // Will return a new Array with a single function bound by `.on()` above + * const newListeners = emitter.rawListeners('log'); + * + * // Logs "log persistently" twice + * newListeners[0](); + * emitter.emit('log'); + * ``` + * @since v9.4.0 + */ + rawListeners(eventName: string | symbol): Function[]; + /** + * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments + * to each. + * + * Returns `true` if the event had listeners, `false` otherwise. + * + * ```js + * const EventEmitter = require('events'); + * const myEmitter = new EventEmitter(); + * + * // First listener + * myEmitter.on('event', function firstListener() { + * console.log('Helloooo! first listener'); + * }); + * // Second listener + * myEmitter.on('event', function secondListener(arg1, arg2) { + * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); + * }); + * // Third listener + * myEmitter.on('event', function thirdListener(...args) { + * const parameters = args.join(', '); + * console.log(`event with parameters ${parameters} in third listener`); + * }); + * + * console.log(myEmitter.listeners('event')); + * + * myEmitter.emit('event', 1, 2, 3, 4, 5); + * + * // Prints: + * // [ + * // [Function: firstListener], + * // [Function: secondListener], + * // [Function: thirdListener] + * // ] + * // Helloooo! first listener + * // event with parameters 1, 2 in second listener + * // event with parameters 1, 2, 3, 4, 5 in third listener + * ``` + * @since v0.1.26 + */ + emit(eventName: string | symbol, ...args: any[]): boolean; + /** + * Returns the number of listeners listening to the event named `eventName`. + * @since v3.2.0 + * @param eventName The name of the event being listened for + */ + listenerCount(eventName: string | symbol): number; + /** + * Adds the `listener` function to the _beginning_ of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.prependListener('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this + * listener is removed, and then invoked. + * + * ```js + * server.prependOnceListener('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Returns an array listing the events for which the emitter has registered + * listeners. The values in the array are strings or `Symbol`s. + * + * ```js + * const EventEmitter = require('events'); + * const myEE = new EventEmitter(); + * myEE.on('foo', () => {}); + * myEE.on('bar', () => {}); + * + * const sym = Symbol('symbol'); + * myEE.on(sym, () => {}); + * + * console.log(myEE.eventNames()); + * // Prints: [ 'foo', 'bar', Symbol(symbol) ] + * ``` + * @since v6.0.0 + */ + eventNames(): Array; + } + } + } + export = EventEmitter; +} +declare module 'node:events' { + import events = require('events'); + export = events; +} diff --git a/server/node_modules/@types/node/ts4.8/fs.d.ts b/server/node_modules/@types/node/ts4.8/fs.d.ts new file mode 100755 index 0000000000..75c53fb0d5 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/fs.d.ts @@ -0,0 +1,3872 @@ +/** + * The `fs` module enables interacting with the file system in a + * way modeled on standard POSIX functions. + * + * To use the promise-based APIs: + * + * ```js + * import * as fs from 'fs/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as fs from 'fs'; + * ``` + * + * All file system operations have synchronous, callback, and promise-based + * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/fs.js) + */ +declare module 'fs' { + import * as stream from 'node:stream'; + import { Abortable, EventEmitter } from 'node:events'; + import { URL } from 'node:url'; + import * as promises from 'node:fs/promises'; + export { promises }; + /** + * Valid types for path values in "fs". + */ + export type PathLike = string | Buffer | URL; + export type PathOrFileDescriptor = PathLike | number; + export type TimeLike = string | number | Date; + export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; + export type BufferEncodingOption = + | 'buffer' + | { + encoding: 'buffer'; + }; + export interface ObjectEncodingOptions { + encoding?: BufferEncoding | null | undefined; + } + export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; + export type OpenMode = number | string; + export type Mode = number | string; + export interface StatsBase { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: T; + ino: T; + mode: T; + nlink: T; + uid: T; + gid: T; + rdev: T; + size: T; + blksize: T; + blocks: T; + atimeMs: T; + mtimeMs: T; + ctimeMs: T; + birthtimeMs: T; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + export interface Stats extends StatsBase {} + /** + * A `fs.Stats` object provides information about a file. + * + * Objects returned from {@link stat}, {@link lstat} and {@link fstat} and + * their synchronous counterparts are of this type. + * If `bigint` in the `options` passed to those methods is true, the numeric values + * will be `bigint` instead of `number`, and the object will contain additional + * nanosecond-precision properties suffixed with `Ns`. + * + * ```console + * Stats { + * dev: 2114, + * ino: 48064969, + * mode: 33188, + * nlink: 1, + * uid: 85, + * gid: 100, + * rdev: 0, + * size: 527, + * blksize: 4096, + * blocks: 8, + * atimeMs: 1318289051000.1, + * mtimeMs: 1318289051000.1, + * ctimeMs: 1318289051000.1, + * birthtimeMs: 1318289051000.1, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * + * `bigint` version: + * + * ```console + * BigIntStats { + * dev: 2114n, + * ino: 48064969n, + * mode: 33188n, + * nlink: 1n, + * uid: 85n, + * gid: 100n, + * rdev: 0n, + * size: 527n, + * blksize: 4096n, + * blocks: 8n, + * atimeMs: 1318289051000n, + * mtimeMs: 1318289051000n, + * ctimeMs: 1318289051000n, + * birthtimeMs: 1318289051000n, + * atimeNs: 1318289051000000000n, + * mtimeNs: 1318289051000000000n, + * ctimeNs: 1318289051000000000n, + * birthtimeNs: 1318289051000000000n, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * @since v0.1.21 + */ + export class Stats {} + /** + * A representation of a directory entry, which can be a file or a subdirectory + * within the directory, as returned by reading from an `fs.Dir`. The + * directory entry is a combination of the file name and file type pairs. + * + * Additionally, when {@link readdir} or {@link readdirSync} is called with + * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. + * @since v10.10.0 + */ + export class Dirent { + /** + * Returns `true` if the `fs.Dirent` object describes a regular file. + * @since v10.10.0 + */ + isFile(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a file system + * directory. + * @since v10.10.0 + */ + isDirectory(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a block device. + * @since v10.10.0 + */ + isBlockDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a character device. + * @since v10.10.0 + */ + isCharacterDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a symbolic link. + * @since v10.10.0 + */ + isSymbolicLink(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a first-in-first-out + * (FIFO) pipe. + * @since v10.10.0 + */ + isFIFO(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a socket. + * @since v10.10.0 + */ + isSocket(): boolean; + /** + * The file name that this `fs.Dirent` object refers to. The type of this + * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. + * @since v10.10.0 + */ + name: string; + } + /** + * A class representing a directory stream. + * + * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. + * + * ```js + * import { opendir } from 'fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + */ + export class Dir implements AsyncIterable { + /** + * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. + * @since v12.12.0 + */ + readonly path: string; + /** + * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. + */ + [Symbol.asyncIterator](): AsyncIterableIterator; + /** + * Asynchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * + * A promise is returned that will be resolved after the resource has been + * closed. + * @since v12.12.0 + */ + close(): Promise; + close(cb: NoParamCallback): void; + /** + * Synchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * @since v12.12.0 + */ + closeSync(): void; + /** + * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. + * + * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + * @return containing {fs.Dirent|null} + */ + read(): Promise; + read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; + /** + * Synchronously read the next directory entry as an `fs.Dirent`. See the + * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. + * + * If there are no more directory entries to read, `null` will be returned. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + */ + readSync(): Dirent | null; + } + /** + * Class: fs.StatWatcher + * @since v14.3.0, v12.20.0 + * Extends `EventEmitter` + * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. + */ + export interface StatWatcher extends EventEmitter { + /** + * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have + * no effect. + * + * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally + * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been + * called previously. + * @since v14.3.0, v12.20.0 + */ + ref(): this; + /** + * When called, the active `fs.StatWatcher` object will not require the Node.js + * event loop to remain active. If there is no other activity keeping the + * event loop running, the process may exit before the `fs.StatWatcher` object's + * callback is invoked. Calling `watcher.unref()` multiple times will have + * no effect. + * @since v14.3.0, v12.20.0 + */ + unref(): this; + } + export interface FSWatcher extends EventEmitter { + /** + * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. + * @since v0.5.8 + */ + close(): void; + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'close', listener: () => void): this; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'close', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'close', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + } + /** + * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. + * @since v0.1.93 + */ + export class ReadStream extends stream.Readable { + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes that have been read so far. + * @since v6.4.0 + */ + bytesRead: number; + /** + * The path to the file the stream is reading from as specified in the first + * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a + * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0, v10.16.0 + */ + pending: boolean; + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'open', listener: (fd: number) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'open', listener: (fd: number) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'open', listener: (fd: number) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'open', listener: (fd: number) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'open', listener: (fd: number) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * * Extends `stream.Writable` + * + * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. + * @since v0.1.93 + */ + export class WriteStream extends stream.Writable { + /** + * Closes `writeStream`. Optionally accepts a + * callback that will be executed once the `writeStream`is closed. + * @since v0.9.4 + */ + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes written so far. Does not include data that is still queued + * for writing. + * @since v0.4.7 + */ + bytesWritten: number; + /** + * The path to the file the stream is writing to as specified in the first + * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a + * `Buffer`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0 + */ + pending: boolean; + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'open', listener: (fd: number) => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'open', listener: (fd: number) => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'open', listener: (fd: number) => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'open', listener: (fd: number) => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'open', listener: (fd: number) => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * Asynchronously rename file at `oldPath` to the pathname provided + * as `newPath`. In the case that `newPath` already exists, it will + * be overwritten. If there is a directory at `newPath`, an error will + * be raised instead. No arguments other than a possible exception are + * given to the completion callback. + * + * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). + * + * ```js + * import { rename } from 'fs'; + * + * rename('oldFile.txt', 'newFile.txt', (err) => { + * if (err) throw err; + * console.log('Rename complete!'); + * }); + * ``` + * @since v0.0.2 + */ + export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + export namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + /** + * Renames the file from `oldPath` to `newPath`. Returns `undefined`. + * + * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. + * @since v0.1.21 + */ + export function renameSync(oldPath: PathLike, newPath: PathLike): void; + /** + * Truncates the file. No arguments other than a possible exception are + * given to the completion callback. A file descriptor can also be passed as the + * first argument. In this case, `fs.ftruncate()` is called. + * + * ```js + * import { truncate } from 'fs'; + * // Assuming that 'path/file.txt' is a regular file. + * truncate('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was truncated'); + * }); + * ``` + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * + * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. + * @since v0.8.6 + * @param [len=0] + */ + export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function truncate(path: PathLike, callback: NoParamCallback): void; + export namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(path: PathLike, len?: number | null): Promise; + } + /** + * Truncates the file. Returns `undefined`. A file descriptor can also be + * passed as the first argument. In this case, `fs.ftruncateSync()` is called. + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * @since v0.8.6 + * @param [len=0] + */ + export function truncateSync(path: PathLike, len?: number | null): void; + /** + * Truncates the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. + * + * If the file referred to by the file descriptor was larger than `len` bytes, only + * the first `len` bytes will be retained in the file. + * + * For example, the following program retains only the first four bytes of the + * file: + * + * ```js + * import { open, close, ftruncate } from 'fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('temp.txt', 'r+', (err, fd) => { + * if (err) throw err; + * + * try { + * ftruncate(fd, 4, (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * if (err) throw err; + * } + * }); + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v0.8.6 + * @param [len=0] + */ + export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + export function ftruncate(fd: number, callback: NoParamCallback): void; + export namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(fd: number, len?: number | null): Promise; + } + /** + * Truncates the file descriptor. Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link ftruncate}. + * @since v0.8.6 + * @param [len=0] + */ + export function ftruncateSync(fd: number, len?: number | null): void; + /** + * Asynchronously changes owner and group of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + export namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Synchronously changes owner and group of a file. Returns `undefined`. + * This is the synchronous version of {@link chown}. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + export function chownSync(path: PathLike, uid: number, gid: number): void; + /** + * Sets the owner of the file. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; + export namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + function __promisify__(fd: number, uid: number, gid: number): Promise; + } + /** + * Sets the owner of the file. Returns `undefined`. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + export function fchownSync(fd: number, uid: number, gid: number): void; + /** + * Set the owner of the symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. + */ + export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + export namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Set the owner for the path. Returns `undefined`. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + export function lchownSync(path: PathLike, uid: number, gid: number): void; + /** + * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic + * link, then the link is not dereferenced: instead, the timestamps of the + * symbolic link itself are changed. + * + * No arguments other than a possible exception are given to the completion + * callback. + * @since v14.5.0, v12.19.0 + */ + export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace lutimes { + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, + * with the difference that if the path refers to a symbolic link, then the link is not + * dereferenced: instead, the timestamps of the symbolic link itself are changed. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Change the file system timestamps of the symbolic link referenced by `path`. + * Returns `undefined`, or throws an exception when parameters are incorrect or + * the operation fails. This is the synchronous version of {@link lutimes}. + * @since v14.5.0, v12.19.0 + */ + export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Asynchronously changes the permissions of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * + * ```js + * import { chmod } from 'fs'; + * + * chmod('my_file.txt', 0o775, (err) => { + * if (err) throw err; + * console.log('The permissions for file "my_file.txt" have been changed!'); + * }); + * ``` + * @since v0.1.30 + */ + export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + export namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link chmod}. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * @since v0.6.7 + */ + export function chmodSync(path: PathLike, mode: Mode): void; + /** + * Sets the permissions on the file. No arguments other than a possible exception + * are given to the completion callback. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; + export namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(fd: number, mode: Mode): Promise; + } + /** + * Sets the permissions on the file. Returns `undefined`. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchmodSync(fd: number, mode: Mode): void; + /** + * Changes the permissions on a symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + /** @deprecated */ + export namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * Changes the permissions on a symbolic link. Returns `undefined`. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + export function lchmodSync(path: PathLike, mode: Mode): void; + /** + * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * + * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. + * Instead, user code should open/read/write the file directly and handle the + * error raised if the file is not available. + * + * To check if a file exists without manipulating it afterwards, {@link access} is recommended. + * + * For example, given the following directory structure: + * + * ```text + * - txtDir + * -- file.txt + * - app.js + * ``` + * + * The next program will check for the stats of the given paths: + * + * ```js + * import { stat } from 'fs'; + * + * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; + * + * for (let i = 0; i < pathsToCheck.length; i++) { + * stat(pathsToCheck[i], (err, stats) => { + * console.log(stats.isDirectory()); + * console.log(stats); + * }); + * } + * ``` + * + * The resulting output will resemble: + * + * ```console + * true + * Stats { + * dev: 16777220, + * mode: 16877, + * nlink: 3, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214262, + * size: 96, + * blocks: 0, + * atimeMs: 1561174653071.963, + * mtimeMs: 1561174614583.3518, + * ctimeMs: 1561174626623.5366, + * birthtimeMs: 1561174126937.2893, + * atime: 2019-06-22T03:37:33.072Z, + * mtime: 2019-06-22T03:36:54.583Z, + * ctime: 2019-06-22T03:37:06.624Z, + * birthtime: 2019-06-22T03:28:46.937Z + * } + * false + * Stats { + * dev: 16777220, + * mode: 33188, + * nlink: 1, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214074, + * size: 8, + * blocks: 8, + * atimeMs: 1561174616618.8555, + * mtimeMs: 1561174614584, + * ctimeMs: 1561174614583.8145, + * birthtimeMs: 1561174007710.7478, + * atime: 2019-06-22T03:36:56.619Z, + * mtime: 2019-06-22T03:36:54.584Z, + * ctime: 2019-06-22T03:36:54.584Z, + * birthtime: 2019-06-22T03:26:47.711Z + * } + * ``` + * @since v0.0.2 + */ + export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function stat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function stat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + export interface StatSyncFn extends Function { + (path: PathLike, options?: undefined): Stats; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + throwIfNoEntry: false; + } + ): Stats | undefined; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + throwIfNoEntry: false; + } + ): BigIntStats | undefined; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + } + ): Stats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + } + ): BigIntStats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: boolean; + throwIfNoEntry?: false | undefined; + } + ): Stats | BigIntStats; + (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; + } + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const statSync: StatSyncFn; + /** + * Invokes the callback with the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function fstat( + fd: number, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function fstat( + fd: number, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + function __promisify__( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + fd: number, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(fd: number, options?: StatOptions): Promise; + } + /** + * Retrieves the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + export function fstatSync( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Stats; + export function fstatSync( + fd: number, + options: StatOptions & { + bigint: true; + } + ): BigIntStats; + export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; + /** + * Retrieves the `fs.Stats` for the symbolic link referred to by the path. + * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic + * link, then the link itself is stat-ed, not the file that it refers to. + * + * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. + * @since v0.1.30 + */ + export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function lstat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function lstat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const lstatSync: StatSyncFn; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than + * a possible + * exception are given to the completion callback. + * @since v0.1.31 + */ + export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + export namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; + } + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.31 + */ + export function linkSync(existingPath: PathLike, newPath: PathLike): void; + /** + * Creates the link called `path` pointing to `target`. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. + * + * The `type` argument is only available on Windows and ignored on other platforms. + * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is + * not set, Node.js will autodetect `target` type and use `'file'` or `'dir'`. If + * the `target` does not exist, `'file'` will be used. Windows junction points + * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. + * + * Relative targets are relative to the link’s parent directory. + * + * ```js + * import { symlink } from 'fs'; + * + * symlink('./mew', './mewtwo', callback); + * ``` + * + * The above example creates a symbolic link `mewtwo` which points to `mew` in the + * same directory: + * + * ```bash + * $ tree . + * . + * ├── mew + * └── mewtwo -> ./mew + * ``` + * @since v0.1.31 + */ + export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; + export namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + type Type = 'dir' | 'file' | 'junction'; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link symlink}. + * @since v0.1.31 + */ + export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; + /** + * Reads the contents of the symbolic link referred to by `path`. The callback gets + * two arguments `(err, linkString)`. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path passed to the callback. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + export namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + } + /** + * Returns the symbolic link's string value. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + export function readlinkSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; + /** + * Asynchronously computes the canonical pathname by resolving `.`, `..` and + * symbolic links. + * + * A canonical pathname is not necessarily unique. Hard links and bind mounts can + * expose a file system entity through many pathnames. + * + * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: + * + * 1. No case conversion is performed on case-insensitive file systems. + * 2. The maximum number of symbolic links is platform-independent and generally + * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. + * + * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * If `path` resolves to a socket or a pipe, the function will return a system + * dependent name for that object. + * @since v0.1.31 + */ + export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + export namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). + * + * The `callback` gets two arguments `(err, resolvedPath)`. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v9.2.0 + */ + function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + } + /** + * Returns the resolved pathname. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link realpath}. + * @since v0.1.31 + */ + export function realpathSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; + export namespace realpathSync { + function native(path: PathLike, options?: EncodingOption): string; + function native(path: PathLike, options: BufferEncodingOption): Buffer; + function native(path: PathLike, options?: EncodingOption): string | Buffer; + } + /** + * Asynchronously removes a file or symbolic link. No arguments other than a + * possible exception are given to the completion callback. + * + * ```js + * import { unlink } from 'fs'; + * // Assuming that 'path/file.txt' is a regular file. + * unlink('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was deleted'); + * }); + * ``` + * + * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a + * directory, use {@link rmdir}. + * + * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. + * @since v0.0.2 + */ + export function unlink(path: PathLike, callback: NoParamCallback): void; + export namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. + * @since v0.1.21 + */ + export function unlinkSync(path: PathLike): void; + export interface RmDirOptions { + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number | undefined; + /** + * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning + * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. + * Use `fs.rm(path, { recursive: true, force: true })` instead. + * + * If `true`, perform a recursive directory removal. In + * recursive mode, operations are retried on failure. + * @default false + */ + recursive?: boolean | undefined; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number | undefined; + } + /** + * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given + * to the completion callback. + * + * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on + * Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. + * @since v0.0.2 + */ + export function rmdir(path: PathLike, callback: NoParamCallback): void; + export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; + export namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, options?: RmDirOptions): Promise; + } + /** + * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. + * + * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error + * on Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. + * @since v0.1.21 + */ + export function rmdirSync(path: PathLike, options?: RmDirOptions): void; + export interface RmOptions { + /** + * When `true`, exceptions will be ignored if `path` does not exist. + * @default false + */ + force?: boolean | undefined; + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number | undefined; + /** + * If `true`, perform a recursive directory removal. In + * recursive mode, operations are retried on failure. + * @default false + */ + recursive?: boolean | undefined; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number | undefined; + } + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the + * completion callback. + * @since v14.14.0 + */ + export function rm(path: PathLike, callback: NoParamCallback): void; + export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; + export namespace rm { + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). + */ + function __promisify__(path: PathLike, options?: RmOptions): Promise; + } + /** + * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. + * @since v14.14.0 + */ + export function rmSync(path: PathLike, options?: RmOptions): void; + export interface MakeDirectoryOptions { + /** + * Indicates whether parent folders should be created. + * If a folder was created, the path to the first created folder will be returned. + * @default false + */ + recursive?: boolean | undefined; + /** + * A file mode. If a string is passed, it is parsed as an octal integer. If not specified + * @default 0o777 + */ + mode?: Mode | undefined; + } + /** + * Asynchronously creates a directory. + * + * The callback is given a possible exception and, if `recursive` is `true`, the + * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was + * created. + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that + * exists results in an error only + * when `recursive` is false. + * + * ```js + * import { mkdir } from 'fs'; + * + * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. + * mkdir('/tmp/a/apple', { recursive: true }, (err) => { + * if (err) throw err; + * }); + * ``` + * + * On Windows, using `fs.mkdir()` on the root directory even with recursion will + * result in an error: + * + * ```js + * import { mkdir } from 'fs'; + * + * mkdir('/', { recursive: true }, (err) => { + * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] + * }); + * ``` + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.8 + */ + export function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + }, + callback: (err: NodeJS.ErrnoException | null, path?: string) => void + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir( + path: PathLike, + options: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + | undefined, + callback: NoParamCallback + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void; + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function mkdir(path: PathLike, callback: NoParamCallback): void; + export namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + } + /** + * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. + * This is the synchronous version of {@link mkdir}. + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.21 + */ + export function mkdirSync( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): string | undefined; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): void; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; + /** + * Creates a unique temporary directory. + * + * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform + * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, + * notably the BSDs, can return more than six random characters, and replace + * trailing `X` characters in `prefix` with random characters. + * + * The created directory path is passed as a string to the callback's second + * parameter. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'fs'; + * + * mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 + * }); + * ``` + * + * The `fs.mkdtemp()` method will append the six randomly selected characters + * directly to the `prefix` string. For instance, given a directory `/tmp`, if the + * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator + * (`require('path').sep`). + * + * ```js + * import { tmpdir } from 'os'; + * import { mkdtemp } from 'fs'; + * + * // The parent directory for the new temporary directory + * const tmpDir = tmpdir(); + * + * // This method is *INCORRECT*: + * mkdtemp(tmpDir, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmpabc123`. + * // A new temporary directory is created at the file system root + * // rather than *within* the /tmp directory. + * }); + * + * // This method is *CORRECT*: + * import { sep } from 'path'; + * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmp/abc123`. + * // A new temporary directory is created within + * // the /tmp directory. + * }); + * ``` + * @since v5.10.0 + */ + export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp( + prefix: string, + options: + | 'buffer' + | { + encoding: 'buffer'; + }, + callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void + ): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + export namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + } + /** + * Returns the created directory path. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link mkdtemp}. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * @since v5.10.0 + */ + export function mkdtempSync(prefix: string, options?: EncodingOption): string; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; + /** + * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. + * @since v0.1.8 + */ + export function readdir( + path: PathLike, + options: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + } + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + } + | 'buffer', + callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + }, + callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void + ): void; + export namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + } + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options: + | 'buffer' + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + } + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent + */ + function __promisify__( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + } + ): Promise; + } + /** + * Reads the contents of the directory. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames returned. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. + * @since v0.1.21 + */ + export function readdirSync( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + } + | BufferEncoding + | null + ): string[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + } + | 'buffer' + ): Buffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | null + ): string[] | Buffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdirSync( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + } + ): Dirent[]; + /** + * Closes the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.0.2 + */ + export function close(fd: number, callback?: NoParamCallback): void; + export namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Closes the file descriptor. Returns `undefined`. + * + * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.1.21 + */ + export function closeSync(fd: number): void; + /** + * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. + * + * `mode` sets the file mode (permission and sticky bits), but only if the file was + * created. On Windows, only the write permission can be manipulated; see {@link chmod}. + * + * The callback gets two arguments `(err, fd)`. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * + * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. + * @since v0.0.2 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] + */ + export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param [flags='r'] See `support of file system `flags``. + */ + export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + + export namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; + } + /** + * Returns an integer representing the file descriptor. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link open}. + * @since v0.1.21 + * @param [flags='r'] + * @param [mode=0o666] + */ + export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. + * @since v0.4.2 + */ + export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link utimes}. + * @since v0.4.2 + */ + export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Change the file system timestamps of the object referenced by the supplied file + * descriptor. See {@link utimes}. + * @since v0.4.2 + */ + export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Synchronous version of {@link futimes}. Returns `undefined`. + * @since v0.4.2 + */ + export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other + * than a possible exception are given to the completion callback. + * @since v0.1.96 + */ + export function fsync(fd: number, callback: NoParamCallback): void; + export namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.96 + */ + export function fsyncSync(fd: number): void; + /** + * Write `buffer` to the file specified by `fd`. + * + * `offset` determines the part of the buffer to be written, and `length` is + * an integer specifying the number of bytes to write. + * + * `position` refers to the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). + * + * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesWritten` and `buffer` properties. + * + * It is unsafe to use `fs.write()` multiple times on the same file without waiting + * for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v0.0.2 + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + position: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function write( + fd: number, + string: string, + position: number | undefined | null, + encoding: BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void + ): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + */ + export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + export namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function __promisify__( + fd: number, + buffer?: TBuffer, + offset?: number, + length?: number, + position?: number | null + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function __promisify__( + fd: number, + string: string, + position?: number | null, + encoding?: BufferEncoding | null + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link write}. + * @since v0.1.21 + * @return The number of bytes written. + */ + export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number; + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; + export type ReadPosition = number | bigint; + export interface ReadSyncOptions { + /** + * @default 0 + */ + offset?: number | undefined; + /** + * @default `length of buffer` + */ + length?: number | undefined; + /** + * @default null + */ + position?: ReadPosition | null | undefined; + } + export interface ReadAsyncOptions extends ReadSyncOptions { + buffer?: TBuffer; + } + /** + * Read data from the file specified by `fd`. + * + * The callback is given the three arguments, `(err, bytesRead, buffer)`. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffer` properties. + * @since v0.0.2 + * @param buffer The buffer that the data will be written to. + * @param offset The position in `buffer` to write the data to. + * @param length The number of bytes to read. + * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If + * `position` is an integer, the file position will be unchanged. + */ + export function read( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: ReadPosition | null, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void + ): void; + /** + * Similar to the above `fs.read` function, this version takes an optional `options` object. + * If not otherwise specified in an `options` object, + * `buffer` defaults to `Buffer.alloc(16384)`, + * `offset` defaults to `0`, + * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 + * `position` defaults to `null` + * @since v12.17.0, 13.11.0 + */ + export function read( + fd: number, + options: ReadAsyncOptions, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void + ): void; + export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void; + export namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + function __promisify__( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: number | null + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__( + fd: number, + options: ReadAsyncOptions + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__(fd: number): Promise<{ + bytesRead: number; + buffer: NodeJS.ArrayBufferView; + }>; + } + /** + * Returns the number of `bytesRead`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link read}. + * @since v0.1.21 + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number; + /** + * Similar to the above `fs.readSync` function, this version takes an optional `options` object. + * If no `options` object is specified, it will default with the above values. + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; + /** + * Asynchronously reads the entire contents of a file. + * + * ```js + * import { readFile } from 'fs'; + * + * readFile('/etc/passwd', (err, data) => { + * if (err) throw err; + * console.log(data); + * }); + * ``` + * + * The callback is passed two arguments `(err, data)`, where `data` is the + * contents of the file. + * + * If no encoding is specified, then the raw buffer is returned. + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { readFile } from 'fs'; + * + * readFile('/etc/passwd', 'utf8', callback); + * ``` + * + * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an + * error will be returned. On FreeBSD, a representation of the directory's contents + * will be returned. + * + * ```js + * import { readFile } from 'fs'; + * + * // macOS, Linux, and Windows + * readFile('', (err, data) => { + * // => [Error: EISDIR: illegal operation on a directory, read ] + * }); + * + * // FreeBSD + * readFile('', (err, data) => { + * // => null, + * }); + * ``` + * + * It is possible to abort an ongoing request using an `AbortSignal`. If a + * request is aborted the callback is called with an `AbortError`: + * + * ```js + * import { readFile } from 'fs'; + * + * const controller = new AbortController(); + * const signal = controller.signal; + * readFile(fileInfo[0].name, { signal }, (err, buf) => { + * // ... + * }); + * // When you want to abort the request + * controller.abort(); + * ``` + * + * The `fs.readFile()` function buffers the entire file. To minimize memory costs, + * when possible prefer streaming via `fs.createReadStream()`. + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * @since v0.1.29 + * @param path filename or file descriptor + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding?: null | undefined; + flag?: string | undefined; + } & Abortable) + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding: BufferEncoding; + flag?: string | undefined; + } & Abortable) + | BufferEncoding, + callback: (err: NodeJS.ErrnoException | null, data: string) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | (ObjectEncodingOptions & { + flag?: string | undefined; + } & Abortable) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; + export namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null + ): Promise; + } + /** + * Returns the contents of the `path`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readFile}. + * + * If the `encoding` option is specified then this function returns a + * string. Otherwise it returns a buffer. + * + * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. + * + * ```js + * import { readFileSync } from 'fs'; + * + * // macOS, Linux, and Windows + * readFileSync(''); + * // => [Error: EISDIR: illegal operation on a directory, read ] + * + * // FreeBSD + * readFileSync(''); // => + * ``` + * @since v0.1.8 + * @param path filename or file descriptor + */ + export function readFileSync( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null + ): Buffer; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding + ): string; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null + ): string | Buffer; + export type WriteFileOptions = + | (ObjectEncodingOptions & + Abortable & { + mode?: Mode | undefined; + flag?: string | undefined; + }) + | BufferEncoding + | null; + /** + * When `file` is a filename, asynchronously writes data to the file, replacing the + * file if it already exists. `data` can be a string or a buffer. + * + * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using + * a file descriptor. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { writeFile } from 'fs'; + * import { Buffer } from 'buffer'; + * + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, (err) => { + * if (err) throw err; + * console.log('The file has been saved!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { writeFile } from 'fs'; + * + * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); + * ``` + * + * It is unsafe to use `fs.writeFile()` multiple times on the same file without + * waiting for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that + * performs multiple `write` calls internally to write the buffer passed to it. + * For performance sensitive code consider using {@link createWriteStream}. + * + * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'fs'; + * import { Buffer } from 'buffer'; + * + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, { signal }, (err) => { + * // When a request is aborted - the callback is called with an AbortError + * }); + * // When the request should be aborted + * controller.abort(); + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v0.1.29 + * @param file filename or file descriptor + */ + export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; + export namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function __promisify__(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; + } + /** + * Returns `undefined`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writeFile}. + * @since v0.1.29 + * @param file filename or file descriptor + */ + export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFile } from 'fs'; + * + * appendFile('message.txt', 'data to append', (err) => { + * if (err) throw err; + * console.log('The "data to append" was appended to file!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFile } from 'fs'; + * + * appendFile('message.txt', 'data to append', 'utf8', callback); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { open, close, appendFile } from 'fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('message.txt', 'a', (err, fd) => { + * if (err) throw err; + * + * try { + * appendFile(fd, 'data to append', 'utf8', (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * throw err; + * } + * }); + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void; + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; + export namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function __promisify__(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise; + } + /** + * Synchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFileSync } from 'fs'; + * + * try { + * appendFileSync('message.txt', 'data to append'); + * console.log('The "data to append" was appended to file!'); + * } catch (err) { + * // Handle the error + * } + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFileSync } from 'fs'; + * + * appendFileSync('message.txt', 'data to append', 'utf8'); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { openSync, closeSync, appendFileSync } from 'fs'; + * + * let fd; + * + * try { + * fd = openSync('message.txt', 'a'); + * appendFileSync(fd, 'data to append', 'utf8'); + * } catch (err) { + * // Handle the error + * } finally { + * if (fd !== undefined) + * closeSync(fd); + * } + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void; + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + export interface WatchFileOptions { + bigint?: boolean | undefined; + persistent?: boolean | undefined; + interval?: number | undefined; + } + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + export function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint?: false | undefined; + }) + | undefined, + listener: (curr: Stats, prev: Stats) => void + ): StatWatcher; + export function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint: true; + }) + | undefined, + listener: (curr: BigIntStats, prev: BigIntStats) => void + ): StatWatcher; + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): StatWatcher; + /** + * Stop watching for changes on `filename`. If `listener` is specified, only that + * particular listener is removed. Otherwise, _all_ listeners are removed, + * effectively stopping watching of `filename`. + * + * Calling `fs.unwatchFile()` with a filename that is not being watched is a + * no-op, not an error. + * + * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. + * @since v0.1.31 + * @param listener Optional, a listener previously attached using `fs.watchFile()` + */ + export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; + export interface WatchOptions extends Abortable { + encoding?: BufferEncoding | 'buffer' | undefined; + persistent?: boolean | undefined; + recursive?: boolean | undefined; + } + export type WatchEventType = 'rename' | 'change'; + export type WatchListener = (event: WatchEventType, filename: T) => void; + /** + * Watch for changes on `filename`, where `filename` is either a file or a + * directory. + * + * The second argument is optional. If `options` is provided as a string, it + * specifies the `encoding`. Otherwise `options` should be passed as an object. + * + * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file + * which triggered the event. + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. + * + * If a `signal` is passed, aborting the corresponding AbortController will close + * the returned `fs.FSWatcher`. + * @since v0.5.10 + * @param listener + */ + export function watch( + filename: PathLike, + options: + | (WatchOptions & { + encoding: 'buffer'; + }) + | 'buffer', + listener?: WatchListener + ): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; + /** + * Test whether or not the given path exists by checking with the file system. + * Then call the `callback` argument with either true or false: + * + * ```js + * import { exists } from 'fs'; + * + * exists('/etc/passwd', (e) => { + * console.log(e ? 'it exists' : 'no passwd!'); + * }); + * ``` + * + * **The parameters for this callback are not consistent with other Node.js** + * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback + * has only one boolean parameter. This is one reason `fs.access()` is recommended + * instead of `fs.exists()`. + * + * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file does not exist. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { exists, open, close } from 'fs'; + * + * exists('myfile', (e) => { + * if (e) { + * console.error('myfile already exists'); + * } else { + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'fs'; + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { open, close, exists } from 'fs'; + * + * exists('myfile', (e) => { + * if (e) { + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } else { + * console.error('myfile does not exist'); + * } + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for existence and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the existence of a file only if the file won’t be + * used directly, for example when its existence is a signal from another + * process. + * @since v0.0.2 + * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. + */ + export function exists(path: PathLike, callback: (exists: boolean) => void): void; + /** @deprecated */ + export namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Returns `true` if the path exists, `false` otherwise. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link exists}. + * + * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other + * Node.js callbacks. `fs.existsSync()` does not use a callback. + * + * ```js + * import { existsSync } from 'fs'; + * + * if (existsSync('/etc/passwd')) + * console.log('The path exists.'); + * ``` + * @since v0.1.21 + */ + export function existsSync(path: PathLike): boolean; + export namespace constants { + // File Access Constants + /** Constant for fs.access(). File is visible to the calling process. */ + const F_OK: number; + /** Constant for fs.access(). File can be read by the calling process. */ + const R_OK: number; + /** Constant for fs.access(). File can be written by the calling process. */ + const W_OK: number; + /** Constant for fs.access(). File can be executed by the calling process. */ + const X_OK: number; + // File Copy Constants + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + const COPYFILE_EXCL: number; + /** + * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. + */ + const COPYFILE_FICLONE: number; + /** + * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then the operation will fail with an error. + */ + const COPYFILE_FICLONE_FORCE: number; + // File Open Constants + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + const O_RDONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + const O_WRONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + const O_RDWR: number; + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + const O_CREAT: number; + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + const O_EXCL: number; + /** + * Constant for fs.open(). Flag indicating that if path identifies a terminal device, + * opening the path shall not cause that terminal to become the controlling terminal for the process + * (if the process does not already have one). + */ + const O_NOCTTY: number; + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + const O_TRUNC: number; + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + const O_APPEND: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + const O_DIRECTORY: number; + /** + * constant for fs.open(). + * Flag indicating reading accesses to the file system will no longer result in + * an update to the atime information associated with the file. + * This flag is available on Linux operating systems only. + */ + const O_NOATIME: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + const O_NOFOLLOW: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + const O_SYNC: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + const O_DSYNC: number; + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + const O_SYMLINK: number; + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + const O_DIRECT: number; + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + const O_NONBLOCK: number; + // File Type Constants + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + const S_IFMT: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + const S_IFREG: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + const S_IFDIR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + const S_IFCHR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + const S_IFBLK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + const S_IFIFO: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + const S_IFLNK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + const S_IFSOCK: number; + // File Mode Constants + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + const S_IRWXU: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + const S_IRUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + const S_IWUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + const S_IXUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + const S_IRWXG: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + const S_IRGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + const S_IWGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + const S_IXGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + const S_IRWXO: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + const S_IROTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + const S_IWOTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + const S_IXOTH: number; + /** + * When set, a memory file mapping is used to access the file. This flag + * is available on Windows operating systems only. On other operating systems, + * this flag is ignored. + */ + const UV_FS_O_FILEMAP: number; + } + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * The final argument, `callback`, is a callback function that is invoked with + * a possible error argument. If any of the accessibility checks fail, the error + * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. + * + * ```js + * import { access, constants } from 'fs'; + * + * const file = 'package.json'; + * + * // Check if the file exists in the current directory. + * access(file, constants.F_OK, (err) => { + * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); + * }); + * + * // Check if the file is readable. + * access(file, constants.R_OK, (err) => { + * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); + * }); + * + * // Check if the file is writable. + * access(file, constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); + * }); + * + * // Check if the file is readable and writable. + * access(file, constants.R_OK | constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); + * }); + * ``` + * + * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file is not accessible. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'fs'; + * + * access('myfile', (err) => { + * if (!err) { + * console.error('myfile already exists'); + * return; + * } + * + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'fs'; + * + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'fs'; + * access('myfile', (err) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for accessibility and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the accessibility of a file only if the file will not be + * used directly, for example when its accessibility is a signal from another + * process. + * + * On Windows, access-control policies (ACLs) on a directory may limit access to + * a file or directory. The `fs.access()` function, however, does not check the + * ACL and therefore may report that a path is accessible even if the ACL restricts + * the user from reading or writing to it. + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function access(path: PathLike, callback: NoParamCallback): void; + export namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike, mode?: number): Promise; + } + /** + * Synchronously tests a user's permissions for the file or directory specified + * by `path`. The `mode` argument is an optional integer that specifies the + * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and + * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, + * the method will return `undefined`. + * + * ```js + * import { accessSync, constants } from 'fs'; + * + * try { + * accessSync('etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can read/write'); + * } catch (err) { + * console.error('no access!'); + * } + * ``` + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + export function accessSync(path: PathLike, mode?: number): void; + interface StreamOptions { + flags?: string | undefined; + encoding?: BufferEncoding | undefined; + fd?: number | promises.FileHandle | undefined; + mode?: number | undefined; + autoClose?: boolean | undefined; + /** + * @default false + */ + emitClose?: boolean | undefined; + start?: number | undefined; + highWaterMark?: number | undefined; + } + interface ReadStreamOptions extends StreamOptions { + end?: number | undefined; + } + /** + * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream + * returned by this method has a default `highWaterMark` of 64 kb. + * + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is + * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the + * current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use + * the specified file descriptor. This means that no `'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. + * + * If `fd` points to a character device that only supports blocking reads + * (such as keyboard or sound card), read operations do not finish until data is + * available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, + * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is + * also required. + * + * ```js + * import { createReadStream } from 'fs'; + * + * // Create a stream from some character device. + * const stream = createReadStream('/dev/input/event0'); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * `mode` sets the file mode (permission and sticky bits), but only if the + * file was created. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { createReadStream } from 'fs'; + * + * createReadStream('sample.txt', { start: 90, end: 99 }); + * ``` + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` option to be set to `r+` rather than the + * default `w`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce + * performance as some optimizations (`_writev()`) + * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override + * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. + * + * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s + * should be passed to `net.Socket`. + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other + * than a possible + * exception are given to the completion callback. + * @since v0.1.96 + */ + export function fdatasync(fd: number, callback: NoParamCallback): void; + export namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. + * @since v0.1.96 + */ + export function fdatasyncSync(fd: number): void; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. No arguments other than a possible exception are given to the + * callback function. Node.js makes no guarantees about the atomicity of the copy + * operation. If an error occurs after the destination file has been opened for + * writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFile, constants } from 'fs'; + * + * function callback(err) { + * if (err) throw err; + * console.log('source.txt was copied to destination.txt'); + * } + * + * // destination.txt will be created or overwritten by default. + * copyFile('source.txt', 'destination.txt', callback); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; + export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; + export namespace copyFile { + function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; + } + /** + * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. Returns `undefined`. Node.js makes no guarantees about the + * atomicity of the copy operation. If an error occurs after the destination file + * has been opened for writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFileSync, constants } from 'fs'; + * + * // destination.txt will be created or overwritten by default. + * copyFileSync('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; + /** + * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. + * + * `position` is the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. + * + * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. + * + * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. + * + * It is unsafe to use `fs.writev()` multiple times on the same file without + * waiting for the callback. For this scenario, use {@link createWriteStream}. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + */ + export function writev(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; + export function writev( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export interface WriteVResult { + bytesWritten: number; + buffers: NodeJS.ArrayBufferView[]; + } + export namespace writev { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writev}. + * @since v12.9.0 + * @return The number of bytes written. + */ + export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; + /** + * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s + * using `readv()`. + * + * `position` is the offset from the beginning of the file from where data + * should be read. If `typeof position !== 'number'`, the data will be read + * from the current position. + * + * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffers` properties. + * @since v13.13.0, v12.17.0 + */ + export function readv(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void; + export function readv( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export interface ReadVResult { + bytesRead: number; + buffers: NodeJS.ArrayBufferView[]; + } + export namespace readv { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readv}. + * @since v13.13.0, v12.17.0 + * @return The number of bytes read. + */ + export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; + export interface OpenDirOptions { + encoding?: BufferEncoding | undefined; + /** + * Number of directory entries that are buffered + * internally when reading from the directory. Higher values lead to better + * performance but higher memory usage. + * @default 32 + */ + bufferSize?: number | undefined; + } + /** + * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; + /** + * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for + * more details. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + export function opendir(path: PathLike, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + export namespace opendir { + function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; + } + export interface BigIntStats extends StatsBase { + atimeNs: bigint; + mtimeNs: bigint; + ctimeNs: bigint; + birthtimeNs: bigint; + } + export interface BigIntOptions { + bigint: true; + } + export interface StatOptions { + bigint?: boolean | undefined; + } + export interface StatSyncOptions extends StatOptions { + throwIfNoEntry?: boolean | undefined; + } + interface CopyOptionsBase { + /** + * Dereference symlinks + * @default false + */ + dereference?: boolean; + /** + * When `force` is `false`, and the destination + * exists, throw an error. + * @default false + */ + errorOnExist?: boolean; + /** + * Overwrite existing file or directory. _The copy + * operation will ignore errors if you set this to false and the destination + * exists. Use the `errorOnExist` option to change this behavior. + * @default true + */ + force?: boolean; + /** + * When `true` timestamps from `src` will + * be preserved. + * @default false + */ + preserveTimestamps?: boolean; + /** + * Copy directories recursively. + * @default false + */ + recursive?: boolean; + /** + * When true, path resolution for symlinks will be skipped + * @default false + */ + verbatimSymlinks?: boolean; + } + export interface CopyOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?(source: string, destination: string): boolean | Promise; + } + export interface CopySyncOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?(source: string, destination: string): boolean; + } + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + export function cp(source: string | URL, destination: string | URL, callback: (err: NodeJS.ErrnoException | null) => void): void; + export function cp(source: string | URL, destination: string | URL, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; + /** + * Synchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; +} +declare module 'node:fs' { + export * from 'fs'; +} diff --git a/server/node_modules/@types/node/ts4.8/fs/promises.d.ts b/server/node_modules/@types/node/ts4.8/fs/promises.d.ts new file mode 100755 index 0000000000..aca2fd51b2 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/fs/promises.d.ts @@ -0,0 +1,1138 @@ +/** + * The `fs/promises` API provides asynchronous file system methods that return + * promises. + * + * The promise APIs use the underlying Node.js threadpool to perform file + * system operations off the event loop thread. These operations are not + * synchronized or threadsafe. Care must be taken when performing multiple + * concurrent modifications on the same file or data corruption may occur. + * @since v10.0.0 + */ +declare module 'fs/promises' { + import { Abortable } from 'node:events'; + import { Stream } from 'node:stream'; + import { ReadableStream } from 'node:stream/web'; + import { + BigIntStats, + BufferEncodingOption, + constants as fsConstants, + CopyOptions, + Dir, + Dirent, + MakeDirectoryOptions, + Mode, + ObjectEncodingOptions, + OpenDirOptions, + OpenMode, + PathLike, + ReadStream, + ReadVResult, + RmDirOptions, + RmOptions, + StatOptions, + Stats, + TimeLike, + WatchEventType, + WatchOptions, + WriteStream, + WriteVResult, + } from 'node:fs'; + import { Interface as ReadlineInterface } from 'node:readline'; + + interface FileChangeInfo { + eventType: WatchEventType; + filename: T; + } + interface FlagAndOpenMode { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + } + interface FileReadResult { + bytesRead: number; + buffer: T; + } + interface FileReadOptions { + /** + * @default `Buffer.alloc(0xffff)` + */ + buffer?: T; + /** + * @default 0 + */ + offset?: number | null; + /** + * @default `buffer.byteLength` + */ + length?: number | null; + position?: number | null; + } + interface CreateReadStreamOptions { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + end?: number | undefined; + highWaterMark?: number | undefined; + } + interface CreateWriteStreamOptions { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + } + // TODO: Add `EventEmitter` close + interface FileHandle { + /** + * The numeric file descriptor managed by the {FileHandle} object. + * @since v10.0.0 + */ + readonly fd: number; + /** + * Alias of `filehandle.writeFile()`. + * + * When operating on file handles, the mode cannot be changed from what it was set + * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; + /** + * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). + * @since v10.0.0 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + * @return Fulfills with `undefined` upon success. + */ + chown(uid: number, gid: number): Promise; + /** + * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). + * @since v10.0.0 + * @param mode the file mode bit mask. + * @return Fulfills with `undefined` upon success. + */ + chmod(mode: Mode): Promise; + /** + * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream + * returned by this method has a default `highWaterMark` of 64 kb. + * + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is + * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from + * the current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If the `FileHandle` points to a character device that only supports blocking + * reads (such as keyboard or sound card), read operations do not finish until data + * is available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * ```js + * import { open } from 'fs/promises'; + * + * const fd = await open('/dev/input/event0'); + * // Create a stream from some character device. + * const stream = fd.createReadStream(); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { open } from 'fs/promises'; + * + * const fd = await open('sample.txt'); + * fd.createReadStream({ start: 90, end: 99 }); + * ``` + * @since v16.11.0 + */ + createReadStream(options?: CreateReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` `open` option to be set to `r+` rather than + * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * @since v16.11.0 + */ + createWriteStream(options?: CreateWriteStreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. + * + * Unlike `filehandle.sync` this method does not flush modified metadata. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + datasync(): Promise; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fufills with `undefined` upon success. + */ + sync(): Promise; + /** + * Reads data from the file and stores that in the given buffer. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * @since v10.0.0 + * @param buffer A buffer that will be filled with the file data read. + * @param offset The location in the buffer at which to start filling. + * @param length The number of bytes to read. + * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an + * integer, the current file position will remain unchanged. + * @return Fulfills upon success with an object with two properties: + */ + read(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise>; + read(options?: FileReadOptions): Promise>; + /** + * Returns a `ReadableStream` that may be used to read the files data. + * + * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed + * or closing. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const chunk of file.readableWebStream()) + * console.log(chunk); + * + * await file.close(); + * ``` + * + * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method. + * + * @since v17.0.0 + * @experimental + */ + readableWebStream(): ReadableStream; + /** + * Asynchronously reads the entire contents of a file. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support reading. + * + * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current + * position till the end of the file. It doesn't always read from the beginning + * of the file. + * @since v10.0.0 + * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the + * data will be a string. + */ + readFile( + options?: { + encoding?: null | undefined; + flag?: OpenMode | undefined; + } | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile( + options: + | { + encoding: BufferEncoding; + flag?: OpenMode | undefined; + } + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile( + options?: + | (ObjectEncodingOptions & { + flag?: OpenMode | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Convenience method to create a `readline` interface and stream over the file. For example: + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const line of file.readLines()) { + * console.log(line); + * } + * ``` + * + * @since v18.11.0 + * @param options See `filehandle.createReadStream()` for the options. + */ + readLines(options?: CreateReadStreamOptions): ReadlineInterface; + /** + * @since v10.0.0 + * @return Fulfills with an {fs.Stats} for the file. + */ + stat( + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + stat( + opts: StatOptions & { + bigint: true; + } + ): Promise; + stat(opts?: StatOptions): Promise; + /** + * Truncates the file. + * + * If the file was larger than `len` bytes, only the first `len` bytes will be + * retained in the file. + * + * The following example retains only the first four bytes of the file: + * + * ```js + * import { open } from 'fs/promises'; + * + * let filehandle = null; + * try { + * filehandle = await open('temp.txt', 'r+'); + * await filehandle.truncate(4); + * } finally { + * await filehandle?.close(); + * } + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + truncate(len?: number): Promise; + /** + * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. + * @since v10.0.0 + */ + utimes(atime: TimeLike, mtime: TimeLike): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * The promise is resolved with no arguments upon success. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support writing. + * + * It is unsafe to use `filehandle.writeFile()` multiple times on the same file + * without waiting for the promise to be resolved (or rejected). + * + * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the + * current position till the end of the file. It doesn't always write from the + * beginning of the file. + * @since v10.0.0 + */ + writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise; + /** + * Write `buffer` to the file. + * + * The promise is resolved with an object containing two properties: + * + * It is unsafe to use `filehandle.write()` multiple times on the same file + * without waiting for the promise to be resolved (or rejected). For this + * scenario, use `filehandle.createWriteStream()`. + * + * On Linux, positional writes do not work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v10.0.0 + * @param [offset=0] The start position from within `buffer` where the data to write begins. + * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. + * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. + * See the POSIX pwrite(2) documentation for more detail. + */ + write( + buffer: TBuffer, + offset?: number | null, + length?: number | null, + position?: number | null + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + write( + data: string, + position?: number | null, + encoding?: BufferEncoding | null + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + /** + * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. + * + * The promise is resolved with an object containing a two properties: + * + * It is unsafe to call `writev()` multiple times on the same file without waiting + * for the promise to be resolved (or rejected). + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current + * position. + */ + writev(buffers: ReadonlyArray, position?: number): Promise; + /** + * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s + * @since v13.13.0, v12.17.0 + * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. + * @return Fulfills upon success an object containing two properties: + */ + readv(buffers: ReadonlyArray, position?: number): Promise; + /** + * Closes the file handle after waiting for any pending operation on the handle to + * complete. + * + * ```js + * import { open } from 'fs/promises'; + * + * let filehandle; + * try { + * filehandle = await open('thefile.txt', 'r'); + * } finally { + * await filehandle?.close(); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + close(): Promise; + } + + const constants: typeof fsConstants; + + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If the accessibility check is successful, the promise is resolved with no + * value. If any of the accessibility checks fail, the promise is rejected + * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and + * written by the current process. + * + * ```js + * import { access } from 'fs/promises'; + * import { constants } from 'fs'; + * + * try { + * await access('/etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can access'); + * } catch { + * console.error('cannot access'); + * } + * ``` + * + * Using `fsPromises.access()` to check for the accessibility of a file before + * calling `fsPromises.open()` is not recommended. Doing so introduces a race + * condition, since other processes may change the file's state between the two + * calls. Instead, user code should open/read/write the file directly and handle + * the error raised if the file is not accessible. + * @since v10.0.0 + * @param [mode=fs.constants.F_OK] + * @return Fulfills with `undefined` upon success. + */ + function access(path: PathLike, mode?: number): Promise; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. + * + * No guarantees are made about the atomicity of the copy operation. If an + * error occurs after the destination file has been opened for writing, an attempt + * will be made to remove the destination. + * + * ```js + * import { constants } from 'fs'; + * import { copyFile } from 'fs/promises'; + * + * try { + * await copyFile('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.log('The file could not be copied'); + * } + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * try { + * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.log('The file could not be copied'); + * } + * ``` + * @since v10.0.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. + * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) + * @return Fulfills with `undefined` upon success. + */ + function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; + /** + * Opens a `FileHandle`. + * + * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * @since v10.0.0 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. + * @return Fulfills with a {FileHandle} object. + */ + function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; + /** + * Renames `oldPath` to `newPath`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + /** + * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + function truncate(path: PathLike, len?: number): Promise; + /** + * Removes the directory identified by `path`. + * + * Using `fsPromises.rmdir()` on a file (not a directory) results in the + * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rmdir(path: PathLike, options?: RmDirOptions): Promise; + /** + * Removes files and directories (modeled on the standard POSIX `rm` utility). + * @since v14.14.0 + * @return Fulfills with `undefined` upon success. + */ + function rm(path: PathLike, options?: RmOptions): Promise; + /** + * Asynchronously creates a directory. + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory + * that exists results in a + * rejection only when `recursive` is false. + * @since v10.0.0 + * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. + */ + function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + /** + * Reads the contents of a directory. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned + * will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. + * + * ```js + * import { readdir } from 'fs/promises'; + * + * try { + * const files = await readdir(path); + * for (const file of files) + * console.log(file); + * } catch (err) { + * console.error(err); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + } + | 'buffer' + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + } + ): Promise; + /** + * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is + * resolved with the`linkString` upon success. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, the link path + * returned will be passed as a `Buffer` object. + * @since v10.0.0 + * @return Fulfills with the `linkString` upon success. + */ + function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; + /** + * Creates a symbolic link. + * + * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path + * to be absolute. When using `'junction'`, the `target` argument will + * automatically be normalized to absolute path. + * @since v10.0.0 + * @param [type='file'] + * @return Fulfills with `undefined` upon success. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + /** + * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, + * in which case the link itself is stat-ed, not the file that it refers to. + * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. + */ + function lstat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function lstat( + path: PathLike, + opts: StatOptions & { + bigint: true; + } + ): Promise; + function lstat(path: PathLike, opts?: StatOptions): Promise; + /** + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given `path`. + */ + function stat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function stat( + path: PathLike, + opts: StatOptions & { + bigint: true; + } + ): Promise; + function stat(path: PathLike, opts?: StatOptions): Promise; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + /** + * If `path` refers to a symbolic link, then the link is removed without affecting + * the file or directory to which that link refers. If the `path` refers to a file + * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function unlink(path: PathLike): Promise; + /** + * Changes the permissions of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the permissions on a symbolic link. + * + * This method is only implemented on macOS. + * @deprecated Since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the ownership on a symbolic link. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a + * symbolic link, then the link is not dereferenced: instead, the timestamps of + * the symbolic link itself are changed. + * @since v14.5.0, v12.19.0 + * @return Fulfills with `undefined` upon success. + */ + function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Changes the ownership of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time, `Date`s, or a + * numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path. If the `encoding` is set to `'buffer'`, the path returned will be + * passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v10.0.0 + * @return Fulfills with the resolved path upon success. + */ + function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Creates a unique temporary directory. A unique directory name is generated by + * appending six random characters to the end of the provided `prefix`. Due to + * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some + * platforms, notably the BSDs, can return more than six random characters, and + * replace trailing `X` characters in `prefix` with random characters. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'fs/promises'; + * + * try { + * await mkdtemp(path.join(os.tmpdir(), 'foo-')); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * The `fsPromises.mkdtemp()` method will append the six randomly selected + * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing + * platform-specific path separator + * (`require('path').sep`). + * @since v10.0.0 + * @return Fulfills with a string containing the filesystem path of the newly created temporary directory. + */ + function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * If `options` is a string, then it specifies the encoding. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * Any specified `FileHandle` has to support writing. + * + * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file + * without waiting for the promise to be settled. + * + * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience + * method that performs multiple `write` calls internally to write the buffer + * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. + * + * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'fs/promises'; + * import { Buffer } from 'buffer'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * const promise = writeFile('message.txt', data, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v10.0.0 + * @param file filename or `FileHandle` + * @return Fulfills with `undefined` upon success. + */ + function writeFile( + file: PathLike | FileHandle, + data: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | Stream, + options?: + | (ObjectEncodingOptions & { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + } & Abortable) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * The `path` may be specified as a `FileHandle` that has been opened + * for appending (using `fsPromises.open()`). + * @since v10.0.0 + * @param path filename or {FileHandle} + * @return Fulfills with `undefined` upon success. + */ + function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; + /** + * Asynchronously reads the entire contents of a file. + * + * If no encoding is specified (using `options.encoding`), the data is returned + * as a `Buffer` object. Otherwise, the data will be a string. + * + * If `options` is a string, then it specifies the encoding. + * + * When the `path` is a directory, the behavior of `fsPromises.readFile()` is + * platform-specific. On macOS, Linux, and Windows, the promise will be rejected + * with an error. On FreeBSD, a representation of the directory's contents will be + * returned. + * + * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a + * request is aborted the promise returned is rejected with an `AbortError`: + * + * ```js + * import { readFile } from 'fs/promises'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const promise = readFile(fileName, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * + * Any specified `FileHandle` has to support reading. + * @since v10.0.0 + * @param path filename or `FileHandle` + * @return Fulfills with the contents of the file. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | ({ + encoding?: null | undefined; + flag?: OpenMode | undefined; + } & Abortable) + | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options: + | ({ + encoding: BufferEncoding; + flag?: OpenMode | undefined; + } & Abortable) + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | (ObjectEncodingOptions & + Abortable & { + flag?: OpenMode | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * + * Example using async iteration: + * + * ```js + * import { opendir } from 'fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + * @return Fulfills with an {fs.Dir}. + */ + function opendir(path: PathLike, options?: OpenDirOptions): Promise; + /** + * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. + * + * ```js + * const { watch } = require('fs/promises'); + * + * const ac = new AbortController(); + * const { signal } = ac; + * setTimeout(() => ac.abort(), 10000); + * + * (async () => { + * try { + * const watcher = watch(__filename, { signal }); + * for await (const event of watcher) + * console.log(event); + * } catch (err) { + * if (err.name === 'AbortError') + * return; + * throw err; + * } + * })(); + * ``` + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. + * @since v15.9.0, v14.18.0 + * @return of objects with the properties: + */ + function watch( + filename: PathLike, + options: + | (WatchOptions & { + encoding: 'buffer'; + }) + | 'buffer' + ): AsyncIterable>; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable> | AsyncIterable>; + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + * @return Fulfills with `undefined` upon success. + */ + function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; +} +declare module 'node:fs/promises' { + export * from 'fs/promises'; +} diff --git a/server/node_modules/@types/node/ts4.8/globals.d.ts b/server/node_modules/@types/node/ts4.8/globals.d.ts new file mode 100755 index 0000000000..f401d95a9e --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/globals.d.ts @@ -0,0 +1,294 @@ +// Declare "static" methods in Error +interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; + + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; + + stackTraceLimit: number; +} + +/*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ + +// For backwards compability +interface NodeRequire extends NodeJS.Require { } +interface RequireResolve extends NodeJS.RequireResolve { } +interface NodeModule extends NodeJS.Module { } + +declare var process: NodeJS.Process; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare var require: NodeRequire; +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; + +/** + * Only available if `--expose-gc` is passed to the process. + */ +declare var gc: undefined | (() => void); + +//#region borrowed +// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib +/** A controller object that allows you to abort one or more DOM requests as and when desired. */ +interface AbortController { + /** + * Returns the AbortSignal object associated with this object. + */ + + readonly signal: AbortSignal; + /** + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. + */ + abort(): void; +} + +/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ +interface AbortSignal extends EventTarget { + /** + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. + */ + readonly aborted: boolean; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +declare var AbortSignal: { + prototype: AbortSignal; + new(): AbortSignal; + // TODO: Add abort() static +}; +//#endregion borrowed + +//#region ArrayLike.at() +interface RelativeIndexable { + /** + * Takes an integer value and returns the item at that index, + * allowing for positive and negative integers. + * Negative integers count back from the last item in the array. + */ + at(index: number): T | undefined; +} +interface String extends RelativeIndexable {} +interface Array extends RelativeIndexable {} +interface Int8Array extends RelativeIndexable {} +interface Uint8Array extends RelativeIndexable {} +interface Uint8ClampedArray extends RelativeIndexable {} +interface Int16Array extends RelativeIndexable {} +interface Uint16Array extends RelativeIndexable {} +interface Int32Array extends RelativeIndexable {} +interface Uint32Array extends RelativeIndexable {} +interface Float32Array extends RelativeIndexable {} +interface Float64Array extends RelativeIndexable {} +interface BigInt64Array extends RelativeIndexable {} +interface BigUint64Array extends RelativeIndexable {} +//#endregion ArrayLike.at() end + +/** + * @since v17.0.0 + * + * Creates a deep clone of an object. + */ +declare function structuredClone( + value: T, + transfer?: { transfer: ReadonlyArray }, +): T; + +/*----------------------------------------------* +* * +* GLOBAL INTERFACES * +* * +*-----------------------------------------------*/ +declare namespace NodeJS { + interface CallSite { + /** + * Value of "this" + */ + getThis(): unknown; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | null; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined; }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + + interface ReadWriteStream extends ReadableStream, WritableStream { } + + interface RefCounted { + ref(): this; + unref(): this; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[] | undefined; }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + '.js': (m: Module, filename: string) => any; + '.json': (m: Module, filename: string) => any; + '.node': (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since v11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } +} diff --git a/server/node_modules/@types/node/ts4.8/globals.global.d.ts b/server/node_modules/@types/node/ts4.8/globals.global.d.ts new file mode 100755 index 0000000000..ef1198c050 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/globals.global.d.ts @@ -0,0 +1 @@ +declare var global: typeof globalThis; diff --git a/server/node_modules/@types/node/ts4.8/http.d.ts b/server/node_modules/@types/node/ts4.8/http.d.ts new file mode 100755 index 0000000000..e14de6cf46 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/http.d.ts @@ -0,0 +1,1651 @@ +/** + * To use the HTTP server and client one must `require('http')`. + * + * The HTTP interfaces in Node.js are designed to support many features + * of the protocol which have been traditionally difficult to use. + * In particular, large, possibly chunk-encoded, messages. The interface is + * careful to never buffer entire requests or responses, so the + * user is able to stream data. + * + * HTTP message headers are represented by an object like this: + * + * ```js + * { 'content-length': '123', + * 'content-type': 'text/plain', + * 'connection': 'keep-alive', + * 'host': 'example.com', + * 'accept': '*' } + * ``` + * + * Keys are lowercased. Values are not modified. + * + * In order to support the full spectrum of possible HTTP applications, the Node.js + * HTTP API is very low-level. It deals with stream handling and message + * parsing only. It parses a message into headers and body but it does not + * parse the actual headers or the body. + * + * See `message.headers` for details on how duplicate headers are handled. + * + * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For + * example, the previous message header object might have a `rawHeaders`list like the following: + * + * ```js + * [ 'ConTent-Length', '123456', + * 'content-LENGTH', '123', + * 'content-type', 'text/plain', + * 'CONNECTION', 'keep-alive', + * 'Host', 'example.com', + * 'accepT', '*' ] + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http.js) + */ +declare module 'http' { + import * as stream from 'node:stream'; + import { URL } from 'node:url'; + import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net'; + import { LookupOptions } from 'node:dns'; + // incoming headers will never contain number + interface IncomingHttpHeaders extends NodeJS.Dict { + accept?: string | undefined; + 'accept-language'?: string | undefined; + 'accept-patch'?: string | undefined; + 'accept-ranges'?: string | undefined; + 'access-control-allow-credentials'?: string | undefined; + 'access-control-allow-headers'?: string | undefined; + 'access-control-allow-methods'?: string | undefined; + 'access-control-allow-origin'?: string | undefined; + 'access-control-expose-headers'?: string | undefined; + 'access-control-max-age'?: string | undefined; + 'access-control-request-headers'?: string | undefined; + 'access-control-request-method'?: string | undefined; + age?: string | undefined; + allow?: string | undefined; + 'alt-svc'?: string | undefined; + authorization?: string | undefined; + 'cache-control'?: string | undefined; + connection?: string | undefined; + 'content-disposition'?: string | undefined; + 'content-encoding'?: string | undefined; + 'content-language'?: string | undefined; + 'content-length'?: string | undefined; + 'content-location'?: string | undefined; + 'content-range'?: string | undefined; + 'content-type'?: string | undefined; + cookie?: string | undefined; + date?: string | undefined; + etag?: string | undefined; + expect?: string | undefined; + expires?: string | undefined; + forwarded?: string | undefined; + from?: string | undefined; + host?: string | undefined; + 'if-match'?: string | undefined; + 'if-modified-since'?: string | undefined; + 'if-none-match'?: string | undefined; + 'if-unmodified-since'?: string | undefined; + 'last-modified'?: string | undefined; + location?: string | undefined; + origin?: string | undefined; + pragma?: string | undefined; + 'proxy-authenticate'?: string | undefined; + 'proxy-authorization'?: string | undefined; + 'public-key-pins'?: string | undefined; + range?: string | undefined; + referer?: string | undefined; + 'retry-after'?: string | undefined; + 'sec-websocket-accept'?: string | undefined; + 'sec-websocket-extensions'?: string | undefined; + 'sec-websocket-key'?: string | undefined; + 'sec-websocket-protocol'?: string | undefined; + 'sec-websocket-version'?: string | undefined; + 'set-cookie'?: string[] | undefined; + 'strict-transport-security'?: string | undefined; + tk?: string | undefined; + trailer?: string | undefined; + 'transfer-encoding'?: string | undefined; + upgrade?: string | undefined; + 'user-agent'?: string | undefined; + vary?: string | undefined; + via?: string | undefined; + warning?: string | undefined; + 'www-authenticate'?: string | undefined; + } + // outgoing headers allows numbers (as they are converted internally to strings) + type OutgoingHttpHeader = number | string | string[]; + interface OutgoingHttpHeaders extends NodeJS.Dict {} + interface ClientRequestArgs { + _defaultAgent?: Agent | undefined; + agent?: Agent | boolean | undefined; + auth?: string | null | undefined; + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 + createConnection?: + | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) + | undefined; + defaultPort?: number | string | undefined; + family?: number | undefined; + headers?: OutgoingHttpHeaders | undefined; + hints?: LookupOptions['hints']; + host?: string | null | undefined; + hostname?: string | null | undefined; + insecureHTTPParser?: boolean | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + lookup?: LookupFunction | undefined; + /** + * @default 16384 + */ + maxHeaderSize?: number | undefined; + method?: string | undefined; + path?: string | null | undefined; + port?: number | string | null | undefined; + protocol?: string | null | undefined; + setHost?: boolean | undefined; + signal?: AbortSignal | undefined; + socketPath?: string | undefined; + timeout?: number | undefined; + uniqueHeaders?: Array | undefined; + } + interface ServerOptions< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > { + /** + * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. + */ + IncomingMessage?: Request | undefined; + /** + * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. + */ + ServerResponse?: Response | undefined; + /** + * Sets the timeout value in milliseconds for receiving the entire request from the client. + * @see Server.requestTimeout for more information. + * @default 300000 + * @since v18.0.0 + */ + requestTimeout?: number | undefined; + /** + * The number of milliseconds of inactivity a server needs to wait for additional incoming data, + * after it has finished writing the last response, before a socket will be destroyed. + * @see Server.keepAliveTimeout for more information. + * @default 5000 + * @since v18.0.0 + */ + keepAliveTimeout?: number | undefined; + /** + * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. + * @default 30000 + */ + connectionsCheckingInterval?: number | undefined; + /** + * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. + * Using the insecure parser should be avoided. + * See --insecure-http-parser for more information. + * @default false + */ + insecureHTTPParser?: boolean | undefined; + /** + * Optionally overrides the value of + * `--max-http-header-size` for requests received by this server, i.e. + * the maximum length of request headers in bytes. + * @default 16384 + * @since v13.3.0 + */ + maxHeaderSize?: number | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default true + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + /** + * A list of response headers that should be sent only once. + * If the header's value is an array, the items will be joined using `; `. + */ + uniqueHeaders?: Array | undefined; + } + type RequestListener< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; + /** + * @since v0.1.17 + */ + class Server< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > extends NetServer { + constructor(requestListener?: RequestListener); + constructor(options: ServerOptions, requestListener?: RequestListener); + /** + * Sets the timeout value for sockets, and emits a `'timeout'` event on + * the Server object, passing the socket as an argument, if a timeout + * occurs. + * + * If there is a `'timeout'` event listener on the Server object, then it + * will be called with the timed-out socket as an argument. + * + * By default, the Server does not timeout sockets. However, if a callback + * is assigned to the Server's `'timeout'` event, timeouts must be handled + * explicitly. + * @since v0.9.12 + * @param [msecs=0 (no timeout)] + */ + setTimeout(msecs?: number, callback?: () => void): this; + setTimeout(callback: () => void): this; + /** + * Limits maximum incoming headers count. If set to 0, no limit will be applied. + * @since v0.7.0 + */ + maxHeadersCount: number | null; + /** + * The maximum number of requests socket can handle + * before closing keep alive connection. + * + * A value of `0` will disable the limit. + * + * When the limit is reached it will set the `Connection` header value to `close`, + * but will not actually close the connection, subsequent requests sent + * after the limit is reached will get `503 Service Unavailable` as a response. + * @since v16.10.0 + */ + maxRequestsPerSocket: number | null; + /** + * The number of milliseconds of inactivity before a socket is presumed + * to have timed out. + * + * A value of `0` will disable the timeout behavior on incoming connections. + * + * The socket timeout logic is set up on connection, so changing this + * value only affects new connections to the server, not any existing connections. + * @since v0.9.12 + */ + timeout: number; + /** + * Limit the amount of time the parser will wait to receive the complete HTTP + * headers. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v11.3.0, v10.14.0 + */ + headersTimeout: number; + /** + * The number of milliseconds of inactivity a server needs to wait for additional + * incoming data, after it has finished writing the last response, before a socket + * will be destroyed. If the server receives new data before the keep-alive + * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. + * + * A value of `0` will disable the keep-alive timeout behavior on incoming + * connections. + * A value of `0` makes the http server behave similarly to Node.js versions prior + * to 8.0.0, which did not have a keep-alive timeout. + * + * The socket timeout logic is set up on connection, so changing this value only + * affects new connections to the server, not any existing connections. + * @since v8.0.0 + */ + keepAliveTimeout: number; + /** + * Sets the timeout value in milliseconds for receiving the entire request from + * the client. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v14.11.0 + */ + requestTimeout: number; + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Socket) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'checkContinue', listener: RequestListener): this; + addListener(event: 'checkExpectation', listener: RequestListener): this; + addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + addListener( + event: 'connect', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + addListener(event: 'request', listener: RequestListener): this; + addListener( + event: 'upgrade', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + emit(event: string, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Socket): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit( + event: 'checkContinue', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit( + event: 'checkExpectation', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean; + emit(event: 'connect', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; + emit( + event: 'request', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'upgrade', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Socket) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'checkContinue', listener: RequestListener): this; + on(event: 'checkExpectation', listener: RequestListener): this; + on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + on(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + on(event: 'request', listener: RequestListener): this; + on(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Socket) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'checkContinue', listener: RequestListener): this; + once(event: 'checkExpectation', listener: RequestListener): this; + once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + once( + event: 'connect', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + once(event: 'request', listener: RequestListener): this; + once( + event: 'upgrade', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Socket) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'checkContinue', listener: RequestListener): this; + prependListener(event: 'checkExpectation', listener: RequestListener): this; + prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + prependListener( + event: 'connect', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + prependListener(event: 'request', listener: RequestListener): this; + prependListener( + event: 'upgrade', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'checkContinue', listener: RequestListener): this; + prependOnceListener(event: 'checkExpectation', listener: RequestListener): this; + prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + prependOnceListener( + event: 'connect', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + prependOnceListener(event: 'request', listener: RequestListener): this; + prependOnceListener( + event: 'upgrade', + listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void, + ): this; + } + /** + * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract of outgoing message from + * the perspective of the participants of HTTP transaction. + * @since v0.1.17 + */ + class OutgoingMessage extends stream.Writable { + readonly req: Request; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + /** + * @deprecated Use `writableEnded` instead. + */ + finished: boolean; + /** + * Read-only. `true` if the headers were sent, otherwise `false`. + * @since v0.9.3 + */ + readonly headersSent: boolean; + /** + * Aliases of `outgoingMessage.socket` + * @since v0.3.0 + * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. + */ + readonly connection: Socket | null; + /** + * Reference to the underlying socket. Usually, users will not want to access + * this property. + * + * After calling `outgoingMessage.end()`, this property will be nulled. + * @since v0.3.0 + */ + readonly socket: Socket | null; + constructor(); + /** + * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. + * @since v0.9.12 + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * Sets a single header value for the header object. + * @since v0.4.0 + * @param name Header name + * @param value Header value + */ + setHeader(name: string, value: number | string | ReadonlyArray): this; + /** + * Gets the value of HTTP header with the given name. If such a name doesn't + * exist in message, it will be `undefined`. + * @since v0.4.0 + * @param name Name of header + */ + getHeader(name: string): number | string | string[] | undefined; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow + * copy is used, array values may be mutated without additional calls to + * various header-related HTTP module methods. The keys of the returned + * object are the header names and the values are the respective header + * values. All header names are lowercase. + * + * The object returned by the `outgoingMessage.getHeaders()` method does + * not prototypically inherit from the JavaScript Object. This means that + * typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`, + * and others are not defined and will not work. + * + * ```js + * outgoingMessage.setHeader('Foo', 'bar'); + * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = outgoingMessage.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v7.7.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns an array of names of headers of the outgoing outgoingMessage. All + * names are lowercase. + * @since v7.7.0 + */ + getHeaderNames(): string[]; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name is case-insensitive. + * + * ```js + * const hasContentType = outgoingMessage.hasHeader('content-type'); + * ``` + * @since v7.7.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that is queued for implicit sending. + * + * ```js + * outgoingMessage.removeHeader('Content-Encoding'); + * ``` + * @since v0.4.0 + * @param name Header name + */ + removeHeader(name: string): void; + /** + * Adds HTTP trailers (headers but at the end of the message) to the message. + * + * Trailers are **only** be emitted if the message is chunked encoded. If not, + * the trailer will be silently discarded. + * + * HTTP requires the `Trailer` header to be sent to emit trailers, + * with a list of header fields in its value, e.g. + * + * ```js + * message.writeHead(200, { 'Content-Type': 'text/plain', + * 'Trailer': 'Content-MD5' }); + * message.write(fileData); + * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); + * message.end(); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v0.3.0 + */ + addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; + /** + * Compulsorily flushes the message headers + * + * For efficiency reason, Node.js normally buffers the message headers + * until `outgoingMessage.end()` is called or the first chunk of message data + * is written. It then tries to pack the headers and data into a single TCP + * packet. + * + * It is usually desired (it saves a TCP round-trip), but not when the first + * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the request. + * @since v1.6.0 + */ + flushHeaders(): void; + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v0.1.17 + */ + class ServerResponse extends OutgoingMessage { + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v0.4.0 + */ + statusCode: number; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status message that will be sent to the client when + * the headers get flushed. If this is left as `undefined` then the standard + * message for the status code will be used. + * + * ```js + * response.statusMessage = 'Not found'; + * ``` + * + * After response header was sent to the client, this property indicates the + * status message which was sent out. + * @since v0.11.8 + */ + statusMessage: string; + constructor(req: Request); + assignSocket(socket: Socket): void; + detachSocket(socket: Socket): void; + /** + * Sends an HTTP/1.1 100 Continue message to the client, indicating that + * the request body should be sent. See the `'checkContinue'` event on`Server`. + * @since v0.3.0 + */ + writeContinue(callback?: () => void): void; + /** + * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. The optional `callback` argument will be called when + * the response message has been written. + * + * Example: + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * 'x-trace-id': 'id for diagnostics' + * }); + * + * const earlyHintsCallback = () => console.log('early hints message sent'); + * response.writeEarlyHints({ + * 'link': earlyHintsLinks + * }, earlyHintsCallback); + * ``` + * + * @since v18.11.0 + * @param hints An object containing the values of headers + * @param callback Will be called when the response message has been written + */ + writeEarlyHints(hints: Record, callback?: () => void): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * Optionally one can give a human-readable `statusMessage` as the second + * argument. + * + * `headers` may be an `Array` where the keys and values are in the same list. + * It is _not_ a list of tuples. So, the even-numbered offsets are key values, + * and the odd-numbered offsets are the associated values. The array is in the same + * format as `request.rawHeaders`. + * + * Returns a reference to the `ServerResponse`, so that calls can be chained. + * + * ```js + * const body = 'hello world'; + * response + * .writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain' + * }) + * .end(body); + * ``` + * + * This method must only be called once on a message and it must + * be called before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * If this method is called and `response.setHeader()` has not been called, + * it will directly write the supplied header values onto the network channel + * without caching internally, and the `response.getHeader()` on the header + * will not yield the expected result. If progressive population of headers is + * desired with potential future retrieval and modification, use `response.setHeader()` instead. + * + * ```js + * // Returns content-type = text/plain + * const server = http.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain' }); + * res.end('ok'); + * }); + * ``` + * + * `Content-Length` is given in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js + * does not check whether `Content-Length` and the length of the body which has + * been transmitted are equal or not. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v0.1.30 + */ + writeHead( + statusCode: number, + statusMessage?: string, + headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], + ): this; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; + /** + * Sends an HTTP/1.1 102 Processing message to the client, indicating that + * the request body should be sent. + * @since v10.0.0 + */ + writeProcessing(): void; + } + interface InformationEvent { + statusCode: number; + statusMessage: string; + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + } + /** + * This object is created internally and returned from {@link request}. It + * represents an _in-progress_ request whose header has already been queued. The + * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will + * be sent along with the first data chunk or when calling `request.end()`. + * + * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response + * headers have been received. The `'response'` event is executed with one + * argument which is an instance of {@link IncomingMessage}. + * + * During the `'response'` event, one can add listeners to the + * response object; particularly to listen for the `'data'` event. + * + * If no `'response'` handler is added, then the response will be + * entirely discarded. However, if a `'response'` event handler is added, + * then the data from the response object **must** be consumed, either by + * calling `response.read()` whenever there is a `'readable'` event, or + * by adding a `'data'` handler, or by calling the `.resume()` method. + * Until the data is consumed, the `'end'` event will not fire. Also, until + * the data is read it will consume memory that can eventually lead to a + * 'process out of memory' error. + * + * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. + * + * Node.js does not check whether Content-Length and the length of the + * body which has been transmitted are equal or not. + * @since v0.1.17 + */ + class ClientRequest extends OutgoingMessage { + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v0.11.14 + * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. + */ + aborted: boolean; + /** + * The request host. + * @since v14.5.0, v12.19.0 + */ + host: string; + /** + * The request protocol. + * @since v14.5.0, v12.19.0 + */ + protocol: string; + /** + * When sending request through a keep-alive enabled agent, the underlying socket + * might be reused. But if server closes connection at unfortunate time, client + * may run into a 'ECONNRESET' error. + * + * ```js + * const http = require('http'); + * + * // Server has a 5 seconds keep-alive timeout by default + * http + * .createServer((req, res) => { + * res.write('hello\n'); + * res.end(); + * }) + * .listen(3000); + * + * setInterval(() => { + * // Adapting a keep-alive agent + * http.get('http://localhost:3000', { agent }, (res) => { + * res.on('data', (data) => { + * // Do nothing + * }); + * }); + * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout + * ``` + * + * By marking a request whether it reused socket or not, we can do + * automatic error retry base on it. + * + * ```js + * const http = require('http'); + * const agent = new http.Agent({ keepAlive: true }); + * + * function retriableRequest() { + * const req = http + * .get('http://localhost:3000', { agent }, (res) => { + * // ... + * }) + * .on('error', (err) => { + * // Check if retry is needed + * if (req.reusedSocket && err.code === 'ECONNRESET') { + * retriableRequest(); + * } + * }); + * } + * + * retriableRequest(); + * ``` + * @since v13.0.0, v12.16.0 + */ + reusedSocket: boolean; + /** + * Limits maximum response headers count. If set to 0, no limit will be applied. + */ + maxHeadersCount: number; + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + /** + * The request method. + * @since v0.1.97 + */ + method: string; + /** + * The request path. + * @since v0.4.0 + */ + path: string; + /** + * Marks the request as aborting. Calling this will cause remaining data + * in the response to be dropped and the socket to be destroyed. + * @since v0.3.8 + * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. + */ + abort(): void; + onSocket(socket: Socket): void; + /** + * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. + * @since v0.5.9 + * @param timeout Milliseconds before a request times out. + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. + * @since v0.5.9 + */ + setNoDelay(noDelay?: boolean): void; + /** + * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. + * @since v0.5.9 + */ + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + /** + * Returns an array containing the unique names of the current outgoing raw + * headers. Header names are returned with their exact casing being set. + * + * ```js + * request.setHeader('Foo', 'bar'); + * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = request.getRawHeaderNames(); + * // headerNames === ['Foo', 'Set-Cookie'] + * ``` + * @since v15.13.0, v14.17.0 + */ + getRawHeaderNames(): string[]; + /** + * @deprecated + */ + addListener(event: 'abort', listener: () => void): this; + addListener( + event: 'connect', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + addListener(event: 'continue', listener: () => void): this; + addListener(event: 'information', listener: (info: InformationEvent) => void): this; + addListener(event: 'response', listener: (response: IncomingMessage) => void): this; + addListener(event: 'socket', listener: (socket: Socket) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener( + event: 'upgrade', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + on(event: 'abort', listener: () => void): this; + on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'continue', listener: () => void): this; + on(event: 'information', listener: (info: InformationEvent) => void): this; + on(event: 'response', listener: (response: IncomingMessage) => void): this; + on(event: 'socket', listener: (socket: Socket) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + once(event: 'abort', listener: () => void): this; + once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'continue', listener: () => void): this; + once(event: 'information', listener: (info: InformationEvent) => void): this; + once(event: 'response', listener: (response: IncomingMessage) => void): this; + once(event: 'socket', listener: (socket: Socket) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + prependListener(event: 'abort', listener: () => void): this; + prependListener( + event: 'connect', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + prependListener(event: 'continue', listener: () => void): this; + prependListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependListener(event: 'socket', listener: (socket: Socket) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener( + event: 'upgrade', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + prependOnceListener(event: 'abort', listener: () => void): this; + prependOnceListener( + event: 'connect', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + prependOnceListener(event: 'continue', listener: () => void): this; + prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener( + event: 'upgrade', + listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void, + ): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to + * access response + * status, headers and data. + * + * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to + * parse and emit the incoming HTTP headers and payload, as the underlying socket + * may be reused multiple times in case of keep-alive. + * @since v0.1.17 + */ + class IncomingMessage extends stream.Readable { + constructor(socket: Socket); + /** + * The `message.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. + */ + aborted: boolean; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. + * Probably either `'1.1'` or `'1.0'`. + * + * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * @since v0.1.1 + */ + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + /** + * The `message.complete` property will be `true` if a complete HTTP message has + * been received and successfully parsed. + * + * This property is particularly useful as a means of determining if a client or + * server fully transmitted a message before a connection was terminated: + * + * ```js + * const req = http.request({ + * host: '127.0.0.1', + * port: 8080, + * method: 'POST' + * }, (res) => { + * res.resume(); + * res.on('end', () => { + * if (!res.complete) + * console.error( + * 'The connection was terminated while the message was still being sent'); + * }); + * }); + * ``` + * @since v0.3.0 + */ + complete: boolean; + /** + * Alias for `message.socket`. + * @since v0.1.90 + * @deprecated Since v16.0.0 - Use `socket`. + */ + connection: Socket; + /** + * The `net.Socket` object associated with the connection. + * + * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the + * client's authentication details. + * + * This property is guaranteed to be an instance of the `net.Socket` class, + * a subclass of `stream.Duplex`, unless the user specified a socket + * type other than `net.Socket` or internally nulled. + * @since v0.3.0 + */ + socket: Socket; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.getHeaders()); + * ``` + * + * Duplicates in raw headers are handled in the following ways, depending on the + * header name: + * + * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, + * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. + * * `set-cookie` is always an array. Duplicates are added to the array. + * * For duplicate `cookie` headers, the values are joined together with '; '. + * * For all other headers, the values are joined together with ', '. + * @since v0.1.5 + */ + headers: IncomingHttpHeaders; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v0.11.6 + */ + rawHeaders: string[]; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v0.3.0 + */ + trailers: NodeJS.Dict; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v0.11.6 + */ + rawTrailers: string[]; + /** + * Calls `message.socket.setTimeout(msecs, callback)`. + * @since v0.5.9 + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * **Only valid for request obtained from {@link Server}.** + * + * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. + * @since v0.1.1 + */ + method?: string | undefined; + /** + * **Only valid for request obtained from {@link Server}.** + * + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. Take the following request: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * To parse the URL into its parts: + * + * ```js + * new URL(request.url, `http://${request.getHeaders().host}`); + * ``` + * + * When `request.url` is `'/status?name=ryan'` and`request.getHeaders().host` is `'localhost:3000'`: + * + * ```console + * $ node + * > new URL(request.url, `http://${request.getHeaders().host}`) + * URL { + * href: 'http://localhost:3000/status?name=ryan', + * origin: 'http://localhost:3000', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'localhost:3000', + * hostname: 'localhost', + * port: '3000', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * @since v0.1.90 + */ + url?: string | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The 3-digit HTTP response status code. E.G. `404`. + * @since v0.1.1 + */ + statusCode?: number | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. + * @since v0.11.10 + */ + statusMessage?: string | undefined; + /** + * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed + * as an argument to any listeners on the event. + * @since v0.3.0 + */ + destroy(error?: Error): this; + } + interface AgentOptions extends Partial { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean | undefined; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number | undefined; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number | undefined; + /** + * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. + */ + maxTotalSockets?: number | undefined; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number | undefined; + /** + * Socket timeout in milliseconds. This will set the timeout after the socket is connected. + */ + timeout?: number | undefined; + /** + * Scheduling strategy to apply when picking the next free socket to use. + * @default `lifo` + */ + scheduling?: 'fifo' | 'lifo' | undefined; + } + /** + * An `Agent` is responsible for managing connection persistence + * and reuse for HTTP clients. It maintains a queue of pending requests + * for a given host and port, reusing a single socket connection for each + * until the queue is empty, at which time the socket is either destroyed + * or put into a pool where it is kept to be used again for requests to the + * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. + * + * Pooled connections have TCP Keep-Alive enabled for them, but servers may + * still close idle connections, in which case they will be removed from the + * pool and a new connection will be made when a new HTTP request is made for + * that host and port. Servers may also refuse to allow multiple requests + * over the same connection, in which case the connection will have to be + * remade for every request and cannot be pooled. The `Agent` will still make + * the requests to that server, but each one will occur over a new connection. + * + * When a connection is closed by the client or the server, it is removed + * from the pool. Any unused sockets in the pool will be unrefed so as not + * to keep the Node.js process running when there are no outstanding requests. + * (see `socket.unref()`). + * + * It is good practice, to `destroy()` an `Agent` instance when it is no + * longer in use, because unused sockets consume OS resources. + * + * Sockets are removed from an agent when the socket emits either + * a `'close'` event or an `'agentRemove'` event. When intending to keep one + * HTTP request open for a long time without keeping it in the agent, something + * like the following may be done: + * + * ```js + * http.get(options, (res) => { + * // Do stuff + * }).on('socket', (socket) => { + * socket.emit('agentRemove'); + * }); + * ``` + * + * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options + * will be used + * for the client connection. + * + * `agent:false`: + * + * ```js + * http.get({ + * hostname: 'localhost', + * port: 80, + * path: '/', + * agent: false // Create a new agent just for this one request + * }, (res) => { + * // Do stuff with response + * }); + * ``` + * @since v0.3.4 + */ + class Agent { + /** + * By default set to 256\. For agents with `keepAlive` enabled, this + * sets the maximum number of sockets that will be left open in the free + * state. + * @since v0.11.7 + */ + maxFreeSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open per origin. Origin is the returned value of `agent.getName()`. + * @since v0.3.6 + */ + maxSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open. Unlike `maxSockets`, this parameter applies across all origins. + * @since v14.5.0, v12.19.0 + */ + maxTotalSockets: number; + /** + * An object which contains arrays of sockets currently awaiting use by + * the agent when `keepAlive` is enabled. Do not modify. + * + * Sockets in the `freeSockets` list will be automatically destroyed and + * removed from the array on `'timeout'`. + * @since v0.11.4 + */ + readonly freeSockets: NodeJS.ReadOnlyDict; + /** + * An object which contains arrays of sockets currently in use by the + * agent. Do not modify. + * @since v0.3.6 + */ + readonly sockets: NodeJS.ReadOnlyDict; + /** + * An object which contains queues of requests that have not yet been assigned to + * sockets. Do not modify. + * @since v0.5.9 + */ + readonly requests: NodeJS.ReadOnlyDict; + constructor(opts?: AgentOptions); + /** + * Destroy any sockets that are currently in use by the agent. + * + * It is usually not necessary to do this. However, if using an + * agent with `keepAlive` enabled, then it is best to explicitly shut down + * the agent when it is no longer needed. Otherwise, + * sockets might stay open for quite a long time before the server + * terminates them. + * @since v0.11.4 + */ + destroy(): void; + } + const METHODS: string[]; + const STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + /** + * Returns a new instance of {@link Server}. + * + * The `requestListener` is a function which is automatically + * added to the `'request'` event. + * @since v0.1.13 + */ + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + >(requestListener?: RequestListener): Server; + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + >( + options: ServerOptions, + requestListener?: RequestListener, + ): Server; + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + interface RequestOptions extends ClientRequestArgs {} + /** + * `options` in `socket.connect()` are also supported. + * + * Node.js maintains several connections per server to make HTTP requests. + * This function allows one to transparently issue requests. + * + * `url` can be a string or a `URL` object. If `url` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. + * + * The optional `callback` parameter will be added as a one-time listener for + * the `'response'` event. + * + * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * const http = require('http'); + * + * const postData = JSON.stringify({ + * 'msg': 'Hello World!' + * }); + * + * const options = { + * hostname: 'www.google.com', + * port: 80, + * path: '/upload', + * method: 'POST', + * headers: { + * 'Content-Type': 'application/json', + * 'Content-Length': Buffer.byteLength(postData) + * } + * }; + * + * const req = http.request(options, (res) => { + * console.log(`STATUS: ${res.statusCode}`); + * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); + * res.setEncoding('utf8'); + * res.on('data', (chunk) => { + * console.log(`BODY: ${chunk}`); + * }); + * res.on('end', () => { + * console.log('No more data in response.'); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(`problem with request: ${e.message}`); + * }); + * + * // Write data to request body + * req.write(postData); + * req.end(); + * ``` + * + * In the example `req.end()` was called. With `http.request()` one + * must always call `req.end()` to signify the end of the request - + * even if there is no data being written to the request body. + * + * If any error is encountered during the request (be that with DNS resolution, + * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted + * on the returned request object. As with all `'error'` events, if no listeners + * are registered the error will be thrown. + * + * There are a few special headers that should be noted. + * + * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to + * the server should be persisted until the next request. + * * Sending a 'Content-Length' header will disable the default chunked encoding. + * * Sending an 'Expect' header will immediately send the request headers. + * Usually, when sending 'Expect: 100-continue', both a timeout and a listener + * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more + * information. + * * Sending an Authorization header will override using the `auth` option + * to compute basic authentication. + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('http://abc:xyz@example.com'); + * + * const req = http.request(options, (res) => { + * // ... + * }); + * ``` + * + * In a successful request, the following events will be emitted in the following + * order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * (`'data'` will not be emitted at all if the response body is empty, for + * instance, in most redirects) + * * `'end'` on the `res` object + * * `'close'` + * + * In the case of a connection error, the following events will be emitted: + * + * * `'socket'` + * * `'error'` + * * `'close'` + * + * In the case of a premature connection close before the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * In the case of a premature connection close after the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (connection closed here) + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. + * * `'close'` + * * `'close'` on the `res` object + * + * If `req.destroy()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * If `req.destroy()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * If `req.destroy()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.destroy()` called here) + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. + * * `'close'` + * * `'close'` on the `res` object + * + * If `req.abort()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.abort()` called here) + * * `'abort'` + * * `'close'` + * + * If `req.abort()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.abort()` called here) + * * `'abort'` + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * If `req.abort()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.abort()` called here) + * * `'abort'` + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. + * * `'close'` + * * `'close'` on the `res` object + * + * Setting the `timeout` option or using the `setTimeout()` function will + * not abort the request or do anything besides add a `'timeout'` event. + * + * Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the + * request itself. + * @since v0.3.6 + */ + function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function request( + url: string | URL, + options: RequestOptions, + callback?: (res: IncomingMessage) => void, + ): ClientRequest; + /** + * Since most requests are GET requests without bodies, Node.js provides this + * convenience method. The only difference between this method and {@link request} is that it sets the method to GET and calls `req.end()`automatically. The callback must take care to consume the + * response + * data for reasons stated in {@link ClientRequest} section. + * + * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. + * + * JSON fetching example: + * + * ```js + * http.get('http://localhost:8000/', (res) => { + * const { statusCode } = res; + * const contentType = res.headers['content-type']; + * + * let error; + * // Any 2xx status code signals a successful response but + * // here we're only checking for 200. + * if (statusCode !== 200) { + * error = new Error('Request Failed.\n' + + * `Status Code: ${statusCode}`); + * } else if (!/^application\/json/.test(contentType)) { + * error = new Error('Invalid content-type.\n' + + * `Expected application/json but received ${contentType}`); + * } + * if (error) { + * console.error(error.message); + * // Consume response data to free up memory + * res.resume(); + * return; + * } + * + * res.setEncoding('utf8'); + * let rawData = ''; + * res.on('data', (chunk) => { rawData += chunk; }); + * res.on('end', () => { + * try { + * const parsedData = JSON.parse(rawData); + * console.log(parsedData); + * } catch (e) { + * console.error(e.message); + * } + * }); + * }).on('error', (e) => { + * console.error(`Got error: ${e.message}`); + * }); + * + * // Create a local server to receive data from + * const server = http.createServer((req, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!' + * })); + * }); + * + * server.listen(8000); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored. + */ + function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + + /** + * Performs the low-level validations on the provided name that are done when `res.setHeader(name, value)` is called. + * Passing illegal value as name will result in a TypeError being thrown, identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. + * @param name Header name + * @since v14.3.0 + */ + function validateHeaderName(name: string): void; + /** + * Performs the low-level validations on the provided value that are done when `res.setHeader(name, value)` is called. + * Passing illegal value as value will result in a TypeError being thrown. + * - Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. + * - Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. + * @param name Header name + * @param value Header value + * @since v14.3.0 + */ + function validateHeaderValue(name: string, value: string): void; + + /** + * Set the maximum number of idle HTTP parsers. Default: 1000. + * @param count + * @since v18.8.0, v16.18.0 + */ + function setMaxIdleHTTPParsers(count: number): void; + + let globalAgent: Agent; + /** + * Read-only property specifying the maximum allowed size of HTTP headers in bytes. + * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. + */ + const maxHeaderSize: number; +} +declare module 'node:http' { + export * from 'http'; +} diff --git a/server/node_modules/@types/node/ts4.8/http2.d.ts b/server/node_modules/@types/node/ts4.8/http2.d.ts new file mode 100755 index 0000000000..0e3682609f --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/http2.d.ts @@ -0,0 +1,2134 @@ +/** + * The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. It + * can be accessed using: + * + * ```js + * const http2 = require('http2'); + * ``` + * @since v8.4.0 + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http2.js) + */ +declare module 'http2' { + import EventEmitter = require('node:events'); + import * as fs from 'node:fs'; + import * as net from 'node:net'; + import * as stream from 'node:stream'; + import * as tls from 'node:tls'; + import * as url from 'node:url'; + import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http'; + export { OutgoingHttpHeaders } from 'node:http'; + export interface IncomingHttpStatusHeader { + ':status'?: number | undefined; + } + export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { + ':path'?: string | undefined; + ':method'?: string | undefined; + ':authority'?: string | undefined; + ':scheme'?: string | undefined; + } + // Http2Stream + export interface StreamPriorityOptions { + exclusive?: boolean | undefined; + parent?: number | undefined; + weight?: number | undefined; + silent?: boolean | undefined; + } + export interface StreamState { + localWindowSize?: number | undefined; + state?: number | undefined; + localClose?: number | undefined; + remoteClose?: number | undefined; + sumDependencyWeight?: number | undefined; + weight?: number | undefined; + } + export interface ServerStreamResponseOptions { + endStream?: boolean | undefined; + waitForTrailers?: boolean | undefined; + } + export interface StatOptions { + offset: number; + length: number; + } + export interface ServerStreamFileResponseOptions { + statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; + waitForTrailers?: boolean | undefined; + offset?: number | undefined; + length?: number | undefined; + } + export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?(err: NodeJS.ErrnoException): void; + } + export interface Http2Stream extends stream.Duplex { + /** + * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, + * the `'aborted'` event will have been emitted. + * @since v8.4.0 + */ + readonly aborted: boolean; + /** + * This property shows the number of characters currently buffered to be written. + * See `net.Socket.bufferSize` for details. + * @since v11.2.0, v10.16.0 + */ + readonly bufferSize: number; + /** + * Set to `true` if the `Http2Stream` instance has been closed. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer + * usable. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Set to `true` if the `END_STREAM` flag was set in the request or response + * HEADERS frame received, indicating that no additional data should be received + * and the readable side of the `Http2Stream` will be closed. + * @since v10.11.0 + */ + readonly endAfterHeaders: boolean; + /** + * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. + * @since v8.4.0 + */ + readonly id?: number | undefined; + /** + * Set to `true` if the `Http2Stream` instance has not yet been assigned a + * numeric stream identifier. + * @since v9.4.0 + */ + readonly pending: boolean; + /** + * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is + * destroyed after either receiving an `RST_STREAM` frame from the connected peer, + * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. + * @since v8.4.0 + */ + readonly rstCode: number; + /** + * An object containing the outbound headers sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentHeaders: OutgoingHttpHeaders; + /** + * An array of objects containing the outbound informational (additional) headers + * sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; + /** + * An object containing the outbound trailers sent for this `HttpStream`. + * @since v9.5.0 + */ + readonly sentTrailers?: OutgoingHttpHeaders | undefined; + /** + * A reference to the `Http2Session` instance that owns this `Http2Stream`. The + * value will be `undefined` after the `Http2Stream` instance is destroyed. + * @since v8.4.0 + */ + readonly session: Http2Session; + /** + * Provides miscellaneous information about the current state of the`Http2Stream`. + * + * A current state of this `Http2Stream`. + * @since v8.4.0 + */ + readonly state: StreamState; + /** + * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the + * connected HTTP/2 peer. + * @since v8.4.0 + * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. + * @param callback An optional function registered to listen for the `'close'` event. + */ + close(code?: number, callback?: () => void): void; + /** + * Updates the priority for this `Http2Stream` instance. + * @since v8.4.0 + */ + priority(options: StreamPriorityOptions): void; + /** + * ```js + * const http2 = require('http2'); + * const client = http2.connect('http://example.org:8000'); + * const { NGHTTP2_CANCEL } = http2.constants; + * const req = client.request({ ':path': '/' }); + * + * // Cancel the stream if there's no activity after 5 seconds + * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); + * ``` + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method + * will cause the `Http2Stream` to be immediately closed and must only be + * called after the `'wantTrailers'` event has been emitted. When sending a + * request or sending a response, the `options.waitForTrailers` option must be set + * in order to keep the `Http2Stream` open after the final `DATA` frame so that + * trailers can be sent. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond(undefined, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ xyz: 'abc' }); + * }); + * stream.end('Hello World'); + * }); + * ``` + * + * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header + * fields (e.g. `':method'`, `':path'`, etc). + * @since v10.0.0 + */ + sendTrailers(headers: OutgoingHttpHeaders): void; + addListener(event: 'aborted', listener: () => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'streamClosed', listener: (code: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'wantTrailers', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'aborted'): boolean; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: Buffer | string): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'frameError', frameType: number, errorCode: number): boolean; + emit(event: 'pipe', src: stream.Readable): boolean; + emit(event: 'unpipe', src: stream.Readable): boolean; + emit(event: 'streamClosed', code: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: 'trailers', trailers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'wantTrailers'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'aborted', listener: () => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: 'streamClosed', listener: (code: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'wantTrailers', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'aborted', listener: () => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: 'streamClosed', listener: (code: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'wantTrailers', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'aborted', listener: () => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'streamClosed', listener: (code: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'wantTrailers', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'aborted', listener: () => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'streamClosed', listener: (code: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'wantTrailers', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ClientHttp2Stream extends Http2Stream { + addListener(event: 'continue', listener: () => {}): this; + addListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'continue'): boolean; + emit(event: 'headers', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: 'push', headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'response', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'continue', listener: () => {}): this; + on(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'continue', listener: () => {}): this; + once(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'continue', listener: () => {}): this; + prependListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'continue', listener: () => {}): this; + prependOnceListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ServerHttp2Stream extends Http2Stream { + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote + * client's most recent `SETTINGS` frame. Will be `true` if the remote peer + * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. + * @since v8.4.0 + */ + readonly pushAllowed: boolean; + /** + * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. + * @since v8.4.0 + */ + additionalHeaders(headers: OutgoingHttpHeaders): void; + /** + * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { + * if (err) throw err; + * pushStream.respond({ ':status': 200 }); + * pushStream.end('some pushed data'); + * }); + * stream.end('some data'); + * }); + * ``` + * + * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass + * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. + * + * Calling `http2stream.pushStream()` from within a pushed stream is not permitted + * and will throw an error. + * @since v8.4.0 + * @param callback Callback that is called once the push stream has been initiated. + */ + pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + /** + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.end('some data'); + * }); + * ``` + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * stream.end('some data'); + * }); + * ``` + * @since v8.4.0 + */ + respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; + /** + * Initiates a response whose data is read from the given file descriptor. No + * validation is performed on the given file descriptor. If an error occurs while + * attempting to read data using the file descriptor, the `Http2Stream` will be + * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * ```js + * const http2 = require('http2'); + * const fs = require('fs'); + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8' + * }; + * stream.respondWithFD(fd, headers); + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to + * collect details on the provided file descriptor. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The file descriptor or `FileHandle` is not closed when the stream is closed, + * so it will need to be closed manually once it is no longer needed. + * Using the same file descriptor concurrently for multiple streams + * is not supported and may result in data loss. Re-using a file descriptor + * after a stream has finished is supported. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('http2'); + * const fs = require('fs'); + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8' + * }; + * stream.respondWithFD(fd, headers, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * @since v8.4.0 + * @param fd A readable file descriptor. + */ + respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; + /** + * Sends a regular file as the response. The `path` must specify a regular file + * or an `'error'` event will be emitted on the `Http2Stream` object. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given file: + * + * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is + * defined, then it will be called. Otherwise + * the stream will be destroyed. + * + * Example using a file path: + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * headers['last-modified'] = stat.mtime.toUTCString(); + * } + * + * function onError(err) { + * // stream.respond() can throw if the stream has been destroyed by + * // the other side. + * try { + * if (err.code === 'ENOENT') { + * stream.respond({ ':status': 404 }); + * } else { + * stream.respond({ ':status': 500 }); + * } + * } catch (err) { + * // Perform actual error handling. + * console.log(err); + * } + * stream.end(); + * } + * + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck, onError }); + * }); + * ``` + * + * The `options.statCheck` function may also be used to cancel the send operation + * by returning `false`. For instance, a conditional request may check the stat + * results to determine if the file has been modified to return an appropriate`304` response: + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * // Check the stat here... + * stream.respond({ ':status': 304 }); + * return false; // Cancel the send operation + * } + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck }); + * }); + * ``` + * + * The `content-length` header field will be automatically set. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The `options.onError` function may also be used to handle all the errors + * that could happen before the delivery of the file is initiated. The + * default behavior is to destroy the stream. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * }); + * ``` + * @since v8.4.0 + */ + respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; + } + // Http2Session + export interface Settings { + headerTableSize?: number | undefined; + enablePush?: boolean | undefined; + initialWindowSize?: number | undefined; + maxFrameSize?: number | undefined; + maxConcurrentStreams?: number | undefined; + maxHeaderListSize?: number | undefined; + enableConnectProtocol?: boolean | undefined; + } + export interface ClientSessionRequestOptions { + endStream?: boolean | undefined; + exclusive?: boolean | undefined; + parent?: number | undefined; + weight?: number | undefined; + waitForTrailers?: boolean | undefined; + signal?: AbortSignal | undefined; + } + export interface SessionState { + effectiveLocalWindowSize?: number | undefined; + effectiveRecvDataLength?: number | undefined; + nextStreamID?: number | undefined; + localWindowSize?: number | undefined; + lastProcStreamID?: number | undefined; + remoteWindowSize?: number | undefined; + outboundQueueSize?: number | undefined; + deflateDynamicTableSize?: number | undefined; + inflateDynamicTableSize?: number | undefined; + } + export interface Http2Session extends EventEmitter { + /** + * Value will be `undefined` if the `Http2Session` is not yet connected to a + * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or + * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. + * @since v9.4.0 + */ + readonly alpnProtocol?: string | undefined; + /** + * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Will be `true` if this `Http2Session` instance is still connecting, will be set + * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. + * @since v10.0.0 + */ + readonly connecting: boolean; + /** + * Will be `true` if this `Http2Session` instance has been destroyed and must no + * longer be used, otherwise `false`. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Value is `undefined` if the `Http2Session` session socket has not yet been + * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, + * and `false` if the `Http2Session` is connected to any other kind of socket + * or stream. + * @since v9.4.0 + */ + readonly encrypted?: boolean | undefined; + /** + * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. + * @since v8.4.0 + */ + readonly localSettings: Settings; + /** + * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property + * will return an `Array` of origins for which the `Http2Session` may be + * considered authoritative. + * + * The `originSet` property is only available when using a secure TLS connection. + * @since v9.4.0 + */ + readonly originSet?: string[] | undefined; + /** + * Indicates whether the `Http2Session` is currently waiting for acknowledgment of + * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. + * @since v8.4.0 + */ + readonly pendingSettingsAck: boolean; + /** + * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. + * @since v8.4.0 + */ + readonly remoteSettings: Settings; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * limits available methods to ones safe to use with HTTP/2. + * + * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw + * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. + * + * `setTimeout` method will be called on this `Http2Session`. + * + * All other interactions will be routed directly to the socket. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * Provides miscellaneous information about the current state of the`Http2Session`. + * + * An object describing the current status of this `Http2Session`. + * @since v8.4.0 + */ + readonly state: SessionState; + /** + * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a + * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a + * client. + * @since v8.4.0 + */ + readonly type: number; + /** + * Gracefully closes the `Http2Session`, allowing any existing streams to + * complete on their own and preventing new `Http2Stream` instances from being + * created. Once closed, `http2session.destroy()`_might_ be called if there + * are no open `Http2Stream` instances. + * + * If specified, the `callback` function is registered as a handler for the`'close'` event. + * @since v9.4.0 + */ + close(callback?: () => void): void; + /** + * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. + * + * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. + * + * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. + * @since v8.4.0 + * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. + * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. + */ + destroy(error?: Error, code?: number): void; + /** + * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. + * @since v9.4.0 + * @param code An HTTP/2 error code + * @param lastStreamID The numeric ID of the last processed `Http2Stream` + * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. + */ + goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; + /** + * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must + * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. + * + * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. + * + * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and + * returned with the ping acknowledgment. + * + * The callback will be invoked with three arguments: an error argument that will + * be `null` if the `PING` was successfully acknowledged, a `duration` argument + * that reports the number of milliseconds elapsed since the ping was sent and the + * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. + * + * ```js + * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { + * if (!err) { + * console.log(`Ping acknowledged in ${duration} milliseconds`); + * console.log(`With payload '${payload.toString()}'`); + * } + * }); + * ``` + * + * If the `payload` argument is not specified, the default payload will be the + * 64-bit timestamp (little endian) marking the start of the `PING` duration. + * @since v8.9.3 + * @param payload Optional ping payload. + */ + ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + /** + * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. + * @since v9.4.0 + */ + ref(): void; + /** + * Sets the local endpoint's window size. + * The `windowSize` is the total window size to set, not + * the delta. + * + * ```js + * const http2 = require('http2'); + * + * const server = http2.createServer(); + * const expectedWindowSize = 2 ** 20; + * server.on('connect', (session) => { + * + * // Set local window size to be 2 ** 20 + * session.setLocalWindowSize(expectedWindowSize); + * }); + * ``` + * @since v15.3.0, v14.18.0 + */ + setLocalWindowSize(windowSize: number): void; + /** + * Used to set a callback function that is called when there is no activity on + * the `Http2Session` after `msecs` milliseconds. The given `callback` is + * registered as a listener on the `'timeout'` event. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. + * + * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new + * settings. + * + * The new settings will not become effective until the `SETTINGS` acknowledgment + * is received and the `'localSettings'` event is emitted. It is possible to send + * multiple `SETTINGS` frames while acknowledgment is still pending. + * @since v8.4.0 + * @param callback Callback that is called once the session is connected or right away if the session is already connected. + */ + settings(settings: Settings, callback?: (err: Error | null, settings: Settings, duration: number) => void): void; + /** + * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. + * @since v9.4.0 + */ + unref(): void; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + addListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + addListener(event: 'localSettings', listener: (settings: Settings) => void): this; + addListener(event: 'ping', listener: () => void): this; + addListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'frameError', frameType: number, errorCode: number, streamID: number): boolean; + emit(event: 'goaway', errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; + emit(event: 'localSettings', settings: Settings): boolean; + emit(event: 'ping'): boolean; + emit(event: 'remoteSettings', settings: Settings): boolean; + emit(event: 'timeout'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + on(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + on(event: 'localSettings', listener: (settings: Settings) => void): this; + on(event: 'ping', listener: () => void): this; + on(event: 'remoteSettings', listener: (settings: Settings) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + once(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + once(event: 'localSettings', listener: (settings: Settings) => void): this; + once(event: 'ping', listener: () => void): this; + once(event: 'remoteSettings', listener: (settings: Settings) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependListener(event: 'localSettings', listener: (settings: Settings) => void): this; + prependListener(event: 'ping', listener: () => void): this; + prependListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependOnceListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependOnceListener(event: 'localSettings', listener: (settings: Settings) => void): this; + prependOnceListener(event: 'ping', listener: () => void): this; + prependOnceListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ClientHttp2Session extends Http2Session { + /** + * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an + * HTTP/2 request to the connected server. + * + * When a `ClientHttp2Session` is first created, the socket may not yet be + * connected. if `clienthttp2session.request()` is called during this time, the + * actual request will be deferred until the socket is ready to go. + * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. + * + * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. + * + * ```js + * const http2 = require('http2'); + * const clientSession = http2.connect('https://localhost:1234'); + * const { + * HTTP2_HEADER_PATH, + * HTTP2_HEADER_STATUS + * } = http2.constants; + * + * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); + * req.on('response', (headers) => { + * console.log(headers[HTTP2_HEADER_STATUS]); + * req.on('data', (chunk) => { // .. }); + * req.on('end', () => { // .. }); + * }); + * ``` + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * is emitted immediately after queuing the last chunk of payload data to be sent. + * The `http2stream.sendTrailers()` method can then be called to send trailing + * headers to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * When `options.signal` is set with an `AbortSignal` and then `abort` on the + * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. + * + * The `:method` and `:path` pseudo-headers are not specified within `headers`, + * they respectively default to: + * + * * `:method` \= `'GET'` + * * `:path` \= `/` + * @since v8.4.0 + */ + request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; + addListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + addListener(event: 'origin', listener: (origins: string[]) => void): this; + addListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'altsvc', alt: string, origin: string, stream: number): boolean; + emit(event: 'origin', origins: ReadonlyArray): boolean; + emit(event: 'connect', session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: 'stream', stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + on(event: 'origin', listener: (origins: string[]) => void): this; + on(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + once(event: 'origin', listener: (origins: string[]) => void): this; + once(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + prependListener(event: 'origin', listener: (origins: string[]) => void): this; + prependListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + prependOnceListener(event: 'origin', listener: (origins: string[]) => void): this; + prependOnceListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + export interface ServerHttp2Session extends Http2Session { + readonly server: Http2Server | Http2SecureServer; + /** + * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. + * + * ```js + * const http2 = require('http2'); + * + * const server = http2.createServer(); + * server.on('session', (session) => { + * // Set altsvc for origin https://example.org:80 + * session.altsvc('h2=":8000"', 'https://example.org:80'); + * }); + * + * server.on('stream', (stream) => { + * // Set altsvc for a specific stream + * stream.session.altsvc('h2=":8000"', stream.id); + * }); + * ``` + * + * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate + * service is associated with the origin of the given `Http2Stream`. + * + * The `alt` and origin string _must_ contain only ASCII bytes and are + * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given + * domain. + * + * When a string is passed for the `originOrStream` argument, it will be parsed as + * a URL and the origin will be derived. For instance, the origin for the + * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * @since v9.4.0 + * @param alt A description of the alternative service configuration as defined by `RFC 7838`. + * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the + * `http2stream.id` property. + */ + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + /** + * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client + * to advertise the set of origins for which the server is capable of providing + * authoritative responses. + * + * ```js + * const http2 = require('http2'); + * const options = getSecureOptionsSomehow(); + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * server.on('session', (session) => { + * session.origin('https://example.com', 'https://example.org'); + * }); + * ``` + * + * When a string is passed as an `origin`, it will be parsed as a URL and the + * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given + * string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as + * an `origin`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * + * Alternatively, the `origins` option may be used when creating a new HTTP/2 + * server using the `http2.createSecureServer()` method: + * + * ```js + * const http2 = require('http2'); + * const options = getSecureOptionsSomehow(); + * options.origins = ['https://example.com', 'https://example.org']; + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * ``` + * @since v10.12.0 + * @param origins One or more URL Strings passed as separate arguments. + */ + origin( + ...origins: Array< + | string + | url.URL + | { + origin: string; + } + > + ): void; + addListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'connect', session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + // Http2Server + export interface SessionOptions { + maxDeflateDynamicTableSize?: number | undefined; + maxSessionMemory?: number | undefined; + maxHeaderListPairs?: number | undefined; + maxOutstandingPings?: number | undefined; + maxSendHeaderBlockLength?: number | undefined; + paddingStrategy?: number | undefined; + peerMaxConcurrentStreams?: number | undefined; + settings?: Settings | undefined; + /** + * Specifies a timeout in milliseconds that + * a server should wait when an [`'unknownProtocol'`][] is emitted. If the + * socket has not been destroyed by that time the server will destroy it. + * @default 100000 + */ + unknownProtocolTimeout?: number | undefined; + selectPadding?(frameLen: number, maxFrameLen: number): number; + createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex; + } + export interface ClientSessionOptions extends SessionOptions { + maxReservedRemoteStreams?: number | undefined; + createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; + protocol?: 'http:' | 'https:' | undefined; + } + export interface ServerSessionOptions extends SessionOptions { + Http1IncomingMessage?: typeof IncomingMessage | undefined; + Http1ServerResponse?: typeof ServerResponse | undefined; + Http2ServerRequest?: typeof Http2ServerRequest | undefined; + Http2ServerResponse?: typeof Http2ServerResponse | undefined; + } + export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} + export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} + export interface ServerOptions extends ServerSessionOptions {} + export interface SecureServerOptions extends SecureServerSessionOptions { + allowHTTP1?: boolean | undefined; + origins?: string[] | undefined; + } + interface HTTP2ServerCommon { + setTimeout(msec?: number, callback?: () => void): this; + /** + * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. + * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. + */ + updateSettings(settings: Settings): void; + } + export interface Http2Server extends net.Server, HTTP2ServerCommon { + addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + addListener(event: 'sessionError', listener: (err: Error) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'session', session: ServerHttp2Session): boolean; + emit(event: 'sessionError', err: Error): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'session', listener: (session: ServerHttp2Session) => void): this; + on(event: 'sessionError', listener: (err: Error) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'session', listener: (session: ServerHttp2Session) => void): this; + once(event: 'sessionError', listener: (err: Error) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependListener(event: 'sessionError', listener: (err: Error) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { + addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + addListener(event: 'sessionError', listener: (err: Error) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'session', session: ServerHttp2Session): boolean; + emit(event: 'sessionError', err: Error): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: 'unknownProtocol', socket: tls.TLSSocket): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'session', listener: (session: ServerHttp2Session) => void): this; + on(event: 'sessionError', listener: (err: Error) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'session', listener: (session: ServerHttp2Session) => void): this; + once(event: 'sessionError', listener: (err: Error) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependListener(event: 'sessionError', listener: (err: Error) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, + * headers, and + * data. + * @since v8.4.0 + */ + export class Http2ServerRequest extends stream.Readable { + constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray); + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + */ + readonly aborted: boolean; + /** + * The request authority pseudo header field. Because HTTP/2 allows requests + * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. + * @since v8.4.0 + */ + readonly authority: string; + /** + * See `request.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * The `request.complete` property will be `true` if the request has + * been completed, aborted, or destroyed. + * @since v12.10.0 + */ + readonly complete: boolean; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.headers); + * ``` + * + * See `HTTP/2 Headers Object`. + * + * In HTTP/2, the request path, host name, protocol, and method are represented as + * special headers prefixed with the `:` character (e.g. `':path'`). These special + * headers will be included in the `request.headers` object. Care must be taken not + * to inadvertently modify these special headers or errors may occur. For instance, + * removing all headers from the request will cause errors to occur: + * + * ```js + * removeAllHeaders(request.headers); + * assert(request.url); // Fails because the :path header has been removed + * ``` + * @since v8.4.0 + */ + readonly headers: IncomingHttpHeaders; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. Returns`'2.0'`. + * + * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * @since v8.4.0 + */ + readonly httpVersion: string; + readonly httpVersionMinor: number; + readonly httpVersionMajor: number; + /** + * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. + * @since v8.4.0 + */ + readonly method: string; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v8.4.0 + */ + readonly rawHeaders: string[]; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly rawTrailers: string[]; + /** + * The request scheme pseudo header field indicating the scheme + * portion of the target URL. + * @since v8.4.0 + */ + readonly scheme: string; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `request.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. + * + * `setTimeout` method will be called on `request.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. With TLS support, + * use `request.socket.getPeerCertificate()` to obtain the client's + * authentication details. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the request. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly trailers: IncomingHttpHeaders; + /** + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. If the request is: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * Then `request.url` will be: + * + * ```js + * '/status?name=ryan' + * ``` + * + * To parse the url into its parts, `new URL()` can be used: + * + * ```console + * $ node + * > new URL('/status?name=ryan', 'http://example.com') + * URL { + * href: 'http://example.com/status?name=ryan', + * origin: 'http://example.com', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'example.com', + * hostname: 'example.com', + * port: '', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * @since v8.4.0 + */ + url: string; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream` s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + read(size?: number): Buffer | string | null; + addListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'aborted', hadError: boolean, code: number): boolean; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: Buffer | string): boolean; + emit(event: 'end'): boolean; + emit(event: 'readable'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v8.4.0 + */ + export class Http2ServerResponse extends stream.Writable { + constructor(stream: ServerHttp2Stream); + /** + * See `response.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * Boolean value that indicates whether the response has completed. Starts + * as `false`. After `response.end()` executes, the value will be `true`. + * @since v8.4.0 + * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. + */ + readonly finished: boolean; + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * A reference to the original HTTP2 request object. + * @since v15.7.0 + */ + readonly req: Http2ServerRequest; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `response.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. + * + * `setTimeout` method will be called on `response.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. + * + * ```js + * const http2 = require('http2'); + * const server = http2.createServer((req, res) => { + * const ip = req.socket.remoteAddress; + * const port = req.socket.remotePort; + * res.end(`Your IP address is ${ip} and your source port is ${port}.`); + * }).listen(3000); + * ``` + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the response. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * When true, the Date header will be automatically generated and sent in + * the response if it is not already present in the headers. Defaults to true. + * + * This should only be disabled for testing; HTTP requires the Date header + * in responses. + * @since v8.4.0 + */ + sendDate: boolean; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v8.4.0 + */ + statusCode: number; + /** + * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns + * an empty string. + * @since v8.4.0 + */ + statusMessage: ''; + /** + * This method adds HTTP trailing headers (a header but at the end of the + * message) to the response. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + addTrailers(trailers: OutgoingHttpHeaders): void; + /** + * This method signals to the server that all of the response headers and body + * have been sent; that server should consider this message complete. + * The method, `response.end()`, MUST be called on each response. + * + * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. + * + * If `callback` is specified, it will be called when the response stream + * is finished. + * @since v8.4.0 + */ + end(callback?: () => void): this; + end(data: string | Uint8Array, callback?: () => void): this; + end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; + /** + * Reads out a header that has already been queued but not sent to the client. + * The name is case-insensitive. + * + * ```js + * const contentType = response.getHeader('content-type'); + * ``` + * @since v8.4.0 + */ + getHeader(name: string): string; + /** + * Returns an array containing the unique names of the current outgoing headers. + * All header names are lowercase. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = response.getHeaderNames(); + * // headerNames === ['foo', 'set-cookie'] + * ``` + * @since v8.4.0 + */ + getHeaderNames(): string[]; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow copy + * is used, array values may be mutated without additional calls to various + * header-related http module methods. The keys of the returned object are the + * header names and the values are the respective header values. All header names + * are lowercase. + * + * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = response.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v8.4.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name matching is case-insensitive. + * + * ```js + * const hasContentType = response.hasHeader('content-type'); + * ``` + * @since v8.4.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that has been queued for implicit sending. + * + * ```js + * response.removeHeader('Content-Encoding'); + * ``` + * @since v8.4.0 + */ + removeHeader(name: string): void; + /** + * Sets a single header value for implicit headers. If this header already exists + * in the to-be-sent headers, its value will be replaced. Use an array of strings + * here to send multiple headers with the same name. + * + * ```js + * response.setHeader('Content-Type', 'text/html; charset=utf-8'); + * ``` + * + * or + * + * ```js + * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * @since v8.4.0 + */ + setHeader(name: string, value: number | string | ReadonlyArray): void; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream` s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * If this method is called and `response.writeHead()` has not been called, + * it will switch to implicit header mode and flush the implicit headers. + * + * This sends a chunk of the response body. This method may + * be called multiple times to provide successive parts of the body. + * + * In the `http` module, the response body is omitted when the + * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. + * + * `chunk` can be a string or a buffer. If `chunk` is a string, + * the second parameter specifies how to encode it into a byte stream. + * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk + * of data is flushed. + * + * This is the raw HTTP body and has nothing to do with higher-level multi-part + * body encodings that may be used. + * + * The first time `response.write()` is called, it will send the buffered + * header information and the first chunk of the body to the client. The second + * time `response.write()` is called, Node.js assumes data will be streamed, + * and sends the new data separately. That is, the response is buffered up to the + * first chunk of the body. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. + * @since v8.4.0 + */ + write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; + write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; + /** + * Sends a status `100 Continue` to the client, indicating that the request body + * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. + * @since v8.4.0 + */ + writeContinue(): void; + /** + * Sends a status `103 Early Hints` to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. + * + * Example: + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * 'x-trace-id': 'id for diagnostics' + * }); + * ``` + * + * @since v18.11.0 + * @param hints An object containing the values of headers + */ + writeEarlyHints(hints: Record): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * + * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. + * + * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be + * passed as the second argument. However, because the `statusMessage` has no + * meaning within HTTP/2, the argument will have no effect and a process warning + * will be emitted. + * + * ```js + * const body = 'hello world'; + * response.writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain; charset=utf-8', + * }); + * ``` + * + * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a + * given encoding. On outbound messages, Node.js does not check if Content-Length + * and the length of the body being transmitted are equal or not. However, when + * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. + * + * This method may be called at most one time on a message before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; + writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; + /** + * Call `http2stream.pushStream()` with the given headers, and wrap the + * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback + * parameter if successful. When `Http2ServerRequest` is closed, the callback is + * called with an error `ERR_HTTP2_INVALID_STREAM`. + * @since v8.4.0 + * @param headers An object describing the headers + * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of + * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method + */ + createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'drain'): boolean; + emit(event: 'error', error: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pipe', src: stream.Readable): boolean; + emit(event: 'unpipe', src: stream.Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export namespace constants { + const NGHTTP2_SESSION_SERVER: number; + const NGHTTP2_SESSION_CLIENT: number; + const NGHTTP2_STREAM_STATE_IDLE: number; + const NGHTTP2_STREAM_STATE_OPEN: number; + const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + const NGHTTP2_STREAM_STATE_CLOSED: number; + const NGHTTP2_NO_ERROR: number; + const NGHTTP2_PROTOCOL_ERROR: number; + const NGHTTP2_INTERNAL_ERROR: number; + const NGHTTP2_FLOW_CONTROL_ERROR: number; + const NGHTTP2_SETTINGS_TIMEOUT: number; + const NGHTTP2_STREAM_CLOSED: number; + const NGHTTP2_FRAME_SIZE_ERROR: number; + const NGHTTP2_REFUSED_STREAM: number; + const NGHTTP2_CANCEL: number; + const NGHTTP2_COMPRESSION_ERROR: number; + const NGHTTP2_CONNECT_ERROR: number; + const NGHTTP2_ENHANCE_YOUR_CALM: number; + const NGHTTP2_INADEQUATE_SECURITY: number; + const NGHTTP2_HTTP_1_1_REQUIRED: number; + const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + const NGHTTP2_FLAG_NONE: number; + const NGHTTP2_FLAG_END_STREAM: number; + const NGHTTP2_FLAG_END_HEADERS: number; + const NGHTTP2_FLAG_ACK: number; + const NGHTTP2_FLAG_PADDED: number; + const NGHTTP2_FLAG_PRIORITY: number; + const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + const DEFAULT_SETTINGS_ENABLE_PUSH: number; + const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + const MAX_MAX_FRAME_SIZE: number; + const MIN_MAX_FRAME_SIZE: number; + const MAX_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_DEFAULT_WEIGHT: number; + const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + const PADDING_STRATEGY_NONE: number; + const PADDING_STRATEGY_MAX: number; + const PADDING_STRATEGY_CALLBACK: number; + const HTTP2_HEADER_STATUS: string; + const HTTP2_HEADER_METHOD: string; + const HTTP2_HEADER_AUTHORITY: string; + const HTTP2_HEADER_SCHEME: string; + const HTTP2_HEADER_PATH: string; + const HTTP2_HEADER_ACCEPT_CHARSET: string; + const HTTP2_HEADER_ACCEPT_ENCODING: string; + const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + const HTTP2_HEADER_ACCEPT_RANGES: string; + const HTTP2_HEADER_ACCEPT: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + const HTTP2_HEADER_AGE: string; + const HTTP2_HEADER_ALLOW: string; + const HTTP2_HEADER_AUTHORIZATION: string; + const HTTP2_HEADER_CACHE_CONTROL: string; + const HTTP2_HEADER_CONNECTION: string; + const HTTP2_HEADER_CONTENT_DISPOSITION: string; + const HTTP2_HEADER_CONTENT_ENCODING: string; + const HTTP2_HEADER_CONTENT_LANGUAGE: string; + const HTTP2_HEADER_CONTENT_LENGTH: string; + const HTTP2_HEADER_CONTENT_LOCATION: string; + const HTTP2_HEADER_CONTENT_MD5: string; + const HTTP2_HEADER_CONTENT_RANGE: string; + const HTTP2_HEADER_CONTENT_TYPE: string; + const HTTP2_HEADER_COOKIE: string; + const HTTP2_HEADER_DATE: string; + const HTTP2_HEADER_ETAG: string; + const HTTP2_HEADER_EXPECT: string; + const HTTP2_HEADER_EXPIRES: string; + const HTTP2_HEADER_FROM: string; + const HTTP2_HEADER_HOST: string; + const HTTP2_HEADER_IF_MATCH: string; + const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + const HTTP2_HEADER_IF_NONE_MATCH: string; + const HTTP2_HEADER_IF_RANGE: string; + const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + const HTTP2_HEADER_LAST_MODIFIED: string; + const HTTP2_HEADER_LINK: string; + const HTTP2_HEADER_LOCATION: string; + const HTTP2_HEADER_MAX_FORWARDS: string; + const HTTP2_HEADER_PREFER: string; + const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + const HTTP2_HEADER_RANGE: string; + const HTTP2_HEADER_REFERER: string; + const HTTP2_HEADER_REFRESH: string; + const HTTP2_HEADER_RETRY_AFTER: string; + const HTTP2_HEADER_SERVER: string; + const HTTP2_HEADER_SET_COOKIE: string; + const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + const HTTP2_HEADER_TRANSFER_ENCODING: string; + const HTTP2_HEADER_TE: string; + const HTTP2_HEADER_UPGRADE: string; + const HTTP2_HEADER_USER_AGENT: string; + const HTTP2_HEADER_VARY: string; + const HTTP2_HEADER_VIA: string; + const HTTP2_HEADER_WWW_AUTHENTICATE: string; + const HTTP2_HEADER_HTTP2_SETTINGS: string; + const HTTP2_HEADER_KEEP_ALIVE: string; + const HTTP2_HEADER_PROXY_CONNECTION: string; + const HTTP2_METHOD_ACL: string; + const HTTP2_METHOD_BASELINE_CONTROL: string; + const HTTP2_METHOD_BIND: string; + const HTTP2_METHOD_CHECKIN: string; + const HTTP2_METHOD_CHECKOUT: string; + const HTTP2_METHOD_CONNECT: string; + const HTTP2_METHOD_COPY: string; + const HTTP2_METHOD_DELETE: string; + const HTTP2_METHOD_GET: string; + const HTTP2_METHOD_HEAD: string; + const HTTP2_METHOD_LABEL: string; + const HTTP2_METHOD_LINK: string; + const HTTP2_METHOD_LOCK: string; + const HTTP2_METHOD_MERGE: string; + const HTTP2_METHOD_MKACTIVITY: string; + const HTTP2_METHOD_MKCALENDAR: string; + const HTTP2_METHOD_MKCOL: string; + const HTTP2_METHOD_MKREDIRECTREF: string; + const HTTP2_METHOD_MKWORKSPACE: string; + const HTTP2_METHOD_MOVE: string; + const HTTP2_METHOD_OPTIONS: string; + const HTTP2_METHOD_ORDERPATCH: string; + const HTTP2_METHOD_PATCH: string; + const HTTP2_METHOD_POST: string; + const HTTP2_METHOD_PRI: string; + const HTTP2_METHOD_PROPFIND: string; + const HTTP2_METHOD_PROPPATCH: string; + const HTTP2_METHOD_PUT: string; + const HTTP2_METHOD_REBIND: string; + const HTTP2_METHOD_REPORT: string; + const HTTP2_METHOD_SEARCH: string; + const HTTP2_METHOD_TRACE: string; + const HTTP2_METHOD_UNBIND: string; + const HTTP2_METHOD_UNCHECKOUT: string; + const HTTP2_METHOD_UNLINK: string; + const HTTP2_METHOD_UNLOCK: string; + const HTTP2_METHOD_UPDATE: string; + const HTTP2_METHOD_UPDATEREDIRECTREF: string; + const HTTP2_METHOD_VERSION_CONTROL: string; + const HTTP_STATUS_CONTINUE: number; + const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + const HTTP_STATUS_PROCESSING: number; + const HTTP_STATUS_OK: number; + const HTTP_STATUS_CREATED: number; + const HTTP_STATUS_ACCEPTED: number; + const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + const HTTP_STATUS_NO_CONTENT: number; + const HTTP_STATUS_RESET_CONTENT: number; + const HTTP_STATUS_PARTIAL_CONTENT: number; + const HTTP_STATUS_MULTI_STATUS: number; + const HTTP_STATUS_ALREADY_REPORTED: number; + const HTTP_STATUS_IM_USED: number; + const HTTP_STATUS_MULTIPLE_CHOICES: number; + const HTTP_STATUS_MOVED_PERMANENTLY: number; + const HTTP_STATUS_FOUND: number; + const HTTP_STATUS_SEE_OTHER: number; + const HTTP_STATUS_NOT_MODIFIED: number; + const HTTP_STATUS_USE_PROXY: number; + const HTTP_STATUS_TEMPORARY_REDIRECT: number; + const HTTP_STATUS_PERMANENT_REDIRECT: number; + const HTTP_STATUS_BAD_REQUEST: number; + const HTTP_STATUS_UNAUTHORIZED: number; + const HTTP_STATUS_PAYMENT_REQUIRED: number; + const HTTP_STATUS_FORBIDDEN: number; + const HTTP_STATUS_NOT_FOUND: number; + const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + const HTTP_STATUS_NOT_ACCEPTABLE: number; + const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + const HTTP_STATUS_REQUEST_TIMEOUT: number; + const HTTP_STATUS_CONFLICT: number; + const HTTP_STATUS_GONE: number; + const HTTP_STATUS_LENGTH_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_FAILED: number; + const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + const HTTP_STATUS_URI_TOO_LONG: number; + const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + const HTTP_STATUS_EXPECTATION_FAILED: number; + const HTTP_STATUS_TEAPOT: number; + const HTTP_STATUS_MISDIRECTED_REQUEST: number; + const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + const HTTP_STATUS_LOCKED: number; + const HTTP_STATUS_FAILED_DEPENDENCY: number; + const HTTP_STATUS_UNORDERED_COLLECTION: number; + const HTTP_STATUS_UPGRADE_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_REQUIRED: number; + const HTTP_STATUS_TOO_MANY_REQUESTS: number; + const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + const HTTP_STATUS_NOT_IMPLEMENTED: number; + const HTTP_STATUS_BAD_GATEWAY: number; + const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + const HTTP_STATUS_GATEWAY_TIMEOUT: number; + const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + const HTTP_STATUS_LOOP_DETECTED: number; + const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + const HTTP_STATUS_NOT_EXTENDED: number; + const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + /** + * This symbol can be set as a property on the HTTP/2 headers object with + * an array value in order to provide a list of headers considered sensitive. + */ + export const sensitiveHeaders: symbol; + /** + * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called + * so instances returned may be safely modified for use. + * @since v8.4.0 + */ + export function getDefaultSettings(): Settings; + /** + * Returns a `Buffer` instance containing serialized representation of the given + * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended + * for use with the `HTTP2-Settings` header field. + * + * ```js + * const http2 = require('http2'); + * + * const packed = http2.getPackedSettings({ enablePush: false }); + * + * console.log(packed.toString('base64')); + * // Prints: AAIAAAAA + * ``` + * @since v8.4.0 + */ + export function getPackedSettings(settings: Settings): Buffer; + /** + * Returns a `HTTP/2 Settings Object` containing the deserialized settings from + * the given `Buffer` as generated by `http2.getPackedSettings()`. + * @since v8.4.0 + * @param buf The packed settings. + */ + export function getUnpackedSettings(buf: Uint8Array): Settings; + /** + * Returns a `net.Server` instance that creates and manages `Http2Session`instances. + * + * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when + * communicating + * with browser clients. + * + * ```js + * const http2 = require('http2'); + * + * // Create an unencrypted HTTP/2 server. + * // Since there are no browsers known that support + * // unencrypted HTTP/2, the use of `http2.createSecureServer()` + * // is necessary when communicating with browser clients. + * const server = http2.createServer(); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200 + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(80); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + /** + * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. + * + * ```js + * const http2 = require('http2'); + * const fs = require('fs'); + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem') + * }; + * + * // Create a secure HTTP/2 server + * const server = http2.createSecureServer(options); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200 + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(80); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + /** + * Returns a `ClientHttp2Session` instance. + * + * ```js + * const http2 = require('http2'); + * const client = http2.connect('https://localhost:1234'); + * + * // Use the client + * + * client.close(); + * ``` + * @since v8.4.0 + * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port + * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. + * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. + */ + export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; + export function connect( + authority: string | url.URL, + options?: ClientSessionOptions | SecureClientSessionOptions, + listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void + ): ClientHttp2Session; +} +declare module 'node:http2' { + export * from 'http2'; +} diff --git a/server/node_modules/@types/node/ts4.8/https.d.ts b/server/node_modules/@types/node/ts4.8/https.d.ts new file mode 100755 index 0000000000..bda367d74c --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/https.d.ts @@ -0,0 +1,542 @@ +/** + * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a + * separate module. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/https.js) + */ +declare module 'https' { + import { Duplex } from 'node:stream'; + import * as tls from 'node:tls'; + import * as http from 'node:http'; + import { URL } from 'node:url'; + type ServerOptions< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; + type RequestOptions = http.RequestOptions & + tls.SecureContextOptions & { + checkServerIdentity?: typeof tls.checkServerIdentity | undefined; + rejectUnauthorized?: boolean | undefined; // Defaults to true + servername?: string | undefined; // SNI TLS Extension + }; + interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + rejectUnauthorized?: boolean | undefined; + maxCachedSessions?: number | undefined; + } + /** + * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. + * @since v0.4.5 + */ + class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + } + interface Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > extends http.Server {} + /** + * See `http.Server` for more information. + * @since v0.3.4 + */ + class Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > extends tls.Server { + constructor(requestListener?: http.RequestListener); + constructor( + options: ServerOptions, + requestListener?: http.RequestListener, + ); + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + addListener( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + addListener( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + addListener( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Duplex) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'checkContinue', listener: http.RequestListener): this; + addListener(event: 'checkExpectation', listener: http.RequestListener): this; + addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + addListener( + event: 'connect', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + addListener(event: 'request', listener: http.RequestListener): this; + addListener( + event: 'upgrade', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + emit(event: string, ...args: any[]): boolean; + emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean; + emit( + event: 'newSession', + sessionId: Buffer, + sessionData: Buffer, + callback: (err: Error, resp: Buffer) => void, + ): boolean; + emit( + event: 'OCSPRequest', + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ): boolean; + emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; + emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean; + emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Duplex): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit( + event: 'checkContinue', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit( + event: 'checkExpectation', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'clientError', err: Error, socket: Duplex): boolean; + emit(event: 'connect', req: InstanceType, socket: Duplex, head: Buffer): boolean; + emit( + event: 'request', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'upgrade', req: InstanceType, socket: Duplex, head: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + on( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + on( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + on( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Duplex) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'checkContinue', listener: http.RequestListener): this; + on(event: 'checkExpectation', listener: http.RequestListener): this; + on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + on(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + on(event: 'request', listener: http.RequestListener): this; + on(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + once( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + once( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + once( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Duplex) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'checkContinue', listener: http.RequestListener): this; + once(event: 'checkExpectation', listener: http.RequestListener): this; + once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + once(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + once(event: 'request', listener: http.RequestListener): this; + once(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + prependListener( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + prependListener( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + prependListener( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Duplex) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'checkContinue', listener: http.RequestListener): this; + prependListener(event: 'checkExpectation', listener: http.RequestListener): this; + prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + prependListener( + event: 'connect', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + prependListener(event: 'request', listener: http.RequestListener): this; + prependListener( + event: 'upgrade', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener( + event: 'newSession', + listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void, + ): this; + prependOnceListener( + event: 'OCSPRequest', + listener: ( + certificate: Buffer, + issuer: Buffer, + callback: (err: Error | null, resp: Buffer) => void, + ) => void, + ): this; + prependOnceListener( + event: 'resumeSession', + listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void, + ): this; + prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this; + prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this; + prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + prependOnceListener( + event: 'connect', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + prependOnceListener(event: 'request', listener: http.RequestListener): this; + prependOnceListener( + event: 'upgrade', + listener: (req: InstanceType, socket: Duplex, head: Buffer) => void, + ): this; + } + /** + * ```js + * // curl -k https://localhost:8000/ + * const https = require('https'); + * const fs = require('fs'); + * + * const options = { + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * + * Or + * + * ```js + * const https = require('https'); + * const fs = require('fs'); + * + * const options = { + * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), + * passphrase: 'sample' + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * @since v0.3.4 + * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. + * @param requestListener A listener to be added to the `'request'` event. + */ + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + >(requestListener?: http.RequestListener): Server; + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + >( + options: ServerOptions, + requestListener?: http.RequestListener, + ): Server; + /** + * Makes a request to a secure web server. + * + * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, + * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * const https = require('https'); + * + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET' + * }; + * + * const req = https.request(options, (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(e); + * }); + * req.end(); + * ``` + * + * Example using options from `tls.connect()`: + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') + * }; + * options.agent = new https.Agent(options); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Alternatively, opt out of connection pooling by not using an `Agent`. + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * agent: false + * }; + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('https://abc:xyz@example.com'); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): + * + * ```js + * const tls = require('tls'); + * const https = require('https'); + * const crypto = require('crypto'); + * + * function sha256(s) { + * return crypto.createHash('sha256').update(s).digest('base64'); + * } + * const options = { + * hostname: 'github.com', + * port: 443, + * path: '/', + * method: 'GET', + * checkServerIdentity: function(host, cert) { + * // Make sure the certificate is issued to the host we are connected to + * const err = tls.checkServerIdentity(host, cert); + * if (err) { + * return err; + * } + * + * // Pin the public key, similar to HPKP pin-sha25 pinning + * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; + * if (sha256(cert.pubkey) !== pubkey256) { + * const msg = 'Certificate verification error: ' + + * `The public key of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // Pin the exact certificate, rather than the pub key + * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + + * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; + * if (cert.fingerprint256 !== cert256) { + * const msg = 'Certificate verification error: ' + + * `The certificate of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // This loop is informational only. + * // Print the certificate and public key fingerprints of all certs in the + * // chain. Its common to pin the public key of the issuer on the public + * // internet, while pinning the public key of the service in sensitive + * // environments. + * do { + * console.log('Subject Common Name:', cert.subject.CN); + * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); + * + * hash = crypto.createHash('sha256'); + * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); + * + * lastprint256 = cert.fingerprint256; + * cert = cert.issuerCertificate; + * } while (cert.fingerprint256 !== lastprint256); + * + * }, + * }; + * + * options.agent = new https.Agent(options); + * const req = https.request(options, (res) => { + * console.log('All OK. Server matched our pinned cert or public key'); + * console.log('statusCode:', res.statusCode); + * // Print the HPKP values + * console.log('headers:', res.headers['public-key-pins']); + * + * res.on('data', (d) => {}); + * }); + * + * req.on('error', (e) => { + * console.error(e.message); + * }); + * req.end(); + * ``` + * + * Outputs for example: + * + * ```text + * Subject Common Name: github.com + * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 + * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= + * Subject Common Name: DigiCert SHA2 Extended Validation Server CA + * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A + * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= + * Subject Common Name: DigiCert High Assurance EV Root CA + * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF + * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= + * All OK. Server matched our pinned cert or public key + * statusCode: 200 + * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; + * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; + * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains + * ``` + * @since v0.3.6 + * @param options Accepts all `options` from `request`, with some differences in default values: + */ + function request( + options: RequestOptions | string | URL, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + function request( + url: string | URL, + options: RequestOptions, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + /** + * Like `http.get()` but for HTTPS. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * ```js + * const https = require('https'); + * + * https.get('https://encrypted.google.com/', (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * + * }).on('error', (e) => { + * console.error(e); + * }); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. + */ + function get( + options: RequestOptions | string | URL, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + function get( + url: string | URL, + options: RequestOptions, + callback?: (res: http.IncomingMessage) => void, + ): http.ClientRequest; + let globalAgent: Agent; +} +declare module 'node:https' { + export * from 'https'; +} diff --git a/server/node_modules/@types/node/ts4.8/index.d.ts b/server/node_modules/@types/node/ts4.8/index.d.ts new file mode 100755 index 0000000000..7c8b38c634 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/index.d.ts @@ -0,0 +1,88 @@ +/** + * License for programmatically and manually incorporated + * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc + * + * Copyright Node.js contributors. All rights reserved. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +// NOTE: These definitions support NodeJS and TypeScript 4.8 and earlier. + +// Reference required types from the default lib: +/// +/// +/// +/// + +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +/// diff --git a/server/node_modules/@types/node/ts4.8/inspector.d.ts b/server/node_modules/@types/node/ts4.8/inspector.d.ts new file mode 100755 index 0000000000..eba0b55d8b --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/inspector.d.ts @@ -0,0 +1,2741 @@ +// eslint-disable-next-line dt-header +// Type definitions for inspector + +// These definitions are auto-generated. +// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 +// for more information. + +// tslint:disable:max-line-length + +/** + * The `inspector` module provides an API for interacting with the V8 inspector. + * + * It can be accessed using: + * + * ```js + * const inspector = require('inspector'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/inspector.js) + */ +declare module 'inspector' { + import EventEmitter = require('node:events'); + interface InspectorNotification { + method: string; + params: T; + } + namespace Schema { + /** + * Description of the protocol domain. + */ + interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Domain[]; + } + } + namespace Runtime { + /** + * Unique script identifier. + */ + type ScriptId = string; + /** + * Unique object identifier. + */ + type RemoteObjectId = string; + /** + * Primitive value which cannot be JSON-stringified. + */ + type UnserializableValue = string; + /** + * Mirror object referencing original JavaScript object. + */ + interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * Object class (constructor) name. Specified for object type values only. + */ + className?: string | undefined; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: RemoteObjectId | undefined; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: ObjectPreview | undefined; + /** + * @experimental + */ + customPreview?: CustomPreview | undefined; + } + /** + * @experimental + */ + interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: RemoteObjectId; + bindRemoteObjectFunctionId: RemoteObjectId; + configObjectId?: RemoteObjectId | undefined; + } + /** + * Object containing abbreviated remote object value. + * @experimental + */ + interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: PropertyPreview[]; + /** + * List of the entries. Specified for map and set subtype values only. + */ + entries?: EntryPreview[] | undefined; + } + /** + * @experimental + */ + interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string | undefined; + /** + * Nested value preview. + */ + valuePreview?: ObjectPreview | undefined; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + } + /** + * @experimental + */ + interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: ObjectPreview | undefined; + /** + * Preview of the value. + */ + value: ObjectPreview; + } + /** + * Object property descriptor. + */ + interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean | undefined; + /** + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + */ + get?: RemoteObject | undefined; + /** + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + */ + set?: RemoteObject | undefined; + /** + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean | undefined; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean | undefined; + /** + * Property symbol object, if the property is of the symbol type. + */ + symbol?: RemoteObject | undefined; + } + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + } + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + interface CallArgument { + /** + * Primitive value or serializable javascript object. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * Remote object handle. + */ + objectId?: RemoteObjectId | undefined; + } + /** + * Id of an execution context. + */ + type ExecutionContextId = number; + /** + * Description of an isolated world. + */ + interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + */ + id: ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {} | undefined; + } + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: ScriptId | undefined; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string | undefined; + /** + * JavaScript stack trace if available. + */ + stackTrace?: StackTrace | undefined; + /** + * Exception object if available. + */ + exception?: RemoteObject | undefined; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: ExecutionContextId | undefined; + } + /** + * Number of milliseconds since epoch. + */ + type Timestamp = number; + /** + * Stack entry for runtime errors and assertions. + */ + interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + /** + * Call frames for assertions or error messages. + */ + interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + */ + description?: string | undefined; + /** + * JavaScript function name. + */ + callFrames: CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: StackTrace | undefined; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + * @experimental + */ + parentId?: StackTraceId | undefined; + } + /** + * Unique identifier of current debugger. + * @experimental + */ + type UniqueDebuggerId = string; + /** + * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. + * @experimental + */ + interface StackTraceId { + id: string; + debuggerId?: UniqueDebuggerId | undefined; + } + interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + contextId?: ExecutionContextId | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + } + interface CallFunctionOnParameterType { + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Identifier of the object to call function on. Either objectId or executionContextId should be specified. + */ + objectId?: RemoteObjectId | undefined; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + */ + arguments?: CallArgument[] | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + /** + * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + */ + objectGroup?: string | undefined; + } + interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype chain. + */ + ownProperties?: boolean | undefined; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean | undefined; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean | undefined; + } + interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: RemoteObjectId; + } + interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: RemoteObjectId; + } + interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: InternalPropertyDescriptor[] | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: ScriptId | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface RunScriptReturnType { + /** + * Run result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: RemoteObject; + } + interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: ExecutionContextDescription; + } + interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: ExecutionContextId; + } + interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Timestamp; + exceptionDetails: ExceptionDetails; + } + interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in exceptionThrown. + */ + exceptionId: number; + } + interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: StackTrace | undefined; + /** + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * @experimental + */ + context?: string | undefined; + } + interface InspectRequestedEventDataType { + object: RemoteObject; + hints: {}; + } + } + namespace Debugger { + /** + * Breakpoint identifier. + */ + type BreakpointId = string; + /** + * Call frame identifier. + */ + type CallFrameId = string; + /** + * Location in the source code. + */ + interface Location { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + } + /** + * Location in the source code. + * @experimental + */ + interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + */ + functionLocation?: Location | undefined; + /** + * Location in the source code. + */ + location: Location; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Scope chain for this call frame. + */ + scopeChain: Scope[]; + /** + * this object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject | undefined; + } + /** + * Scope description. + */ + interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string | undefined; + /** + * Location in the source code where scope starts + */ + startLocation?: Location | undefined; + /** + * Location in the source code where scope ends + */ + endLocation?: Location | undefined; + } + /** + * Search match for resource. + */ + interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + interface BreakLocation { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + type?: string | undefined; + } + interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string | undefined; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + */ + urlRegex?: string | undefined; + /** + * Script hash of the resources to set breakpoint on. + */ + scriptHash?: string | undefined; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number | undefined; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface RemoveBreakpointParameterType { + breakpointId: BreakpointId; + } + interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + */ + end?: Location | undefined; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean | undefined; + } + interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Location; + targetCallFrames?: string | undefined; + } + interface PauseOnAsyncCallParameterType { + /** + * Debugger will pause when async call with given stack trace is started. + */ + parentStackTraceId: Runtime.StackTraceId; + } + interface StepIntoParameterType { + /** + * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. + * @experimental + */ + breakOnAsyncCall?: boolean | undefined; + } + interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean | undefined; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean | undefined; + } + interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. + */ + dryRun?: boolean | undefined; + } + interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + } + interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). + */ + objectGroup?: string | undefined; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults to false. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + */ + throwOnSideEffect?: boolean | undefined; + } + interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: CallFrameId; + } + interface SetReturnValueParameterType { + /** + * New return value. + */ + newValue: Runtime.CallArgument; + } + interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). + */ + maxDepth: number; + } + interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: ScriptPosition[]; + } + interface EnableReturnType { + /** + * Unique identifier of the debugger. + * @experimental + */ + debuggerId: Runtime.UniqueDebuggerId; + } + interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Location[]; + } + interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Location; + } + interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: BreakLocation[]; + } + interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: SearchMatch[]; + } + interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: CallFrame[] | undefined; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + } + interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {} | undefined; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {} | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: BreakpointId; + /** + * Actual breakpoint location. + */ + location: Location; + } + interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {} | undefined; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[] | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. + * @experimental + */ + asyncCallStackTraceId?: Runtime.StackTraceId | undefined; + } + } + namespace Console { + /** + * Console message. + */ + interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string | undefined; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number | undefined; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number | undefined; + } + interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: ConsoleMessage; + } + } + namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + */ + hitCount?: number | undefined; + /** + * Child node ids. + */ + children?: number[] | undefined; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. + */ + deoptReason?: string | undefined; + /** + * An array of source position ticks. + */ + positionTicks?: PositionTickInfo[] | undefined; + } + /** + * Profile. + */ + interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[] | undefined; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. + */ + timeDeltas?: number[] | undefined; + } + /** + * Specifies a number of samples attributed to a certain source position. + */ + interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + /** + * Coverage data for a source range. + */ + interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + /** + * Coverage data for a JavaScript function. + */ + interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + /** + * Coverage data for a JavaScript script. + */ + interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: FunctionCoverage[]; + } + /** + * Describes a type collected during runtime. + * @experimental + */ + interface TypeObject { + /** + * Name of a type collected with type profiling. + */ + name: string; + } + /** + * Source offset and types for a parameter or return value. + * @experimental + */ + interface TypeProfileEntry { + /** + * Source offset of the parameter or end of function for return values. + */ + offset: number; + /** + * The types for this parameter or return value. + */ + types: TypeObject[]; + } + /** + * Type profile data collected during runtime for a JavaScript script. + * @experimental + */ + interface ScriptTypeProfile { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Type profile entries for parameters and return values of the functions in the script. + */ + entries: TypeProfileEntry[]; + } + interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean | undefined; + /** + * Collect block-based coverage. + */ + detailed?: boolean | undefined; + } + interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profile; + } + interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface TakeTypeProfileReturnType { + /** + * Type profile for all scripts since startTypeProfile() was turned on. + */ + result: ScriptTypeProfile[]; + } + interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + } + namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + type HeapSnapshotObjectId = string; + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: SamplingHeapProfileNode[]; + } + /** + * Profile. + */ + interface SamplingHeapProfile { + head: SamplingHeapProfileNode; + } + interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean | undefined; + } + interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. + */ + reportProgress?: boolean | undefined; + } + interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean | undefined; + } + interface GetObjectByHeapObjectIdParameterType { + objectId: HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + } + interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapSnapshotObjectId; + } + interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. + */ + samplingInterval?: number | undefined; + } + interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapSnapshotObjectId; + } + interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: SamplingHeapProfile; + } + interface GetSamplingProfileReturnType { + /** + * Return the sampling profile being collected. + */ + profile: SamplingHeapProfile; + } + interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean | undefined; + } + interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + } + namespace NodeTracing { + interface TraceConfig { + /** + * Controls how the trace buffer stores data. + */ + recordMode?: string | undefined; + /** + * Included category filters. + */ + includedCategories: string[]; + } + interface StartParameterType { + traceConfig: TraceConfig; + } + interface GetCategoriesReturnType { + /** + * A list of supported tracing categories. + */ + categories: string[]; + } + interface DataCollectedEventDataType { + value: Array<{}>; + } + } + namespace NodeWorker { + type WorkerID = string; + /** + * Unique identifier of attached debugging session. + */ + type SessionID = string; + interface WorkerInfo { + workerId: WorkerID; + type: string; + title: string; + url: string; + } + interface SendMessageToWorkerParameterType { + message: string; + /** + * Identifier of the session. + */ + sessionId: SessionID; + } + interface EnableParameterType { + /** + * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` + * message to run them. + */ + waitForDebuggerOnStart: boolean; + } + interface DetachParameterType { + sessionId: SessionID; + } + interface AttachedToWorkerEventDataType { + /** + * Identifier assigned to the session used to send/receive messages. + */ + sessionId: SessionID; + workerInfo: WorkerInfo; + waitingForDebugger: boolean; + } + interface DetachedFromWorkerEventDataType { + /** + * Detached session identifier. + */ + sessionId: SessionID; + } + interface ReceivedMessageFromWorkerEventDataType { + /** + * Identifier of a session which sends a message. + */ + sessionId: SessionID; + message: string; + } + } + namespace NodeRuntime { + interface NotifyWhenWaitingForDisconnectParameterType { + enabled: boolean; + } + } + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + */ + class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. + */ + constructor(); + /** + * Connects a session to the inspector back-end. + * @since v8.0.0 + */ + connect(): void; + /** + * Immediately close the session. All pending message callbacks will be called + * with an error. `session.connect()` will need to be called to be able to send + * messages again. Reconnected session will lose all inspector state, such as + * enabled agents or configured breakpoints. + * @since v8.0.0 + */ + disconnect(): void; + /** + * Posts a message to the inspector back-end. `callback` will be notified when + * a response is received. `callback` is a function that accepts two optional + * arguments: error and message-specific result. + * + * ```js + * session.post('Runtime.evaluate', { expression: '2 + 2' }, + * (error, { result }) => console.log(result)); + * // Output: { type: 'number', value: 4, description: '4' } + * ``` + * + * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). + * + * Node.js inspector supports all the Chrome DevTools Protocol domains declared + * by V8\. Chrome DevTools Protocol domain provides an interface for interacting + * with one of the runtime agents used to inspect the application state and listen + * to the run-time events. + * + * ## Example usage + * + * Apart from the debugger, various V8 Profilers are available through the DevTools + * protocol. + * @since v8.0.0 + */ + post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; + post(method: string, callback?: (err: Error | null, params?: {}) => void): void; + /** + * Returns supported domains. + */ + post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + /** + * Evaluates expression on global object. + */ + post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + /** + * Add handler to promise with given promise object id. + */ + post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + /** + * Releases remote object with given id. + */ + post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; + /** + * Releases all remote objects that belong to a given group. + */ + post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; + /** + * Disables reporting of execution contexts creation. + */ + post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; + /** + * Discards collected exceptions and console API calls. + */ + post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; + /** + * Compiles expression. + */ + post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + /** + * Runs script with given id in a given context. + */ + post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + /** + * Returns all let, const and class variables from global scope. + */ + post( + method: 'Runtime.globalLexicalScopeNames', + params?: Runtime.GlobalLexicalScopeNamesParameterType, + callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void + ): void; + post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + /** + * Disables debugger for given page. + */ + post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + /** + * Removes JavaScript breakpoint. + */ + post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + */ + post( + method: 'Debugger.getPossibleBreakpoints', + params?: Debugger.GetPossibleBreakpointsParameterType, + callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void + ): void; + post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + /** + * Continues execution until specific location is reached. + */ + post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; + /** + * Steps over the statement. + */ + post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; + /** + * Steps into the function call. + */ + post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; + /** + * Steps out of the function call. + */ + post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; + /** + * Stops on the next JavaScript statement. + */ + post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; + /** + * Resumes JavaScript execution. + */ + post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; + /** + * Returns stack trace with given stackTraceId. + * @experimental + */ + post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + /** + * Searches for given string in script content. + */ + post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + /** + * Edits JavaScript source live. + */ + post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + /** + * Restarts particular call frame from the beginning. + */ + post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + /** + * Returns source for the script with given id. + */ + post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; + /** + * Evaluates expression on a given call frame. + */ + post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; + /** + * Enables or disables async call stacks tracking. + */ + post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: 'Console.enable', callback?: (err: Error | null) => void): void; + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: 'Console.disable', callback?: (err: Error | null) => void): void; + /** + * Does nothing. + */ + post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + */ + post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + */ + post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + */ + post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + */ + post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + /** + * Enable type profile. + * @experimental + */ + post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; + /** + * Disable type profile. Disabling releases type profile data collected so far. + * @experimental + */ + post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; + /** + * Collect type profile. + * @experimental + */ + post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; + post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; + post( + method: 'HeapProfiler.getObjectByHeapObjectId', + params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, + callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void + ): void; + post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; + /** + * Gets supported tracing categories. + */ + post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; + /** + * Start trace events collection. + */ + post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; + /** + * Stop trace events collection. Remaining collected events will be sent as a sequence of + * dataCollected events followed by tracingComplete event. + */ + post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; + /** + * Sends protocol message over session with given id. + */ + post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; + /** + * Instructs the inspector to attach to running workers. Will also attach to new workers + * as they start + */ + post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; + /** + * Detaches from all running workers and disables attaching to new workers as they are started. + */ + post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; + /** + * Detached from the worker with given sessionId. + */ + post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; + /** + * Enable the `NodeRuntime.waitingForDisconnect`. + */ + post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; + // Events + addListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; + emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; + emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; + emit(event: 'Runtime.executionContextsCleared'): boolean; + emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; + emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; + emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; + emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; + emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; + emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; + emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; + emit(event: 'Debugger.paused', message: InspectorNotification): boolean; + emit(event: 'Debugger.resumed'): boolean; + emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; + emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; + emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.resetProfiles'): boolean; + emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; + emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; + emit(event: 'NodeTracing.tracingComplete'): boolean; + emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; + emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; + emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; + emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + on(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + on(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + once(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + once(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + } + /** + * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has + * started. + * + * If wait is `true`, will block until a client has connected to the inspect port + * and flow control has been passed to the debugger client. + * + * See the `security warning` regarding the `host`parameter usage. + * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. + * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. + * @param [wait=false] Block until a client has connected. Optional. + */ + function open(port?: number, host?: string, wait?: boolean): void; + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + function close(): void; + /** + * Return the URL of the active inspector, or `undefined` if there is none. + * + * ```console + * $ node --inspect -p 'inspector.url()' + * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * For help, see: https://nodejs.org/en/docs/inspector + * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * + * $ node --inspect=localhost:3000 -p 'inspector.url()' + * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * For help, see: https://nodejs.org/en/docs/inspector + * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * + * $ node -p 'inspector.url()' + * undefined + * ``` + */ + function url(): string | undefined; + /** + * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. + * + * An exception will be thrown if there is no active inspector. + * @since v12.7.0 + */ + function waitForDebugger(): void; +} +/** + * The inspector module provides an API for interacting with the V8 inspector. + */ +declare module 'node:inspector' { + import inspector = require('inspector'); + export = inspector; +} diff --git a/server/node_modules/@types/node/ts4.8/module.d.ts b/server/node_modules/@types/node/ts4.8/module.d.ts new file mode 100755 index 0000000000..d83aec94aa --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/module.d.ts @@ -0,0 +1,114 @@ +/** + * @since v0.3.7 + */ +declare module 'module' { + import { URL } from 'node:url'; + namespace Module { + /** + * The `module.syncBuiltinESMExports()` method updates all the live bindings for + * builtin `ES Modules` to match the properties of the `CommonJS` exports. It + * does not add or remove exported names from the `ES Modules`. + * + * ```js + * const fs = require('fs'); + * const assert = require('assert'); + * const { syncBuiltinESMExports } = require('module'); + * + * fs.readFile = newAPI; + * + * delete fs.readFileSync; + * + * function newAPI() { + * // ... + * } + * + * fs.newAPI = newAPI; + * + * syncBuiltinESMExports(); + * + * import('fs').then((esmFS) => { + * // It syncs the existing readFile property with the new value + * assert.strictEqual(esmFS.readFile, newAPI); + * // readFileSync has been deleted from the required fs + * assert.strictEqual('readFileSync' in fs, false); + * // syncBuiltinESMExports() does not remove readFileSync from esmFS + * assert.strictEqual('readFileSync' in esmFS, true); + * // syncBuiltinESMExports() does not add names + * assert.strictEqual(esmFS.newAPI, undefined); + * }); + * ``` + * @since v12.12.0 + */ + function syncBuiltinESMExports(): void; + /** + * `path` is the resolved path for the file for which a corresponding source map + * should be fetched. + * @since v13.7.0, v12.17.0 + */ + function findSourceMap(path: string, error?: Error): SourceMap; + interface SourceMapPayload { + file: string; + version: number; + sources: string[]; + sourcesContent: string[]; + names: string[]; + mappings: string; + sourceRoot: string; + } + interface SourceMapping { + generatedLine: number; + generatedColumn: number; + originalSource: string; + originalLine: number; + originalColumn: number; + } + /** + * @since v13.7.0, v12.17.0 + */ + class SourceMap { + /** + * Getter for the payload used to construct the `SourceMap` instance. + */ + readonly payload: SourceMapPayload; + constructor(payload: SourceMapPayload); + /** + * Given a line number and column number in the generated source file, returns + * an object representing the position in the original file. The object returned + * consists of the following keys: + */ + findEntry(line: number, column: number): SourceMapping; + } + } + interface Module extends NodeModule {} + class Module { + static runMain(): void; + static wrap(code: string): string; + static createRequire(path: string | URL): NodeRequire; + static builtinModules: string[]; + static Module: typeof Module; + constructor(id: string, parent?: Module); + } + global { + interface ImportMeta { + url: string; + /** + * @experimental + * This feature is only available with the `--experimental-import-meta-resolve` + * command flag enabled. + * + * Provides a module-relative resolution function scoped to each module, returning + * the URL string. + * + * @param specified The module specifier to resolve relative to `parent`. + * @param parent The absolute parent module URL to resolve from. If none + * is specified, the value of `import.meta.url` is used as the default. + */ + resolve?(specified: string, parent?: string | URL): Promise; + } + } + export = Module; +} +declare module 'node:module' { + import module = require('module'); + export = module; +} diff --git a/server/node_modules/@types/node/ts4.8/net.d.ts b/server/node_modules/@types/node/ts4.8/net.d.ts new file mode 100755 index 0000000000..72cebc8254 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/net.d.ts @@ -0,0 +1,869 @@ +/** + * > Stability: 2 - Stable + * + * The `net` module provides an asynchronous network API for creating stream-based + * TCP or `IPC` servers ({@link createServer}) and clients + * ({@link createConnection}). + * + * It can be accessed using: + * + * ```js + * const net = require('net'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/net.js) + */ +declare module 'net' { + import * as stream from 'node:stream'; + import { Abortable, EventEmitter } from 'node:events'; + import * as dns from 'node:dns'; + type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; + interface AddressInfo { + address: string; + family: string; + port: number; + } + interface SocketConstructorOpts { + fd?: number | undefined; + allowHalfOpen?: boolean | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + signal?: AbortSignal; + } + interface OnReadOpts { + buffer: Uint8Array | (() => Uint8Array); + /** + * This function is called for every chunk of incoming data. + * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. + * Return false from this function to implicitly pause() the socket. + */ + callback(bytesWritten: number, buf: Uint8Array): boolean; + } + interface ConnectOpts { + /** + * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. + * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will + * still be emitted as normal and methods like pause() and resume() will also behave as expected. + */ + onread?: OnReadOpts | undefined; + } + interface TcpSocketConnectOpts extends ConnectOpts { + port: number; + host?: string | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + hints?: number | undefined; + family?: number | undefined; + lookup?: LookupFunction | undefined; + noDelay?: boolean | undefined; + keepAlive?: boolean | undefined; + keepAliveInitialDelay?: number | undefined; + } + interface IpcSocketConnectOpts extends ConnectOpts { + path: string; + } + type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + type SocketReadyState = 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed'; + /** + * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint + * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also + * an `EventEmitter`. + * + * A `net.Socket` can be created by the user and used directly to interact with + * a server. For example, it is returned by {@link createConnection}, + * so the user can use it to talk to the server. + * + * It can also be created by Node.js and passed to the user when a connection + * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use + * it to interact with the client. + * @since v0.3.4 + */ + class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + /** + * Sends data on the socket. The second parameter specifies the encoding in the + * case of a string. It defaults to UTF8 encoding. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. + * + * The optional `callback` parameter will be executed when the data is finally + * written out, which may not be immediately. + * + * See `Writable` stream `write()` method for more + * information. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + */ + write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; + write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; + /** + * Initiate a connection on a given socket. + * + * Possible signatures: + * + * * `socket.connect(options[, connectListener])` + * * `socket.connect(path[, connectListener])` for `IPC` connections. + * * `socket.connect(port[, host][, connectListener])` for TCP connections. + * * Returns: `net.Socket` The socket itself. + * + * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, + * instead of a `'connect'` event, an `'error'` event will be emitted with + * the error passed to the `'error'` listener. + * The last parameter `connectListener`, if supplied, will be added as a listener + * for the `'connect'` event **once**. + * + * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined + * behavior. + */ + connect(options: SocketConnectOpts, connectionListener?: () => void): this; + connect(port: number, host: string, connectionListener?: () => void): this; + connect(port: number, connectionListener?: () => void): this; + connect(path: string, connectionListener?: () => void): this; + /** + * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. + * @since v0.1.90 + * @return The socket itself. + */ + setEncoding(encoding?: BufferEncoding): this; + /** + * Pauses the reading of data. That is, `'data'` events will not be emitted. + * Useful to throttle back an upload. + * @return The socket itself. + */ + pause(): this; + /** + * Close the TCP connection by sending an RST packet and destroy the stream. + * If this TCP socket is in connecting status, it will send an RST packet + * and destroy this TCP socket once it is connected. Otherwise, it will call + * `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. If this is not a TCP socket + * (for example, a pipe), calling this method will immediately throw + * an `ERR_INVALID_HANDLE_TYPE` Error. + * @since v18.3.0 + * @return The socket itself. + */ + resetAndDestroy(): this; + /** + * Resumes reading after a call to `socket.pause()`. + * @return The socket itself. + */ + resume(): this; + /** + * Sets the socket to timeout after `timeout` milliseconds of inactivity on + * the socket. By default `net.Socket` do not have a timeout. + * + * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to + * end the connection. + * + * ```js + * socket.setTimeout(3000); + * socket.on('timeout', () => { + * console.log('socket timeout'); + * socket.end(); + * }); + * ``` + * + * If `timeout` is 0, then the existing idle timeout is disabled. + * + * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. + * @since v0.1.90 + * @return The socket itself. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Enable/disable the use of Nagle's algorithm. + * + * When a TCP connection is created, it will have Nagle's algorithm enabled. + * + * Nagle's algorithm delays data before it is sent via the network. It attempts + * to optimize throughput at the expense of latency. + * + * Passing `true` for `noDelay` or not passing an argument will disable Nagle's + * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's + * algorithm. + * @since v0.1.90 + * @param [noDelay=true] + * @return The socket itself. + */ + setNoDelay(noDelay?: boolean): this; + /** + * Enable/disable keep-alive functionality, and optionally set the initial + * delay before the first keepalive probe is sent on an idle socket. + * + * Set `initialDelay` (in milliseconds) to set the delay between the last + * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default + * (or previous) setting. + * + * Enabling the keep-alive functionality will set the following socket options: + * + * * `SO_KEEPALIVE=1` + * * `TCP_KEEPIDLE=initialDelay` + * * `TCP_KEEPCNT=10` + * * `TCP_KEEPINTVL=1` + * @since v0.1.92 + * @param [enable=false] + * @param [initialDelay=0] + * @return The socket itself. + */ + setKeepAlive(enable?: boolean, initialDelay?: number): this; + /** + * Returns the bound `address`, the address `family` name and `port` of the + * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` + * @since v0.1.90 + */ + address(): AddressInfo | {}; + /** + * Calling `unref()` on a socket will allow the program to exit if this is the only + * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + unref(): this; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). + * If the socket is `ref`ed calling `ref` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + ref(): this; + /** + * This property shows the number of characters buffered for writing. The buffer + * may contain strings whose length after encoding is not yet known. So this number + * is only an approximation of the number of bytes in the buffer. + * + * `net.Socket` has the property that `socket.write()` always works. This is to + * help users get up and running quickly. The computer cannot always keep up + * with the amount of data that is written to a socket. The network connection + * simply might be too slow. Node.js will internally queue up the data written to a + * socket and send it out over the wire when it is possible. + * + * The consequence of this internal buffering is that memory may grow. + * Users who experience large or growing `bufferSize` should attempt to + * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. + * @since v0.3.8 + * @deprecated Since v14.6.0 - Use `writableLength` instead. + */ + readonly bufferSize: number; + /** + * The amount of received bytes. + * @since v0.5.3 + */ + readonly bytesRead: number; + /** + * The amount of bytes sent. + * @since v0.5.3 + */ + readonly bytesWritten: number; + /** + * If `true`,`socket.connect(options[, connectListener])` was + * called and has not yet finished. It will stay `true` until the socket becomes + * connected, then it is set to `false` and the `'connect'` event is emitted. Note + * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. + * @since v6.1.0 + */ + readonly connecting: boolean; + /** + * See `writable.destroyed` for further details. + */ + readonly destroyed: boolean; + /** + * The string representation of the local IP address the remote client is + * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client + * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. + * @since v0.9.6 + */ + readonly localAddress?: string; + /** + * The numeric representation of the local port. For example, `80` or `21`. + * @since v0.9.6 + */ + readonly localPort?: number; + /** + * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. + * @since v18.8.0 + */ + readonly localFamily?: string; + /** + * This property represents the state of the connection as a string. + * @see {https://nodejs.org/api/net.html#socketreadystate} + * @since v0.5.0 + */ + readonly readyState: SocketReadyState; + /** + * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.5.10 + */ + readonly remoteAddress?: string | undefined; + /** + * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. + * @since v0.11.14 + */ + readonly remoteFamily?: string | undefined; + /** + * The numeric representation of the remote port. For example, `80` or `21`. + * @since v0.5.10 + */ + readonly remotePort?: number | undefined; + /** + * The socket timeout in milliseconds as set by socket.setTimeout(). It is undefined if a timeout has not been set. + * @since v10.7.0 + */ + readonly timeout?: number | undefined; + /** + * Half-closes the socket. i.e., it sends a FIN packet. It is possible the + * server will still send some data. + * + * See `writable.end()` for further details. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + * @param callback Optional callback for when the socket is finished. + * @return The socket itself. + */ + end(callback?: () => void): this; + end(buffer: Uint8Array | string, callback?: () => void): this; + end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. ready + * 9. timeout + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: (hadError: boolean) => void): this; + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'data', listener: (data: Buffer) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'timeout', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close', hadError: boolean): boolean; + emit(event: 'connect'): boolean; + emit(event: 'data', data: Buffer): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean; + emit(event: 'ready'): boolean; + emit(event: 'timeout'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (hadError: boolean) => void): this; + on(event: 'connect', listener: () => void): this; + on(event: 'data', listener: (data: Buffer) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'timeout', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: (hadError: boolean) => void): this; + once(event: 'connect', listener: () => void): this; + once(event: 'data', listener: (data: Buffer) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'timeout', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: (hadError: boolean) => void): this; + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'data', listener: (data: Buffer) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this; + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'data', listener: (data: Buffer) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + } + interface ListenOptions extends Abortable { + port?: number | undefined; + host?: string | undefined; + backlog?: number | undefined; + path?: string | undefined; + exclusive?: boolean | undefined; + readableAll?: boolean | undefined; + writableAll?: boolean | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + } + interface ServerOpts { + /** + * Indicates whether half-opened TCP connections are allowed. + * @default false + */ + allowHalfOpen?: boolean | undefined; + /** + * Indicates whether the socket should be paused on incoming connections. + * @default false + */ + pauseOnConnect?: boolean | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default false + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + } + interface DropArgument { + localAddress?: string; + localPort?: number; + localFamily?: string; + remoteAddress?: string; + remotePort?: number; + remoteFamily?: string; + } + /** + * This class is used to create a TCP or `IPC` server. + * @since v0.1.90 + */ + class Server extends EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); + /** + * Start a server listening for connections. A `net.Server` can be a TCP or + * an `IPC` server depending on what it listens to. + * + * Possible signatures: + * + * * `server.listen(handle[, backlog][, callback])` + * * `server.listen(options[, callback])` + * * `server.listen(path[, backlog][, callback])` for `IPC` servers + * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers + * + * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` + * event. + * + * All `listen()` methods can take a `backlog` parameter to specify the maximum + * length of the queue of pending connections. The actual length will be determined + * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). + * + * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for + * details). + * + * The `server.listen()` method can be called again if and only if there was an + * error during the first `server.listen()` call or `server.close()` has been + * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. + * + * One of the most common errors raised when listening is `EADDRINUSE`. + * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry + * after a certain amount of time: + * + * ```js + * server.on('error', (e) => { + * if (e.code === 'EADDRINUSE') { + * console.log('Address in use, retrying...'); + * setTimeout(() => { + * server.close(); + * server.listen(PORT, HOST); + * }, 1000); + * } + * }); + * ``` + */ + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, hostname?: string, listeningListener?: () => void): this; + listen(port?: number, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, listeningListener?: () => void): this; + listen(path: string, backlog?: number, listeningListener?: () => void): this; + listen(path: string, listeningListener?: () => void): this; + listen(options: ListenOptions, listeningListener?: () => void): this; + listen(handle: any, backlog?: number, listeningListener?: () => void): this; + listen(handle: any, listeningListener?: () => void): this; + /** + * Stops the server from accepting new connections and keeps existing + * connections. This function is asynchronous, the server is finally closed + * when all connections are ended and the server emits a `'close'` event. + * The optional `callback` will be called once the `'close'` event occurs. Unlike + * that event, it will be called with an `Error` as its only argument if the server + * was not open when it was closed. + * @since v0.1.90 + * @param callback Called when the server is closed. + */ + close(callback?: (err?: Error) => void): this; + /** + * Returns the bound `address`, the address `family` name, and `port` of the server + * as reported by the operating system if listening on an IP socket + * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. + * + * For a server listening on a pipe or Unix domain socket, the name is returned + * as a string. + * + * ```js + * const server = net.createServer((socket) => { + * socket.end('goodbye\n'); + * }).on('error', (err) => { + * // Handle errors here. + * throw err; + * }); + * + * // Grab an arbitrary unused port. + * server.listen(() => { + * console.log('opened server on', server.address()); + * }); + * ``` + * + * `server.address()` returns `null` before the `'listening'` event has been + * emitted or after calling `server.close()`. + * @since v0.1.90 + */ + address(): AddressInfo | string | null; + /** + * Asynchronously get the number of concurrent connections on the server. Works + * when sockets were sent to forks. + * + * Callback should take two arguments `err` and `count`. + * @since v0.9.7 + */ + getConnections(cb: (error: Error | null, count: number) => void): void; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). + * If the server is `ref`ed calling `ref()` again will have no effect. + * @since v0.9.1 + */ + ref(): this; + /** + * Calling `unref()` on a server will allow the program to exit if this is the only + * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + */ + unref(): this; + /** + * Set this property to reject connections when the server's connection count gets + * high. + * + * It is not recommended to use this option once a socket has been sent to a child + * with `child_process.fork()`. + * @since v0.2.0 + */ + maxConnections: number; + connections: number; + /** + * Indicates whether or not the server is listening for connections. + * @since v5.7.0 + */ + listening: boolean; + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + * 5. drop + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Socket) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'drop', listener: (data?: DropArgument) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Socket): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit(event: 'drop', data?: DropArgument): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Socket) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'drop', listener: (data?: DropArgument) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Socket) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'drop', listener: (data?: DropArgument) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Socket) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'drop', listener: (data?: DropArgument) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'drop', listener: (data?: DropArgument) => void): this; + } + type IPVersion = 'ipv4' | 'ipv6'; + /** + * The `BlockList` object can be used with some network APIs to specify rules for + * disabling inbound or outbound access to specific IP addresses, IP ranges, or + * IP subnets. + * @since v15.0.0, v14.18.0 + */ + class BlockList { + /** + * Adds a rule to block the given IP address. + * @since v15.0.0, v14.18.0 + * @param address An IPv4 or IPv6 address. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addAddress(address: string, type?: IPVersion): void; + addAddress(address: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). + * @since v15.0.0, v14.18.0 + * @param start The starting IPv4 or IPv6 address in the range. + * @param end The ending IPv4 or IPv6 address in the range. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addRange(start: string, end: string, type?: IPVersion): void; + addRange(start: SocketAddress, end: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses specified as a subnet mask. + * @since v15.0.0, v14.18.0 + * @param net The network IPv4 or IPv6 address. + * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addSubnet(net: SocketAddress, prefix: number): void; + addSubnet(net: string, prefix: number, type?: IPVersion): void; + /** + * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. + * + * ```js + * const blockList = new net.BlockList(); + * blockList.addAddress('123.123.123.123'); + * blockList.addRange('10.0.0.1', '10.0.0.10'); + * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); + * + * console.log(blockList.check('123.123.123.123')); // Prints: true + * console.log(blockList.check('10.0.0.3')); // Prints: true + * console.log(blockList.check('222.111.111.222')); // Prints: false + * + * // IPv6 notation for IPv4 addresses works: + * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true + * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true + * ``` + * @since v15.0.0, v14.18.0 + * @param address The IP address to check + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + check(address: SocketAddress): boolean; + check(address: string, type?: IPVersion): boolean; + } + interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + /** + * Creates a new TCP or `IPC` server. + * + * If `allowHalfOpen` is set to `true`, when the other end of the socket + * signals the end of transmission, the server will only send back the end of + * transmission when `socket.end()` is explicitly called. For example, in the + * context of TCP, when a FIN packed is received, a FIN packed is sent + * back only when `socket.end()` is explicitly called. Until then the + * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. + * + * If `pauseOnConnect` is set to `true`, then the socket associated with each + * incoming connection will be paused, and no data will be read from its handle. + * This allows connections to be passed between processes without any data being + * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. + * + * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. + * + * Here is an example of a TCP echo server which listens for connections + * on port 8124: + * + * ```js + * const net = require('net'); + * const server = net.createServer((c) => { + * // 'connection' listener. + * console.log('client connected'); + * c.on('end', () => { + * console.log('client disconnected'); + * }); + * c.write('hello\r\n'); + * c.pipe(c); + * }); + * server.on('error', (err) => { + * throw err; + * }); + * server.listen(8124, () => { + * console.log('server bound'); + * }); + * ``` + * + * Test this by using `telnet`: + * + * ```console + * $ telnet localhost 8124 + * ``` + * + * To listen on the socket `/tmp/echo.sock`: + * + * ```js + * server.listen('/tmp/echo.sock', () => { + * console.log('server bound'); + * }); + * ``` + * + * Use `nc` to connect to a Unix domain socket server: + * + * ```console + * $ nc -U /tmp/echo.sock + * ``` + * @since v0.5.0 + * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. + */ + function createServer(connectionListener?: (socket: Socket) => void): Server; + function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; + /** + * Aliases to {@link createConnection}. + * + * Possible signatures: + * + * * {@link connect} + * * {@link connect} for `IPC` connections. + * * {@link connect} for TCP connections. + */ + function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; + function connect(port: number, host?: string, connectionListener?: () => void): Socket; + function connect(path: string, connectionListener?: () => void): Socket; + /** + * A factory function, which creates a new {@link Socket}, + * immediately initiates connection with `socket.connect()`, + * then returns the `net.Socket` that starts the connection. + * + * When the connection is established, a `'connect'` event will be emitted + * on the returned socket. The last parameter `connectListener`, if supplied, + * will be added as a listener for the `'connect'` event **once**. + * + * Possible signatures: + * + * * {@link createConnection} + * * {@link createConnection} for `IPC` connections. + * * {@link createConnection} for TCP connections. + * + * The {@link connect} function is an alias to this function. + */ + function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; + function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; + function createConnection(path: string, connectionListener?: () => void): Socket; + /** + * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 + * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. + * + * ```js + * net.isIP('::1'); // returns 6 + * net.isIP('127.0.0.1'); // returns 4 + * net.isIP('127.000.000.001'); // returns 0 + * net.isIP('127.0.0.1/24'); // returns 0 + * net.isIP('fhqwhgads'); // returns 0 + * ``` + * @since v0.3.0 + */ + function isIP(input: string): number; + /** + * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no + * leading zeroes. Otherwise, returns `false`. + * + * ```js + * net.isIPv4('127.0.0.1'); // returns true + * net.isIPv4('127.000.000.001'); // returns false + * net.isIPv4('127.0.0.1/24'); // returns false + * net.isIPv4('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv4(input: string): boolean; + /** + * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. + * + * ```js + * net.isIPv6('::1'); // returns true + * net.isIPv6('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv6(input: string): boolean; + interface SocketAddressInitOptions { + /** + * The network address as either an IPv4 or IPv6 string. + * @default 127.0.0.1 + */ + address?: string | undefined; + /** + * @default `'ipv4'` + */ + family?: IPVersion | undefined; + /** + * An IPv6 flow-label used only if `family` is `'ipv6'`. + * @default 0 + */ + flowlabel?: number | undefined; + /** + * An IP port. + * @default 0 + */ + port?: number | undefined; + } + /** + * @since v15.14.0, v14.18.0 + */ + class SocketAddress { + constructor(options: SocketAddressInitOptions); + /** + * @since v15.14.0, v14.18.0 + */ + readonly address: string; + /** + * Either \`'ipv4'\` or \`'ipv6'\`. + * @since v15.14.0, v14.18.0 + */ + readonly family: IPVersion; + /** + * @since v15.14.0, v14.18.0 + */ + readonly port: number; + /** + * @since v15.14.0, v14.18.0 + */ + readonly flowlabel: number; + } +} +declare module 'node:net' { + export * from 'net'; +} diff --git a/server/node_modules/@types/node/ts4.8/os.d.ts b/server/node_modules/@types/node/ts4.8/os.d.ts new file mode 100755 index 0000000000..3c555992dd --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/os.d.ts @@ -0,0 +1,466 @@ +/** + * The `os` module provides operating system-related utility methods and + * properties. It can be accessed using: + * + * ```js + * const os = require('os'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js) + */ +declare module 'os' { + interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + cidr: string | null; + } + interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: 'IPv4'; + scopeid?: undefined; + } + interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: 'IPv6'; + scopeid: number; + } + interface UserInfo { + username: T; + uid: number; + gid: number; + shell: T; + homedir: T; + } + type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + /** + * Returns the host name of the operating system as a string. + * @since v0.3.3 + */ + function hostname(): string; + /** + * Returns an array containing the 1, 5, and 15 minute load averages. + * + * The load average is a measure of system activity calculated by the operating + * system and expressed as a fractional number. + * + * The load average is a Unix-specific concept. On Windows, the return value is + * always `[0, 0, 0]`. + * @since v0.3.3 + */ + function loadavg(): number[]; + /** + * Returns the system uptime in number of seconds. + * @since v0.3.3 + */ + function uptime(): number; + /** + * Returns the amount of free system memory in bytes as an integer. + * @since v0.3.3 + */ + function freemem(): number; + /** + * Returns the total amount of system memory in bytes as an integer. + * @since v0.3.3 + */ + function totalmem(): number; + /** + * Returns an array of objects containing information about each logical CPU core. + * + * The properties included on each object include: + * + * ```js + * [ + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 252020, + * nice: 0, + * sys: 30340, + * idle: 1070356870, + * irq: 0 + * } + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 306960, + * nice: 0, + * sys: 26980, + * idle: 1071569080, + * irq: 0 + * } + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 248450, + * nice: 0, + * sys: 21750, + * idle: 1070919370, + * irq: 0 + * } + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 256880, + * nice: 0, + * sys: 19430, + * idle: 1070905480, + * irq: 20 + * } + * }, + * ] + * ``` + * + * `nice` values are POSIX-only. On Windows, the `nice` values of all processors + * are always 0. + * @since v0.3.3 + */ + function cpus(): CpuInfo[]; + /** + * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it + * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. + * + * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information + * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. + * @since v0.3.3 + */ + function type(): string; + /** + * Returns the operating system as a string. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See + * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v0.3.3 + */ + function release(): string; + /** + * Returns an object containing network interfaces that have been assigned a + * network address. + * + * Each key on the returned object identifies a network interface. The associated + * value is an array of objects that each describe an assigned network address. + * + * The properties available on the assigned network address object include: + * + * ```js + * { + * lo: [ + * { + * address: '127.0.0.1', + * netmask: '255.0.0.0', + * family: 'IPv4', + * mac: '00:00:00:00:00:00', + * internal: true, + * cidr: '127.0.0.1/8' + * }, + * { + * address: '::1', + * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', + * family: 'IPv6', + * mac: '00:00:00:00:00:00', + * scopeid: 0, + * internal: true, + * cidr: '::1/128' + * } + * ], + * eth0: [ + * { + * address: '192.168.1.108', + * netmask: '255.255.255.0', + * family: 'IPv4', + * mac: '01:02:03:0a:0b:0c', + * internal: false, + * cidr: '192.168.1.108/24' + * }, + * { + * address: 'fe80::a00:27ff:fe4e:66a1', + * netmask: 'ffff:ffff:ffff:ffff::', + * family: 'IPv6', + * mac: '01:02:03:0a:0b:0c', + * scopeid: 1, + * internal: false, + * cidr: 'fe80::a00:27ff:fe4e:66a1/64' + * } + * ] + * } + * ``` + * @since v0.6.0 + */ + function networkInterfaces(): NodeJS.Dict; + /** + * Returns the string path of the current user's home directory. + * + * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it + * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. + * + * On Windows, it uses the `USERPROFILE` environment variable if defined. + * Otherwise it uses the path to the profile directory of the current user. + * @since v2.3.0 + */ + function homedir(): string; + /** + * Returns information about the currently effective user. On POSIX platforms, + * this is typically a subset of the password file. The returned object includes + * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. + * + * The value of `homedir` returned by `os.userInfo()` is provided by the operating + * system. This differs from the result of `os.homedir()`, which queries + * environment variables for the home directory before falling back to the + * operating system response. + * + * Throws a `SystemError` if a user has no `username` or `homedir`. + * @since v6.0.0 + */ + function userInfo(options: { encoding: 'buffer' }): UserInfo; + function userInfo(options?: { encoding: BufferEncoding }): UserInfo; + type SignalConstants = { + [key in NodeJS.Signals]: number; + }; + namespace constants { + const UV_UDP_REUSEADDR: number; + namespace signals {} + const signals: SignalConstants; + namespace errno { + const E2BIG: number; + const EACCES: number; + const EADDRINUSE: number; + const EADDRNOTAVAIL: number; + const EAFNOSUPPORT: number; + const EAGAIN: number; + const EALREADY: number; + const EBADF: number; + const EBADMSG: number; + const EBUSY: number; + const ECANCELED: number; + const ECHILD: number; + const ECONNABORTED: number; + const ECONNREFUSED: number; + const ECONNRESET: number; + const EDEADLK: number; + const EDESTADDRREQ: number; + const EDOM: number; + const EDQUOT: number; + const EEXIST: number; + const EFAULT: number; + const EFBIG: number; + const EHOSTUNREACH: number; + const EIDRM: number; + const EILSEQ: number; + const EINPROGRESS: number; + const EINTR: number; + const EINVAL: number; + const EIO: number; + const EISCONN: number; + const EISDIR: number; + const ELOOP: number; + const EMFILE: number; + const EMLINK: number; + const EMSGSIZE: number; + const EMULTIHOP: number; + const ENAMETOOLONG: number; + const ENETDOWN: number; + const ENETRESET: number; + const ENETUNREACH: number; + const ENFILE: number; + const ENOBUFS: number; + const ENODATA: number; + const ENODEV: number; + const ENOENT: number; + const ENOEXEC: number; + const ENOLCK: number; + const ENOLINK: number; + const ENOMEM: number; + const ENOMSG: number; + const ENOPROTOOPT: number; + const ENOSPC: number; + const ENOSR: number; + const ENOSTR: number; + const ENOSYS: number; + const ENOTCONN: number; + const ENOTDIR: number; + const ENOTEMPTY: number; + const ENOTSOCK: number; + const ENOTSUP: number; + const ENOTTY: number; + const ENXIO: number; + const EOPNOTSUPP: number; + const EOVERFLOW: number; + const EPERM: number; + const EPIPE: number; + const EPROTO: number; + const EPROTONOSUPPORT: number; + const EPROTOTYPE: number; + const ERANGE: number; + const EROFS: number; + const ESPIPE: number; + const ESRCH: number; + const ESTALE: number; + const ETIME: number; + const ETIMEDOUT: number; + const ETXTBSY: number; + const EWOULDBLOCK: number; + const EXDEV: number; + const WSAEINTR: number; + const WSAEBADF: number; + const WSAEACCES: number; + const WSAEFAULT: number; + const WSAEINVAL: number; + const WSAEMFILE: number; + const WSAEWOULDBLOCK: number; + const WSAEINPROGRESS: number; + const WSAEALREADY: number; + const WSAENOTSOCK: number; + const WSAEDESTADDRREQ: number; + const WSAEMSGSIZE: number; + const WSAEPROTOTYPE: number; + const WSAENOPROTOOPT: number; + const WSAEPROTONOSUPPORT: number; + const WSAESOCKTNOSUPPORT: number; + const WSAEOPNOTSUPP: number; + const WSAEPFNOSUPPORT: number; + const WSAEAFNOSUPPORT: number; + const WSAEADDRINUSE: number; + const WSAEADDRNOTAVAIL: number; + const WSAENETDOWN: number; + const WSAENETUNREACH: number; + const WSAENETRESET: number; + const WSAECONNABORTED: number; + const WSAECONNRESET: number; + const WSAENOBUFS: number; + const WSAEISCONN: number; + const WSAENOTCONN: number; + const WSAESHUTDOWN: number; + const WSAETOOMANYREFS: number; + const WSAETIMEDOUT: number; + const WSAECONNREFUSED: number; + const WSAELOOP: number; + const WSAENAMETOOLONG: number; + const WSAEHOSTDOWN: number; + const WSAEHOSTUNREACH: number; + const WSAENOTEMPTY: number; + const WSAEPROCLIM: number; + const WSAEUSERS: number; + const WSAEDQUOT: number; + const WSAESTALE: number; + const WSAEREMOTE: number; + const WSASYSNOTREADY: number; + const WSAVERNOTSUPPORTED: number; + const WSANOTINITIALISED: number; + const WSAEDISCON: number; + const WSAENOMORE: number; + const WSAECANCELLED: number; + const WSAEINVALIDPROCTABLE: number; + const WSAEINVALIDPROVIDER: number; + const WSAEPROVIDERFAILEDINIT: number; + const WSASYSCALLFAILURE: number; + const WSASERVICE_NOT_FOUND: number; + const WSATYPE_NOT_FOUND: number; + const WSA_E_NO_MORE: number; + const WSA_E_CANCELLED: number; + const WSAEREFUSED: number; + } + namespace priority { + const PRIORITY_LOW: number; + const PRIORITY_BELOW_NORMAL: number; + const PRIORITY_NORMAL: number; + const PRIORITY_ABOVE_NORMAL: number; + const PRIORITY_HIGH: number; + const PRIORITY_HIGHEST: number; + } + } + const devNull: string; + const EOL: string; + /** + * Returns the operating system CPU architecture for which the Node.js binary was + * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. + * + * The return value is equivalent to `process.arch`. + * @since v0.5.0 + */ + function arch(): string; + /** + * Returns a string identifying the kernel version. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not + * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v13.11.0, v12.17.0 + */ + function version(): string; + /** + * Returns a string identifying the operating system platform for which + * the Node.js binary was compiled. The value is set at compile time. + * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. + * + * The return value is equivalent to `process.platform`. + * + * The value `'android'` may also be returned if Node.js is built on the Android + * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.5.0 + */ + function platform(): NodeJS.Platform; + /** + * Returns the machine type as a string, such as arm, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64. + * + * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). + * On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used. + * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v18.9.0 + */ + function machine(): string; + /** + * Returns the operating system's default directory for temporary files as a + * string. + * @since v0.9.9 + */ + function tmpdir(): string; + /** + * Returns a string identifying the endianness of the CPU for which the Node.js + * binary was compiled. + * + * Possible values are `'BE'` for big endian and `'LE'` for little endian. + * @since v0.9.4 + */ + function endianness(): 'BE' | 'LE'; + /** + * Returns the scheduling priority for the process specified by `pid`. If `pid` is + * not provided or is `0`, the priority of the current process is returned. + * @since v10.10.0 + * @param [pid=0] The process ID to retrieve scheduling priority for. + */ + function getPriority(pid?: number): number; + /** + * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. + * + * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows + * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range + * mapping may cause the return value to be slightly different on Windows. To avoid + * confusion, set `priority` to one of the priority constants. + * + * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user + * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. + * @since v10.10.0 + * @param [pid=0] The process ID to set scheduling priority for. + * @param priority The scheduling priority to assign to the process. + */ + function setPriority(priority: number): void; + function setPriority(pid: number, priority: number): void; +} +declare module 'node:os' { + export * from 'os'; +} diff --git a/server/node_modules/@types/node/ts4.8/path.d.ts b/server/node_modules/@types/node/ts4.8/path.d.ts new file mode 100755 index 0000000000..1d33f79269 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/path.d.ts @@ -0,0 +1,191 @@ +declare module 'path/posix' { + import path = require('path'); + export = path; +} +declare module 'path/win32' { + import path = require('path'); + export = path; +} +/** + * The `path` module provides utilities for working with file and directory paths. + * It can be accessed using: + * + * ```js + * const path = require('path'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/path.js) + */ +declare module 'path' { + namespace path { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string | undefined; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string | undefined; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string | undefined; + /** + * The file extension (if any) such as '.html' + */ + ext?: string | undefined; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string | undefined; + } + interface PlatformPath { + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param path string path to normalize. + * @throws {TypeError} if `path` is not a string. + */ + normalize(path: string): string; + /** + * Join all arguments together and normalize the resulting path. + * + * @param paths paths to join. + * @throws {TypeError} if any of the path segments is not a string. + */ + join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} parameter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, + * until an absolute path is found. If after using all {from} paths still no absolute path is found, + * the current working directory is used as well. The resulting path is normalized, + * and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param paths A sequence of paths or path segments. + * @throws {TypeError} if any of the arguments is not a string. + */ + resolve(...paths: string[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * If the given {path} is a zero-length string, `false` will be returned. + * + * @param path path to test. + * @throws {TypeError} if `path` is not a string. + */ + isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to} based on the current working directory. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @throws {TypeError} if either `from` or `to` is not a string. + */ + relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + dirname(path: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param path the path to evaluate. + * @param suffix optionally, an extension to remove from the result. + * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. + */ + basename(path: string, suffix?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + extname(path: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + readonly sep: '\\' | '/'; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + readonly delimiter: ';' | ':'; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param path path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + parse(path: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathObject path to evaluate. + */ + format(pathObject: FormatInputPathObject): string; + /** + * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. + * If path is not a string, path will be returned without modifications. + * This method is meaningful only on Windows system. + * On POSIX systems, the method is non-operational and always returns path without modifications. + */ + toNamespacedPath(path: string): string; + /** + * Posix specific pathing. + * Same as parent object on posix. + */ + readonly posix: PlatformPath; + /** + * Windows specific pathing. + * Same as parent object on windows + */ + readonly win32: PlatformPath; + } + } + const path: path.PlatformPath; + export = path; +} +declare module 'node:path' { + import path = require('path'); + export = path; +} +declare module 'node:path/posix' { + import path = require('path/posix'); + export = path; +} +declare module 'node:path/win32' { + import path = require('path/win32'); + export = path; +} diff --git a/server/node_modules/@types/node/ts4.8/perf_hooks.d.ts b/server/node_modules/@types/node/ts4.8/perf_hooks.d.ts new file mode 100755 index 0000000000..5c0b228e7d --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/perf_hooks.d.ts @@ -0,0 +1,625 @@ +/** + * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for + * Node.js-specific performance measurements. + * + * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): + * + * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) + * * [Performance Timeline](https://w3c.github.io/performance-timeline/) + * * [User Timing](https://www.w3.org/TR/user-timing/) + * + * ```js + * const { PerformanceObserver, performance } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((items) => { + * console.log(items.getEntries()[0].duration); + * performance.clearMarks(); + * }); + * obs.observe({ type: 'measure' }); + * performance.measure('Start to Now'); + * + * performance.mark('A'); + * doSomeLongRunningProcess(() => { + * performance.measure('A to Now', 'A'); + * + * performance.mark('B'); + * performance.measure('A to B', 'A', 'B'); + * }); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js) + */ +declare module 'perf_hooks' { + import { AsyncResource } from 'node:async_hooks'; + type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http'; + interface NodeGCPerformanceDetail { + /** + * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies + * the type of garbage collection operation that occurred. + * See perf_hooks.constants for valid values. + */ + readonly kind?: number | undefined; + /** + * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` + * property contains additional information about garbage collection operation. + * See perf_hooks.constants for valid values. + */ + readonly flags?: number | undefined; + } + /** + * @since v8.5.0 + */ + class PerformanceEntry { + protected constructor(); + /** + * The total number of milliseconds elapsed for this entry. This value will not + * be meaningful for all Performance Entry types. + * @since v8.5.0 + */ + readonly duration: number; + /** + * The name of the performance entry. + * @since v8.5.0 + */ + readonly name: string; + /** + * The high resolution millisecond timestamp marking the starting time of the + * Performance Entry. + * @since v8.5.0 + */ + readonly startTime: number; + /** + * The type of the performance entry. It may be one of: + * + * * `'node'` (Node.js only) + * * `'mark'` (available on the Web) + * * `'measure'` (available on the Web) + * * `'gc'` (Node.js only) + * * `'function'` (Node.js only) + * * `'http2'` (Node.js only) + * * `'http'` (Node.js only) + * @since v8.5.0 + */ + readonly entryType: EntryType; + /** + * Additional detail specific to the `entryType`. + * @since v16.0.0 + */ + readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. + toJSON(): any; + } + class PerformanceMark extends PerformanceEntry { + readonly duration: 0; + readonly entryType: 'mark'; + } + class PerformanceMeasure extends PerformanceEntry { + readonly entryType: 'measure'; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Provides timing details for Node.js itself. The constructor of this class + * is not exposed to users. + * @since v8.5.0 + */ + class PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process + * completed bootstrapping. If bootstrapping has not yet finished, the property + * has the value of -1. + * @since v8.5.0 + */ + readonly bootstrapComplete: number; + /** + * The high resolution millisecond timestamp at which the Node.js environment was + * initialized. + * @since v8.5.0 + */ + readonly environment: number; + /** + * The high resolution millisecond timestamp of the amount of time the event loop + * has been idle within the event loop's event provider (e.g. `epoll_wait`). This + * does not take CPU usage into consideration. If the event loop has not yet + * started (e.g., in the first tick of the main script), the property has the + * value of 0. + * @since v14.10.0, v12.19.0 + */ + readonly idleTime: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * exited. If the event loop has not yet exited, the property has the value of -1\. + * It can only have a value of not -1 in a handler of the `'exit'` event. + * @since v8.5.0 + */ + readonly loopExit: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * started. If the event loop has not yet started (e.g., in the first tick of the + * main script), the property has the value of -1. + * @since v8.5.0 + */ + readonly loopStart: number; + /** + * The high resolution millisecond timestamp at which the V8 platform was + * initialized. + * @since v8.5.0 + */ + readonly v8Start: number; + } + interface EventLoopUtilization { + idle: number; + active: number; + utilization: number; + } + /** + * @param util1 The result of a previous call to eventLoopUtilization() + * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 + */ + type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization; + interface MarkOptions { + /** + * Additional optional detail to include with the mark. + */ + detail?: unknown | undefined; + /** + * An optional timestamp to be used as the mark time. + * @default `performance.now()`. + */ + startTime?: number | undefined; + } + interface MeasureOptions { + /** + * Additional optional detail to include with the mark. + */ + detail?: unknown | undefined; + /** + * Duration between start and end times. + */ + duration?: number | undefined; + /** + * Timestamp to be used as the end time, or a string identifying a previously recorded mark. + */ + end?: number | string | undefined; + /** + * Timestamp to be used as the start time, or a string identifying a previously recorded mark. + */ + start?: number | string | undefined; + } + interface TimerifyOptions { + /** + * A histogram object created using + * `perf_hooks.createHistogram()` that will record runtime durations in + * nanoseconds. + */ + histogram?: RecordableHistogram | undefined; + } + interface Performance { + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + /** + * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. + * If name is provided, removes only the named measure. + * @param name + * @since v16.7.0 + */ + clearMeasures(name?: string): void; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. + * If you are only interested in performance entries of certain types or that have certain names, see + * `performance.getEntriesByType()` and `performance.getEntriesByName()`. + * @since v16.7.0 + */ + getEntries(): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` + * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. + * @param name + * @param type + * @since v16.7.0 + */ + getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` + * whose `performanceEntry.entryType` is equal to `type`. + * @param type + * @since v16.7.0 + */ + getEntriesByType(type: EntryType): PerformanceEntry[]; + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + * @return The PerformanceMark entry that was created + */ + mark(name?: string, options?: MarkOptions): PerformanceMark; + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + * @return The PerformanceMeasure entry that was created + */ + measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; + measure(name: string, options: MeasureOptions): PerformanceMeasure; + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T, options?: TimerifyOptions): T; + /** + * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. + * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). + * No other CPU idle time is taken into consideration. + */ + eventLoopUtilization: EventLoopUtilityFunction; + } + interface PerformanceObserverEntryList { + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime`. + * + * ```js + * const { + * performance, + * PerformanceObserver + * } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntries()); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 81.465639, + * * duration: 0 + * * }, + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 81.860064, + * * duration: 0 + * * } + * * ] + * + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ type: 'mark' }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntries(): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is + * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. + * + * ```js + * const { + * performance, + * PerformanceObserver + * } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntriesByName('meow')); + * + * * [ + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 98.545991, + * * duration: 0 + * * } + * * ] + * + * console.log(perfObserverList.getEntriesByName('nope')); // [] + * + * console.log(perfObserverList.getEntriesByName('test', 'mark')); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 63.518931, + * * duration: 0 + * * } + * * ] + * + * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ entryTypes: ['mark', 'measure'] }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. + * + * ```js + * const { + * performance, + * PerformanceObserver + * } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntriesByType('mark')); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 55.897834, + * * duration: 0 + * * }, + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 56.350146, + * * duration: 0 + * * } + * * ] + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ type: 'mark' }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntriesByType(type: EntryType): PerformanceEntry[]; + } + type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; + class PerformanceObserver extends AsyncResource { + constructor(callback: PerformanceObserverCallback); + /** + * Disconnects the `PerformanceObserver` instance from all notifications. + * @since v8.5.0 + */ + disconnect(): void; + /** + * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: + * + * ```js + * const { + * performance, + * PerformanceObserver + * } = require('perf_hooks'); + * + * const obs = new PerformanceObserver((list, observer) => { + * // Called once asynchronously. `list` contains three items. + * }); + * obs.observe({ type: 'mark' }); + * + * for (let n = 0; n < 3; n++) + * performance.mark(`test${n}`); + * ``` + * @since v8.5.0 + */ + observe( + options: + | { + entryTypes: ReadonlyArray; + buffered?: boolean | undefined; + } + | { + type: EntryType; + buffered?: boolean | undefined; + } + ): void; + } + namespace constants { + const NODE_PERFORMANCE_GC_MAJOR: number; + const NODE_PERFORMANCE_GC_MINOR: number; + const NODE_PERFORMANCE_GC_INCREMENTAL: number; + const NODE_PERFORMANCE_GC_WEAKCB: number; + const NODE_PERFORMANCE_GC_FLAGS_NO: number; + const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; + const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; + const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; + const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; + } + const performance: Performance; + interface EventLoopMonitorOptions { + /** + * The sampling rate in milliseconds. + * Must be greater than zero. + * @default 10 + */ + resolution?: number | undefined; + } + interface Histogram { + /** + * Returns a `Map` object detailing the accumulated percentile distribution. + * @since v11.10.0 + */ + readonly percentiles: Map; + /** + * The number of times the event loop delay exceeded the maximum 1 hour event + * loop delay threshold. + * @since v11.10.0 + */ + readonly exceeds: number; + /** + * The minimum recorded event loop delay. + * @since v11.10.0 + */ + readonly min: number; + /** + * The maximum recorded event loop delay. + * @since v11.10.0 + */ + readonly max: number; + /** + * The mean of the recorded event loop delays. + * @since v11.10.0 + */ + readonly mean: number; + /** + * The standard deviation of the recorded event loop delays. + * @since v11.10.0 + */ + readonly stddev: number; + /** + * Resets the collected histogram data. + * @since v11.10.0 + */ + reset(): void; + /** + * Returns the value at the given percentile. + * @since v11.10.0 + * @param percentile A percentile value in the range (0, 100]. + */ + percentile(percentile: number): number; + } + interface IntervalHistogram extends Histogram { + /** + * Enables the update interval timer. Returns `true` if the timer was + * started, `false` if it was already started. + * @since v11.10.0 + */ + enable(): boolean; + /** + * Disables the update interval timer. Returns `true` if the timer was + * stopped, `false` if it was already stopped. + * @since v11.10.0 + */ + disable(): boolean; + } + interface RecordableHistogram extends Histogram { + /** + * @since v15.9.0, v14.18.0 + * @param val The amount to record in the histogram. + */ + record(val: number | bigint): void; + /** + * Calculates the amount of time (in nanoseconds) that has passed since the + * previous call to `recordDelta()` and records that amount in the histogram. + * + * ## Examples + * @since v15.9.0, v14.18.0 + */ + recordDelta(): void; + /** + * Adds the values from other to this histogram. + * @since v17.4.0, v16.14.0 + * @param other Recordable Histogram to combine with + */ + add(other: RecordableHistogram): void; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Creates an `IntervalHistogram` object that samples and reports the event loop + * delay over time. The delays will be reported in nanoseconds. + * + * Using a timer to detect approximate event loop delay works because the + * execution of timers is tied specifically to the lifecycle of the libuv + * event loop. That is, a delay in the loop will cause a delay in the execution + * of the timer, and those delays are specifically what this API is intended to + * detect. + * + * ```js + * const { monitorEventLoopDelay } = require('perf_hooks'); + * const h = monitorEventLoopDelay({ resolution: 20 }); + * h.enable(); + * // Do something. + * h.disable(); + * console.log(h.min); + * console.log(h.max); + * console.log(h.mean); + * console.log(h.stddev); + * console.log(h.percentiles); + * console.log(h.percentile(50)); + * console.log(h.percentile(99)); + * ``` + * @since v11.10.0 + */ + function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; + interface CreateHistogramOptions { + /** + * The minimum recordable value. Must be an integer value greater than 0. + * @default 1 + */ + min?: number | bigint | undefined; + /** + * The maximum recordable value. Must be an integer value greater than min. + * @default Number.MAX_SAFE_INTEGER + */ + max?: number | bigint | undefined; + /** + * The number of accuracy digits. Must be a number between 1 and 5. + * @default 3 + */ + figures?: number | undefined; + } + /** + * Returns a `RecordableHistogram`. + * @since v15.9.0, v14.18.0 + */ + function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; + + import { performance as _performance } from 'perf_hooks'; + global { + /** + * `performance` is a global reference for `require('perf_hooks').performance` + * https://nodejs.org/api/globals.html#performance + * @since v16.0.0 + */ + var performance: typeof globalThis extends { + onmessage: any; + performance: infer T; + } + ? T + : typeof _performance; + } +} +declare module 'node:perf_hooks' { + export * from 'perf_hooks'; +} diff --git a/server/node_modules/@types/node/ts4.8/process.d.ts b/server/node_modules/@types/node/ts4.8/process.d.ts new file mode 100755 index 0000000000..12148f911b --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/process.d.ts @@ -0,0 +1,1482 @@ +declare module 'process' { + import * as tty from 'node:tty'; + import { Worker } from 'node:worker_threads'; + global { + var process: NodeJS.Process; + namespace NodeJS { + // this namespace merge is here because these are specifically used + // as the type for process.stdin, process.stdout, and process.stderr. + // they can't live in tty.d.ts because we need to disambiguate the imported name. + interface ReadStream extends tty.ReadStream {} + interface WriteStream extends tty.WriteStream {} + interface MemoryUsageFn { + /** + * The `process.memoryUsage()` method iterate over each page to gather informations about memory + * usage which can be slow depending on the program memory allocations. + */ + (): MemoryUsage; + /** + * method returns an integer representing the Resident Set Size (RSS) in bytes. + */ + rss(): number; + } + interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + external: number; + arrayBuffers: number; + } + interface CpuUsage { + user: number; + system: number; + } + interface ProcessRelease { + name: string; + sourceUrl?: string | undefined; + headersUrl?: string | undefined; + libUrl?: string | undefined; + lts?: string | undefined; + } + interface ProcessVersions extends Dict { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; + type Architecture = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x64'; + type Signals = + | 'SIGABRT' + | 'SIGALRM' + | 'SIGBUS' + | 'SIGCHLD' + | 'SIGCONT' + | 'SIGFPE' + | 'SIGHUP' + | 'SIGILL' + | 'SIGINT' + | 'SIGIO' + | 'SIGIOT' + | 'SIGKILL' + | 'SIGPIPE' + | 'SIGPOLL' + | 'SIGPROF' + | 'SIGPWR' + | 'SIGQUIT' + | 'SIGSEGV' + | 'SIGSTKFLT' + | 'SIGSTOP' + | 'SIGSYS' + | 'SIGTERM' + | 'SIGTRAP' + | 'SIGTSTP' + | 'SIGTTIN' + | 'SIGTTOU' + | 'SIGUNUSED' + | 'SIGURG' + | 'SIGUSR1' + | 'SIGUSR2' + | 'SIGVTALRM' + | 'SIGWINCH' + | 'SIGXCPU' + | 'SIGXFSZ' + | 'SIGBREAK' + | 'SIGLOST' + | 'SIGINFO'; + type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection'; + type MultipleResolveType = 'resolve' | 'reject'; + type BeforeExitListener = (code: number) => void; + type DisconnectListener = () => void; + type ExitListener = (code: number) => void; + type RejectionHandledListener = (promise: Promise) => void; + type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; + /** + * Most of the time the unhandledRejection will be an Error, but this should not be relied upon + * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. + */ + type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; + type WarningListener = (warning: Error) => void; + type MessageListener = (message: unknown, sendHandle: unknown) => void; + type SignalsListener = (signal: Signals) => void; + type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: unknown) => void; + type WorkerListener = (worker: Worker) => void; + interface Socket extends ReadWriteStream { + isTTY?: true | undefined; + } + // Alias for compatibility + interface ProcessEnv extends Dict { + /** + * Can be used to change the default timezone at runtime + */ + TZ?: string; + } + interface HRTime { + (time?: [number, number]): [number, number]; + bigint(): bigint; + } + interface ProcessReport { + /** + * Directory where the report is written. + * working directory of the Node.js process. + * @default '' indicating that reports are written to the current + */ + directory: string; + /** + * Filename where the report is written. + * The default value is the empty string. + * @default '' the output filename will be comprised of a timestamp, + * PID, and sequence number. + */ + filename: string; + /** + * Returns a JSON-formatted diagnostic report for the running process. + * The report's JavaScript stack trace is taken from err, if present. + */ + getReport(err?: Error): string; + /** + * If true, a diagnostic report is generated on fatal errors, + * such as out of memory errors or failed C++ assertions. + * @default false + */ + reportOnFatalError: boolean; + /** + * If true, a diagnostic report is generated when the process + * receives the signal specified by process.report.signal. + * @default false + */ + reportOnSignal: boolean; + /** + * If true, a diagnostic report is generated on uncaught exception. + * @default false + */ + reportOnUncaughtException: boolean; + /** + * The signal used to trigger the creation of a diagnostic report. + * @default 'SIGUSR2' + */ + signal: Signals; + /** + * Writes a diagnostic report to a file. If filename is not provided, the default filename + * includes the date, time, PID, and a sequence number. + * The report's JavaScript stack trace is taken from err, if present. + * + * @param fileName Name of the file where the report is written. + * This should be a relative path, that will be appended to the directory specified in + * `process.report.directory`, or the current working directory of the Node.js process, + * if unspecified. + * @param error A custom error used for reporting the JavaScript stack. + * @return Filename of the generated report. + */ + writeReport(fileName?: string): string; + writeReport(error?: Error): string; + writeReport(fileName?: string, err?: Error): string; + } + interface ResourceUsage { + fsRead: number; + fsWrite: number; + involuntaryContextSwitches: number; + ipcReceived: number; + ipcSent: number; + majorPageFault: number; + maxRSS: number; + minorPageFault: number; + sharedMemorySize: number; + signalsCount: number; + swappedOut: number; + systemCPUTime: number; + unsharedDataSize: number; + unsharedStackSize: number; + userCPUTime: number; + voluntaryContextSwitches: number; + } + interface EmitWarningOptions { + /** + * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. + * + * @default 'Warning' + */ + type?: string | undefined; + /** + * A unique identifier for the warning instance being emitted. + */ + code?: string | undefined; + /** + * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. + * + * @default process.emitWarning + */ + ctor?: Function | undefined; + /** + * Additional text to include with the error. + */ + detail?: string | undefined; + } + interface ProcessConfig { + readonly target_defaults: { + readonly cflags: any[]; + readonly default_configuration: string; + readonly defines: string[]; + readonly include_dirs: string[]; + readonly libraries: string[]; + }; + readonly variables: { + readonly clang: number; + readonly host_arch: string; + readonly node_install_npm: boolean; + readonly node_install_waf: boolean; + readonly node_prefix: string; + readonly node_shared_openssl: boolean; + readonly node_shared_v8: boolean; + readonly node_shared_zlib: boolean; + readonly node_use_dtrace: boolean; + readonly node_use_etw: boolean; + readonly node_use_openssl: boolean; + readonly target_arch: string; + readonly v8_no_strict_aliasing: number; + readonly v8_use_snapshot: boolean; + readonly visibility: string; + }; + } + interface Process extends EventEmitter { + /** + * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is + * a `Writable` stream. + * + * For example, to copy `process.stdin` to `process.stdout`: + * + * ```js + * import { stdin, stdout } from 'process'; + * + * stdin.pipe(stdout); + * ``` + * + * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stdout: WriteStream & { + fd: 1; + }; + /** + * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is + * a `Writable` stream. + * + * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stderr: WriteStream & { + fd: 2; + }; + /** + * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is + * a `Readable` stream. + * + * For details of how to read from `stdin` see `readable.read()`. + * + * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that + * is compatible with scripts written for Node.js prior to v0.10\. + * For more information see `Stream compatibility`. + * + * In "old" streams mode the `stdin` stream is paused by default, so one + * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. + */ + stdin: ReadStream & { + fd: 0; + }; + openStdin(): Socket; + /** + * The `process.argv` property returns an array containing the command-line + * arguments passed when the Node.js process was launched. The first element will + * be {@link execPath}. See `process.argv0` if access to the original value + * of `argv[0]` is needed. The second element will be the path to the JavaScript + * file being executed. The remaining elements will be any additional command-line + * arguments. + * + * For example, assuming the following script for `process-args.js`: + * + * ```js + * import { argv } from 'process'; + * + * // print process.argv + * argv.forEach((val, index) => { + * console.log(`${index}: ${val}`); + * }); + * ``` + * + * Launching the Node.js process as: + * + * ```console + * $ node process-args.js one two=three four + * ``` + * + * Would generate the output: + * + * ```text + * 0: /usr/local/bin/node + * 1: /Users/mjr/work/node/process-args.js + * 2: one + * 3: two=three + * 4: four + * ``` + * @since v0.1.27 + */ + argv: string[]; + /** + * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. + * + * ```console + * $ bash -c 'exec -a customArgv0 ./node' + * > process.argv[0] + * '/Volumes/code/external/node/out/Release/node' + * > process.argv0 + * 'customArgv0' + * ``` + * @since v6.4.0 + */ + argv0: string; + /** + * The `process.execArgv` property returns the set of Node.js-specific command-line + * options passed when the Node.js process was launched. These options do not + * appear in the array returned by the {@link argv} property, and do not + * include the Node.js executable, the name of the script, or any options following + * the script name. These options are useful in order to spawn child processes with + * the same execution environment as the parent. + * + * ```console + * $ node --harmony script.js --version + * ``` + * + * Results in `process.execArgv`: + * + * ```js + * ['--harmony'] + * ``` + * + * And `process.argv`: + * + * ```js + * ['/usr/local/bin/node', 'script.js', '--version'] + * ``` + * + * Refer to `Worker constructor` for the detailed behavior of worker + * threads with this property. + * @since v0.7.7 + */ + execArgv: string[]; + /** + * The `process.execPath` property returns the absolute pathname of the executable + * that started the Node.js process. Symbolic links, if any, are resolved. + * + * ```js + * '/usr/local/bin/node' + * ``` + * @since v0.1.100 + */ + execPath: string; + /** + * The `process.abort()` method causes the Node.js process to exit immediately and + * generate a core file. + * + * This feature is not available in `Worker` threads. + * @since v0.7.0 + */ + abort(): never; + /** + * The `process.chdir()` method changes the current working directory of the + * Node.js process or throws an exception if doing so fails (for instance, if + * the specified `directory` does not exist). + * + * ```js + * import { chdir, cwd } from 'process'; + * + * console.log(`Starting directory: ${cwd()}`); + * try { + * chdir('/tmp'); + * console.log(`New directory: ${cwd()}`); + * } catch (err) { + * console.error(`chdir: ${err}`); + * } + * ``` + * + * This feature is not available in `Worker` threads. + * @since v0.1.17 + */ + chdir(directory: string): void; + /** + * The `process.cwd()` method returns the current working directory of the Node.js + * process. + * + * ```js + * import { cwd } from 'process'; + * + * console.log(`Current directory: ${cwd()}`); + * ``` + * @since v0.1.8 + */ + cwd(): string; + /** + * The port used by the Node.js debugger when enabled. + * + * ```js + * import process from 'process'; + * + * process.debugPort = 5858; + * ``` + * @since v0.7.2 + */ + debugPort: number; + /** + * The `process.emitWarning()` method can be used to emit custom or application + * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. + * + * ```js + * import { emitWarning } from 'process'; + * + * // Emit a warning with a code and additional detail. + * emitWarning('Something happened!', { + * code: 'MY_WARNING', + * detail: 'This is some additional information' + * }); + * // Emits: + * // (node:56338) [MY_WARNING] Warning: Something happened! + * // This is some additional information + * ``` + * + * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. + * + * ```js + * import process from 'process'; + * + * process.on('warning', (warning) => { + * console.warn(warning.name); // 'Warning' + * console.warn(warning.message); // 'Something happened!' + * console.warn(warning.code); // 'MY_WARNING' + * console.warn(warning.stack); // Stack trace + * console.warn(warning.detail); // 'This is some additional information' + * }); + * ``` + * + * If `warning` is passed as an `Error` object, the `options` argument is ignored. + * @since v8.0.0 + * @param warning The warning to emit. + */ + emitWarning(warning: string | Error, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; + emitWarning(warning: string | Error, options?: EmitWarningOptions): void; + /** + * The `process.env` property returns an object containing the user environment. + * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). + * + * An example of this object looks like: + * + * ```js + * { + * TERM: 'xterm-256color', + * SHELL: '/usr/local/bin/bash', + * USER: 'maciej', + * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + * PWD: '/Users/maciej', + * EDITOR: 'vim', + * SHLVL: '1', + * HOME: '/Users/maciej', + * LOGNAME: 'maciej', + * _: '/usr/local/bin/node' + * } + * ``` + * + * It is possible to modify this object, but such modifications will not be + * reflected outside the Node.js process, or (unless explicitly requested) + * to other `Worker` threads. + * In other words, the following example would not work: + * + * ```console + * $ node -e 'process.env.foo = "bar"' && echo $foo + * ``` + * + * While the following will: + * + * ```js + * import { env } from 'process'; + * + * env.foo = 'bar'; + * console.log(env.foo); + * ``` + * + * Assigning a property on `process.env` will implicitly convert the value + * to a string. **This behavior is deprecated.** Future versions of Node.js may + * throw an error when the value is not a string, number, or boolean. + * + * ```js + * import { env } from 'process'; + * + * env.test = null; + * console.log(env.test); + * // => 'null' + * env.test = undefined; + * console.log(env.test); + * // => 'undefined' + * ``` + * + * Use `delete` to delete a property from `process.env`. + * + * ```js + * import { env } from 'process'; + * + * env.TEST = 1; + * delete env.TEST; + * console.log(env.TEST); + * // => undefined + * ``` + * + * On Windows operating systems, environment variables are case-insensitive. + * + * ```js + * import { env } from 'process'; + * + * env.TEST = 1; + * console.log(env.test); + * // => 1 + * ``` + * + * Unless explicitly specified when creating a `Worker` instance, + * each `Worker` thread has its own copy of `process.env`, based on its + * parent thread’s `process.env`, or whatever was specified as the `env` option + * to the `Worker` constructor. Changes to `process.env` will not be visible + * across `Worker` threads, and only the main thread can make changes that + * are visible to the operating system or to native add-ons. + * @since v0.1.27 + */ + env: ProcessEnv; + /** + * The `process.exit()` method instructs Node.js to terminate the process + * synchronously with an exit status of `code`. If `code` is omitted, exit uses + * either the 'success' code `0` or the value of `process.exitCode` if it has been + * set. Node.js will not terminate until all the `'exit'` event listeners are + * called. + * + * To exit with a 'failure' code: + * + * ```js + * import { exit } from 'process'; + * + * exit(1); + * ``` + * + * The shell that executed Node.js should see the exit code as `1`. + * + * Calling `process.exit()` will force the process to exit as quickly as possible + * even if there are still asynchronous operations pending that have not yet + * completed fully, including I/O operations to `process.stdout` and`process.stderr`. + * + * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ + * _work pending_ in the event loop. The `process.exitCode` property can be set to + * tell the process which exit code to use when the process exits gracefully. + * + * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being + * truncated and lost: + * + * ```js + * import { exit } from 'process'; + * + * // This is an example of what *not* to do: + * if (someConditionNotMet()) { + * printUsageToStdout(); + * exit(1); + * } + * ``` + * + * The reason this is problematic is because writes to `process.stdout` in Node.js + * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js + * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. + * + * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding + * scheduling any additional work for the event loop: + * + * ```js + * import process from 'process'; + * + * // How to properly set the exit code while letting + * // the process exit gracefully. + * if (someConditionNotMet()) { + * printUsageToStdout(); + * process.exitCode = 1; + * } + * ``` + * + * If it is necessary to terminate the Node.js process due to an error condition, + * throwing an _uncaught_ error and allowing the process to terminate accordingly + * is safer than calling `process.exit()`. + * + * In `Worker` threads, this function stops the current thread rather + * than the current process. + * @since v0.1.13 + * @param [code=0] The exit code. + */ + exit(code?: number): never; + /** + * A number which will be the process exit code, when the process either + * exits gracefully, or is exited via {@link exit} without specifying + * a code. + * + * Specifying a code to {@link exit} will override any + * previous setting of `process.exitCode`. + * @since v0.11.8 + */ + exitCode?: number | undefined; + /** + * The `process.getgid()` method returns the numerical group identity of the + * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getgid) { + * console.log(`Current gid: ${process.getgid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.31 + */ + getgid?: () => number; + /** + * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a + * numeric ID or a group name + * string. If a group name is specified, this method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getgid && process.setgid) { + * console.log(`Current gid: ${process.getgid()}`); + * try { + * process.setgid(501); + * console.log(`New gid: ${process.getgid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.31 + * @param id The group name or ID + */ + setgid?: (id: number | string) => void; + /** + * The `process.getuid()` method returns the numeric user identity of the process. + * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getuid) { + * console.log(`Current uid: ${process.getuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.28 + */ + getuid?: () => number; + /** + * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a + * numeric ID or a username string. + * If a username is specified, the method blocks while resolving the associated + * numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getuid && process.setuid) { + * console.log(`Current uid: ${process.getuid()}`); + * try { + * process.setuid(501); + * console.log(`New uid: ${process.getuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.28 + */ + setuid?: (id: number | string) => void; + /** + * The `process.geteuid()` method returns the numerical effective user identity of + * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.geteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + geteuid?: () => number; + /** + * The `process.seteuid()` method sets the effective user identity of the process. + * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username + * string. If a username is specified, the method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.geteuid && process.seteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * try { + * process.seteuid(501); + * console.log(`New uid: ${process.geteuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A user name or ID + */ + seteuid?: (id: number | string) => void; + /** + * The `process.getegid()` method returns the numerical effective group identity + * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getegid) { + * console.log(`Current gid: ${process.getegid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + getegid?: () => number; + /** + * The `process.setegid()` method sets the effective group identity of the process. + * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group + * name string. If a group name is specified, this method blocks while resolving + * the associated a numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getegid && process.setegid) { + * console.log(`Current gid: ${process.getegid()}`); + * try { + * process.setegid(501); + * console.log(`New gid: ${process.getegid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A group name or ID + */ + setegid?: (id: number | string) => void; + /** + * The `process.getgroups()` method returns an array with the supplementary group + * IDs. POSIX leaves it unspecified if the effective group ID is included but + * Node.js ensures it always is. + * + * ```js + * import process from 'process'; + * + * if (process.getgroups) { + * console.log(process.getgroups()); // [ 16, 21, 297 ] + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.9.4 + */ + getgroups?: () => number[]; + /** + * The `process.setgroups()` method sets the supplementary group IDs for the + * Node.js process. This is a privileged operation that requires the Node.js + * process to have `root` or the `CAP_SETGID` capability. + * + * The `groups` array can contain numeric group IDs, group names, or both. + * + * ```js + * import process from 'process'; + * + * if (process.getgroups && process.setgroups) { + * try { + * process.setgroups([501]); + * console.log(process.getgroups()); // new groups + * } catch (err) { + * console.log(`Failed to set groups: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.9.4 + */ + setgroups?: (groups: ReadonlyArray) => void; + /** + * The `process.setUncaughtExceptionCaptureCallback()` function sets a function + * that will be invoked when an uncaught exception occurs, which will receive the + * exception value itself as its first argument. + * + * If such a function is set, the `'uncaughtException'` event will + * not be emitted. If `--abort-on-uncaught-exception` was passed from the + * command line or set through `v8.setFlagsFromString()`, the process will + * not abort. Actions configured to take place on exceptions such as report + * generations will be affected too + * + * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this + * method with a non-`null` argument while another capture function is set will + * throw an error. + * + * Using this function is mutually exclusive with using the deprecated `domain` built-in module. + * @since v9.3.0 + */ + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + /** + * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. + * @since v9.3.0 + */ + hasUncaughtExceptionCaptureCallback(): boolean; + /** + * The `process.version` property contains the Node.js version string. + * + * ```js + * import { version } from 'process'; + * + * console.log(`Version: ${version}`); + * // Version: v14.8.0 + * ``` + * + * To get the version string without the prepended _v_, use`process.versions.node`. + * @since v0.1.3 + */ + readonly version: string; + /** + * The `process.versions` property returns an object listing the version strings of + * Node.js and its dependencies. `process.versions.modules` indicates the current + * ABI version, which is increased whenever a C++ API changes. Node.js will refuse + * to load modules that were compiled against a different module ABI version. + * + * ```js + * import { versions } from 'process'; + * + * console.log(versions); + * ``` + * + * Will generate an object similar to: + * + * ```console + * { node: '11.13.0', + * v8: '7.0.276.38-node.18', + * uv: '1.27.0', + * zlib: '1.2.11', + * brotli: '1.0.7', + * ares: '1.15.0', + * modules: '67', + * nghttp2: '1.34.0', + * napi: '4', + * llhttp: '1.1.1', + * openssl: '1.1.1b', + * cldr: '34.0', + * icu: '63.1', + * tz: '2018e', + * unicode: '11.0' } + * ``` + * @since v0.2.0 + */ + readonly versions: ProcessVersions; + /** + * The `process.config` property returns an `Object` containing the JavaScript + * representation of the configure options used to compile the current Node.js + * executable. This is the same as the `config.gypi` file that was produced when + * running the `./configure` script. + * + * An example of the possible output looks like: + * + * ```js + * { + * target_defaults: + * { cflags: [], + * default_configuration: 'Release', + * defines: [], + * include_dirs: [], + * libraries: [] }, + * variables: + * { + * host_arch: 'x64', + * napi_build_version: 5, + * node_install_npm: 'true', + * node_prefix: '', + * node_shared_cares: 'false', + * node_shared_http_parser: 'false', + * node_shared_libuv: 'false', + * node_shared_zlib: 'false', + * node_use_dtrace: 'false', + * node_use_openssl: 'true', + * node_shared_openssl: 'false', + * strict_aliasing: 'true', + * target_arch: 'x64', + * v8_use_snapshot: 1 + * } + * } + * ``` + * + * The `process.config` property is **not** read-only and there are existing + * modules in the ecosystem that are known to extend, modify, or entirely replace + * the value of `process.config`. + * + * Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made + * read-only in a future release. + * @since v0.7.7 + */ + readonly config: ProcessConfig; + /** + * The `process.kill()` method sends the `signal` to the process identified by`pid`. + * + * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. + * + * This method will throw an error if the target `pid` does not exist. As a special + * case, a signal of `0` can be used to test for the existence of a process. + * Windows platforms will throw an error if the `pid` is used to kill a process + * group. + * + * Even though the name of this function is `process.kill()`, it is really just a + * signal sender, like the `kill` system call. The signal sent may do something + * other than kill the target process. + * + * ```js + * import process, { kill } from 'process'; + * + * process.on('SIGHUP', () => { + * console.log('Got SIGHUP signal.'); + * }); + * + * setTimeout(() => { + * console.log('Exiting.'); + * process.exit(0); + * }, 100); + * + * kill(process.pid, 'SIGHUP'); + * ``` + * + * When `SIGUSR1` is received by a Node.js process, Node.js will start the + * debugger. See `Signal Events`. + * @since v0.0.6 + * @param pid A process ID + * @param [signal='SIGTERM'] The signal to send, either as a string or number. + */ + kill(pid: number, signal?: string | number): true; + /** + * The `process.pid` property returns the PID of the process. + * + * ```js + * import { pid } from 'process'; + * + * console.log(`This process is pid ${pid}`); + * ``` + * @since v0.1.15 + */ + readonly pid: number; + /** + * The `process.ppid` property returns the PID of the parent of the + * current process. + * + * ```js + * import { ppid } from 'process'; + * + * console.log(`The parent process is pid ${ppid}`); + * ``` + * @since v9.2.0, v8.10.0, v6.13.0 + */ + readonly ppid: number; + /** + * The `process.title` property returns the current process title (i.e. returns + * the current value of `ps`). Assigning a new value to `process.title` modifies + * the current value of `ps`. + * + * When a new value is assigned, different platforms will impose different maximum + * length restrictions on the title. Usually such restrictions are quite limited. + * For instance, on Linux and macOS, `process.title` is limited to the size of the + * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 + * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) + * cases. + * + * Assigning a value to `process.title` might not result in an accurate label + * within process manager applications such as macOS Activity Monitor or Windows + * Services Manager. + * @since v0.1.104 + */ + title: string; + /** + * The operating system CPU architecture for which the Node.js binary was compiled. + * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. + * + * ```js + * import { arch } from 'process'; + * + * console.log(`This processor architecture is ${arch}`); + * ``` + * @since v0.5.0 + */ + readonly arch: Architecture; + /** + * The `process.platform` property returns a string identifying the operating + * system platform for which the Node.js binary was compiled. + * + * Currently possible values are: + * + * * `'aix'` + * * `'darwin'` + * * `'freebsd'` + * * `'linux'` + * * `'openbsd'` + * * `'sunos'` + * * `'win32'` + * + * ```js + * import { platform } from 'process'; + * + * console.log(`This platform is ${platform}`); + * ``` + * + * The value `'android'` may also be returned if the Node.js is built on the + * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.1.16 + */ + readonly platform: Platform; + /** + * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at + * runtime, `require.main` may still refer to the original main module in + * modules that were required before the change occurred. Generally, it's + * safe to assume that the two refer to the same module. + * + * As with `require.main`, `process.mainModule` will be `undefined` if there + * is no entry script. + * @since v0.1.17 + * @deprecated Since v14.0.0 - Use `main` instead. + */ + mainModule?: Module | undefined; + memoryUsage: MemoryUsageFn; + /** + * The `process.cpuUsage()` method returns the user and system CPU time usage of + * the current process, in an object with properties `user` and `system`, whose + * values are microsecond values (millionth of a second). These values measure time + * spent in user and system code respectively, and may end up being greater than + * actual elapsed time if multiple CPU cores are performing work for this process. + * + * The result of a previous call to `process.cpuUsage()` can be passed as the + * argument to the function, to get a diff reading. + * + * ```js + * import { cpuUsage } from 'process'; + * + * const startUsage = cpuUsage(); + * // { user: 38579, system: 6986 } + * + * // spin the CPU for 500 milliseconds + * const now = Date.now(); + * while (Date.now() - now < 500); + * + * console.log(cpuUsage(startUsage)); + * // { user: 514883, system: 11226 } + * ``` + * @since v6.1.0 + * @param previousValue A previous return value from calling `process.cpuUsage()` + */ + cpuUsage(previousValue?: CpuUsage): CpuUsage; + /** + * `process.nextTick()` adds `callback` to the "next tick queue". This queue is + * fully drained after the current operation on the JavaScript stack runs to + * completion and before the event loop is allowed to continue. It's possible to + * create an infinite loop if one were to recursively call `process.nextTick()`. + * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. + * + * ```js + * import { nextTick } from 'process'; + * + * console.log('start'); + * nextTick(() => { + * console.log('nextTick callback'); + * }); + * console.log('scheduled'); + * // Output: + * // start + * // scheduled + * // nextTick callback + * ``` + * + * This is important when developing APIs in order to give users the opportunity + * to assign event handlers _after_ an object has been constructed but before any + * I/O has occurred: + * + * ```js + * import { nextTick } from 'process'; + * + * function MyThing(options) { + * this.setupOptions(options); + * + * nextTick(() => { + * this.startDoingStuff(); + * }); + * } + * + * const thing = new MyThing(); + * thing.getReadyForStuff(); + * + * // thing.startDoingStuff() gets called now, not before. + * ``` + * + * It is very important for APIs to be either 100% synchronous or 100% + * asynchronous. Consider this example: + * + * ```js + * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! + * function maybeSync(arg, cb) { + * if (arg) { + * cb(); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * + * This API is hazardous because in the following case: + * + * ```js + * const maybeTrue = Math.random() > 0.5; + * + * maybeSync(maybeTrue, () => { + * foo(); + * }); + * + * bar(); + * ``` + * + * It is not clear whether `foo()` or `bar()` will be called first. + * + * The following approach is much better: + * + * ```js + * import { nextTick } from 'process'; + * + * function definitelyAsync(arg, cb) { + * if (arg) { + * nextTick(cb); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * @since v0.1.26 + * @param args Additional arguments to pass when invoking the `callback` + */ + nextTick(callback: Function, ...args: any[]): void; + /** + * The `process.release` property returns an `Object` containing metadata related + * to the current release, including URLs for the source tarball and headers-only + * tarball. + * + * `process.release` contains the following properties: + * + * ```js + * { + * name: 'node', + * lts: 'Erbium', + * sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz', + * headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz', + * libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib' + * } + * ``` + * + * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be + * relied upon to exist. + * @since v3.0.0 + */ + readonly release: ProcessRelease; + features: { + inspector: boolean; + debug: boolean; + uv: boolean; + ipv6: boolean; + tls_alpn: boolean; + tls_sni: boolean; + tls_ocsp: boolean; + tls: boolean; + }; + /** + * `process.umask()` returns the Node.js process's file mode creation mask. Child + * processes inherit the mask from the parent process. + * @since v0.1.19 + * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * + * security vulnerability. There is no safe, cross-platform alternative API. + */ + umask(): number; + /** + * Can only be set if not in worker thread. + */ + umask(mask: string | number): number; + /** + * The `process.uptime()` method returns the number of seconds the current Node.js + * process has been running. + * + * The return value includes fractions of a second. Use `Math.floor()` to get whole + * seconds. + * @since v0.5.0 + */ + uptime(): number; + hrtime: HRTime; + /** + * If Node.js is spawned with an IPC channel, the `process.send()` method can be + * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. + * + * If Node.js was not spawned with an IPC channel, `process.send` will be`undefined`. + * + * The message goes through serialization and parsing. The resulting message might + * not be the same as what is originally sent. + * @since v0.5.9 + * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: + */ + send?( + message: any, + sendHandle?: any, + options?: { + swallowErrors?: boolean | undefined; + }, + callback?: (error: Error | null) => void + ): boolean; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the + * IPC channel to the parent process, allowing the child process to exit gracefully + * once there are no other connections keeping it alive. + * + * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. + * + * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. + * @since v0.7.2 + */ + disconnect(): void; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC + * channel is connected and will return `false` after`process.disconnect()` is called. + * + * Once `process.connected` is `false`, it is no longer possible to send messages + * over the IPC channel using `process.send()`. + * @since v0.7.2 + */ + connected: boolean; + /** + * The `process.allowedNodeEnvironmentFlags` property is a special, + * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. + * + * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag + * representations. `process.allowedNodeEnvironmentFlags.has()` will + * return `true` in the following cases: + * + * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. + * * Flags passed through to V8 (as listed in `--v8-options`) may replace + * one or more _non-leading_ dashes for an underscore, or vice-versa; + * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, + * etc. + * * Flags may contain one or more equals (`=`) characters; all + * characters after and including the first equals will be ignored; + * e.g., `--stack-trace-limit=100`. + * * Flags _must_ be allowable within `NODE_OPTIONS`. + * + * When iterating over `process.allowedNodeEnvironmentFlags`, flags will + * appear only _once_; each will begin with one or more dashes. Flags + * passed through to V8 will contain underscores instead of non-leading + * dashes: + * + * ```js + * import { allowedNodeEnvironmentFlags } from 'process'; + * + * allowedNodeEnvironmentFlags.forEach((flag) => { + * // -r + * // --inspect-brk + * // --abort_on_uncaught_exception + * // ... + * }); + * ``` + * + * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail + * silently. + * + * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will + * contain what _would have_ been allowable. + * @since v10.10.0 + */ + allowedNodeEnvironmentFlags: ReadonlySet; + /** + * `process.report` is an object whose methods are used to generate diagnostic + * reports for the current process. Additional documentation is available in the `report documentation`. + * @since v11.8.0 + */ + report?: ProcessReport | undefined; + /** + * ```js + * import { resourceUsage } from 'process'; + * + * console.log(resourceUsage()); + * /* + * Will output: + * { + * userCPUTime: 82872, + * systemCPUTime: 4143, + * maxRSS: 33164, + * sharedMemorySize: 0, + * unsharedDataSize: 0, + * unsharedStackSize: 0, + * minorPageFault: 2469, + * majorPageFault: 0, + * swappedOut: 0, + * fsRead: 0, + * fsWrite: 8, + * ipcSent: 0, + * ipcReceived: 0, + * signalsCount: 0, + * voluntaryContextSwitches: 79, + * involuntaryContextSwitches: 1 + * } + * + * ``` + * @since v12.6.0 + * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. + */ + resourceUsage(): ResourceUsage; + /** + * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the + * documentation for the `'warning' event` and the `emitWarning() method` for more information about this + * flag's behavior. + * @since v0.8.0 + */ + traceDeprecation: boolean; + /* EventEmitter */ + addListener(event: 'beforeExit', listener: BeforeExitListener): this; + addListener(event: 'disconnect', listener: DisconnectListener): this; + addListener(event: 'exit', listener: ExitListener): this; + addListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + addListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + addListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + addListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + addListener(event: 'warning', listener: WarningListener): this; + addListener(event: 'message', listener: MessageListener): this; + addListener(event: Signals, listener: SignalsListener): this; + addListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + addListener(event: 'worker', listener: WorkerListener): this; + emit(event: 'beforeExit', code: number): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'exit', code: number): boolean; + emit(event: 'rejectionHandled', promise: Promise): boolean; + emit(event: 'uncaughtException', error: Error): boolean; + emit(event: 'uncaughtExceptionMonitor', error: Error): boolean; + emit(event: 'unhandledRejection', reason: unknown, promise: Promise): boolean; + emit(event: 'warning', warning: Error): boolean; + emit(event: 'message', message: unknown, sendHandle: unknown): this; + emit(event: Signals, signal?: Signals): boolean; + emit(event: 'multipleResolves', type: MultipleResolveType, promise: Promise, value: unknown): this; + emit(event: 'worker', listener: WorkerListener): this; + on(event: 'beforeExit', listener: BeforeExitListener): this; + on(event: 'disconnect', listener: DisconnectListener): this; + on(event: 'exit', listener: ExitListener): this; + on(event: 'rejectionHandled', listener: RejectionHandledListener): this; + on(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + on(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + on(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + on(event: 'warning', listener: WarningListener): this; + on(event: 'message', listener: MessageListener): this; + on(event: Signals, listener: SignalsListener): this; + on(event: 'multipleResolves', listener: MultipleResolveListener): this; + on(event: 'worker', listener: WorkerListener): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'beforeExit', listener: BeforeExitListener): this; + once(event: 'disconnect', listener: DisconnectListener): this; + once(event: 'exit', listener: ExitListener): this; + once(event: 'rejectionHandled', listener: RejectionHandledListener): this; + once(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + once(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + once(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + once(event: 'warning', listener: WarningListener): this; + once(event: 'message', listener: MessageListener): this; + once(event: Signals, listener: SignalsListener): this; + once(event: 'multipleResolves', listener: MultipleResolveListener): this; + once(event: 'worker', listener: WorkerListener): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'beforeExit', listener: BeforeExitListener): this; + prependListener(event: 'disconnect', listener: DisconnectListener): this; + prependListener(event: 'exit', listener: ExitListener): this; + prependListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + prependListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + prependListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + prependListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + prependListener(event: 'warning', listener: WarningListener): this; + prependListener(event: 'message', listener: MessageListener): this; + prependListener(event: Signals, listener: SignalsListener): this; + prependListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + prependListener(event: 'worker', listener: WorkerListener): this; + prependOnceListener(event: 'beforeExit', listener: BeforeExitListener): this; + prependOnceListener(event: 'disconnect', listener: DisconnectListener): this; + prependOnceListener(event: 'exit', listener: ExitListener): this; + prependOnceListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + prependOnceListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + prependOnceListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + prependOnceListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + prependOnceListener(event: 'warning', listener: WarningListener): this; + prependOnceListener(event: 'message', listener: MessageListener): this; + prependOnceListener(event: Signals, listener: SignalsListener): this; + prependOnceListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + prependOnceListener(event: 'worker', listener: WorkerListener): this; + listeners(event: 'beforeExit'): BeforeExitListener[]; + listeners(event: 'disconnect'): DisconnectListener[]; + listeners(event: 'exit'): ExitListener[]; + listeners(event: 'rejectionHandled'): RejectionHandledListener[]; + listeners(event: 'uncaughtException'): UncaughtExceptionListener[]; + listeners(event: 'uncaughtExceptionMonitor'): UncaughtExceptionListener[]; + listeners(event: 'unhandledRejection'): UnhandledRejectionListener[]; + listeners(event: 'warning'): WarningListener[]; + listeners(event: 'message'): MessageListener[]; + listeners(event: Signals): SignalsListener[]; + listeners(event: 'multipleResolves'): MultipleResolveListener[]; + listeners(event: 'worker'): WorkerListener[]; + } + } + } + export = process; +} +declare module 'node:process' { + import process = require('process'); + export = process; +} diff --git a/server/node_modules/@types/node/ts4.8/punycode.d.ts b/server/node_modules/@types/node/ts4.8/punycode.d.ts new file mode 100755 index 0000000000..87ebbb9048 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/punycode.d.ts @@ -0,0 +1,117 @@ +/** + * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users + * currently depending on the `punycode` module should switch to using the + * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL + * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. + * + * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It + * can be accessed using: + * + * ```js + * const punycode = require('punycode'); + * ``` + * + * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is + * primarily intended for use in Internationalized Domain Names. Because host + * names in URLs are limited to ASCII characters only, Domain Names that contain + * non-ASCII characters must be converted into ASCII using the Punycode scheme. + * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent + * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. + * + * The `punycode` module provides a simple implementation of the Punycode standard. + * + * The `punycode` module is a third-party dependency used by Node.js and + * made available to developers as a convenience. Fixes or other modifications to + * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. + * @deprecated Since v7.0.0 - Deprecated + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/punycode.js) + */ +declare module 'punycode' { + /** + * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only + * characters to the equivalent string of Unicode codepoints. + * + * ```js + * punycode.decode('maana-pta'); // 'mañana' + * punycode.decode('--dqo34k'); // '☃-⌘' + * ``` + * @since v0.5.1 + */ + function decode(string: string): string; + /** + * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. + * + * ```js + * punycode.encode('mañana'); // 'maana-pta' + * punycode.encode('☃-⌘'); // '--dqo34k' + * ``` + * @since v0.5.1 + */ + function encode(string: string): string; + /** + * The `punycode.toUnicode()` method converts a string representing a domain name + * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be + * converted. + * + * ```js + * // decode domain names + * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' + * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' + * punycode.toUnicode('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toUnicode(domain: string): string; + /** + * The `punycode.toASCII()` method converts a Unicode string representing an + * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the + * domain name will be converted. Calling `punycode.toASCII()` on a string that + * already only contains ASCII characters will have no effect. + * + * ```js + * // encode domain names + * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' + * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' + * punycode.toASCII('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toASCII(domain: string): string; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const ucs2: ucs2; + interface ucs2 { + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + decode(string: string): number[]; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + encode(codePoints: ReadonlyArray): string; + } + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const version: string; +} +declare module 'node:punycode' { + export * from 'punycode'; +} diff --git a/server/node_modules/@types/node/ts4.8/querystring.d.ts b/server/node_modules/@types/node/ts4.8/querystring.d.ts new file mode 100755 index 0000000000..e118547846 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/querystring.d.ts @@ -0,0 +1,131 @@ +/** + * The `querystring` module provides utilities for parsing and formatting URL + * query strings. It can be accessed using: + * + * ```js + * const querystring = require('querystring'); + * ``` + * + * `querystring` is more performant than `URLSearchParams` but is not a + * standardized API. Use `URLSearchParams` when performance is not critical + * or when compatibility with browser code is desirable. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/querystring.js) + */ +declare module 'querystring' { + interface StringifyOptions { + encodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParseOptions { + maxKeys?: number | undefined; + decodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParsedUrlQuery extends NodeJS.Dict {} + interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> {} + /** + * The `querystring.stringify()` method produces a URL query string from a + * given `obj` by iterating through the object's "own properties". + * + * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | + * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to + * empty strings. + * + * ```js + * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); + * // Returns 'foo=bar&baz=qux&baz=quux&corge=' + * + * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); + * // Returns 'foo:bar;baz:qux' + * ``` + * + * By default, characters requiring percent-encoding within the query string will + * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkEncodeURIComponent function already exists, + * + * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, + * { encodeURIComponent: gbkEncodeURIComponent }); + * ``` + * @since v0.1.25 + * @param obj The object to serialize into a URL query string + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] . The substring used to delimit keys and values in the query string. + */ + function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; + /** + * The `querystring.parse()` method parses a URL query string (`str`) into a + * collection of key and value pairs. + * + * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: + * + * ```js + * { + * foo: 'bar', + * abc: ['xyz', '123'] + * } + * ``` + * + * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * By default, percent-encoded characters within the query string will be assumed + * to use UTF-8 encoding. If an alternative character encoding is used, then an + * alternative `decodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkDecodeURIComponent function already exists... + * + * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, + * { decodeURIComponent: gbkDecodeURIComponent }); + * ``` + * @since v0.1.25 + * @param str The URL query string to parse + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] . The substring used to delimit keys and values in the query string. + */ + function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + /** + * The querystring.encode() function is an alias for querystring.stringify(). + */ + const encode: typeof stringify; + /** + * The querystring.decode() function is an alias for querystring.parse(). + */ + const decode: typeof parse; + /** + * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL + * query strings. + * + * The `querystring.escape()` method is used by `querystring.stringify()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement percent-encoding implementation if + * necessary by assigning `querystring.escape` to an alternative function. + * @since v0.1.25 + */ + function escape(str: string): string; + /** + * The `querystring.unescape()` method performs decoding of URL percent-encoded + * characters on the given `str`. + * + * The `querystring.unescape()` method is used by `querystring.parse()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement decoding implementation if + * necessary by assigning `querystring.unescape` to an alternative function. + * + * By default, the `querystring.unescape()` method will attempt to use the + * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, + * a safer equivalent that does not throw on malformed URLs will be used. + * @since v0.1.25 + */ + function unescape(str: string): string; +} +declare module 'node:querystring' { + export * from 'querystring'; +} diff --git a/server/node_modules/@types/node/ts4.8/readline.d.ts b/server/node_modules/@types/node/ts4.8/readline.d.ts new file mode 100755 index 0000000000..6ab64acbbe --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/readline.d.ts @@ -0,0 +1,653 @@ +/** + * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. + * + * To use the promise-based APIs: + * + * ```js + * import * as readline from 'node:readline/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as readline from 'node:readline'; + * ``` + * + * The following simple example illustrates the basic use of the `readline` module. + * + * ```js + * import * as readline from 'node:readline/promises'; + * import { stdin as input, stdout as output } from 'node:process'; + * + * const rl = readline.createInterface({ input, output }); + * + * const answer = await rl.question('What do you think of Node.js? '); + * + * console.log(`Thank you for your valuable feedback: ${answer}`); + * + * rl.close(); + * ``` + * + * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be + * received on the `input` stream. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline.js) + */ +declare module 'readline' { + import { Abortable, EventEmitter } from 'node:events'; + import * as promises from 'node:readline/promises'; + + export { promises }; + export interface Key { + sequence?: string | undefined; + name?: string | undefined; + ctrl?: boolean | undefined; + meta?: boolean | undefined; + shift?: boolean | undefined; + } + /** + * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a + * single `input` `Readable` stream and a single `output` `Writable` stream. + * The `output` stream is used to print prompts for user input that arrives on, + * and is read from, the `input` stream. + * @since v0.1.104 + */ + export class Interface extends EventEmitter { + readonly terminal: boolean; + /** + * The current input data being processed by node. + * + * This can be used when collecting input from a TTY stream to retrieve the + * current value that has been processed thus far, prior to the `line` event + * being emitted. Once the `line` event has been emitted, this property will + * be an empty string. + * + * Be aware that modifying the value during the instance runtime may have + * unintended consequences if `rl.cursor` is not also controlled. + * + * **If not using a TTY stream for input, use the `'line'` event.** + * + * One possible use case would be as follows: + * + * ```js + * const values = ['lorem ipsum', 'dolor sit amet']; + * const rl = readline.createInterface(process.stdin); + * const showResults = debounce(() => { + * console.log( + * '\n', + * values.filter((val) => val.startsWith(rl.line)).join(' ') + * ); + * }, 300); + * process.stdin.on('keypress', (c, k) => { + * showResults(); + * }); + * ``` + * @since v0.1.98 + */ + readonly line: string; + /** + * The cursor position relative to `rl.line`. + * + * This will track where the current cursor lands in the input string, when + * reading input from a TTY stream. The position of cursor determines the + * portion of the input string that will be modified as input is processed, + * as well as the column where the terminal caret will be rendered. + * @since v0.1.98 + */ + readonly cursor: number; + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface + */ + protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface + */ + protected constructor(options: ReadLineOptions); + /** + * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. + * @since v15.3.0 + * @return the current prompt string + */ + getPrompt(): string; + /** + * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. + * @since v0.1.98 + */ + setPrompt(prompt: string): void; + /** + * The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new + * location at which to provide input. + * + * When called, `rl.prompt()` will resume the `input` stream if it has been + * paused. + * + * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written. + * @since v0.1.98 + * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. + */ + prompt(preserveCursor?: boolean): void; + /** + * The `rl.question()` method displays the `query` by writing it to the `output`, + * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. + * + * When called, `rl.question()` will resume the `input` stream if it has been + * paused. + * + * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written. + * + * The `callback` function passed to `rl.question()` does not follow the typical + * pattern of accepting an `Error` object or `null` as the first argument. + * The `callback` is called with the provided answer as the only argument. + * + * Example usage: + * + * ```js + * rl.question('What is your favorite food? ', (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * ``` + * + * Using an `AbortController` to cancel a question. + * + * ```js + * const ac = new AbortController(); + * const signal = ac.signal; + * + * rl.question('What is your favorite food? ', { signal }, (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * setTimeout(() => ac.abort(), 10000); + * ``` + * + * If this method is invoked as it's util.promisify()ed version, it returns a + * Promise that fulfills with the answer. If the question is canceled using + * an `AbortController` it will reject with an `AbortError`. + * + * ```js + * const util = require('util'); + * const question = util.promisify(rl.question).bind(rl); + * + * async function questionExample() { + * try { + * const answer = await question('What is you favorite food? '); + * console.log(`Oh, so your favorite food is ${answer}`); + * } catch (err) { + * console.error('Question rejected', err); + * } + * } + * questionExample(); + * ``` + * @since v0.3.3 + * @param query A statement or query to write to `output`, prepended to the prompt. + * @param callback A callback function that is invoked with the user's input in response to the `query`. + */ + question(query: string, callback: (answer: string) => void): void; + question(query: string, options: Abortable, callback: (answer: string) => void): void; + /** + * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed + * later if necessary. + * + * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance. + * @since v0.3.4 + */ + pause(): this; + /** + * The `rl.resume()` method resumes the `input` stream if it has been paused. + * @since v0.3.4 + */ + resume(): this; + /** + * The `rl.close()` method closes the `readline.Interface` instance and + * relinquishes control over the `input` and `output` streams. When called, + * the `'close'` event will be emitted. + * + * Calling `rl.close()` does not immediately stop other events (including `'line'`) + * from being emitted by the `readline.Interface` instance. + * @since v0.1.98 + */ + close(): void; + /** + * The `rl.write()` method will write either `data` or a key sequence identified + * by `key` to the `output`. The `key` argument is supported only if `output` is + * a `TTY` text terminal. See `TTY keybindings` for a list of key + * combinations. + * + * If `key` is specified, `data` is ignored. + * + * When called, `rl.write()` will resume the `input` stream if it has been + * paused. + * + * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. + * + * ```js + * rl.write('Delete this!'); + * // Simulate Ctrl+U to delete the line written previously + * rl.write(null, { ctrl: true, name: 'u' }); + * ``` + * + * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. + * @since v0.1.98 + */ + write(data: string | Buffer, key?: Key): void; + write(data: undefined | null | string | Buffer, key: Key): void; + /** + * Returns the real position of the cursor in relation to the input + * prompt + string. Long input (wrapping) strings, as well as multiple + * line prompts are included in the calculations. + * @since v13.5.0, v12.16.0 + */ + getCursorPos(): CursorPos; + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + * 8. history + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'line', listener: (input: string) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'SIGCONT', listener: () => void): this; + addListener(event: 'SIGINT', listener: () => void): this; + addListener(event: 'SIGTSTP', listener: () => void): this; + addListener(event: 'history', listener: (history: string[]) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'line', input: string): boolean; + emit(event: 'pause'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'SIGCONT'): boolean; + emit(event: 'SIGINT'): boolean; + emit(event: 'SIGTSTP'): boolean; + emit(event: 'history', history: string[]): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'line', listener: (input: string) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'SIGCONT', listener: () => void): this; + on(event: 'SIGINT', listener: () => void): this; + on(event: 'SIGTSTP', listener: () => void): this; + on(event: 'history', listener: (history: string[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'line', listener: (input: string) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'SIGCONT', listener: () => void): this; + once(event: 'SIGINT', listener: () => void): this; + once(event: 'SIGTSTP', listener: () => void): this; + once(event: 'history', listener: (history: string[]) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'line', listener: (input: string) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'SIGCONT', listener: () => void): this; + prependListener(event: 'SIGINT', listener: () => void): this; + prependListener(event: 'SIGTSTP', listener: () => void): this; + prependListener(event: 'history', listener: (history: string[]) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'line', listener: (input: string) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'SIGCONT', listener: () => void): this; + prependOnceListener(event: 'SIGINT', listener: () => void): this; + prependOnceListener(event: 'SIGTSTP', listener: () => void): this; + prependOnceListener(event: 'history', listener: (history: string[]) => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + export type ReadLine = Interface; // type forwarded for backwards compatibility + export type Completer = (line: string) => CompleterResult; + export type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void; + export type CompleterResult = [string[], string]; + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream | undefined; + completer?: Completer | AsyncCompleter | undefined; + terminal?: boolean | undefined; + /** + * Initial list of history lines. This option makes sense + * only if `terminal` is set to `true` by the user or by an internal `output` + * check, otherwise the history caching mechanism is not initialized at all. + * @default [] + */ + history?: string[] | undefined; + historySize?: number | undefined; + prompt?: string | undefined; + crlfDelay?: number | undefined; + /** + * If `true`, when a new input line added + * to the history list duplicates an older one, this removes the older line + * from the list. + * @default false + */ + removeHistoryDuplicates?: boolean | undefined; + escapeCodeTimeout?: number | undefined; + tabSize?: number | undefined; + } + /** + * The `readline.createInterface()` method creates a new `readline.Interface`instance. + * + * ```js + * const readline = require('readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout + * }); + * ``` + * + * Once the `readline.Interface` instance is created, the most common case is to + * listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get + * the best compatibility if it defines an `output.columns` property and emits + * a `'resize'` event on the `output` if or when the columns ever change + * (`process.stdout` does this automatically when it is a TTY). + * + * When creating a `readline.Interface` using `stdin` as input, the program + * will not terminate until it receives `EOF` (Ctrl+D on + * Linux/macOS, Ctrl+Z followed by Return on + * Windows). + * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream: + * + * ```js + * process.stdin.unref(); + * ``` + * @since v0.1.98 + */ + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; + export function createInterface(options: ReadLineOptions): Interface; + /** + * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. + * + * Optionally, `interface` specifies a `readline.Interface` instance for which + * autocompletion is disabled when copy-pasted input is detected. + * + * If the `stream` is a `TTY`, then it must be in raw mode. + * + * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop + * the `input` from emitting `'keypress'` events. + * + * ```js + * readline.emitKeypressEvents(process.stdin); + * if (process.stdin.isTTY) + * process.stdin.setRawMode(true); + * ``` + * + * ## Example: Tiny CLI + * + * The following example illustrates the use of `readline.Interface` class to + * implement a small command-line interface: + * + * ```js + * const readline = require('readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * prompt: 'OHAI> ' + * }); + * + * rl.prompt(); + * + * rl.on('line', (line) => { + * switch (line.trim()) { + * case 'hello': + * console.log('world!'); + * break; + * default: + * console.log(`Say what? I might have heard '${line.trim()}'`); + * break; + * } + * rl.prompt(); + * }).on('close', () => { + * console.log('Have a great day!'); + * process.exit(0); + * }); + * ``` + * + * ## Example: Read file stream line-by-Line + * + * A common use case for `readline` is to consume an input file one line at a + * time. The easiest way to do so is leveraging the `fs.ReadStream` API as + * well as a `for await...of` loop: + * + * ```js + * const fs = require('fs'); + * const readline = require('readline'); + * + * async function processLineByLine() { + * const fileStream = fs.createReadStream('input.txt'); + * + * const rl = readline.createInterface({ + * input: fileStream, + * crlfDelay: Infinity + * }); + * // Note: we use the crlfDelay option to recognize all instances of CR LF + * // ('\r\n') in input.txt as a single line break. + * + * for await (const line of rl) { + * // Each line in input.txt will be successively available here as `line`. + * console.log(`Line from file: ${line}`); + * } + * } + * + * processLineByLine(); + * ``` + * + * Alternatively, one could use the `'line'` event: + * + * ```js + * const fs = require('fs'); + * const readline = require('readline'); + * + * const rl = readline.createInterface({ + * input: fs.createReadStream('sample.txt'), + * crlfDelay: Infinity + * }); + * + * rl.on('line', (line) => { + * console.log(`Line from file: ${line}`); + * }); + * ``` + * + * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: + * + * ```js + * const { once } = require('events'); + * const { createReadStream } = require('fs'); + * const { createInterface } = require('readline'); + * + * (async function processLineByLine() { + * try { + * const rl = createInterface({ + * input: createReadStream('big-file.txt'), + * crlfDelay: Infinity + * }); + * + * rl.on('line', (line) => { + * // Process the line. + * }); + * + * await once(rl, 'close'); + * + * console.log('File processed.'); + * } catch (err) { + * console.error(err); + * } + * })(); + * ``` + * @since v0.7.7 + */ + export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; + export type Direction = -1 | 0 | 1; + export interface CursorPos { + rows: number; + cols: number; + } + /** + * The `readline.clearLine()` method clears current line of given `TTY` stream + * in a specified direction identified by `dir`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; + /** + * The `readline.clearScreenDown()` method clears the given `TTY` stream from + * the current position of the cursor down. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; + /** + * The `readline.cursorTo()` method moves cursor to the specified position in a + * given `TTY` `stream`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; + /** + * The `readline.moveCursor()` method moves the cursor _relative_ to its current + * position in a given `TTY` `stream`. + * + * ## Example: Tiny CLI + * + * The following example illustrates the use of `readline.Interface` class to + * implement a small command-line interface: + * + * ```js + * const readline = require('readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * prompt: 'OHAI> ' + * }); + * + * rl.prompt(); + * + * rl.on('line', (line) => { + * switch (line.trim()) { + * case 'hello': + * console.log('world!'); + * break; + * default: + * console.log(`Say what? I might have heard '${line.trim()}'`); + * break; + * } + * rl.prompt(); + * }).on('close', () => { + * console.log('Have a great day!'); + * process.exit(0); + * }); + * ``` + * + * ## Example: Read file stream line-by-Line + * + * A common use case for `readline` is to consume an input file one line at a + * time. The easiest way to do so is leveraging the `fs.ReadStream` API as + * well as a `for await...of` loop: + * + * ```js + * const fs = require('fs'); + * const readline = require('readline'); + * + * async function processLineByLine() { + * const fileStream = fs.createReadStream('input.txt'); + * + * const rl = readline.createInterface({ + * input: fileStream, + * crlfDelay: Infinity + * }); + * // Note: we use the crlfDelay option to recognize all instances of CR LF + * // ('\r\n') in input.txt as a single line break. + * + * for await (const line of rl) { + * // Each line in input.txt will be successively available here as `line`. + * console.log(`Line from file: ${line}`); + * } + * } + * + * processLineByLine(); + * ``` + * + * Alternatively, one could use the `'line'` event: + * + * ```js + * const fs = require('fs'); + * const readline = require('readline'); + * + * const rl = readline.createInterface({ + * input: fs.createReadStream('sample.txt'), + * crlfDelay: Infinity + * }); + * + * rl.on('line', (line) => { + * console.log(`Line from file: ${line}`); + * }); + * ``` + * + * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: + * + * ```js + * const { once } = require('events'); + * const { createReadStream } = require('fs'); + * const { createInterface } = require('readline'); + * + * (async function processLineByLine() { + * try { + * const rl = createInterface({ + * input: createReadStream('big-file.txt'), + * crlfDelay: Infinity + * }); + * + * rl.on('line', (line) => { + * // Process the line. + * }); + * + * await once(rl, 'close'); + * + * console.log('File processed.'); + * } catch (err) { + * console.error(err); + * } + * })(); + * ``` + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; +} +declare module 'node:readline' { + export * from 'readline'; +} diff --git a/server/node_modules/@types/node/ts4.8/readline/promises.d.ts b/server/node_modules/@types/node/ts4.8/readline/promises.d.ts new file mode 100755 index 0000000000..8f9f06f0b9 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/readline/promises.d.ts @@ -0,0 +1,143 @@ +/** + * The `readline/promise` module provides an API for reading lines of input from a Readable stream one line at a time. + * + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline/promises.js) + * @since v17.0.0 + */ +declare module 'readline/promises' { + import { Interface as _Interface, ReadLineOptions, Completer, AsyncCompleter, Direction } from 'node:readline'; + import { Abortable } from 'node:events'; + + class Interface extends _Interface { + /** + * The rl.question() method displays the query by writing it to the output, waits for user input to be provided on input, + * then invokes the callback function passing the provided input as the first argument. + * + * When called, rl.question() will resume the input stream if it has been paused. + * + * If the readlinePromises.Interface was created with output set to null or undefined the query is not written. + * + * If the question is called after rl.close(), it returns a rejected promise. + * + * Example usage: + * + * ```js + * const answer = await rl.question('What is your favorite food? '); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * + * Using an AbortSignal to cancel a question. + * + * ```js + * const signal = AbortSignal.timeout(10_000); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * const answer = await rl.question('What is your favorite food? ', { signal }); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * + * @since v17.0.0 + * @param query A statement or query to write to output, prepended to the prompt. + */ + question(query: string): Promise; + question(query: string, options: Abortable): Promise; + } + + class Readline { + /** + * @param stream A TTY stream. + */ + constructor(stream: NodeJS.WritableStream, options?: { autoCommit?: boolean }); + /** + * The `rl.clearLine()` method adds to the internal list of pending action an action that clears current line of the associated `stream` in a specified direction identified by `dir`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + */ + clearLine(dir: Direction): this; + /** + * The `rl.clearScreenDown()` method adds to the internal list of pending action an action that clears the associated `stream` from the current position of the cursor down. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + */ + clearScreenDown(): this; + /** + * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions. + */ + commit(): Promise; + /** + * The `rl.cursorTo()` method adds to the internal list of pending action an action that moves cursor to the specified position in the associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor. + */ + cursorTo(x: number, y?: number): this; + /** + * The `rl.moveCursor()` method adds to the internal list of pending action an action that moves the cursor relative to its current position in the associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless autoCommit: true was passed to the constructor. + */ + moveCursor(dx: number, dy: number): this; + /** + * The `rl.rollback()` method clears the internal list of pending actions without sending it to the associated `stream`. + */ + rollback(): this; + } + + /** + * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. + * + * ```js + * const readlinePromises = require('node:readline/promises'); + * const rl = readlinePromises.createInterface({ + * input: process.stdin, + * output: process.stdout + * }); + * ``` + * + * Once the `readlinePromises.Interface` instance is created, the most common case is to listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property, + * and emits a `'resize'` event on the `output`, if or when the columns ever change (`process.stdout` does this automatically when it is a TTY). + * + * ## Use of the `completer` function + * + * The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries: + * + * - An Array with matching entries for the completion. + * - The substring that was used for the matching. + * + * For instance: `[[substr1, substr2, ...], originalsubstring]`. + * + * ```js + * function completer(line) { + * const completions = '.help .error .exit .quit .q'.split(' '); + * const hits = completions.filter((c) => c.startsWith(line)); + * // Show all completions if none found + * return [hits.length ? hits : completions, line]; + * } + * ``` + * + * The `completer` function can also returns a `Promise`, or be asynchronous: + * + * ```js + * async function completer(linePartial) { + * await someAsyncWork(); + * return [['123'], linePartial]; + * } + * ``` + */ + function createInterface( + input: NodeJS.ReadableStream, + output?: NodeJS.WritableStream, + completer?: Completer | AsyncCompleter, + terminal?: boolean, + ): Interface; + function createInterface(options: ReadLineOptions): Interface; +} +declare module 'node:readline/promises' { + export * from 'readline/promises'; +} diff --git a/server/node_modules/@types/node/ts4.8/repl.d.ts b/server/node_modules/@types/node/ts4.8/repl.d.ts new file mode 100755 index 0000000000..be42ccc4ae --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/repl.d.ts @@ -0,0 +1,424 @@ +/** + * The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that + * is available both as a standalone program or includible in other applications. + * It can be accessed using: + * + * ```js + * const repl = require('repl'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/repl.js) + */ +declare module 'repl' { + import { Interface, Completer, AsyncCompleter } from 'node:readline'; + import { Context } from 'node:vm'; + import { InspectOptions } from 'node:util'; + interface ReplOptions { + /** + * The input prompt to display. + * @default "> " + */ + prompt?: string | undefined; + /** + * The `Readable` stream from which REPL input will be read. + * @default process.stdin + */ + input?: NodeJS.ReadableStream | undefined; + /** + * The `Writable` stream to which REPL output will be written. + * @default process.stdout + */ + output?: NodeJS.WritableStream | undefined; + /** + * If `true`, specifies that the output should be treated as a TTY terminal, and have + * ANSI/VT100 escape codes written to it. + * Default: checking the value of the `isTTY` property on the output stream upon + * instantiation. + */ + terminal?: boolean | undefined; + /** + * The function to be used when evaluating each given line of input. + * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can + * error with `repl.Recoverable` to indicate the input was incomplete and prompt for + * additional lines. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions + */ + eval?: REPLEval | undefined; + /** + * Defines if the repl prints output previews or not. + * @default `true` Always `false` in case `terminal` is falsy. + */ + preview?: boolean | undefined; + /** + * If `true`, specifies that the default `writer` function should include ANSI color + * styling to REPL output. If a custom `writer` function is provided then this has no + * effect. + * Default: the REPL instance's `terminal` value. + */ + useColors?: boolean | undefined; + /** + * If `true`, specifies that the default evaluation function will use the JavaScript + * `global` as the context as opposed to creating a new separate context for the REPL + * instance. The node CLI REPL sets this value to `true`. + * Default: `false`. + */ + useGlobal?: boolean | undefined; + /** + * If `true`, specifies that the default writer will not output the return value of a + * command if it evaluates to `undefined`. + * Default: `false`. + */ + ignoreUndefined?: boolean | undefined; + /** + * The function to invoke to format the output of each command before writing to `output`. + * Default: a wrapper for `util.inspect`. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output + */ + writer?: REPLWriter | undefined; + /** + * An optional function used for custom Tab auto completion. + * + * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function + */ + completer?: Completer | AsyncCompleter | undefined; + /** + * A flag that specifies whether the default evaluator executes all JavaScript commands in + * strict mode or default (sloppy) mode. + * Accepted values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; + /** + * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is + * pressed. This cannot be used together with a custom `eval` function. + * Default: `false`. + */ + breakEvalOnSigint?: boolean | undefined; + } + type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; + type REPLWriter = (this: REPLServer, obj: any) => string; + /** + * This is the default "writer" value, if none is passed in the REPL options, + * and it can be overridden by custom print functions. + */ + const writer: REPLWriter & { + options: InspectOptions; + }; + type REPLCommandAction = (this: REPLServer, text: string) => void; + interface REPLCommand { + /** + * Help text to be displayed when `.help` is entered. + */ + help?: string | undefined; + /** + * The function to execute, optionally accepting a single string argument. + */ + action: REPLCommandAction; + } + /** + * Instances of `repl.REPLServer` are created using the {@link start} method + * or directly using the JavaScript `new` keyword. + * + * ```js + * const repl = require('repl'); + * + * const options = { useColors: true }; + * + * const firstInstance = repl.start(options); + * const secondInstance = new repl.REPLServer(options); + * ``` + * @since v0.1.91 + */ + class REPLServer extends Interface { + /** + * The `vm.Context` provided to the `eval` function to be used for JavaScript + * evaluation. + */ + readonly context: Context; + /** + * @deprecated since v14.3.0 - Use `input` instead. + */ + readonly inputStream: NodeJS.ReadableStream; + /** + * @deprecated since v14.3.0 - Use `output` instead. + */ + readonly outputStream: NodeJS.WritableStream; + /** + * The `Readable` stream from which REPL input will be read. + */ + readonly input: NodeJS.ReadableStream; + /** + * The `Writable` stream to which REPL output will be written. + */ + readonly output: NodeJS.WritableStream; + /** + * The commands registered via `replServer.defineCommand()`. + */ + readonly commands: NodeJS.ReadOnlyDict; + /** + * A value indicating whether the REPL is currently in "editor mode". + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys + */ + readonly editorMode: boolean; + /** + * A value indicating whether the `_` variable has been assigned. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreAssigned: boolean; + /** + * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly last: any; + /** + * A value indicating whether the `_error` variable has been assigned. + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreErrAssigned: boolean; + /** + * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly lastError: any; + /** + * Specified in the REPL options, this is the function to be used when evaluating each + * given line of input. If not specified in the REPL options, this is an async wrapper + * for the JavaScript `eval()` function. + */ + readonly eval: REPLEval; + /** + * Specified in the REPL options, this is a value indicating whether the default + * `writer` function should include ANSI color styling to REPL output. + */ + readonly useColors: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `eval` + * function will use the JavaScript `global` as the context as opposed to creating a new + * separate context for the REPL instance. + */ + readonly useGlobal: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `writer` + * function should output the result of a command if it evaluates to `undefined`. + */ + readonly ignoreUndefined: boolean; + /** + * Specified in the REPL options, this is the function to invoke to format the output of + * each command before writing to `outputStream`. If not specified in the REPL options, + * this will be a wrapper for `util.inspect`. + */ + readonly writer: REPLWriter; + /** + * Specified in the REPL options, this is the function to use for custom Tab auto-completion. + */ + readonly completer: Completer | AsyncCompleter; + /** + * Specified in the REPL options, this is a flag that specifies whether the default `eval` + * function should execute all JavaScript commands in strict mode or default (sloppy) mode. + * Possible values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; + /** + * NOTE: According to the documentation: + * + * > Instances of `repl.REPLServer` are created using the `repl.start()` method and + * > _should not_ be created directly using the JavaScript `new` keyword. + * + * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver + */ + private constructor(); + /** + * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands + * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following + * properties: + * + * The following example shows two new commands added to the REPL instance: + * + * ```js + * const repl = require('repl'); + * + * const replServer = repl.start({ prompt: '> ' }); + * replServer.defineCommand('sayhello', { + * help: 'Say hello', + * action(name) { + * this.clearBufferedCommand(); + * console.log(`Hello, ${name}!`); + * this.displayPrompt(); + * } + * }); + * replServer.defineCommand('saybye', function saybye() { + * console.log('Goodbye!'); + * this.close(); + * }); + * ``` + * + * The new commands can then be used from within the REPL instance: + * + * ```console + * > .sayhello Node.js User + * Hello, Node.js User! + * > .saybye + * Goodbye! + * ``` + * @since v0.3.0 + * @param keyword The command keyword (_without_ a leading `.` character). + * @param cmd The function to invoke when the command is processed. + */ + defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; + /** + * The `replServer.displayPrompt()` method readies the REPL instance for input + * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. + * + * When multi-line input is being entered, an ellipsis is printed rather than the + * 'prompt'. + * + * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. + * + * The `replServer.displayPrompt` method is primarily intended to be called from + * within the action function for commands registered using the`replServer.defineCommand()` method. + * @since v0.1.91 + */ + displayPrompt(preserveCursor?: boolean): void; + /** + * The `replServer.clearBufferedCommand()` method clears any command that has been + * buffered but not yet executed. This method is primarily intended to be + * called from within the action function for commands registered using the`replServer.defineCommand()` method. + * @since v9.0.0 + */ + clearBufferedCommand(): void; + /** + * Initializes a history log file for the REPL instance. When executing the + * Node.js binary and using the command-line REPL, a history file is initialized + * by default. However, this is not the case when creating a REPL + * programmatically. Use this method to initialize a history log file when working + * with REPL instances programmatically. + * @since v11.10.0 + * @param historyPath the path to the history file + * @param callback called when history writes are ready or upon error + */ + setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; + /** + * events.EventEmitter + * 1. close - inherited from `readline.Interface` + * 2. line - inherited from `readline.Interface` + * 3. pause - inherited from `readline.Interface` + * 4. resume - inherited from `readline.Interface` + * 5. SIGCONT - inherited from `readline.Interface` + * 6. SIGINT - inherited from `readline.Interface` + * 7. SIGTSTP - inherited from `readline.Interface` + * 8. exit + * 9. reset + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'line', listener: (input: string) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'SIGCONT', listener: () => void): this; + addListener(event: 'SIGINT', listener: () => void): this; + addListener(event: 'SIGTSTP', listener: () => void): this; + addListener(event: 'exit', listener: () => void): this; + addListener(event: 'reset', listener: (context: Context) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'line', input: string): boolean; + emit(event: 'pause'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'SIGCONT'): boolean; + emit(event: 'SIGINT'): boolean; + emit(event: 'SIGTSTP'): boolean; + emit(event: 'exit'): boolean; + emit(event: 'reset', context: Context): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'line', listener: (input: string) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'SIGCONT', listener: () => void): this; + on(event: 'SIGINT', listener: () => void): this; + on(event: 'SIGTSTP', listener: () => void): this; + on(event: 'exit', listener: () => void): this; + on(event: 'reset', listener: (context: Context) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'line', listener: (input: string) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'SIGCONT', listener: () => void): this; + once(event: 'SIGINT', listener: () => void): this; + once(event: 'SIGTSTP', listener: () => void): this; + once(event: 'exit', listener: () => void): this; + once(event: 'reset', listener: (context: Context) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'line', listener: (input: string) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'SIGCONT', listener: () => void): this; + prependListener(event: 'SIGINT', listener: () => void): this; + prependListener(event: 'SIGTSTP', listener: () => void): this; + prependListener(event: 'exit', listener: () => void): this; + prependListener(event: 'reset', listener: (context: Context) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'line', listener: (input: string) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'SIGCONT', listener: () => void): this; + prependOnceListener(event: 'SIGINT', listener: () => void): this; + prependOnceListener(event: 'SIGTSTP', listener: () => void): this; + prependOnceListener(event: 'exit', listener: () => void): this; + prependOnceListener(event: 'reset', listener: (context: Context) => void): this; + } + /** + * A flag passed in the REPL options. Evaluates expressions in sloppy mode. + */ + const REPL_MODE_SLOPPY: unique symbol; + /** + * A flag passed in the REPL options. Evaluates expressions in strict mode. + * This is equivalent to prefacing every repl statement with `'use strict'`. + */ + const REPL_MODE_STRICT: unique symbol; + /** + * The `repl.start()` method creates and starts a {@link REPLServer} instance. + * + * If `options` is a string, then it specifies the input prompt: + * + * ```js + * const repl = require('repl'); + * + * // a Unix style prompt + * repl.start('$ '); + * ``` + * @since v0.1.91 + */ + function start(options?: string | ReplOptions): REPLServer; + /** + * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors + */ + class Recoverable extends SyntaxError { + err: Error; + constructor(err: Error); + } +} +declare module 'node:repl' { + export * from 'repl'; +} diff --git a/server/node_modules/@types/node/ts4.8/stream.d.ts b/server/node_modules/@types/node/ts4.8/stream.d.ts new file mode 100755 index 0000000000..a0df689e1d --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/stream.d.ts @@ -0,0 +1,1340 @@ +/** + * A stream is an abstract interface for working with streaming data in Node.js. + * The `stream` module provides an API for implementing the stream interface. + * + * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. + * + * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. + * + * To access the `stream` module: + * + * ```js + * const stream = require('stream'); + * ``` + * + * The `stream` module is useful for creating new types of stream instances. It is + * usually not necessary to use the `stream` module to consume streams. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/stream.js) + */ +declare module 'stream' { + import { EventEmitter, Abortable } from 'node:events'; + import { Blob as NodeBlob } from "node:buffer"; + import * as streamPromises from 'node:stream/promises'; + import * as streamConsumers from 'node:stream/consumers'; + import * as streamWeb from 'node:stream/web'; + class internal extends EventEmitter { + pipe( + destination: T, + options?: { + end?: boolean | undefined; + } + ): T; + } + namespace internal { + class Stream extends internal { + constructor(opts?: ReadableOptions); + } + interface StreamOptions extends Abortable { + emitClose?: boolean | undefined; + highWaterMark?: number | undefined; + objectMode?: boolean | undefined; + construct?(this: T, callback: (error?: Error | null) => void): void; + destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; + autoDestroy?: boolean | undefined; + } + interface ReadableOptions extends StreamOptions { + encoding?: BufferEncoding | undefined; + read?(this: Readable, size: number): void; + } + /** + * @since v0.9.4 + */ + class Readable extends Stream implements NodeJS.ReadableStream { + /** + * A utility method for creating Readable Streams out of iterators. + */ + static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; + /** + * A utility method for creating a `Readable` from a web `ReadableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick): Readable; + /** + * Returns whether the stream has been read from or cancelled. + * @since v16.8.0 + */ + static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; + /** + * A utility method for creating a web `ReadableStream` from a `Readable`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamReadable: Readable): streamWeb.ReadableStream; + /** + * Returns whether the stream was destroyed or errored before emitting `'end'`. + * @since v16.8.0 + * @experimental + */ + readonly readableAborted: boolean; + /** + * Is `true` if it is safe to call `readable.read()`, which means + * the stream has not been destroyed or emitted `'error'` or `'end'`. + * @since v11.4.0 + */ + readable: boolean; + /** + * Returns whether `'data'` has been emitted. + * @since v16.7.0, v14.18.0 + * @experimental + */ + readonly readableDidRead: boolean; + /** + * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. + * @since v12.7.0 + */ + readonly readableEncoding: BufferEncoding | null; + /** + * Becomes `true` when `'end'` event is emitted. + * @since v12.9.0 + */ + readonly readableEnded: boolean; + /** + * This property reflects the current state of a `Readable` stream as described + * in the `Three states` section. + * @since v9.4.0 + */ + readonly readableFlowing: boolean | null; + /** + * Returns the value of `highWaterMark` passed when creating this `Readable`. + * @since v9.3.0 + */ + readonly readableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be read. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly readableLength: number; + /** + * Getter for the property `objectMode` of a given `Readable` stream. + * @since v12.3.0 + */ + readonly readableObjectMode: boolean; + /** + * Is `true` after `readable.destroy()` has been called. + * @since v18.0.0 + */ + destroyed: boolean; + /** + * Is true after 'close' has been emitted. + * @since v8.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + constructor(opts?: ReadableOptions); + _construct?(callback: (error?: Error | null) => void): void; + _read(size: number): void; + /** + * The `readable.read()` method reads data out of the internal buffer and + * returns it. If no data is available to be read, `null` is returned. By default, + * the data is returned as a `Buffer` object unless an encoding has been + * specified using the `readable.setEncoding()` method or the stream is operating + * in object mode. + * + * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which + * case all of the data remaining in the internal + * buffer will be returned. + * + * If the `size` argument is not specified, all of the data contained in the + * internal buffer will be returned. + * + * The `size` argument must be less than or equal to 1 GiB. + * + * The `readable.read()` method should only be called on `Readable` streams + * operating in paused mode. In flowing mode, `readable.read()` is called + * automatically until the internal buffer is fully drained. + * + * ```js + * const readable = getReadableStreamSomehow(); + * + * // 'readable' may be triggered multiple times as data is buffered in + * readable.on('readable', () => { + * let chunk; + * console.log('Stream is readable (new data received in buffer)'); + * // Use a loop to make sure we read all currently available data + * while (null !== (chunk = readable.read())) { + * console.log(`Read ${chunk.length} bytes of data...`); + * } + * }); + * + * // 'end' will be triggered once when there is no more data available + * readable.on('end', () => { + * console.log('Reached end of stream.'); + * }); + * ``` + * + * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks + * are not concatenated. A `while` loop is necessary to consume all data + * currently in the buffer. When reading a large file `.read()` may return `null`, + * having consumed all buffered content so far, but there is still more data to + * come not yet buffered. In this case a new `'readable'` event will be emitted + * when there is more data in the buffer. Finally the `'end'` event will be + * emitted when there is no more data to come. + * + * Therefore to read a file's whole contents from a `readable`, it is necessary + * to collect chunks across multiple `'readable'` events: + * + * ```js + * const chunks = []; + * + * readable.on('readable', () => { + * let chunk; + * while (null !== (chunk = readable.read())) { + * chunks.push(chunk); + * } + * }); + * + * readable.on('end', () => { + * const content = chunks.join(''); + * }); + * ``` + * + * A `Readable` stream in object mode will always return a single item from + * a call to `readable.read(size)`, regardless of the value of the`size` argument. + * + * If the `readable.read()` method returns a chunk of data, a `'data'` event will + * also be emitted. + * + * Calling {@link read} after the `'end'` event has + * been emitted will return `null`. No runtime error will be raised. + * @since v0.9.4 + * @param size Optional argument to specify how much data to read. + */ + read(size?: number): any; + /** + * The `readable.setEncoding()` method sets the character encoding for + * data read from the `Readable` stream. + * + * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data + * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the + * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal + * string format. + * + * The `Readable` stream will properly handle multi-byte characters delivered + * through the stream that would otherwise become improperly decoded if simply + * pulled from the stream as `Buffer` objects. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.setEncoding('utf8'); + * readable.on('data', (chunk) => { + * assert.equal(typeof chunk, 'string'); + * console.log('Got %d characters of string data:', chunk.length); + * }); + * ``` + * @since v0.9.4 + * @param encoding The encoding to use. + */ + setEncoding(encoding: BufferEncoding): this; + /** + * The `readable.pause()` method will cause a stream in flowing mode to stop + * emitting `'data'` events, switching out of flowing mode. Any data that + * becomes available will remain in the internal buffer. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.on('data', (chunk) => { + * console.log(`Received ${chunk.length} bytes of data.`); + * readable.pause(); + * console.log('There will be no additional data for 1 second.'); + * setTimeout(() => { + * console.log('Now data will start flowing again.'); + * readable.resume(); + * }, 1000); + * }); + * ``` + * + * The `readable.pause()` method has no effect if there is a `'readable'`event listener. + * @since v0.9.4 + */ + pause(): this; + /** + * The `readable.resume()` method causes an explicitly paused `Readable` stream to + * resume emitting `'data'` events, switching the stream into flowing mode. + * + * The `readable.resume()` method can be used to fully consume the data from a + * stream without actually processing any of that data: + * + * ```js + * getReadableStreamSomehow() + * .resume() + * .on('end', () => { + * console.log('Reached the end, but did not read anything.'); + * }); + * ``` + * + * The `readable.resume()` method has no effect if there is a `'readable'`event listener. + * @since v0.9.4 + */ + resume(): this; + /** + * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most + * typical cases, there will be no reason to + * use this method directly. + * + * ```js + * const readable = new stream.Readable(); + * + * readable.isPaused(); // === false + * readable.pause(); + * readable.isPaused(); // === true + * readable.resume(); + * readable.isPaused(); // === false + * ``` + * @since v0.11.14 + */ + isPaused(): boolean; + /** + * The `readable.unpipe()` method detaches a `Writable` stream previously attached + * using the {@link pipe} method. + * + * If the `destination` is not specified, then _all_ pipes are detached. + * + * If the `destination` is specified, but no pipe is set up for it, then + * the method does nothing. + * + * ```js + * const fs = require('fs'); + * const readable = getReadableStreamSomehow(); + * const writable = fs.createWriteStream('file.txt'); + * // All the data from readable goes into 'file.txt', + * // but only for the first second. + * readable.pipe(writable); + * setTimeout(() => { + * console.log('Stop writing to file.txt.'); + * readable.unpipe(writable); + * console.log('Manually close the file stream.'); + * writable.end(); + * }, 1000); + * ``` + * @since v0.9.4 + * @param destination Optional specific stream to unpipe + */ + unpipe(destination?: NodeJS.WritableStream): this; + /** + * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the + * same as `readable.push(null)`, after which no more data can be written. The EOF + * signal is put at the end of the buffer and any buffered data will still be + * flushed. + * + * The `readable.unshift()` method pushes a chunk of data back into the internal + * buffer. This is useful in certain situations where a stream is being consumed by + * code that needs to "un-consume" some amount of data that it has optimistically + * pulled out of the source, so that the data can be passed on to some other party. + * + * The `stream.unshift(chunk)` method cannot be called after the `'end'` event + * has been emitted or a runtime error will be thrown. + * + * Developers using `stream.unshift()` often should consider switching to + * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. + * + * ```js + * // Pull off a header delimited by \n\n. + * // Use unshift() if we get too much. + * // Call the callback with (error, header, stream). + * const { StringDecoder } = require('string_decoder'); + * function parseHeader(stream, callback) { + * stream.on('error', callback); + * stream.on('readable', onReadable); + * const decoder = new StringDecoder('utf8'); + * let header = ''; + * function onReadable() { + * let chunk; + * while (null !== (chunk = stream.read())) { + * const str = decoder.write(chunk); + * if (str.includes('\n\n')) { + * // Found the header boundary. + * const split = str.split(/\n\n/); + * header += split.shift(); + * const remaining = split.join('\n\n'); + * const buf = Buffer.from(remaining, 'utf8'); + * stream.removeListener('error', callback); + * // Remove the 'readable' listener before unshifting. + * stream.removeListener('readable', onReadable); + * if (buf.length) + * stream.unshift(buf); + * // Now the body of the message can be read from the stream. + * callback(null, header, stream); + * return; + * } + * // Still reading the header. + * header += str; + * } + * } + * } + * ``` + * + * Unlike {@link push}, `stream.unshift(chunk)` will not + * end the reading process by resetting the internal reading state of the stream. + * This can cause unexpected results if `readable.unshift()` is called during a + * read (i.e. from within a {@link _read} implementation on a + * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, + * however it is best to simply avoid calling `readable.unshift()` while in the + * process of performing a read. + * @since v0.9.11 + * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array` or `null`. For object mode + * streams, `chunk` may be any JavaScript value. + * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. + */ + unshift(chunk: any, encoding?: BufferEncoding): void; + /** + * Prior to Node.js 0.10, streams did not implement the entire `stream` module API + * as it is currently defined. (See `Compatibility` for more information.) + * + * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` + * stream that uses + * the old stream as its data source. + * + * It will rarely be necessary to use `readable.wrap()` but the method has been + * provided as a convenience for interacting with older Node.js applications and + * libraries. + * + * ```js + * const { OldReader } = require('./old-api-module.js'); + * const { Readable } = require('stream'); + * const oreader = new OldReader(); + * const myReader = new Readable().wrap(oreader); + * + * myReader.on('readable', () => { + * myReader.read(); // etc. + * }); + * ``` + * @since v0.9.4 + * @param stream An "old style" readable stream + */ + wrap(stream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: BufferEncoding): boolean; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable + * stream will release any internal resources and subsequent calls to `push()`will be ignored. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, but instead implement `readable._destroy()`. + * @since v8.0.0 + * @param error Error which will be passed as payload in `'error'` event + */ + destroy(error?: Error): this; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. error + * 5. pause + * 6. readable + * 7. resume + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: any) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: any): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'pause'): boolean; + emit(event: 'readable'): boolean; + emit(event: 'resume'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: any) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: any) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: any) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: any) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'data', listener: (chunk: any) => void): this; + removeListener(event: 'end', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'pause', listener: () => void): this; + removeListener(event: 'readable', listener: () => void): this; + removeListener(event: 'resume', listener: () => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + interface WritableOptions extends StreamOptions { + decodeStrings?: boolean | undefined; + defaultEncoding?: BufferEncoding | undefined; + write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Writable, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Writable, callback: (error?: Error | null) => void): void; + } + /** + * @since v0.9.4 + */ + class Writable extends Stream implements NodeJS.WritableStream { + /** + * A utility method for creating a `Writable` from a web `WritableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb(writableStream: streamWeb.WritableStream, options?: Pick): Writable; + /** + * A utility method for creating a web `WritableStream` from a `Writable`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamWritable: Writable): streamWeb.WritableStream; + /** + * Is `true` if it is safe to call `writable.write()`, which means + * the stream has not been destroyed, errored or ended. + * @since v11.4.0 + */ + readonly writable: boolean; + /** + * Is `true` after `writable.end()` has been called. This property + * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. + * @since v12.9.0 + */ + readonly writableEnded: boolean; + /** + * Is set to `true` immediately before the `'finish'` event is emitted. + * @since v12.6.0 + */ + readonly writableFinished: boolean; + /** + * Return the value of `highWaterMark` passed when creating this `Writable`. + * @since v9.3.0 + */ + readonly writableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be written. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly writableLength: number; + /** + * Getter for the property `objectMode` of a given `Writable` stream. + * @since v12.3.0 + */ + readonly writableObjectMode: boolean; + /** + * Number of times `writable.uncork()` needs to be + * called in order to fully uncork the stream. + * @since v13.2.0, v12.16.0 + */ + readonly writableCorked: number; + /** + * Is `true` after `writable.destroy()` has been called. + * @since v8.0.0 + */ + destroyed: boolean; + /** + * Is true after 'close' has been emitted. + * @since v8.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + /** + * Is `true` if the stream's buffer has been full and stream will emit 'drain'. + * @since v15.2.0, v14.17.0 + */ + readonly writableNeedDrain: boolean; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?( + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + _construct?(callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + /** + * The `writable.write()` method writes some data to the stream, and calls the + * supplied `callback` once the data has been fully handled. If an error + * occurs, the `callback` will be called with the error as its + * first argument. The `callback` is called asynchronously and before `'error'` is + * emitted. + * + * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. + * If `false` is returned, further attempts to write data to the stream should + * stop until the `'drain'` event is emitted. + * + * While a stream is not draining, calls to `write()` will buffer `chunk`, and + * return false. Once all currently buffered chunks are drained (accepted for + * delivery by the operating system), the `'drain'` event will be emitted. + * Once `write()` returns false, do not write more chunks + * until the `'drain'` event is emitted. While calling `write()` on a stream that + * is not draining is allowed, Node.js will buffer all written chunks until + * maximum memory usage occurs, at which point it will abort unconditionally. + * Even before it aborts, high memory usage will cause poor garbage collector + * performance and high RSS (which is not typically released back to the system, + * even after the memory is no longer required). Since TCP sockets may never + * drain if the remote peer does not read the data, writing a socket that is + * not draining may lead to a remotely exploitable vulnerability. + * + * Writing data while the stream is not draining is particularly + * problematic for a `Transform`, because the `Transform` streams are paused + * by default until they are piped or a `'data'` or `'readable'` event handler + * is added. + * + * If the data to be written can be generated or fetched on demand, it is + * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is + * possible to respect backpressure and avoid memory issues using the `'drain'` event: + * + * ```js + * function write(data, cb) { + * if (!stream.write(data)) { + * stream.once('drain', cb); + * } else { + * process.nextTick(cb); + * } + * } + * + * // Wait for cb to be called before doing any other write. + * write('hello', () => { + * console.log('Write completed, do more writes now.'); + * }); + * ``` + * + * A `Writable` stream in object mode will always ignore the `encoding` argument. + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any + * JavaScript value other than `null`. + * @param [encoding='utf8'] The encoding, if `chunk` is a string. + * @param callback Callback for when this chunk of data is flushed. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; + /** + * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. + * @since v0.11.15 + * @param encoding The new default encoding + */ + setDefaultEncoding(encoding: BufferEncoding): this; + /** + * Calling the `writable.end()` method signals that no more data will be written + * to the `Writable`. The optional `chunk` and `encoding` arguments allow one + * final additional chunk of data to be written immediately before closing the + * stream. + * + * Calling the {@link write} method after calling {@link end} will raise an error. + * + * ```js + * // Write 'hello, ' and then end with 'world!'. + * const fs = require('fs'); + * const file = fs.createWriteStream('example.txt'); + * file.write('hello, '); + * file.end('world!'); + * // Writing more now is not allowed! + * ``` + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any + * JavaScript value other than `null`. + * @param encoding The encoding if `chunk` is a string + * @param callback Callback for when the stream is finished. + */ + end(cb?: () => void): this; + end(chunk: any, cb?: () => void): this; + end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; + /** + * The `writable.cork()` method forces all written data to be buffered in memory. + * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. + * + * The primary intent of `writable.cork()` is to accommodate a situation in which + * several small chunks are written to the stream in rapid succession. Instead of + * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them + * all to `writable._writev()`, if present. This prevents a head-of-line blocking + * situation where data is being buffered while waiting for the first small chunk + * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. + * + * See also: `writable.uncork()`, `writable._writev()`. + * @since v0.11.2 + */ + cork(): void; + /** + * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. + * + * When using `writable.cork()` and `writable.uncork()` to manage the buffering + * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event + * loop phase. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.write('data '); + * process.nextTick(() => stream.uncork()); + * ``` + * + * If the `writable.cork()` method is called multiple times on a stream, the + * same number of calls to `writable.uncork()` must be called to flush the buffered + * data. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.cork(); + * stream.write('data '); + * process.nextTick(() => { + * stream.uncork(); + * // The data will not be flushed until uncork() is called a second time. + * stream.uncork(); + * }); + * ``` + * + * See also: `writable.cork()`. + * @since v0.11.2 + */ + uncork(): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable + * stream has ended and subsequent calls to `write()` or `end()` will result in + * an `ERR_STREAM_DESTROYED` error. + * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. + * Use `end()` instead of destroy if data should flush before close, or wait for + * the `'drain'` event before destroying the stream. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, + * but instead implement `writable._destroy()`. + * @since v8.0.0 + * @param error Optional, an error to emit with `'error'` event. + */ + destroy(error?: Error): this; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: Readable) => void): this; + addListener(event: 'unpipe', listener: (src: Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'drain'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pipe', src: Readable): boolean; + emit(event: 'unpipe', src: Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: Readable) => void): this; + on(event: 'unpipe', listener: (src: Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: Readable) => void): this; + once(event: 'unpipe', listener: (src: Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'drain', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'finish', listener: () => void): this; + removeListener(event: 'pipe', listener: (src: Readable) => void): this; + removeListener(event: 'unpipe', listener: (src: Readable) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean | undefined; + readableObjectMode?: boolean | undefined; + writableObjectMode?: boolean | undefined; + readableHighWaterMark?: number | undefined; + writableHighWaterMark?: number | undefined; + writableCorked?: number | undefined; + construct?(this: Duplex, callback: (error?: Error | null) => void): void; + read?(this: Duplex, size: number): void; + write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Duplex, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Duplex, callback: (error?: Error | null) => void): void; + destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; + } + /** + * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Duplex` streams include: + * + * * `TCP sockets` + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Duplex extends Readable implements Writable { + readonly writable: boolean; + readonly writableEnded: boolean; + readonly writableFinished: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + readonly writableObjectMode: boolean; + readonly writableCorked: number; + readonly writableNeedDrain: boolean; + readonly closed: boolean; + readonly errored: Error | null; + /** + * If `false` then the stream will automatically end the writable side when the + * readable side ends. Set initially by the `allowHalfOpen` constructor option, + * which defaults to `false`. + * + * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is + * emitted. + * @since v0.9.4 + */ + allowHalfOpen: boolean; + constructor(opts?: DuplexOptions); + /** + * A utility method for creating duplex streams. + * + * - `Stream` converts writable stream into writable `Duplex` and readable stream + * to `Duplex`. + * - `Blob` converts into readable `Duplex`. + * - `string` converts into readable `Duplex`. + * - `ArrayBuffer` converts into readable `Duplex`. + * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. + * - `AsyncGeneratorFunction` converts into a readable/writable transform + * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield + * `null`. + * - `AsyncFunction` converts into a writable `Duplex`. Must return + * either `null` or `undefined` + * - `Object ({ writable, readable })` converts `readable` and + * `writable` into `Stream` and then combines them into `Duplex` where the + * `Duplex` will write to the `writable` and read from the `readable`. + * - `Promise` converts into readable `Duplex`. Value `null` is ignored. + * + * @since v16.8.0 + */ + static from(src: Stream | NodeBlob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?( + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + _destroy(error: Error | null, callback: (error: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: BufferEncoding): this; + end(cb?: () => void): this; + end(chunk: any, cb?: () => void): this; + end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; + cork(): void; + uncork(): void; + } + type TransformCallback = (error?: Error | null, data?: any) => void; + interface TransformOptions extends DuplexOptions { + construct?(this: Transform, callback: (error?: Error | null) => void): void; + read?(this: Transform, size: number): void; + write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Transform, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Transform, callback: (error?: Error | null) => void): void; + destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; + transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + flush?(this: Transform, callback: TransformCallback): void; + } + /** + * Transform streams are `Duplex` streams where the output is in some way + * related to the input. Like all `Duplex` streams, `Transform` streams + * implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Transform` streams include: + * + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; + } + /** + * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is + * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. + */ + class PassThrough extends Transform {} + /** + * Attaches an AbortSignal to a readable or writeable stream. This lets code + * control stream destruction using an `AbortController`. + * + * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream. + * + * ```js + * const fs = require('fs'); + * + * const controller = new AbortController(); + * const read = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')) + * ); + * // Later, abort the operation closing the stream + * controller.abort(); + * ``` + * + * Or using an `AbortSignal` with a readable stream as an async iterable: + * + * ```js + * const controller = new AbortController(); + * setTimeout(() => controller.abort(), 10_000); // set a timeout + * const stream = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')) + * ); + * (async () => { + * try { + * for await (const chunk of stream) { + * await process(chunk); + * } + * } catch (e) { + * if (e.name === 'AbortError') { + * // The operation was cancelled + * } else { + * throw e; + * } + * } + * })(); + * ``` + * @since v15.4.0 + * @param signal A signal representing possible cancellation + * @param stream a stream to attach a signal to + */ + function addAbortSignal(signal: AbortSignal, stream: T): T; + interface FinishedOptions extends Abortable { + error?: boolean | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + } + /** + * A function to get notified when a stream is no longer readable, writable + * or has experienced an error or a premature close event. + * + * ```js + * const { finished } = require('stream'); + * + * const rs = fs.createReadStream('archive.tar'); + * + * finished(rs, (err) => { + * if (err) { + * console.error('Stream failed.', err); + * } else { + * console.log('Stream is done reading.'); + * } + * }); + * + * rs.resume(); // Drain the stream. + * ``` + * + * Especially useful in error handling scenarios where a stream is destroyed + * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. + * + * The `finished` API provides promise version: + * + * ```js + * const { finished } = require('stream/promises'); + * + * const rs = fs.createReadStream('archive.tar'); + * + * async function run() { + * await finished(rs); + * console.log('Stream is done reading.'); + * } + * + * run().catch(console.error); + * rs.resume(); // Drain the stream. + * ``` + * + * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been + * invoked. The reason for this is so that unexpected `'error'` events (due to + * incorrect stream implementations) do not cause unexpected crashes. + * If this is unwanted behavior then the returned cleanup function needs to be + * invoked in the callback: + * + * ```js + * const cleanup = finished(rs, (err) => { + * cleanup(); + * // ... + * }); + * ``` + * @since v10.0.0 + * @param stream A readable and/or writable stream. + * @param callback A callback function that takes an optional error argument. + * @return A cleanup function which removes all registered listeners. + */ + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + namespace finished { + function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + } + type PipelineSourceFunction = () => Iterable | AsyncIterable; + type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; + type PipelineTransform, U> = + | NodeJS.ReadWriteStream + | ((source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable : S) => AsyncIterable); + type PipelineTransformSource = PipelineSource | PipelineTransform; + type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; + type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; + type PipelineDestination, P> = S extends PipelineTransformSource + ? NodeJS.WritableStream | PipelineDestinationIterableFunction | PipelineDestinationPromiseFunction + : never; + type PipelineCallback> = S extends PipelineDestinationPromiseFunction + ? (err: NodeJS.ErrnoException | null, value: P) => void + : (err: NodeJS.ErrnoException | null) => void; + type PipelinePromise> = S extends PipelineDestinationPromiseFunction ? Promise

: Promise; + interface PipelineOptions { + signal: AbortSignal; + } + /** + * A module method to pipe between streams and generators forwarding errors and + * properly cleaning up and provide a callback when the pipeline is complete. + * + * ```js + * const { pipeline } = require('stream'); + * const fs = require('fs'); + * const zlib = require('zlib'); + * + * // Use the pipeline API to easily pipe a series of streams + * // together and get notified when the pipeline is fully done. + * + * // A pipeline to gzip a potentially huge tar file efficiently: + * + * pipeline( + * fs.createReadStream('archive.tar'), + * zlib.createGzip(), + * fs.createWriteStream('archive.tar.gz'), + * (err) => { + * if (err) { + * console.error('Pipeline failed.', err); + * } else { + * console.log('Pipeline succeeded.'); + * } + * } + * ); + * ``` + * + * The `pipeline` API provides a promise version, which can also + * receive an options argument as the last parameter with a`signal` `AbortSignal` property. When the signal is aborted,`destroy` will be called on the underlying pipeline, with + * an`AbortError`. + * + * ```js + * const { pipeline } = require('stream/promises'); + * + * async function run() { + * await pipeline( + * fs.createReadStream('archive.tar'), + * zlib.createGzip(), + * fs.createWriteStream('archive.tar.gz') + * ); + * console.log('Pipeline succeeded.'); + * } + * + * run().catch(console.error); + * ``` + * + * To use an `AbortSignal`, pass it inside an options object, + * as the last argument: + * + * ```js + * const { pipeline } = require('stream/promises'); + * + * async function run() { + * const ac = new AbortController(); + * const signal = ac.signal; + * + * setTimeout(() => ac.abort(), 1); + * await pipeline( + * fs.createReadStream('archive.tar'), + * zlib.createGzip(), + * fs.createWriteStream('archive.tar.gz'), + * { signal }, + * ); + * } + * + * run().catch(console.error); // AbortError + * ``` + * + * The `pipeline` API also supports async generators: + * + * ```js + * const { pipeline } = require('stream/promises'); + * const fs = require('fs'); + * + * async function run() { + * await pipeline( + * fs.createReadStream('lowercase.txt'), + * async function* (source, { signal }) { + * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s. + * for await (const chunk of source) { + * yield await processChunk(chunk, { signal }); + * } + * }, + * fs.createWriteStream('uppercase.txt') + * ); + * console.log('Pipeline succeeded.'); + * } + * + * run().catch(console.error); + * ``` + * + * Remember to handle the `signal` argument passed into the async generator. + * Especially in the case where the async generator is the source for the + * pipeline (i.e. first argument) or the pipeline will never complete. + * + * ```js + * const { pipeline } = require('stream/promises'); + * const fs = require('fs'); + * + * async function run() { + * await pipeline( + * async function* ({ signal }) { + * await someLongRunningfn({ signal }); + * yield 'asd'; + * }, + * fs.createWriteStream('uppercase.txt') + * ); + * console.log('Pipeline succeeded.'); + * } + * + * run().catch(console.error); + * ``` + * + * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: + * + * * `Readable` streams which have emitted `'end'` or `'close'`. + * * `Writable` streams which have emitted `'finish'` or `'close'`. + * + * `stream.pipeline()` leaves dangling event listeners on the streams + * after the `callback` has been invoked. In the case of reuse of streams after + * failure, this can cause event listener leaks and swallowed errors. If the last + * stream is readable, dangling event listeners will be removed so that the last + * stream can be consumed later. + * + * `stream.pipeline()` closes all the streams when an error is raised. + * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior + * once it would destroy the socket without sending the expected response. + * See the example below: + * + * ```js + * const fs = require('fs'); + * const http = require('http'); + * const { pipeline } = require('stream'); + * + * const server = http.createServer((req, res) => { + * const fileStream = fs.createReadStream('./fileNotExist.txt'); + * pipeline(fileStream, res, (err) => { + * if (err) { + * console.log(err); // No such file + * // this message can't be sent once `pipeline` already destroyed the socket + * return res.end('error!!!'); + * } + * }); + * }); + * ``` + * @since v10.0.0 + * @param callback Called when the pipeline is fully done. + */ + function pipeline, B extends PipelineDestination>( + source: A, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline( + streams: ReadonlyArray, + callback?: (err: NodeJS.ErrnoException | null) => void + ): NodeJS.WritableStream; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array void)> + ): NodeJS.WritableStream; + namespace pipeline { + function __promisify__, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__(streams: ReadonlyArray, options?: PipelineOptions): Promise; + function __promisify__( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array + ): Promise; + } + interface Pipe { + close(): void; + hasRef(): boolean; + ref(): void; + unref(): void; + } + + /** + * Returns whether the stream has encountered an error. + * @since v17.3.0 + */ + function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; + + /** + * Returns whether the stream is readable. + * @since v17.4.0 + */ + function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; + + const promises: typeof streamPromises; + const consumers: typeof streamConsumers; + } + export = internal; +} +declare module 'node:stream' { + import stream = require('stream'); + export = stream; +} diff --git a/server/node_modules/@types/node/ts4.8/stream/consumers.d.ts b/server/node_modules/@types/node/ts4.8/stream/consumers.d.ts new file mode 100755 index 0000000000..1ebf12e1fa --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/stream/consumers.d.ts @@ -0,0 +1,12 @@ +declare module 'stream/consumers' { + import { Blob as NodeBlob } from "node:buffer"; + import { Readable } from 'node:stream'; + function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; +} +declare module 'node:stream/consumers' { + export * from 'stream/consumers'; +} diff --git a/server/node_modules/@types/node/ts4.8/stream/promises.d.ts b/server/node_modules/@types/node/ts4.8/stream/promises.d.ts new file mode 100755 index 0000000000..b427073de5 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/stream/promises.d.ts @@ -0,0 +1,42 @@ +declare module 'stream/promises' { + import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream'; + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + function pipeline, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline(streams: ReadonlyArray, options?: PipelineOptions): Promise; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array + ): Promise; +} +declare module 'node:stream/promises' { + export * from 'stream/promises'; +} diff --git a/server/node_modules/@types/node/ts4.8/stream/web.d.ts b/server/node_modules/@types/node/ts4.8/stream/web.d.ts new file mode 100755 index 0000000000..f9ef0570dc --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/stream/web.d.ts @@ -0,0 +1,330 @@ +declare module 'stream/web' { + // stub module, pending copy&paste from .d.ts or manual impl + // copy from lib.dom.d.ts + interface ReadableWritablePair { + readable: ReadableStream; + /** + * Provides a convenient, chainable way of piping this readable stream + * through a transform stream (or any other { writable, readable } + * pair). It simply pipes the stream into the writable side of the + * supplied pair, and returns the readable side for further use. + * + * Piping a stream will lock it for the duration of the pipe, preventing + * any other consumer from acquiring a reader. + */ + writable: WritableStream; + } + interface StreamPipeOptions { + preventAbort?: boolean; + preventCancel?: boolean; + /** + * Pipes this readable stream to a given writable stream destination. + * The way in which the piping process behaves under various error + * conditions can be customized with a number of passed options. It + * returns a promise that fulfills when the piping process completes + * successfully, or rejects if any errors were encountered. + * + * Piping a stream will lock it for the duration of the pipe, preventing + * any other consumer from acquiring a reader. + * + * Errors and closures of the source and destination streams propagate + * as follows: + * + * An error in this source readable stream will abort destination, + * unless preventAbort is truthy. The returned promise will be rejected + * with the source's error, or with any error that occurs during + * aborting the destination. + * + * An error in destination will cancel this source readable stream, + * unless preventCancel is truthy. The returned promise will be rejected + * with the destination's error, or with any error that occurs during + * canceling the source. + * + * When this source readable stream closes, destination will be closed, + * unless preventClose is truthy. The returned promise will be fulfilled + * once this process completes, unless an error is encountered while + * closing the destination, in which case it will be rejected with that + * error. + * + * If destination starts out closed or closing, this source readable + * stream will be canceled, unless preventCancel is true. The returned + * promise will be rejected with an error indicating piping to a closed + * stream failed, or with any error that occurs during canceling the + * source. + * + * The signal option can be set to an AbortSignal to allow aborting an + * ongoing pipe operation via the corresponding AbortController. In this + * case, this source readable stream will be canceled, and destination + * aborted, unless the respective options preventCancel or preventAbort + * are set. + */ + preventClose?: boolean; + signal?: AbortSignal; + } + interface ReadableStreamGenericReader { + readonly closed: Promise; + cancel(reason?: any): Promise; + } + interface ReadableStreamDefaultReadValueResult { + done: false; + value: T; + } + interface ReadableStreamDefaultReadDoneResult { + done: true; + value?: undefined; + } + type ReadableStreamController = ReadableStreamDefaultController; + type ReadableStreamDefaultReadResult = ReadableStreamDefaultReadValueResult | ReadableStreamDefaultReadDoneResult; + interface ReadableByteStreamControllerCallback { + (controller: ReadableByteStreamController): void | PromiseLike; + } + interface UnderlyingSinkAbortCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSinkCloseCallback { + (): void | PromiseLike; + } + interface UnderlyingSinkStartCallback { + (controller: WritableStreamDefaultController): any; + } + interface UnderlyingSinkWriteCallback { + (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; + } + interface UnderlyingSourceCancelCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSourcePullCallback { + (controller: ReadableStreamController): void | PromiseLike; + } + interface UnderlyingSourceStartCallback { + (controller: ReadableStreamController): any; + } + interface TransformerFlushCallback { + (controller: TransformStreamDefaultController): void | PromiseLike; + } + interface TransformerStartCallback { + (controller: TransformStreamDefaultController): any; + } + interface TransformerTransformCallback { + (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; + } + interface UnderlyingByteSource { + autoAllocateChunkSize?: number; + cancel?: ReadableStreamErrorCallback; + pull?: ReadableByteStreamControllerCallback; + start?: ReadableByteStreamControllerCallback; + type: 'bytes'; + } + interface UnderlyingSource { + cancel?: UnderlyingSourceCancelCallback; + pull?: UnderlyingSourcePullCallback; + start?: UnderlyingSourceStartCallback; + type?: undefined; + } + interface UnderlyingSink { + abort?: UnderlyingSinkAbortCallback; + close?: UnderlyingSinkCloseCallback; + start?: UnderlyingSinkStartCallback; + type?: undefined; + write?: UnderlyingSinkWriteCallback; + } + interface ReadableStreamErrorCallback { + (reason: any): void | PromiseLike; + } + /** This Streams API interface represents a readable stream of byte data. */ + interface ReadableStream { + readonly locked: boolean; + cancel(reason?: any): Promise; + getReader(): ReadableStreamDefaultReader; + pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; + pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; + tee(): [ReadableStream, ReadableStream]; + values(options?: { preventCancel?: boolean }): AsyncIterableIterator; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + const ReadableStream: { + prototype: ReadableStream; + new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; + new (underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; + }; + interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { + read(): Promise>; + releaseLock(): void; + } + const ReadableStreamDefaultReader: { + prototype: ReadableStreamDefaultReader; + new (stream: ReadableStream): ReadableStreamDefaultReader; + }; + const ReadableStreamBYOBReader: any; + const ReadableStreamBYOBRequest: any; + interface ReadableByteStreamController { + readonly byobRequest: undefined; + readonly desiredSize: number | null; + close(): void; + enqueue(chunk: ArrayBufferView): void; + error(error?: any): void; + } + const ReadableByteStreamController: { + prototype: ReadableByteStreamController; + new (): ReadableByteStreamController; + }; + interface ReadableStreamDefaultController { + readonly desiredSize: number | null; + close(): void; + enqueue(chunk?: R): void; + error(e?: any): void; + } + const ReadableStreamDefaultController: { + prototype: ReadableStreamDefaultController; + new (): ReadableStreamDefaultController; + }; + interface Transformer { + flush?: TransformerFlushCallback; + readableType?: undefined; + start?: TransformerStartCallback; + transform?: TransformerTransformCallback; + writableType?: undefined; + } + interface TransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const TransformStream: { + prototype: TransformStream; + new (transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream; + }; + interface TransformStreamDefaultController { + readonly desiredSize: number | null; + enqueue(chunk?: O): void; + error(reason?: any): void; + terminate(): void; + } + const TransformStreamDefaultController: { + prototype: TransformStreamDefaultController; + new (): TransformStreamDefaultController; + }; + /** + * This Streams API interface provides a standard abstraction for writing + * streaming data to a destination, known as a sink. This object comes with + * built-in back pressure and queuing. + */ + interface WritableStream { + readonly locked: boolean; + abort(reason?: any): Promise; + close(): Promise; + getWriter(): WritableStreamDefaultWriter; + } + const WritableStream: { + prototype: WritableStream; + new (underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; + }; + /** + * This Streams API interface is the object returned by + * WritableStream.getWriter() and once created locks the < writer to the + * WritableStream ensuring that no other streams can write to the underlying + * sink. + */ + interface WritableStreamDefaultWriter { + readonly closed: Promise; + readonly desiredSize: number | null; + readonly ready: Promise; + abort(reason?: any): Promise; + close(): Promise; + releaseLock(): void; + write(chunk?: W): Promise; + } + const WritableStreamDefaultWriter: { + prototype: WritableStreamDefaultWriter; + new (stream: WritableStream): WritableStreamDefaultWriter; + }; + /** + * This Streams API interface represents a controller allowing control of a + * WritableStream's state. When constructing a WritableStream, the + * underlying sink is given a corresponding WritableStreamDefaultController + * instance to manipulate. + */ + interface WritableStreamDefaultController { + error(e?: any): void; + } + const WritableStreamDefaultController: { + prototype: WritableStreamDefaultController; + new (): WritableStreamDefaultController; + }; + interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; + } + interface QueuingStrategySize { + (chunk?: T): number; + } + interface QueuingStrategyInit { + /** + * Creates a new ByteLengthQueuingStrategy with the provided high water + * mark. + * + * Note that the provided high water mark will not be validated ahead of + * time. Instead, if it is negative, NaN, or not a number, the resulting + * ByteLengthQueuingStrategy will cause the corresponding stream + * constructor to throw. + */ + highWaterMark: number; + } + /** + * This Streams API interface provides a built-in byte length queuing + * strategy that can be used when constructing streams. + */ + interface ByteLengthQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + const ByteLengthQueuingStrategy: { + prototype: ByteLengthQueuingStrategy; + new (init: QueuingStrategyInit): ByteLengthQueuingStrategy; + }; + /** + * This Streams API interface provides a built-in byte length queuing + * strategy that can be used when constructing streams. + */ + interface CountQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + const CountQueuingStrategy: { + prototype: CountQueuingStrategy; + new (init: QueuingStrategyInit): CountQueuingStrategy; + }; + interface TextEncoderStream { + /** Returns "utf-8". */ + readonly encoding: 'utf-8'; + readonly readable: ReadableStream; + readonly writable: WritableStream; + readonly [Symbol.toStringTag]: string; + } + const TextEncoderStream: { + prototype: TextEncoderStream; + new (): TextEncoderStream; + }; + interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; + } + type BufferSource = ArrayBufferView | ArrayBuffer; + interface TextDecoderStream { + /** Returns encoding's name, lower cased. */ + readonly encoding: string; + /** Returns `true` if error mode is "fatal", and `false` otherwise. */ + readonly fatal: boolean; + /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ + readonly ignoreBOM: boolean; + readonly readable: ReadableStream; + readonly writable: WritableStream; + readonly [Symbol.toStringTag]: string; + } + const TextDecoderStream: { + prototype: TextDecoderStream; + new (label?: string, options?: TextDecoderOptions): TextDecoderStream; + }; +} +declare module 'node:stream/web' { + export * from 'stream/web'; +} diff --git a/server/node_modules/@types/node/ts4.8/string_decoder.d.ts b/server/node_modules/@types/node/ts4.8/string_decoder.d.ts new file mode 100755 index 0000000000..a585804111 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/string_decoder.d.ts @@ -0,0 +1,67 @@ +/** + * The `string_decoder` module provides an API for decoding `Buffer` objects into + * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 + * characters. It can be accessed using: + * + * ```js + * const { StringDecoder } = require('string_decoder'); + * ``` + * + * The following example shows the basic use of the `StringDecoder` class. + * + * ```js + * const { StringDecoder } = require('string_decoder'); + * const decoder = new StringDecoder('utf8'); + * + * const cent = Buffer.from([0xC2, 0xA2]); + * console.log(decoder.write(cent)); + * + * const euro = Buffer.from([0xE2, 0x82, 0xAC]); + * console.log(decoder.write(euro)); + * ``` + * + * When a `Buffer` instance is written to the `StringDecoder` instance, an + * internal buffer is used to ensure that the decoded string does not contain + * any incomplete multibyte characters. These are held in the buffer until the + * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. + * + * In the following example, the three UTF-8 encoded bytes of the European Euro + * symbol (`€`) are written over three separate operations: + * + * ```js + * const { StringDecoder } = require('string_decoder'); + * const decoder = new StringDecoder('utf8'); + * + * decoder.write(Buffer.from([0xE2])); + * decoder.write(Buffer.from([0x82])); + * console.log(decoder.end(Buffer.from([0xAC]))); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/string_decoder.js) + */ +declare module 'string_decoder' { + class StringDecoder { + constructor(encoding?: BufferEncoding); + /** + * Returns a decoded string, ensuring that any incomplete multibyte characters at + * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the + * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. + * @since v0.1.99 + * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. + */ + write(buffer: Buffer): string; + /** + * Returns any remaining input stored in the internal buffer as a string. Bytes + * representing incomplete UTF-8 and UTF-16 characters will be replaced with + * substitution characters appropriate for the character encoding. + * + * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. + * After `end()` is called, the `stringDecoder` object can be reused for new input. + * @since v0.9.3 + * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. + */ + end(buffer?: Buffer): string; + } +} +declare module 'node:string_decoder' { + export * from 'string_decoder'; +} diff --git a/server/node_modules/@types/node/ts4.8/test.d.ts b/server/node_modules/@types/node/ts4.8/test.d.ts new file mode 100755 index 0000000000..8e20710eca --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/test.d.ts @@ -0,0 +1,446 @@ +/** + * The `node:test` module provides a standalone testing module. + * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/test.js) + */ +declare module 'node:test' { + /** + * Programmatically start the test runner. + * @since v18.9.0 + * @param options Configuration options for running tests. + * @returns A {@link TapStream} that emits events about the test execution. + */ + function run(options?: RunOptions): TapStream; + + /** + * The `test()` function is the value imported from the test module. Each invocation of this + * function results in the creation of a test point in the TAP output. + * + * The {@link TestContext} object passed to the fn argument can be used to perform actions + * related to the current test. Examples include skipping the test, adding additional TAP + * diagnostic information, or creating subtests. + * + * `test()` returns a {@link Promise} that resolves once the test completes. The return value + * can usually be discarded for top level tests. However, the return value from subtests should + * be used to prevent the parent test from finishing first and cancelling the subtest as shown + * in the following example. + * + * ```js + * test('top level test', async (t) => { + * // The setTimeout() in the following subtest would cause it to outlive its + * // parent test if 'await' is removed on the next line. Once the parent test + * // completes, it will cancel any outstanding subtests. + * await t.test('longer running subtest', async (t) => { + * return new Promise((resolve, reject) => { + * setTimeout(resolve, 1000); + * }); + * }); + * }); + * ``` + * @since v18.0.0 + * @param name The name of the test, which is displayed when reporting test results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the test + * @param fn The function under test. The first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is + * passed as the second argument. Default: A no-op function. + * @returns A {@link Promise} resolved with `undefined` once the test completes. + */ + function test(name?: string, fn?: TestFn): Promise; + function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function test(options?: TestOptions, fn?: TestFn): Promise; + function test(fn?: TestFn): Promise; + + /** + * @since v18.6.0 + * @param name The name of the suite, which is displayed when reporting suite results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the suite + * @param fn The function under suite. Default: A no-op function. + */ + function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void; + function describe(name?: string, fn?: SuiteFn): void; + function describe(options?: TestOptions, fn?: SuiteFn): void; + function describe(fn?: SuiteFn): void; + namespace describe { + // Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`. + function skip(name?: string, options?: TestOptions, fn?: SuiteFn): void; + function skip(name?: string, fn?: SuiteFn): void; + function skip(options?: TestOptions, fn?: SuiteFn): void; + function skip(fn?: SuiteFn): void; + + // Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`. + function todo(name?: string, options?: TestOptions, fn?: SuiteFn): void; + function todo(name?: string, fn?: SuiteFn): void; + function todo(options?: TestOptions, fn?: SuiteFn): void; + function todo(fn?: SuiteFn): void; + } + + /** + * @since v18.6.0 + * @param name The name of the test, which is displayed when reporting test results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the test + * @param fn The function under test. If the test uses callbacks, the callback function is + * passed as the second argument. Default: A no-op function. + */ + function it(name?: string, options?: TestOptions, fn?: ItFn): void; + function it(name?: string, fn?: ItFn): void; + function it(options?: TestOptions, fn?: ItFn): void; + function it(fn?: ItFn): void; + namespace it { + // Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. + function skip(name?: string, options?: TestOptions, fn?: ItFn): void; + function skip(name?: string, fn?: ItFn): void; + function skip(options?: TestOptions, fn?: ItFn): void; + function skip(fn?: ItFn): void; + + // Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. + function todo(name?: string, options?: TestOptions, fn?: ItFn): void; + function todo(name?: string, fn?: ItFn): void; + function todo(options?: TestOptions, fn?: ItFn): void; + function todo(fn?: ItFn): void; + } + + /** + * The type of a function under test. The first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is passed as + * the second argument. + */ + type TestFn = (t: TestContext, done: (result?: any) => void) => any; + + /** + * The type of a function under Suite. + * If the test uses callbacks, the callback function is passed as an argument + */ + type SuiteFn = (done: (result?: any) => void) => void; + + /** + * The type of a function under test. + * If the test uses callbacks, the callback function is passed as an argument + */ + type ItFn = (done: (result?: any) => void) => any; + + interface RunOptions { + /** + * If a number is provided, then that many files would run in parallel. + * If truthy, it would run (number of cpu cores - 1) files in parallel. + * If falsy, it would only run one file at a time. + * If unspecified, subtests inherit this value from their parent. + * @default true + */ + concurrency?: number | boolean | undefined; + + /** + * An array containing the list of files to run. + * If unspecified, the test runner execution model will be used. + */ + files?: readonly string[] | undefined; + + /** + * Allows aborting an in-progress test execution. + * @default undefined + */ + signal?: AbortSignal | undefined; + + /** + * A number of milliseconds the test will fail after. + * If unspecified, subtests inherit this value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + + /** + * Sets inspector port of test child process. + * If a nullish value is provided, each process gets its own port, + * incremented from the primary's `process.debugPort`. + */ + inspectPort?: number | (() => number) | undefined; + } + + /** + * A successful call of the `run()` method will return a new `TapStream` object, + * streaming a [TAP](https://testanything.org/) output. + * `TapStream` will emit events in the order of the tests' definitions. + * @since v18.9.0 + */ + interface TapStream extends NodeJS.ReadableStream { + addListener(event: 'test:diagnostic', listener: (message: string) => void): this; + addListener(event: 'test:fail', listener: (data: TestFail) => void): this; + addListener(event: 'test:pass', listener: (data: TestPass) => void): this; + addListener(event: string, listener: (...args: any[]) => void): this; + emit(event: 'test:diagnostic', message: string): boolean; + emit(event: 'test:fail', data: TestFail): boolean; + emit(event: 'test:pass', data: TestPass): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'test:diagnostic', listener: (message: string) => void): this; + on(event: 'test:fail', listener: (data: TestFail) => void): this; + on(event: 'test:pass', listener: (data: TestPass) => void): this; + on(event: string, listener: (...args: any[]) => void): this; + once(event: 'test:diagnostic', listener: (message: string) => void): this; + once(event: 'test:fail', listener: (data: TestFail) => void): this; + once(event: 'test:pass', listener: (data: TestPass) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'test:diagnostic', listener: (message: string) => void): this; + prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; + prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'test:diagnostic', listener: (message: string) => void): this; + prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; + prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + } + + interface TestFail { + /** + * The test duration. + */ + duration: number; + + /** + * The failure casing test to fail. + */ + error: Error; + + /** + * The test name. + */ + name: string; + + /** + * The ordinal number of the test. + */ + testNumber: number; + + /** + * Present if `context.todo` is called. + */ + todo?: string; + + /** + * Present if `context.skip` is called. + */ + skip?: string; + } + + interface TestPass { + /** + * The test duration. + */ + duration: number; + + /** + * The test name. + */ + name: string; + + /** + * The ordinal number of the test. + */ + testNumber: number; + + /** + * Present if `context.todo` is called. + */ + todo?: string; + + /** + * Present if `context.skip` is called. + */ + skip?: string; + } + + /** + * An instance of `TestContext` is passed to each test function in order to interact with the + * test runner. However, the `TestContext` constructor is not exposed as part of the API. + * @since v18.0.0 + */ + interface TestContext { + /** + * This function is used to create a hook running before each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + beforeEach: typeof beforeEach; + + /** + * This function is used to create a hook running after each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + afterEach: typeof afterEach; + + /** + * This function is used to write TAP diagnostics to the output. Any diagnostic information is + * included at the end of the test's results. This function does not return a value. + * @param message Message to be displayed as a TAP diagnostic. + * @since v18.0.0 + */ + diagnostic(message: string): void; + + /** + * The name of the test. + * @since v18.8.0 + */ + readonly name: string; + + /** + * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only` + * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only` + * command-line option, this function is a no-op. + * @param shouldRunOnlyTests Whether or not to run `only` tests. + * @since v18.0.0 + */ + runOnly(shouldRunOnlyTests: boolean): void; + + /** + * Can be used to abort test subtasks when the test has been aborted. + * @since v18.7.0 + */ + readonly signal: AbortSignal; + + /** + * This function causes the test's output to indicate the test as skipped. If `message` is + * provided, it is included in the TAP output. Calling `skip()` does not terminate execution of + * the test function. This function does not return a value. + * @param message Optional skip message to be displayed in TAP output. + * @since v18.0.0 + */ + skip(message?: string): void; + + /** + * This function adds a `TODO` directive to the test's output. If `message` is provided, it is + * included in the TAP output. Calling `todo()` does not terminate execution of the test + * function. This function does not return a value. + * @param message Optional `TODO` message to be displayed in TAP output. + * @since v18.0.0 + */ + todo(message?: string): void; + + /** + * This function is used to create subtests under the current test. This function behaves in + * the same fashion as the top level {@link test} function. + * @since v18.0.0 + * @param name The name of the test, which is displayed when reporting test results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the test + * @param fn The function under test. This first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is + * passed as the second argument. Default: A no-op function. + * @returns A {@link Promise} resolved with `undefined` once the test completes. + */ + test: typeof test; + } + + interface TestOptions { + /** + * If a number is provided, then that many tests would run in parallel. + * If truthy, it would run (number of cpu cores - 1) tests in parallel. + * For subtests, it will be `Infinity` tests in parallel. + * If falsy, it would only run one test at a time. + * If unspecified, subtests inherit this value from their parent. + * @default false + */ + concurrency?: number | boolean | undefined; + + /** + * If truthy, and the test context is configured to run `only` tests, then this test will be + * run. Otherwise, the test is skipped. + * @default false + */ + only?: boolean | undefined; + + /** + * Allows aborting an in-progress test. + * @since v18.8.0 + */ + signal?: AbortSignal | undefined; + + /** + * If truthy, the test is skipped. If a string is provided, that string is displayed in the + * test results as the reason for skipping the test. + * @default false + */ + skip?: boolean | string | undefined; + + /** + * A number of milliseconds the test will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + * @since v18.7.0 + */ + timeout?: number | undefined; + + /** + * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in + * the test results as the reason why the test is `TODO`. + * @default false + */ + todo?: boolean | string | undefined; + } + + /** + * This function is used to create a hook running before running a suite. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + function before(fn?: HookFn, options?: HookOptions): void; + + /** + * This function is used to create a hook running after running a suite. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + function after(fn?: HookFn, options?: HookOptions): void; + + /** + * This function is used to create a hook running before each subtest of the current suite. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + function beforeEach(fn?: HookFn, options?: HookOptions): void; + + /** + * This function is used to create a hook running after each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + function afterEach(fn?: HookFn, options?: HookOptions): void; + + /** + * The hook function. If the hook uses callbacks, the callback function is passed as the + * second argument. + */ + type HookFn = (done: (result?: any) => void) => any; + + /** + * Configuration options for hooks. + * @since v18.8.0 + */ + interface HookOptions { + /** + * Allows aborting an in-progress hook. + */ + signal?: AbortSignal | undefined; + + /** + * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + } + + export { test as default, run, test, describe, it, before, after, beforeEach, afterEach }; +} diff --git a/server/node_modules/@types/node/ts4.8/timers.d.ts b/server/node_modules/@types/node/ts4.8/timers.d.ts new file mode 100755 index 0000000000..b26f3cedab --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/timers.d.ts @@ -0,0 +1,94 @@ +/** + * The `timer` module exposes a global API for scheduling functions to + * be called at some future period of time. Because the timer functions are + * globals, there is no need to call `require('timers')` to use the API. + * + * The timer functions within Node.js implement a similar API as the timers API + * provided by Web Browsers but use a different internal implementation that is + * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/timers.js) + */ +declare module 'timers' { + import { Abortable } from 'node:events'; + import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises'; + interface TimerOptions extends Abortable { + /** + * Set to `false` to indicate that the scheduled `Timeout` + * should not require the Node.js event loop to remain active. + * @default true + */ + ref?: boolean | undefined; + } + let setTimeout: typeof global.setTimeout; + let clearTimeout: typeof global.clearTimeout; + let setInterval: typeof global.setInterval; + let clearInterval: typeof global.clearInterval; + let setImmediate: typeof global.setImmediate; + let clearImmediate: typeof global.clearImmediate; + global { + namespace NodeJS { + // compatibility with older typings + interface Timer extends RefCounted { + hasRef(): boolean; + refresh(): this; + [Symbol.toPrimitive](): number; + } + interface Immediate extends RefCounted { + /** + * If true, the `Immediate` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + _onImmediate: Function; // to distinguish it from the Timeout class + } + interface Timeout extends Timer { + /** + * If true, the `Timeout` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + /** + * Sets the timer's start time to the current time, and reschedules the timer to + * call its callback at the previously specified duration adjusted to the current + * time. This is useful for refreshing a timer without allocating a new + * JavaScript object. + * + * Using this on a timer that has already called its callback will reactivate the + * timer. + * @since v10.2.0 + * @return a reference to `timeout` + */ + refresh(): this; + [Symbol.toPrimitive](): number; + } + } + function setTimeout(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; + namespace setTimeout { + const __promisify__: typeof setTimeoutPromise; + } + function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; + function setInterval(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer; + namespace setInterval { + const __promisify__: typeof setIntervalPromise; + } + function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; + function setImmediate(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setImmediate(callback: (args: void) => void): NodeJS.Immediate; + namespace setImmediate { + const __promisify__: typeof setImmediatePromise; + } + function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; + function queueMicrotask(callback: () => void): void; + } +} +declare module 'node:timers' { + export * from 'timers'; +} diff --git a/server/node_modules/@types/node/ts4.8/timers/promises.d.ts b/server/node_modules/@types/node/ts4.8/timers/promises.d.ts new file mode 100755 index 0000000000..c1450684d6 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/timers/promises.d.ts @@ -0,0 +1,93 @@ +/** + * The `timers/promises` API provides an alternative set of timer functions + * that return `Promise` objects. The API is accessible via`require('timers/promises')`. + * + * ```js + * import { + * setTimeout, + * setImmediate, + * setInterval, + * } from 'timers/promises'; + * ``` + * @since v15.0.0 + */ +declare module 'timers/promises' { + import { TimerOptions } from 'node:timers'; + /** + * ```js + * import { + * setTimeout, + * } from 'timers/promises'; + * + * const res = await setTimeout(100, 'result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. + * @param value A value with which the promise is fulfilled. + */ + function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; + /** + * ```js + * import { + * setImmediate, + * } from 'timers/promises'; + * + * const res = await setImmediate('result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param value A value with which the promise is fulfilled. + */ + function setImmediate(value?: T, options?: TimerOptions): Promise; + /** + * Returns an async iterator that generates values in an interval of `delay` ms. + * + * ```js + * import { + * setInterval, + * } from 'timers/promises'; + * + * const interval = 100; + * for await (const startTime of setInterval(interval, Date.now())) { + * const now = Date.now(); + * console.log(now); + * if ((now - startTime) > 1000) + * break; + * } + * console.log(Date.now()); + * ``` + * @since v15.9.0 + */ + function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; + + interface Scheduler { + /** + * ```js + * import { scheduler } from 'node:timers/promises'; + * + * await scheduler.wait(1000); // Wait one second before continuing + * ``` + * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. + * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported. + * @since v16.14.0 + * @experimental + * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. + */ + wait: (delay?: number, options?: TimerOptions) => Promise; + /** + * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. + * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments. + * @since v16.14.0 + * @experimental + */ + yield: () => Promise; + } + + const scheduler: Scheduler; +} +declare module 'node:timers/promises' { + export * from 'timers/promises'; +} diff --git a/server/node_modules/@types/node/ts4.8/tls.d.ts b/server/node_modules/@types/node/ts4.8/tls.d.ts new file mode 100755 index 0000000000..2cbc716580 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/tls.d.ts @@ -0,0 +1,1028 @@ +/** + * The `tls` module provides an implementation of the Transport Layer Security + * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. + * The module can be accessed using: + * + * ```js + * const tls = require('tls'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tls.js) + */ +declare module 'tls' { + import { X509Certificate } from 'node:crypto'; + import * as net from 'node:net'; + import * as stream from 'stream'; + const CLIENT_RENEG_LIMIT: number; + const CLIENT_RENEG_WINDOW: number; + interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + interface PeerCertificate { + subject: Certificate; + issuer: Certificate; + subjectaltname: string; + infoAccess: NodeJS.Dict; + modulus: string; + exponent: string; + valid_from: string; + valid_to: string; + fingerprint: string; + fingerprint256: string; + ext_key_usage: string[]; + serialNumber: string; + raw: Buffer; + } + interface DetailedPeerCertificate extends PeerCertificate { + issuerCertificate: DetailedPeerCertificate; + } + interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + /** + * IETF name for the cipher suite. + */ + standardName: string; + } + interface EphemeralKeyInfo { + /** + * The supported types are 'DH' and 'ECDH'. + */ + type: string; + /** + * The name property is available only when type is 'ECDH'. + */ + name?: string | undefined; + /** + * The size of parameter of an ephemeral key exchange. + */ + size: number; + } + interface KeyObject { + /** + * Private keys in PEM format. + */ + pem: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface PxfObject { + /** + * PFX or PKCS12 encoded private key and certificate chain. + */ + buf: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean | undefined; + /** + * An optional net.Server instance. + */ + server?: net.Server | undefined; + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer | undefined; + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean | undefined; + } + /** + * Performs transparent encryption of written data and all required TLS + * negotiation. + * + * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. + * + * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the + * connection is open. + * @since v0.11.4 + */ + class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket, options?: TLSSocketOptions); + /** + * This property is `true` if the peer certificate was signed by one of the CAs + * specified when creating the `tls.TLSSocket` instance, otherwise `false`. + * @since v0.11.4 + */ + authorized: boolean; + /** + * Returns the reason why the peer's certificate was not been verified. This + * property is set only when `tlsSocket.authorized === false`. + * @since v0.11.4 + */ + authorizationError: Error; + /** + * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. + * @since v0.11.4 + */ + encrypted: true; + /** + * String containing the selected ALPN protocol. + * Before a handshake has completed, this value is always null. + * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. + */ + alpnProtocol: string | false | null; + /** + * Returns an object representing the local certificate. The returned object has + * some properties corresponding to the fields of the certificate. + * + * See {@link TLSSocket.getPeerCertificate} for an example of the certificate + * structure. + * + * If there is no local certificate, an empty object will be returned. If the + * socket has been destroyed, `null` will be returned. + * @since v11.2.0 + */ + getCertificate(): PeerCertificate | object | null; + /** + * Returns an object containing information on the negotiated cipher suite. + * + * For example: + * + * ```json + * { + * "name": "AES128-SHA256", + * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", + * "version": "TLSv1.2" + * } + * ``` + * + * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. + * @since v0.11.4 + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the type, name, and size of parameter of + * an ephemeral key exchange in `perfect forward secrecy` on a client + * connection. It returns an empty object when the key exchange is not + * ephemeral. As this is only supported on a client socket; `null` is returned + * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. + * + * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. + * @since v5.0.0 + */ + getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. + */ + getFinished(): Buffer | undefined; + /** + * Returns an object representing the peer's certificate. If the peer does not + * provide a certificate, an empty object will be returned. If the socket has been + * destroyed, `null` will be returned. + * + * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's + * certificate. + * @since v0.11.4 + * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. + * @return A certificate object. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so + * far. + */ + getPeerFinished(): Buffer | undefined; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the + * current connection. The value `'unknown'` will be returned for connected + * sockets that have not completed the handshaking process. The value `null` will + * be returned for server sockets or disconnected client sockets. + * + * Protocol versions are: + * + * * `'SSLv3'` + * * `'TLSv1'` + * * `'TLSv1.1'` + * * `'TLSv1.2'` + * * `'TLSv1.3'` + * + * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. + * @since v5.7.0 + */ + getProtocol(): string | null; + /** + * Returns the TLS session data or `undefined` if no session was + * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful + * for debugging. + * + * See `Session Resumption` for more information. + * + * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications + * must use the `'session'` event (it also works for TLSv1.2 and below). + * @since v0.11.4 + */ + getSession(): Buffer | undefined; + /** + * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. + * @since v12.11.0 + * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. + */ + getSharedSigalgs(): string[]; + /** + * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. + * + * It may be useful for debugging. + * + * See `Session Resumption` for more information. + * @since v0.11.4 + */ + getTLSTicket(): Buffer | undefined; + /** + * See `Session Resumption` for more information. + * @since v0.5.6 + * @return `true` if the session was reused, `false` otherwise. + */ + isSessionReused(): boolean; + /** + * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. + * Upon completion, the `callback` function will be passed a single argument + * that is either an `Error` (if the request failed) or `null`. + * + * This method can be used to request a peer's certificate after the secure + * connection has been established. + * + * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. + * + * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the + * protocol. + * @since v0.11.8 + * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with + * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. + * @return `true` if renegotiation was initiated, `false` otherwise. + */ + renegotiate( + options: { + rejectUnauthorized?: boolean | undefined; + requestCert?: boolean | undefined; + }, + callback: (err: Error | null) => void + ): undefined | boolean; + /** + * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. + * Returns `true` if setting the limit succeeded; `false` otherwise. + * + * Smaller fragment sizes decrease the buffering latency on the client: larger + * fragments are buffered by the TLS layer until the entire fragment is received + * and its integrity is verified; large fragments can span multiple roundtrips + * and their processing can be delayed due to packet loss or reordering. However, + * smaller fragments add extra TLS framing bytes and CPU overhead, which may + * decrease overall server throughput. + * @since v0.11.11 + * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. + */ + setMaxSendFragment(size: number): boolean; + /** + * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts + * to renegotiate will trigger an `'error'` event on the `TLSSocket`. + * @since v8.4.0 + */ + disableRenegotiation(): void; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * + * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by + * OpenSSL's `SSL_trace()` function, the format is undocumented, can change + * without notice, and should not be relied on. + * @since v12.2.0 + */ + enableTrace(): void; + /** + * Returns the peer certificate as an `X509Certificate` object. + * + * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getPeerX509Certificate(): X509Certificate | undefined; + /** + * Returns the local certificate as an `X509Certificate` object. + * + * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getX509Certificate(): X509Certificate | undefined; + /** + * Keying material is used for validations to prevent different kind of attacks in + * network protocols, for example in the specifications of IEEE 802.1X. + * + * Example + * + * ```js + * const keyingMaterial = tlsSocket.exportKeyingMaterial( + * 128, + * 'client finished'); + * + * /* + * Example return value of keyingMaterial: + * + * + * ``` + * + * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more + * information. + * @since v13.10.0, v12.17.0 + * @param length number of bytes to retrieve from keying material + * @param label an application specific label, typically this will be a value from the [IANA Exporter Label + * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). + * @param context Optionally provide a context. + * @return requested bytes of the keying material + */ + exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + addListener(event: 'secureConnect', listener: () => void): this; + addListener(event: 'session', listener: (session: Buffer) => void): this; + addListener(event: 'keylog', listener: (line: Buffer) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'OCSPResponse', response: Buffer): boolean; + emit(event: 'secureConnect'): boolean; + emit(event: 'session', session: Buffer): boolean; + emit(event: 'keylog', line: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + on(event: 'secureConnect', listener: () => void): this; + on(event: 'session', listener: (session: Buffer) => void): this; + on(event: 'keylog', listener: (line: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + once(event: 'secureConnect', listener: () => void): this; + once(event: 'session', listener: (session: Buffer) => void): this; + once(event: 'keylog', listener: (line: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + prependListener(event: 'secureConnect', listener: () => void): this; + prependListener(event: 'session', listener: (session: Buffer) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + prependOnceListener(event: 'secureConnect', listener: () => void): this; + prependOnceListener(event: 'session', listener: (session: Buffer) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer) => void): this; + } + interface CommonConnectionOptions { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext | undefined; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * @default false + */ + enableTrace?: boolean | undefined; + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean | undefined; + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) + */ + ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. + * @default true + */ + rejectUnauthorized?: boolean | undefined; + } + interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { + /** + * Abort the connection if the SSL/TLS handshake does not finish in the + * specified number of milliseconds. A 'tlsClientError' is emitted on + * the tls.Server object whenever a handshake times out. Default: + * 120000 (120 seconds). + */ + handshakeTimeout?: number | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + */ + ticketKeys?: Buffer | undefined; + /** + * + * @param socket + * @param identity identity parameter sent from the client. + * @return pre-shared key that must either be + * a buffer or `null` to stop the negotiation process. Returned PSK must be + * compatible with the selected cipher's digest. + * + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with the identity provided by the client. + * If the return value is `null` the negotiation process will stop and an + * "unknown_psk_identity" alert message will be sent to the other party. + * If the server wishes to hide the fact that the PSK identity was not known, + * the callback must provide some random data as `psk` to make the connection + * fail with "decrypt_error" before negotiation is finished. + * PSK ciphers are disabled by default, and using TLS-PSK thus + * requires explicitly specifying a cipher suite with the `ciphers` option. + * More information can be found in the RFC 4279. + */ + pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; + /** + * hint to send to a client to help + * with selecting the identity during TLS-PSK negotiation. Will be ignored + * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be + * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. + */ + pskIdentityHint?: string | undefined; + } + interface PSKCallbackNegotation { + psk: DataView | NodeJS.TypedArray; + identity: string; + } + interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { + host?: string | undefined; + port?: number | undefined; + path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket + checkServerIdentity?: typeof checkServerIdentity | undefined; + servername?: string | undefined; // SNI TLS Extension + session?: Buffer | undefined; + minDHSize?: number | undefined; + lookup?: net.LookupFunction | undefined; + timeout?: number | undefined; + /** + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with optional identity `hint` provided by the server or `null` + * in case of TLS 1.3 where `hint` was removed. + * It will be necessary to provide a custom `tls.checkServerIdentity()` + * for the connection as the default one will try to check hostname/IP + * of the server against the certificate but that's not applicable for PSK + * because there won't be a certificate present. + * More information can be found in the RFC 4279. + * + * @param hint message sent from the server to help client + * decide which identity to use during negotiation. + * Always `null` if TLS 1.3 is used. + * @returns Return `null` to stop the negotiation process. `psk` must be + * compatible with the selected cipher's digest. + * `identity` must use UTF-8 encoding. + */ + pskCallback?(hint: string | null): PSKCallbackNegotation | null; + } + /** + * Accepts encrypted connections using TLS or SSL. + * @since v0.3.2 + */ + class Server extends net.Server { + constructor(secureConnectionListener?: (socket: TLSSocket) => void); + constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); + /** + * The `server.addContext()` method adds a secure context that will be used if + * the client request's SNI name matches the supplied `hostname` (or wildcard). + * + * When there are multiple matching contexts, the most recently added one is + * used. + * @since v0.5.3 + * @param hostname A SNI host name or wildcard (e.g. `'*'`) + * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). + */ + addContext(hostname: string, context: SecureContextOptions): void; + /** + * Returns the session ticket keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @return A 48-byte buffer containing the session ticket keys. + */ + getTicketKeys(): Buffer; + /** + * The `server.setSecureContext()` method replaces the secure context of an + * existing server. Existing connections to the server are not interrupted. + * @since v11.0.0 + * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). + */ + setSecureContext(options: SecureContextOptions): void; + /** + * Sets the session ticket keys. + * + * Changes to the ticket keys are effective only for future server connections. + * Existing or currently pending server connections will use the previous keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @param keys A 48-byte buffer containing the session ticket keys. + */ + setTicketKeys(keys: Buffer): void; + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + * 6. keylog + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean; + emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; + emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; + emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void): boolean; + emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean; + emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + } + /** + * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. + */ + interface SecurePair { + encrypted: TLSSocket; + cleartext: TLSSocket; + } + type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; + interface SecureContextOptions { + /** + * Optionally override the trusted CA certificates. Default is to trust + * the well-known CAs curated by Mozilla. Mozilla's CAs are completely + * replaced when CAs are explicitly specified using this option. + */ + ca?: string | Buffer | Array | undefined; + /** + * Cert chains in PEM format. One cert chain should be provided per + * private key. Each cert chain should consist of the PEM formatted + * certificate for a provided private key, followed by the PEM + * formatted intermediate certificates (if any), in order, and not + * including the root CA (the root CA must be pre-known to the peer, + * see ca). When providing multiple cert chains, they do not have to + * be in the same order as their private keys in key. If the + * intermediate certificates are not provided, the peer will not be + * able to validate the certificate, and the handshake will fail. + */ + cert?: string | Buffer | Array | undefined; + /** + * Colon-separated list of supported signature algorithms. The list + * can contain digest algorithms (SHA256, MD5 etc.), public key + * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g + * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). + */ + sigalgs?: string | undefined; + /** + * Cipher suite specification, replacing the default. For more + * information, see modifying the default cipher suite. Permitted + * ciphers can be obtained via tls.getCiphers(). Cipher names must be + * uppercased in order for OpenSSL to accept them. + */ + ciphers?: string | undefined; + /** + * Name of an OpenSSL engine which can provide the client certificate. + */ + clientCertEngine?: string | undefined; + /** + * PEM formatted CRLs (Certificate Revocation Lists). + */ + crl?: string | Buffer | Array | undefined; + /** + * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use + * openssl dhparam to create the parameters. The key length must be + * greater than or equal to 1024 bits or else an error will be thrown. + * Although 1024 bits is permissible, use 2048 bits or larger for + * stronger security. If omitted or invalid, the parameters are + * silently discarded and DHE ciphers will not be available. + */ + dhparam?: string | Buffer | undefined; + /** + * A string describing a named curve or a colon separated list of curve + * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key + * agreement. Set to auto to select the curve automatically. Use + * crypto.getCurves() to obtain a list of available curve names. On + * recent releases, openssl ecparam -list_curves will also display the + * name and description of each available elliptic curve. Default: + * tls.DEFAULT_ECDH_CURVE. + */ + ecdhCurve?: string | undefined; + /** + * Attempt to use the server's cipher suite preferences instead of the + * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be + * set in secureOptions + */ + honorCipherOrder?: boolean | undefined; + /** + * Private keys in PEM format. PEM allows the option of private keys + * being encrypted. Encrypted keys will be decrypted with + * options.passphrase. Multiple keys using different algorithms can be + * provided either as an array of unencrypted key strings or buffers, + * or an array of objects in the form {pem: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted keys will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + key?: string | Buffer | Array | undefined; + /** + * Name of an OpenSSL engine to get private key from. Should be used + * together with privateKeyIdentifier. + */ + privateKeyEngine?: string | undefined; + /** + * Identifier of a private key managed by an OpenSSL engine. Should be + * used together with privateKeyEngine. Should not be set together with + * key, because both options define a private key in different ways. + */ + privateKeyIdentifier?: string | undefined; + /** + * Optionally set the maximum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. + * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using + * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to + * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. + */ + maxVersion?: SecureVersion | undefined; + /** + * Optionally set the minimum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. It is not recommended to use + * less than TLSv1.2, but it may be required for interoperability. + * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using + * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to + * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. + */ + minVersion?: SecureVersion | undefined; + /** + * Shared passphrase used for a single private key and/or a PFX. + */ + passphrase?: string | undefined; + /** + * PFX or PKCS12 encoded private key and certificate chain. pfx is an + * alternative to providing key and cert individually. PFX is usually + * encrypted, if it is, passphrase will be used to decrypt it. Multiple + * PFX can be provided either as an array of unencrypted PFX buffers, + * or an array of objects in the form {buf: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted PFX will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + pfx?: string | Buffer | Array | undefined; + /** + * Optionally affect the OpenSSL protocol behavior, which is not + * usually necessary. This should be used carefully if at all! Value is + * a numeric bitmask of the SSL_OP_* options from OpenSSL Options + */ + secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options + /** + * Legacy mechanism to select the TLS protocol version to use, it does + * not support independent control of the minimum and maximum version, + * and does not support limiting the protocol to TLSv1.3. Use + * minVersion and maxVersion instead. The possible values are listed as + * SSL_METHODS, use the function names as strings. For example, use + * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow + * any TLS protocol version up to TLSv1.3. It is not recommended to use + * TLS versions less than 1.2, but it may be required for + * interoperability. Default: none, see minVersion. + */ + secureProtocol?: string | undefined; + /** + * Opaque identifier used by servers to ensure session state is not + * shared between applications. Unused by clients. + */ + sessionIdContext?: string | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + * See Session Resumption for more information. + */ + ticketKeys?: Buffer | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + } + interface SecureContext { + context: any; + } + /** + * Verifies the certificate `cert` is issued to `hostname`. + * + * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on + * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). + * + * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as + * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. + * + * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The + * overwriting function can call `tls.checkServerIdentity()` of course, to augment + * the checks done with additional verification. + * + * This function is only called if the certificate passed all other checks, such as + * being issued by trusted CA (`options.ca`). + * + * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name + * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use + * a custom`options.checkServerIdentity` function that implements the desired behavior. + * @since v0.8.4 + * @param hostname The host name or IP address to verify the certificate against. + * @param cert A `certificate object` representing the peer's certificate. + */ + function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; + /** + * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is + * automatically set as a listener for the `'secureConnection'` event. + * + * The `ticketKeys` options is automatically shared between `cluster` module + * workers. + * + * The following illustrates a simple echo server: + * + * ```js + * const tls = require('tls'); + * const fs = require('fs'); + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem'), + * + * // This is necessary only if using client certificate authentication. + * requestCert: true, + * + * // This is necessary only if the client uses a self-signed certificate. + * ca: [ fs.readFileSync('client-cert.pem') ] + * }; + * + * const server = tls.createServer(options, (socket) => { + * console.log('server connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * socket.write('welcome!\n'); + * socket.setEncoding('utf8'); + * socket.pipe(socket); + * }); + * server.listen(8000, () => { + * console.log('server bound'); + * }); + * ``` + * + * The server can be tested by connecting to it using the example client from {@link connect}. + * @since v0.3.2 + */ + function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; + function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + /** + * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. + * + * `tls.connect()` returns a {@link TLSSocket} object. + * + * Unlike the `https` API, `tls.connect()` does not enable the + * SNI (Server Name Indication) extension by default, which may cause some + * servers to return an incorrect certificate or reject the connection + * altogether. To enable SNI, set the `servername` option in addition + * to `host`. + * + * The following illustrates a client for the echo server example from {@link createServer}: + * + * ```js + * // Assumes an echo server that is listening on port 8000. + * const tls = require('tls'); + * const fs = require('fs'); + * + * const options = { + * // Necessary only if the server requires client certificate authentication. + * key: fs.readFileSync('client-key.pem'), + * cert: fs.readFileSync('client-cert.pem'), + * + * // Necessary only if the server uses a self-signed certificate. + * ca: [ fs.readFileSync('server-cert.pem') ], + * + * // Necessary only if the server's cert isn't for "localhost". + * checkServerIdentity: () => { return null; }, + * }; + * + * const socket = tls.connect(8000, options, () => { + * console.log('client connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * process.stdin.pipe(socket); + * process.stdin.resume(); + * }); + * socket.setEncoding('utf8'); + * socket.on('data', (data) => { + * console.log(data); + * }); + * socket.on('end', () => { + * console.log('server ends connection'); + * }); + * ``` + * @since v0.11.3 + */ + function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + /** + * Creates a new secure pair object with two streams, one of which reads and writes + * the encrypted data and the other of which reads and writes the cleartext data. + * Generally, the encrypted stream is piped to/from an incoming encrypted data + * stream and the cleartext one is used as a replacement for the initial encrypted + * stream. + * + * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. + * + * Using `cleartext` has the same API as {@link TLSSocket}. + * + * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: + * + * ```js + * pair = tls.createSecurePair(// ... ); + * pair.encrypted.pipe(socket); + * socket.pipe(pair.encrypted); + * ``` + * + * can be replaced by: + * + * ```js + * secureSocket = tls.TLSSocket(socket, options); + * ``` + * + * where `secureSocket` has the same API as `pair.cleartext`. + * @since v0.3.2 + * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. + * @param context A secure context object as returned by `tls.createSecureContext()` + * @param isServer `true` to specify that this TLS connection should be opened as a server. + * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. + * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. + */ + function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + /** + * {@link createServer} sets the default value of the `honorCipherOrder` option + * to `true`, other APIs that create secure contexts leave it unset. + * + * {@link createServer} uses a 128 bit truncated SHA1 hash value generated + * from `process.argv` as the default value of the `sessionIdContext` option, other + * APIs that create secure contexts have no default value. + * + * The `tls.createSecureContext()` method creates a `SecureContext` object. It is + * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods. + * + * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. + * + * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of + * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). + * @since v0.11.13 + */ + function createSecureContext(options?: SecureContextOptions): SecureContext; + /** + * Returns an array with the names of the supported TLS ciphers. The names are + * lower-case for historical reasons, but must be uppercased to be used in + * the `ciphers` option of {@link createSecureContext}. + * + * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. + * + * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for + * TLSv1.2 and below. + * + * ```js + * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] + * ``` + * @since v0.10.2 + */ + function getCiphers(): string[]; + /** + * The default curve name to use for ECDH key agreement in a tls server. + * The default value is 'auto'. See tls.createSecureContext() for further + * information. + */ + let DEFAULT_ECDH_CURVE: string; + /** + * The default value of the maxVersion option of + * tls.createSecureContext(). It can be assigned any of the supported TLS + * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: + * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets + * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the highest maximum + * is used. + */ + let DEFAULT_MAX_VERSION: SecureVersion; + /** + * The default value of the minVersion option of tls.createSecureContext(). + * It can be assigned any of the supported TLS protocol versions, + * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless + * changed using CLI options. Using --tls-min-v1.0 sets the default to + * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using + * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options + * are provided, the lowest minimum is used. + */ + let DEFAULT_MIN_VERSION: SecureVersion; + /** + * An immutable array of strings representing the root certificates (in PEM + * format) used for verifying peer certificates. This is the default value + * of the ca option to tls.createSecureContext(). + */ + const rootCertificates: ReadonlyArray; +} +declare module 'node:tls' { + export * from 'tls'; +} diff --git a/server/node_modules/@types/node/ts4.8/trace_events.d.ts b/server/node_modules/@types/node/ts4.8/trace_events.d.ts new file mode 100755 index 0000000000..d47aa9311e --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/trace_events.d.ts @@ -0,0 +1,171 @@ +/** + * The `trace_events` module provides a mechanism to centralize tracing information + * generated by V8, Node.js core, and userspace code. + * + * Tracing can be enabled with the `--trace-event-categories` command-line flag + * or by using the `trace_events` module. The `--trace-event-categories` flag + * accepts a list of comma-separated category names. + * + * The available categories are: + * + * * `node`: An empty placeholder. + * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. + * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. + * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. + * * `node.console`: Enables capture of `console.time()` and `console.count()`output. + * * `node.dns.native`: Enables capture of trace data for DNS queries. + * * `node.environment`: Enables capture of Node.js Environment milestones. + * * `node.fs.sync`: Enables capture of trace data for file system sync methods. + * * `node.perf`: Enables capture of `Performance API` measurements. + * * `node.perf.usertiming`: Enables capture of only Performance API User Timing + * measures and marks. + * * `node.perf.timerify`: Enables capture of only Performance API timerify + * measurements. + * * `node.promises.rejections`: Enables capture of trace data tracking the number + * of unhandled Promise rejections and handled-after-rejections. + * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. + * * `v8`: The `V8` events are GC, compiling, and execution related. + * + * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. + * + * ```bash + * node --trace-event-categories v8,node,node.async_hooks server.js + * ``` + * + * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be + * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. + * + * ```bash + * node --trace-events-enabled + * + * # is equivalent to + * + * node --trace-event-categories v8,node,node.async_hooks + * ``` + * + * Alternatively, trace events may be enabled using the `trace_events` module: + * + * ```js + * const trace_events = require('trace_events'); + * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); + * tracing.enable(); // Enable trace event capture for the 'node.perf' category + * + * // do work + * + * tracing.disable(); // Disable trace event capture for the 'node.perf' category + * ``` + * + * Running Node.js with tracing enabled will produce log files that can be opened + * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. + * + * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can + * be specified with `--trace-event-file-pattern` that accepts a template + * string that supports `${rotation}` and `${pid}`: + * + * ```bash + * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js + * ``` + * + * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers + * in your code, such as: + * + * ```js + * process.on('SIGINT', function onSigint() { + * console.info('Received SIGINT.'); + * process.exit(130); // Or applicable exit code depending on OS and signal + * }); + * ``` + * + * The tracing system uses the same time source + * as the one used by `process.hrtime()`. + * However the trace-event timestamps are expressed in microseconds, + * unlike `process.hrtime()` which returns nanoseconds. + * + * The features from this module are not available in `Worker` threads. + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js) + */ +declare module 'trace_events' { + /** + * The `Tracing` object is used to enable or disable tracing for sets of + * categories. Instances are created using the + * `trace_events.createTracing()` method. + * + * When created, the `Tracing` object is disabled. Calling the + * `tracing.enable()` method adds the categories to the set of enabled trace + * event categories. Calling `tracing.disable()` will remove the categories + * from the set of enabled trace event categories. + */ + interface Tracing { + /** + * A comma-separated list of the trace event categories covered by this + * `Tracing` object. + */ + readonly categories: string; + /** + * Disables this `Tracing` object. + * + * Only trace event categories _not_ covered by other enabled `Tracing` + * objects and _not_ specified by the `--trace-event-categories` flag + * will be disabled. + */ + disable(): void; + /** + * Enables this `Tracing` object for the set of categories covered by + * the `Tracing` object. + */ + enable(): void; + /** + * `true` only if the `Tracing` object has been enabled. + */ + readonly enabled: boolean; + } + interface CreateTracingOptions { + /** + * An array of trace category names. Values included in the array are + * coerced to a string when possible. An error will be thrown if the + * value cannot be coerced. + */ + categories: string[]; + } + /** + * Creates and returns a `Tracing` object for the given set of `categories`. + * + * ```js + * const trace_events = require('trace_events'); + * const categories = ['node.perf', 'node.async_hooks']; + * const tracing = trace_events.createTracing({ categories }); + * tracing.enable(); + * // do stuff + * tracing.disable(); + * ``` + * @since v10.0.0 + * @return . + */ + function createTracing(options: CreateTracingOptions): Tracing; + /** + * Returns a comma-separated list of all currently-enabled trace event + * categories. The current set of enabled trace event categories is determined + * by the _union_ of all currently-enabled `Tracing` objects and any categories + * enabled using the `--trace-event-categories` flag. + * + * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. + * + * ```js + * const trace_events = require('trace_events'); + * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); + * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); + * const t3 = trace_events.createTracing({ categories: ['v8'] }); + * + * t1.enable(); + * t2.enable(); + * + * console.log(trace_events.getEnabledCategories()); + * ``` + * @since v10.0.0 + */ + function getEnabledCategories(): string | undefined; +} +declare module 'node:trace_events' { + export * from 'trace_events'; +} diff --git a/server/node_modules/@types/node/ts4.8/tty.d.ts b/server/node_modules/@types/node/ts4.8/tty.d.ts new file mode 100755 index 0000000000..6473f8db7c --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/tty.d.ts @@ -0,0 +1,206 @@ +/** + * The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. + * In most cases, it will not be necessary or possible to use this module directly. + * However, it can be accessed using: + * + * ```js + * const tty = require('tty'); + * ``` + * + * When Node.js detects that it is being run with a text terminal ("TTY") + * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by + * default, be instances of `tty.WriteStream`. The preferred method of determining + * whether Node.js is being run within a TTY context is to check that the value of + * the `process.stdout.isTTY` property is `true`: + * + * ```console + * $ node -p -e "Boolean(process.stdout.isTTY)" + * true + * $ node -p -e "Boolean(process.stdout.isTTY)" | cat + * false + * ``` + * + * In most cases, there should be little to no reason for an application to + * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes. + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tty.js) + */ +declare module 'tty' { + import * as net from 'node:net'; + /** + * The `tty.isatty()` method returns `true` if the given `fd` is associated with + * a TTY and `false` if it is not, including whenever `fd` is not a non-negative + * integer. + * @since v0.5.8 + * @param fd A numeric file descriptor + */ + function isatty(fd: number): boolean; + /** + * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js + * process and there should be no reason to create additional instances. + * @since v0.5.8 + */ + class ReadStream extends net.Socket { + constructor(fd: number, options?: net.SocketConstructorOpts); + /** + * A `boolean` that is `true` if the TTY is currently configured to operate as a + * raw device. Defaults to `false`. + * @since v0.7.7 + */ + isRaw: boolean; + /** + * Allows configuration of `tty.ReadStream` so that it operates as a raw device. + * + * When in raw mode, input is always available character-by-character, not + * including modifiers. Additionally, all special processing of characters by the + * terminal is disabled, including echoing input + * characters. Ctrl+C will no longer cause a `SIGINT` when + * in this mode. + * @since v0.7.7 + * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` + * property will be set to the resulting mode. + * @return The read stream instance. + */ + setRawMode(mode: boolean): this; + /** + * A `boolean` that is always `true` for `tty.ReadStream` instances. + * @since v0.5.8 + */ + isTTY: boolean; + } + /** + * -1 - to the left from cursor + * 0 - the entire line + * 1 - to the right from cursor + */ + type Direction = -1 | 0 | 1; + /** + * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there + * should be no reason to create additional instances. + * @since v0.5.8 + */ + class WriteStream extends net.Socket { + constructor(fd: number); + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'resize', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'resize'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'resize', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'resize', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'resize', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'resize', listener: () => void): this; + /** + * `writeStream.clearLine()` clears the current line of this `WriteStream` in a + * direction identified by `dir`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + clearLine(dir: Direction, callback?: () => void): boolean; + /** + * `writeStream.clearScreenDown()` clears this `WriteStream` from the current + * cursor down. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + clearScreenDown(callback?: () => void): boolean; + /** + * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified + * position. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + cursorTo(x: number, y?: number, callback?: () => void): boolean; + cursorTo(x: number, callback: () => void): boolean; + /** + * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its + * current position. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + moveCursor(dx: number, dy: number, callback?: () => void): boolean; + /** + * Returns: + * + * * `1` for 2, + * * `4` for 16, + * * `8` for 256, + * * `24` for 16,777,216 colors supported. + * + * Use this to determine what colors the terminal supports. Due to the nature of + * colors in terminals it is possible to either have false positives or false + * negatives. It depends on process information and the environment variables that + * may lie about what terminal is used. + * It is possible to pass in an `env` object to simulate the usage of a specific + * terminal. This can be useful to check how specific environment settings behave. + * + * To enforce a specific color support, use one of the below environment settings. + * + * * 2 colors: `FORCE_COLOR = 0` (Disables colors) + * * 16 colors: `FORCE_COLOR = 1` + * * 256 colors: `FORCE_COLOR = 2` + * * 16,777,216 colors: `FORCE_COLOR = 3` + * + * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables. + * @since v9.9.0 + * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. + */ + getColorDepth(env?: object): number; + /** + * Returns `true` if the `writeStream` supports at least as many colors as provided + * in `count`. Minimum support is 2 (black and white). + * + * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. + * + * ```js + * process.stdout.hasColors(); + * // Returns true or false depending on if `stdout` supports at least 16 colors. + * process.stdout.hasColors(256); + * // Returns true or false depending on if `stdout` supports at least 256 colors. + * process.stdout.hasColors({ TMUX: '1' }); + * // Returns true. + * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); + * // Returns false (the environment setting pretends to support 2 ** 8 colors). + * ``` + * @since v11.13.0, v10.16.0 + * @param [count=16] The number of colors that are requested (minimum 2). + * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. + */ + hasColors(count?: number): boolean; + hasColors(env?: object): boolean; + hasColors(count: number, env?: object): boolean; + /** + * `writeStream.getWindowSize()` returns the size of the TTY + * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number + * of columns and rows in the corresponding TTY. + * @since v0.7.7 + */ + getWindowSize(): [number, number]; + /** + * A `number` specifying the number of columns the TTY currently has. This property + * is updated whenever the `'resize'` event is emitted. + * @since v0.7.7 + */ + columns: number; + /** + * A `number` specifying the number of rows the TTY currently has. This property + * is updated whenever the `'resize'` event is emitted. + * @since v0.7.7 + */ + rows: number; + /** + * A `boolean` that is always `true`. + * @since v0.5.8 + */ + isTTY: boolean; + } +} +declare module 'node:tty' { + export * from 'tty'; +} diff --git a/server/node_modules/@types/node/ts4.8/url.d.ts b/server/node_modules/@types/node/ts4.8/url.d.ts new file mode 100755 index 0000000000..e172acbf54 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/url.d.ts @@ -0,0 +1,897 @@ +/** + * The `url` module provides utilities for URL resolution and parsing. It can be + * accessed using: + * + * ```js + * import url from 'url'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/url.js) + */ +declare module 'url' { + import { Blob as NodeBlob } from 'node:buffer'; + import { ClientRequestArgs } from 'node:http'; + import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring'; + // Input to `url.format` + interface UrlObject { + auth?: string | null | undefined; + hash?: string | null | undefined; + host?: string | null | undefined; + hostname?: string | null | undefined; + href?: string | null | undefined; + pathname?: string | null | undefined; + protocol?: string | null | undefined; + search?: string | null | undefined; + slashes?: boolean | null | undefined; + port?: string | number | null | undefined; + query?: string | null | ParsedUrlQueryInput | undefined; + } + // Output of `url.parse` + interface Url { + auth: string | null; + hash: string | null; + host: string | null; + hostname: string | null; + href: string; + path: string | null; + pathname: string | null; + protocol: string | null; + search: string | null; + slashes: boolean | null; + port: string | null; + query: string | null | ParsedUrlQuery; + } + interface UrlWithParsedQuery extends Url { + query: ParsedUrlQuery; + } + interface UrlWithStringQuery extends Url { + query: string | null; + } + /** + * The `url.parse()` method takes a URL string, parses it, and returns a URL + * object. + * + * A `TypeError` is thrown if `urlString` is not a string. + * + * A `URIError` is thrown if the `auth` property is present but cannot be decoded. + * + * Use of the legacy `url.parse()` method is discouraged. Users should + * use the WHATWG `URL` API. Because the `url.parse()` method uses a + * lenient, non-standard algorithm for parsing URL strings, security + * issues can be introduced. Specifically, issues with [host name spoofing](https://hackerone.com/reports/678487) and + * incorrect handling of usernames and passwords have been identified. + * + * Deprecation of this API has been shelved for now primarily due to the the + * inability of the [WHATWG API to parse relative URLs](https://github.com/nodejs/node/issues/12682#issuecomment-1154492373). + * [Discussions are ongoing](https://github.com/whatwg/url/issues/531) for the best way to resolve this. + * + * @since v0.1.25 + * @param urlString The URL string to parse. + * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property + * on the returned URL object will be an unparsed, undecoded string. + * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the + * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. + */ + function parse(urlString: string): UrlWithStringQuery; + function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; + function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; + function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; + /** + * The `url.format()` method returns a formatted URL string derived from`urlObject`. + * + * ```js + * const url = require('url'); + * url.format({ + * protocol: 'https', + * hostname: 'example.com', + * pathname: '/some/path', + * query: { + * page: 1, + * format: 'json' + * } + * }); + * + * // => 'https://example.com/some/path?page=1&format=json' + * ``` + * + * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. + * + * The formatting process operates as follows: + * + * * A new empty string `result` is created. + * * If `urlObject.protocol` is a string, it is appended as-is to `result`. + * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. + * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII + * colon (`:`) character, the literal string `:` will be appended to `result`. + * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: + * * `urlObject.slashes` property is true; + * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; + * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string + * and appended to `result`followed by the literal string `@`. + * * If the `urlObject.host` property is `undefined` then: + * * If the `urlObject.hostname` is a string, it is appended to `result`. + * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, + * an `Error` is thrown. + * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: + * * The literal string `:` is appended to `result`, and + * * The value of `urlObject.port` is coerced to a string and appended to`result`. + * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. + * * If the `urlObject.pathname` property is a string that is not an empty string: + * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash + * (`/`), then the literal string `'/'` is appended to `result`. + * * The value of `urlObject.pathname` is appended to `result`. + * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the + * `querystring` module's `stringify()`method passing the value of `urlObject.query`. + * * Otherwise, if `urlObject.search` is a string: + * * If the value of `urlObject.search`_does not start_ with the ASCII question + * mark (`?`) character, the literal string `?` is appended to `result`. + * * The value of `urlObject.search` is appended to `result`. + * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.hash` property is a string: + * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) + * character, the literal string `#` is appended to `result`. + * * The value of `urlObject.hash` is appended to `result`. + * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a + * string, an `Error` is thrown. + * * `result` is returned. + * @since v0.1.25 + * @deprecated Legacy: Use the WHATWG URL API instead. + * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. + */ + function format(urlObject: URL, options?: URLFormatOptions): string; + /** + * The `url.format()` method returns a formatted URL string derived from`urlObject`. + * + * ```js + * const url = require('url'); + * url.format({ + * protocol: 'https', + * hostname: 'example.com', + * pathname: '/some/path', + * query: { + * page: 1, + * format: 'json' + * } + * }); + * + * // => 'https://example.com/some/path?page=1&format=json' + * ``` + * + * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. + * + * The formatting process operates as follows: + * + * * A new empty string `result` is created. + * * If `urlObject.protocol` is a string, it is appended as-is to `result`. + * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. + * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII + * colon (`:`) character, the literal string `:` will be appended to `result`. + * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: + * * `urlObject.slashes` property is true; + * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; + * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string + * and appended to `result`followed by the literal string `@`. + * * If the `urlObject.host` property is `undefined` then: + * * If the `urlObject.hostname` is a string, it is appended to `result`. + * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, + * an `Error` is thrown. + * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: + * * The literal string `:` is appended to `result`, and + * * The value of `urlObject.port` is coerced to a string and appended to`result`. + * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. + * * If the `urlObject.pathname` property is a string that is not an empty string: + * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash + * (`/`), then the literal string `'/'` is appended to `result`. + * * The value of `urlObject.pathname` is appended to `result`. + * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the + * `querystring` module's `stringify()`method passing the value of `urlObject.query`. + * * Otherwise, if `urlObject.search` is a string: + * * If the value of `urlObject.search`_does not start_ with the ASCII question + * mark (`?`) character, the literal string `?` is appended to `result`. + * * The value of `urlObject.search` is appended to `result`. + * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.hash` property is a string: + * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) + * character, the literal string `#` is appended to `result`. + * * The value of `urlObject.hash` is appended to `result`. + * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a + * string, an `Error` is thrown. + * * `result` is returned. + * @since v0.1.25 + * @deprecated Legacy: Use the WHATWG URL API instead. + * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. + */ + function format(urlObject: UrlObject | string): string; + /** + * The `url.resolve()` method resolves a target URL relative to a base URL in a + * manner similar to that of a web browser resolving an anchor tag. + * + * ```js + * const url = require('url'); + * url.resolve('/one/two/three', 'four'); // '/one/two/four' + * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' + * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' + * ``` + * + * To achieve the same result using the WHATWG URL API: + * + * ```js + * function resolve(from, to) { + * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); + * if (resolvedUrl.protocol === 'resolve:') { + * // `from` is a relative URL. + * const { pathname, search, hash } = resolvedUrl; + * return pathname + search + hash; + * } + * return resolvedUrl.toString(); + * } + * + * resolve('/one/two/three', 'four'); // '/one/two/four' + * resolve('http://example.com/', '/one'); // 'http://example.com/one' + * resolve('http://example.com/one', '/two'); // 'http://example.com/two' + * ``` + * @since v0.1.25 + * @deprecated Legacy: Use the WHATWG URL API instead. + * @param from The base URL to use if `to` is a relative URL. + * @param to The target URL to resolve. + */ + function resolve(from: string, to: string): string; + /** + * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an + * invalid domain, the empty string is returned. + * + * It performs the inverse operation to {@link domainToUnicode}. + * + * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged. + * + * ```js + * import url from 'url'; + * + * console.log(url.domainToASCII('español.com')); + * // Prints xn--espaol-zwa.com + * console.log(url.domainToASCII('中文.com')); + * // Prints xn--fiq228c.com + * console.log(url.domainToASCII('xn--iñvalid.com')); + * // Prints an empty string + * ``` + * @since v7.4.0, v6.13.0 + */ + function domainToASCII(domain: string): string; + /** + * Returns the Unicode serialization of the `domain`. If `domain` is an invalid + * domain, the empty string is returned. + * + * It performs the inverse operation to {@link domainToASCII}. + * + * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged. + * + * ```js + * import url from 'url'; + * + * console.log(url.domainToUnicode('xn--espaol-zwa.com')); + * // Prints español.com + * console.log(url.domainToUnicode('xn--fiq228c.com')); + * // Prints 中文.com + * console.log(url.domainToUnicode('xn--iñvalid.com')); + * // Prints an empty string + * ``` + * @since v7.4.0, v6.13.0 + */ + function domainToUnicode(domain: string): string; + /** + * This function ensures the correct decodings of percent-encoded characters as + * well as ensuring a cross-platform valid absolute path string. + * + * ```js + * import { fileURLToPath } from 'url'; + * + * const __filename = fileURLToPath(import.meta.url); + * + * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ + * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) + * + * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt + * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) + * + * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt + * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) + * + * new URL('file:///hello world').pathname; // Incorrect: /hello%20world + * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) + * ``` + * @since v10.12.0 + * @param url The file URL string or URL object to convert to a path. + * @return The fully-resolved platform-specific Node.js file path. + */ + function fileURLToPath(url: string | URL): string; + /** + * This function ensures that `path` is resolved absolutely, and that the URL + * control characters are correctly encoded when converting into a File URL. + * + * ```js + * import { pathToFileURL } from 'url'; + * + * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 + * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) + * + * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c + * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) + * ``` + * @since v10.12.0 + * @param path The path to convert to a File URL. + * @return The file URL object. + */ + function pathToFileURL(path: string): URL; + /** + * This utility function converts a URL object into an ordinary options object as + * expected by the `http.request()` and `https.request()` APIs. + * + * ```js + * import { urlToHttpOptions } from 'url'; + * const myURL = new URL('https://a:b@測試?abc#foo'); + * + * console.log(urlToHttpOptions(myURL)); + * /* + * { + * protocol: 'https:', + * hostname: 'xn--g6w251d', + * hash: '#foo', + * search: '?abc', + * pathname: '/', + * path: '/?abc', + * href: 'https://a:b@xn--g6w251d/?abc#foo', + * auth: 'a:b' + * } + * + * ``` + * @since v15.7.0, v14.18.0 + * @param url The `WHATWG URL` object to convert to an options object. + * @return Options object + */ + function urlToHttpOptions(url: URL): ClientRequestArgs; + interface URLFormatOptions { + auth?: boolean | undefined; + fragment?: boolean | undefined; + search?: boolean | undefined; + unicode?: boolean | undefined; + } + /** + * Browser-compatible `URL` class, implemented by following the WHATWG URL + * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. + * The `URL` class is also available on the global object. + * + * In accordance with browser conventions, all properties of `URL` objects + * are implemented as getters and setters on the class prototype, rather than as + * data properties on the object itself. Thus, unlike `legacy urlObject` s, + * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still + * return `true`. + * @since v7.0.0, v6.13.0 + */ + class URL { + /** + * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. + * + * ```js + * const { + * Blob, + * resolveObjectURL, + * } = require('buffer'); + * + * const blob = new Blob(['hello']); + * const id = URL.createObjectURL(blob); + * + * // later... + * + * const otherBlob = resolveObjectURL(id); + * console.log(otherBlob.size); + * ``` + * + * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it. + * + * `Blob` objects are registered within the current thread. If using Worker + * Threads, `Blob` objects registered within one Worker will not be available + * to other workers or the main thread. + * @since v16.7.0 + * @experimental + */ + static createObjectURL(blob: NodeBlob): string; + /** + * Removes the stored `Blob` identified by the given ID. Attempting to revoke a + * ID that isn’t registered will silently fail. + * @since v16.7.0 + * @experimental + * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. + */ + static revokeObjectURL(objectUrl: string): void; + constructor(input: string, base?: string | URL); + /** + * Gets and sets the fragment portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org/foo#bar'); + * console.log(myURL.hash); + * // Prints #bar + * + * myURL.hash = 'baz'; + * console.log(myURL.href); + * // Prints https://example.org/foo#baz + * ``` + * + * Invalid URL characters included in the value assigned to the `hash` property + * are `percent-encoded`. The selection of which characters to + * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + hash: string; + /** + * Gets and sets the host portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org:81/foo'); + * console.log(myURL.host); + * // Prints example.org:81 + * + * myURL.host = 'example.com:82'; + * console.log(myURL.href); + * // Prints https://example.com:82/foo + * ``` + * + * Invalid host values assigned to the `host` property are ignored. + */ + host: string; + /** + * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the + * port. + * + * ```js + * const myURL = new URL('https://example.org:81/foo'); + * console.log(myURL.hostname); + * // Prints example.org + * + * // Setting the hostname does not change the port + * myURL.hostname = 'example.com:82'; + * console.log(myURL.href); + * // Prints https://example.com:81/foo + * + * // Use myURL.host to change the hostname and port + * myURL.host = 'example.org:82'; + * console.log(myURL.href); + * // Prints https://example.org:82/foo + * ``` + * + * Invalid host name values assigned to the `hostname` property are ignored. + */ + hostname: string; + /** + * Gets and sets the serialized URL. + * + * ```js + * const myURL = new URL('https://example.org/foo'); + * console.log(myURL.href); + * // Prints https://example.org/foo + * + * myURL.href = 'https://example.com/bar'; + * console.log(myURL.href); + * // Prints https://example.com/bar + * ``` + * + * Getting the value of the `href` property is equivalent to calling {@link toString}. + * + * Setting the value of this property to a new value is equivalent to creating a + * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified. + * + * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown. + */ + href: string; + /** + * Gets the read-only serialization of the URL's origin. + * + * ```js + * const myURL = new URL('https://example.org/foo/bar?baz'); + * console.log(myURL.origin); + * // Prints https://example.org + * ``` + * + * ```js + * const idnURL = new URL('https://測試'); + * console.log(idnURL.origin); + * // Prints https://xn--g6w251d + * + * console.log(idnURL.hostname); + * // Prints xn--g6w251d + * ``` + */ + readonly origin: string; + /** + * Gets and sets the password portion of the URL. + * + * ```js + * const myURL = new URL('https://abc:xyz@example.com'); + * console.log(myURL.password); + * // Prints xyz + * + * myURL.password = '123'; + * console.log(myURL.href); + * // Prints https://abc:123@example.com + * ``` + * + * Invalid URL characters included in the value assigned to the `password` property + * are `percent-encoded`. The selection of which characters to + * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + password: string; + /** + * Gets and sets the path portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org/abc/xyz?123'); + * console.log(myURL.pathname); + * // Prints /abc/xyz + * + * myURL.pathname = '/abcdef'; + * console.log(myURL.href); + * // Prints https://example.org/abcdef?123 + * ``` + * + * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters + * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + pathname: string; + /** + * Gets and sets the port portion of the URL. + * + * The port value may be a number or a string containing a number in the range`0` to `65535` (inclusive). Setting the value to the default port of the`URL` objects given `protocol` will + * result in the `port` value becoming + * the empty string (`''`). + * + * The port value can be an empty string in which case the port depends on + * the protocol/scheme: + * + * + * + * Upon assigning a value to the port, the value will first be converted to a + * string using `.toString()`. + * + * If that string is invalid but it begins with a number, the leading number is + * assigned to `port`. + * If the number lies outside the range denoted above, it is ignored. + * + * ```js + * const myURL = new URL('https://example.org:8888'); + * console.log(myURL.port); + * // Prints 8888 + * + * // Default ports are automatically transformed to the empty string + * // (HTTPS protocol's default port is 443) + * myURL.port = '443'; + * console.log(myURL.port); + * // Prints the empty string + * console.log(myURL.href); + * // Prints https://example.org/ + * + * myURL.port = 1234; + * console.log(myURL.port); + * // Prints 1234 + * console.log(myURL.href); + * // Prints https://example.org:1234/ + * + * // Completely invalid port strings are ignored + * myURL.port = 'abcd'; + * console.log(myURL.port); + * // Prints 1234 + * + * // Leading numbers are treated as a port number + * myURL.port = '5678abcd'; + * console.log(myURL.port); + * // Prints 5678 + * + * // Non-integers are truncated + * myURL.port = 1234.5678; + * console.log(myURL.port); + * // Prints 1234 + * + * // Out-of-range numbers which are not represented in scientific notation + * // will be ignored. + * myURL.port = 1e10; // 10000000000, will be range-checked as described below + * console.log(myURL.port); + * // Prints 1234 + * ``` + * + * Numbers which contain a decimal point, + * such as floating-point numbers or numbers in scientific notation, + * are not an exception to this rule. + * Leading numbers up to the decimal point will be set as the URL's port, + * assuming they are valid: + * + * ```js + * myURL.port = 4.567e21; + * console.log(myURL.port); + * // Prints 4 (because it is the leading number in the string '4.567e21') + * ``` + */ + port: string; + /** + * Gets and sets the protocol portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org'); + * console.log(myURL.protocol); + * // Prints https: + * + * myURL.protocol = 'ftp'; + * console.log(myURL.href); + * // Prints ftp://example.org/ + * ``` + * + * Invalid URL protocol values assigned to the `protocol` property are ignored. + */ + protocol: string; + /** + * Gets and sets the serialized query portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org/abc?123'); + * console.log(myURL.search); + * // Prints ?123 + * + * myURL.search = 'abc=xyz'; + * console.log(myURL.href); + * // Prints https://example.org/abc?abc=xyz + * ``` + * + * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which + * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + search: string; + /** + * Gets the `URLSearchParams` object representing the query parameters of the + * URL. This property is read-only but the `URLSearchParams` object it provides + * can be used to mutate the URL instance; to replace the entirety of query + * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. + * + * Use care when using `.searchParams` to modify the `URL` because, + * per the WHATWG specification, the `URLSearchParams` object uses + * different rules to determine which characters to percent-encode. For + * instance, the `URL` object will not percent encode the ASCII tilde (`~`) + * character, while `URLSearchParams` will always encode it: + * + * ```js + * const myUrl = new URL('https://example.org/abc?foo=~bar'); + * + * console.log(myUrl.search); // prints ?foo=~bar + * + * // Modify the URL via searchParams... + * myUrl.searchParams.sort(); + * + * console.log(myUrl.search); // prints ?foo=%7Ebar + * ``` + */ + readonly searchParams: URLSearchParams; + /** + * Gets and sets the username portion of the URL. + * + * ```js + * const myURL = new URL('https://abc:xyz@example.com'); + * console.log(myURL.username); + * // Prints abc + * + * myURL.username = '123'; + * console.log(myURL.href); + * // Prints https://123:xyz@example.com/ + * ``` + * + * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which + * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + username: string; + /** + * The `toString()` method on the `URL` object returns the serialized URL. The + * value returned is equivalent to that of {@link href} and {@link toJSON}. + */ + toString(): string; + /** + * The `toJSON()` method on the `URL` object returns the serialized URL. The + * value returned is equivalent to that of {@link href} and {@link toString}. + * + * This method is automatically called when an `URL` object is serialized + * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). + * + * ```js + * const myURLs = [ + * new URL('https://www.example.com'), + * new URL('https://test.example.org'), + * ]; + * console.log(JSON.stringify(myURLs)); + * // Prints ["https://www.example.com/","https://test.example.org/"] + * ``` + */ + toJSON(): string; + } + /** + * The `URLSearchParams` API provides read and write access to the query of a`URL`. The `URLSearchParams` class can also be used standalone with one of the + * four following constructors. + * The `URLSearchParams` class is also available on the global object. + * + * The WHATWG `URLSearchParams` interface and the `querystring` module have + * similar purpose, but the purpose of the `querystring` module is more + * general, as it allows the customization of delimiter characters (`&` and `=`). + * On the other hand, this API is designed purely for URL query strings. + * + * ```js + * const myURL = new URL('https://example.org/?abc=123'); + * console.log(myURL.searchParams.get('abc')); + * // Prints 123 + * + * myURL.searchParams.append('abc', 'xyz'); + * console.log(myURL.href); + * // Prints https://example.org/?abc=123&abc=xyz + * + * myURL.searchParams.delete('abc'); + * myURL.searchParams.set('a', 'b'); + * console.log(myURL.href); + * // Prints https://example.org/?a=b + * + * const newSearchParams = new URLSearchParams(myURL.searchParams); + * // The above is equivalent to + * // const newSearchParams = new URLSearchParams(myURL.search); + * + * newSearchParams.append('a', 'c'); + * console.log(myURL.href); + * // Prints https://example.org/?a=b + * console.log(newSearchParams.toString()); + * // Prints a=b&a=c + * + * // newSearchParams.toString() is implicitly called + * myURL.search = newSearchParams; + * console.log(myURL.href); + * // Prints https://example.org/?a=b&a=c + * newSearchParams.delete('a'); + * console.log(myURL.href); + * // Prints https://example.org/?a=b&a=c + * ``` + * @since v7.5.0, v6.13.0 + */ + class URLSearchParams implements Iterable<[string, string]> { + constructor(init?: URLSearchParams | string | Record> | Iterable<[string, string]> | ReadonlyArray<[string, string]>); + /** + * Append a new name-value pair to the query string. + */ + append(name: string, value: string): void; + /** + * Remove all name-value pairs whose name is `name`. + */ + delete(name: string): void; + /** + * Returns an ES6 `Iterator` over each of the name-value pairs in the query. + * Each item of the iterator is a JavaScript `Array`. The first item of the `Array`is the `name`, the second item of the `Array` is the `value`. + * + * Alias for `urlSearchParams[@@iterator]()`. + */ + entries(): IterableIterator<[string, string]>; + /** + * Iterates over each name-value pair in the query and invokes the given function. + * + * ```js + * const myURL = new URL('https://example.org/?a=b&c=d'); + * myURL.searchParams.forEach((value, name, searchParams) => { + * console.log(name, value, myURL.searchParams === searchParams); + * }); + * // Prints: + * // a b true + * // c d true + * ``` + * @param fn Invoked for each name-value pair in the query + * @param thisArg To be used as `this` value for when `fn` is called + */ + forEach(callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, thisArg?: TThis): void; + /** + * Returns the value of the first name-value pair whose name is `name`. If there + * are no such pairs, `null` is returned. + * @return or `null` if there is no name-value pair with the given `name`. + */ + get(name: string): string | null; + /** + * Returns the values of all name-value pairs whose name is `name`. If there are + * no such pairs, an empty array is returned. + */ + getAll(name: string): string[]; + /** + * Returns `true` if there is at least one name-value pair whose name is `name`. + */ + has(name: string): boolean; + /** + * Returns an ES6 `Iterator` over the names of each name-value pair. + * + * ```js + * const params = new URLSearchParams('foo=bar&foo=baz'); + * for (const name of params.keys()) { + * console.log(name); + * } + * // Prints: + * // foo + * // foo + * ``` + */ + keys(): IterableIterator; + /** + * Sets the value in the `URLSearchParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, + * set the first such pair's value to `value` and remove all others. If not, + * append the name-value pair to the query string. + * + * ```js + * const params = new URLSearchParams(); + * params.append('foo', 'bar'); + * params.append('foo', 'baz'); + * params.append('abc', 'def'); + * console.log(params.toString()); + * // Prints foo=bar&foo=baz&abc=def + * + * params.set('foo', 'def'); + * params.set('xyz', 'opq'); + * console.log(params.toString()); + * // Prints foo=def&abc=def&xyz=opq + * ``` + */ + set(name: string, value: string): void; + /** + * Sort all existing name-value pairs in-place by their names. Sorting is done + * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs + * with the same name is preserved. + * + * This method can be used, in particular, to increase cache hits. + * + * ```js + * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); + * params.sort(); + * console.log(params.toString()); + * // Prints query%5B%5D=abc&query%5B%5D=123&type=search + * ``` + * @since v7.7.0, v6.13.0 + */ + sort(): void; + /** + * Returns the search parameters serialized as a string, with characters + * percent-encoded where necessary. + */ + toString(): string; + /** + * Returns an ES6 `Iterator` over the values of each name-value pair. + */ + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[string, string]>; + } + import { URL as _URL, URLSearchParams as _URLSearchParams } from 'url'; + global { + interface URLSearchParams extends _URLSearchParams {} + interface URL extends _URL {} + interface Global { + URL: typeof _URL; + URLSearchParams: typeof _URLSearchParams; + } + /** + * `URL` class is a global reference for `require('url').URL` + * https://nodejs.org/api/url.html#the-whatwg-url-api + * @since v10.0.0 + */ + var URL: typeof globalThis extends { + onmessage: any; + URL: infer T; + } + ? T + : typeof _URL; + /** + * `URLSearchParams` class is a global reference for `require('url').URLSearchParams` + * https://nodejs.org/api/url.html#class-urlsearchparams + * @since v10.0.0 + */ + var URLSearchParams: typeof globalThis extends { + onmessage: any; + URLSearchParams: infer T; + } + ? T + : typeof _URLSearchParams; + } +} +declare module 'node:url' { + export * from 'url'; +} diff --git a/server/node_modules/@types/node/ts4.8/util.d.ts b/server/node_modules/@types/node/ts4.8/util.d.ts new file mode 100755 index 0000000000..6d350195b0 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/util.d.ts @@ -0,0 +1,1926 @@ +/** + * The `util` module supports the needs of Node.js internal APIs. Many of the + * utilities are useful for application and module developers as well. To access + * it: + * + * ```js + * const util = require('util'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/util.js) + */ +declare module 'util' { + import * as types from 'node:util/types'; + export interface InspectOptions { + /** + * If `true`, object's non-enumerable symbols and properties are included in the formatted result. + * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties). + * @default false + */ + showHidden?: boolean | undefined; + /** + * Specifies the number of times to recurse while formatting object. + * This is useful for inspecting large objects. + * To recurse up to the maximum call stack size pass `Infinity` or `null`. + * @default 2 + */ + depth?: number | null | undefined; + /** + * If `true`, the output is styled with ANSI color codes. Colors are customizable. + */ + colors?: boolean | undefined; + /** + * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked. + * @default true + */ + customInspect?: boolean | undefined; + /** + * If `true`, `Proxy` inspection includes the target and handler objects. + * @default false + */ + showProxy?: boolean | undefined; + /** + * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements + * to include when formatting. Set to `null` or `Infinity` to show all elements. + * Set to `0` or negative to show no elements. + * @default 100 + */ + maxArrayLength?: number | null | undefined; + /** + * Specifies the maximum number of characters to + * include when formatting. Set to `null` or `Infinity` to show all elements. + * Set to `0` or negative to show no characters. + * @default 10000 + */ + maxStringLength?: number | null | undefined; + /** + * The length at which input values are split across multiple lines. + * Set to `Infinity` to format the input as a single line + * (in combination with `compact` set to `true` or any number >= `1`). + * @default 80 + */ + breakLength?: number | undefined; + /** + * Setting this to `false` causes each object key + * to be displayed on a new line. It will also add new lines to text that is + * longer than `breakLength`. If set to a number, the most `n` inner elements + * are united on a single line as long as all properties fit into + * `breakLength`. Short array elements are also grouped together. Note that no + * text will be reduced below 16 characters, no matter the `breakLength` size. + * For more information, see the example below. + * @default true + */ + compact?: boolean | number | undefined; + /** + * If set to `true` or a function, all properties of an object, and `Set` and `Map` + * entries are sorted in the resulting string. + * If set to `true` the default sort is used. + * If set to a function, it is used as a compare function. + */ + sorted?: boolean | ((a: string, b: string) => number) | undefined; + /** + * If set to `true`, getters are going to be + * inspected as well. If set to `'get'` only getters without setter are going + * to be inspected. If set to `'set'` only getters having a corresponding + * setter are going to be inspected. This might cause side effects depending on + * the getter function. + * @default false + */ + getters?: 'get' | 'set' | boolean | undefined; + /** + * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers. + * @default false + */ + numericSeparator?: boolean | undefined; + } + export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module'; + export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect + export interface InspectOptionsStylized extends InspectOptions { + stylize(text: string, styleType: Style): string; + } + /** + * The `util.format()` method returns a formatted string using the first argument + * as a `printf`\-like format string which can contain zero or more format + * specifiers. Each specifier is replaced with the converted value from the + * corresponding argument. Supported specifiers are: + * + * If a specifier does not have a corresponding argument, it is not replaced: + * + * ```js + * util.format('%s:%s', 'foo'); + * // Returns: 'foo:%s' + * ``` + * + * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`. + * + * If there are more arguments passed to the `util.format()` method than the + * number of specifiers, the extra arguments are concatenated to the returned + * string, separated by spaces: + * + * ```js + * util.format('%s:%s', 'foo', 'bar', 'baz'); + * // Returns: 'foo:bar baz' + * ``` + * + * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces: + * + * ```js + * util.format(1, 2, 3); + * // Returns: '1 2 3' + * ``` + * + * If only one argument is passed to `util.format()`, it is returned as it is + * without any formatting: + * + * ```js + * util.format('%% %s'); + * // Returns: '%% %s' + * ``` + * + * `util.format()` is a synchronous method that is intended as a debugging tool. + * Some input values can have a significant performance overhead that can block the + * event loop. Use this function with care and never in a hot code path. + * @since v0.5.3 + * @param format A `printf`-like format string. + */ + export function format(format?: any, ...param: any[]): string; + /** + * This function is identical to {@link format}, except in that it takes + * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. + * + * ```js + * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); + * // Returns 'See object { foo: 42 }', where `42` is colored as a number + * // when printed to a terminal. + * ``` + * @since v10.0.0 + */ + export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; + /** + * Returns the string name for a numeric error code that comes from a Node.js API. + * The mapping between error codes and error names is platform-dependent. + * See `Common System Errors` for the names of common errors. + * + * ```js + * fs.access('file/that/does/not/exist', (err) => { + * const name = util.getSystemErrorName(err.errno); + * console.error(name); // ENOENT + * }); + * ``` + * @since v9.7.0 + */ + export function getSystemErrorName(err: number): string; + /** + * Returns a Map of all system error codes available from the Node.js API. + * The mapping between error codes and error names is platform-dependent. + * See `Common System Errors` for the names of common errors. + * + * ```js + * fs.access('file/that/does/not/exist', (err) => { + * const errorMap = util.getSystemErrorMap(); + * const name = errorMap.get(err.errno); + * console.error(name); // ENOENT + * }); + * ``` + * @since v16.0.0, v14.17.0 + */ + export function getSystemErrorMap(): Map; + /** + * The `util.log()` method prints the given `string` to `stdout` with an included + * timestamp. + * + * ```js + * const util = require('util'); + * + * util.log('Timestamped message.'); + * ``` + * @since v0.3.0 + * @deprecated Since v6.0.0 - Use a third party module instead. + */ + export function log(string: string): void; + /** + * Returns the `string` after replacing any surrogate code points + * (or equivalently, any unpaired surrogate code units) with the + * Unicode "replacement character" U+FFFD. + * @since v16.8.0, v14.18.0 + */ + export function toUSVString(string: string): string; + /** + * Creates and returns an `AbortController` instance whose `AbortSignal` is marked + * as transferable and can be used with `structuredClone()` or `postMessage()`. + * @since v18.11.0 + * @returns A transferable AbortController + */ + export function transferableAbortController(): AbortController; + /** + * Marks the given {AbortSignal} as transferable so that it can be used with + * `structuredClone()` and `postMessage()`. + * + * ```js + * const signal = transferableAbortSignal(AbortSignal.timeout(100)); + * const channel = new MessageChannel(); + * channel.port2.postMessage(signal, [signal]); + * ``` + * @since v18.11.0 + * @param signal The AbortSignal + * @returns The same AbortSignal + */ + export function transferableAbortSignal(signal: AbortSignal): AbortSignal; + /** + * The `util.inspect()` method returns a string representation of `object` that is + * intended for debugging. The output of `util.inspect` may change at any time + * and should not be depended upon programmatically. Additional `options` may be + * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make + * an identifiable tag for an inspected value. + * + * ```js + * class Foo { + * get [Symbol.toStringTag]() { + * return 'bar'; + * } + * } + * + * class Bar {} + * + * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); + * + * util.inspect(new Foo()); // 'Foo [bar] {}' + * util.inspect(new Bar()); // 'Bar {}' + * util.inspect(baz); // '[foo] {}' + * ``` + * + * Circular references point to their anchor by using a reference index: + * + * ```js + * const { inspect } = require('util'); + * + * const obj = {}; + * obj.a = [obj]; + * obj.b = {}; + * obj.b.inner = obj.b; + * obj.b.obj = obj; + * + * console.log(inspect(obj)); + * // { + * // a: [ [Circular *1] ], + * // b: { inner: [Circular *2], obj: [Circular *1] } + * // } + * ``` + * + * The following example inspects all properties of the `util` object: + * + * ```js + * const util = require('util'); + * + * console.log(util.inspect(util, { showHidden: true, depth: null })); + * ``` + * + * The following example highlights the effect of the `compact` option: + * + * ```js + * const util = require('util'); + * + * const o = { + * a: [1, 2, [[ + * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + + * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', + * 'test', + * 'foo']], 4], + * b: new Map([['za', 1], ['zb', 'test']]) + * }; + * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); + * + * // { a: + * // [ 1, + * // 2, + * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line + * // 'test', + * // 'foo' ] ], + * // 4 ], + * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } + * + * // Setting `compact` to false or an integer creates more reader friendly output. + * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); + * + * // { + * // a: [ + * // 1, + * // 2, + * // [ + * // [ + * // 'Lorem ipsum dolor sit amet,\n' + + * // 'consectetur adipiscing elit, sed do eiusmod \n' + + * // 'tempor incididunt ut labore et dolore magna aliqua.', + * // 'test', + * // 'foo' + * // ] + * // ], + * // 4 + * // ], + * // b: Map(2) { + * // 'za' => 1, + * // 'zb' => 'test' + * // } + * // } + * + * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a + * // single line. + * ``` + * + * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and + * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be + * inspected. If there are more entries than `maxArrayLength`, there is no + * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may + * result in different output. Furthermore, entries + * with no remaining strong references may be garbage collected at any time. + * + * ```js + * const { inspect } = require('util'); + * + * const obj = { a: 1 }; + * const obj2 = { b: 2 }; + * const weakSet = new WeakSet([obj, obj2]); + * + * console.log(inspect(weakSet, { showHidden: true })); + * // WeakSet { { a: 1 }, { b: 2 } } + * ``` + * + * The `sorted` option ensures that an object's property insertion order does not + * impact the result of `util.inspect()`. + * + * ```js + * const { inspect } = require('util'); + * const assert = require('assert'); + * + * const o1 = { + * b: [2, 3, 1], + * a: '`a` comes before `b`', + * c: new Set([2, 3, 1]) + * }; + * console.log(inspect(o1, { sorted: true })); + * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } + * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); + * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } + * + * const o2 = { + * c: new Set([2, 1, 3]), + * a: '`a` comes before `b`', + * b: [2, 3, 1] + * }; + * assert.strict.equal( + * inspect(o1, { sorted: true }), + * inspect(o2, { sorted: true }) + * ); + * ``` + * + * The `numericSeparator` option adds an underscore every three digits to all + * numbers. + * + * ```js + * const { inspect } = require('util'); + * + * const thousand = 1_000; + * const million = 1_000_000; + * const bigNumber = 123_456_789n; + * const bigDecimal = 1_234.123_45; + * + * console.log(thousand, million, bigNumber, bigDecimal); + * // 1_000 1_000_000 123_456_789n 1_234.123_45 + * ``` + * + * `util.inspect()` is a synchronous method intended for debugging. Its maximum + * output length is approximately 128 MB. Inputs that result in longer output will + * be truncated. + * @since v0.3.0 + * @param object Any JavaScript primitive or `Object`. + * @return The representation of `object`. + */ + export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; + export function inspect(object: any, options?: InspectOptions): string; + export namespace inspect { + let colors: NodeJS.Dict<[number, number]>; + let styles: { + [K in Style]: string; + }; + let defaultOptions: InspectOptions; + /** + * Allows changing inspect settings from the repl. + */ + let replDefaults: InspectOptions; + /** + * That can be used to declare custom inspect functions. + */ + const custom: unique symbol; + } + /** + * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). + * + * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isArray([]); + * // Returns: true + * util.isArray(new Array()); + * // Returns: true + * util.isArray({}); + * // Returns: false + * ``` + * @since v0.6.0 + * @deprecated Since v4.0.0 - Use `isArray` instead. + */ + export function isArray(object: unknown): object is unknown[]; + /** + * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isRegExp(/some regexp/); + * // Returns: true + * util.isRegExp(new RegExp('another regexp')); + * // Returns: true + * util.isRegExp({}); + * // Returns: false + * ``` + * @since v0.6.0 + * @deprecated Since v4.0.0 - Deprecated + */ + export function isRegExp(object: unknown): object is RegExp; + /** + * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isDate(new Date()); + * // Returns: true + * util.isDate(Date()); + * // false (without 'new' returns a String) + * util.isDate({}); + * // Returns: false + * ``` + * @since v0.6.0 + * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. + */ + export function isDate(object: unknown): object is Date; + /** + * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`. + * + * ```js + * const util = require('util'); + * + * util.isError(new Error()); + * // Returns: true + * util.isError(new TypeError()); + * // Returns: true + * util.isError({ name: 'Error', message: 'an error occurred' }); + * // Returns: false + * ``` + * + * This method relies on `Object.prototype.toString()` behavior. It is + * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`. + * + * ```js + * const util = require('util'); + * const obj = { name: 'Error', message: 'an error occurred' }; + * + * util.isError(obj); + * // Returns: false + * obj[Symbol.toStringTag] = 'Error'; + * util.isError(obj); + * // Returns: true + * ``` + * @since v0.6.0 + * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. + */ + export function isError(object: unknown): object is Error; + /** + * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note + * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). + * + * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The + * prototype of `constructor` will be set to a new object created from`superConstructor`. + * + * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. + * As an additional convenience, `superConstructor` will be accessible + * through the `constructor.super_` property. + * + * ```js + * const util = require('util'); + * const EventEmitter = require('events'); + * + * function MyStream() { + * EventEmitter.call(this); + * } + * + * util.inherits(MyStream, EventEmitter); + * + * MyStream.prototype.write = function(data) { + * this.emit('data', data); + * }; + * + * const stream = new MyStream(); + * + * console.log(stream instanceof EventEmitter); // true + * console.log(MyStream.super_ === EventEmitter); // true + * + * stream.on('data', (data) => { + * console.log(`Received data: "${data}"`); + * }); + * stream.write('It works!'); // Received data: "It works!" + * ``` + * + * ES6 example using `class` and `extends`: + * + * ```js + * const EventEmitter = require('events'); + * + * class MyStream extends EventEmitter { + * write(data) { + * this.emit('data', data); + * } + * } + * + * const stream = new MyStream(); + * + * stream.on('data', (data) => { + * console.log(`Received data: "${data}"`); + * }); + * stream.write('With ES6'); + * ``` + * @since v0.3.0 + * @deprecated Legacy: Use ES2015 class syntax and `extends` keyword instead. + */ + export function inherits(constructor: unknown, superConstructor: unknown): void; + export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; + export interface DebugLogger extends DebugLoggerFunction { + enabled: boolean; + } + /** + * The `util.debuglog()` method is used to create a function that conditionally + * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that + * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. + * + * ```js + * const util = require('util'); + * const debuglog = util.debuglog('foo'); + * + * debuglog('hello from foo [%d]', 123); + * ``` + * + * If this program is run with `NODE_DEBUG=foo` in the environment, then + * it will output something like: + * + * ```console + * FOO 3245: hello from foo [123] + * ``` + * + * where `3245` is the process id. If it is not run with that + * environment variable set, then it will not print anything. + * + * The `section` supports wildcard also: + * + * ```js + * const util = require('util'); + * const debuglog = util.debuglog('foo-bar'); + * + * debuglog('hi there, it\'s foo-bar [%d]', 2333); + * ``` + * + * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output + * something like: + * + * ```console + * FOO-BAR 3257: hi there, it's foo-bar [2333] + * ``` + * + * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. + * + * The optional `callback` argument can be used to replace the logging function + * with a different function that doesn't have any initialization or + * unnecessary wrapping. + * + * ```js + * const util = require('util'); + * let debuglog = util.debuglog('internals', (debug) => { + * // Replace with a logging function that optimizes out + * // testing if the section is enabled + * debuglog = debug; + * }); + * ``` + * @since v0.11.3 + * @param section A string identifying the portion of the application for which the `debuglog` function is being created. + * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. + * @return The logging function + */ + export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; + export const debug: typeof debuglog; + /** + * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isBoolean(1); + * // Returns: false + * util.isBoolean(0); + * // Returns: false + * util.isBoolean(false); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. + */ + export function isBoolean(object: unknown): object is boolean; + /** + * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isBuffer({ length: 0 }); + * // Returns: false + * util.isBuffer([]); + * // Returns: false + * util.isBuffer(Buffer.from('hello world')); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `isBuffer` instead. + */ + export function isBuffer(object: unknown): object is Buffer; + /** + * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`. + * + * ```js + * const util = require('util'); + * + * function Foo() {} + * const Bar = () => {}; + * + * util.isFunction({}); + * // Returns: false + * util.isFunction(Foo); + * // Returns: true + * util.isFunction(Bar); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. + */ + export function isFunction(object: unknown): boolean; + /** + * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. + * + * ```js + * const util = require('util'); + * + * util.isNull(0); + * // Returns: false + * util.isNull(undefined); + * // Returns: false + * util.isNull(null); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `value === null` instead. + */ + export function isNull(object: unknown): object is null; + /** + * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, + * returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isNullOrUndefined(0); + * // Returns: false + * util.isNullOrUndefined(undefined); + * // Returns: true + * util.isNullOrUndefined(null); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. + */ + export function isNullOrUndefined(object: unknown): object is null | undefined; + /** + * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isNumber(false); + * // Returns: false + * util.isNumber(Infinity); + * // Returns: true + * util.isNumber(0); + * // Returns: true + * util.isNumber(NaN); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. + */ + export function isNumber(object: unknown): object is number; + /** + * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). + * Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isObject(5); + * // Returns: false + * util.isObject(null); + * // Returns: false + * util.isObject({}); + * // Returns: true + * util.isObject(() => {}); + * // Returns: false + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Deprecated: Use `value !== null && typeof value === 'object'` instead. + */ + export function isObject(object: unknown): boolean; + /** + * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. + * + * ```js + * const util = require('util'); + * + * util.isPrimitive(5); + * // Returns: true + * util.isPrimitive('foo'); + * // Returns: true + * util.isPrimitive(false); + * // Returns: true + * util.isPrimitive(null); + * // Returns: true + * util.isPrimitive(undefined); + * // Returns: true + * util.isPrimitive({}); + * // Returns: false + * util.isPrimitive(() => {}); + * // Returns: false + * util.isPrimitive(/^$/); + * // Returns: false + * util.isPrimitive(new Date()); + * // Returns: false + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. + */ + export function isPrimitive(object: unknown): boolean; + /** + * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isString(''); + * // Returns: true + * util.isString('foo'); + * // Returns: true + * util.isString(String('foo')); + * // Returns: true + * util.isString(5); + * // Returns: false + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. + */ + export function isString(object: unknown): object is string; + /** + * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * util.isSymbol(5); + * // Returns: false + * util.isSymbol('foo'); + * // Returns: false + * util.isSymbol(Symbol('foo')); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. + */ + export function isSymbol(object: unknown): object is symbol; + /** + * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. + * + * ```js + * const util = require('util'); + * + * const foo = undefined; + * util.isUndefined(5); + * // Returns: false + * util.isUndefined(foo); + * // Returns: true + * util.isUndefined(null); + * // Returns: false + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `value === undefined` instead. + */ + export function isUndefined(object: unknown): object is undefined; + /** + * The `util.deprecate()` method wraps `fn` (which may be a function or class) in + * such a way that it is marked as deprecated. + * + * ```js + * const util = require('util'); + * + * exports.obsoleteFunction = util.deprecate(() => { + * // Do something here. + * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); + * ``` + * + * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will + * be emitted and printed to `stderr` the first time the returned function is + * called. After the warning is emitted, the wrapped function is called without + * emitting a warning. + * + * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, + * the warning will be emitted only once for that `code`. + * + * ```js + * const util = require('util'); + * + * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); + * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); + * fn1(); // Emits a deprecation warning with code DEP0001 + * fn2(); // Does not emit a deprecation warning because it has the same code + * ``` + * + * If either the `--no-deprecation` or `--no-warnings` command-line flags are + * used, or if the `process.noDeprecation` property is set to `true`_prior_ to + * the first deprecation warning, the `util.deprecate()` method does nothing. + * + * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, + * or the `process.traceDeprecation` property is set to `true`, a warning and a + * stack trace are printed to `stderr` the first time the deprecated function is + * called. + * + * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be + * thrown when the deprecated function is called. + * + * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`. + * @since v0.8.0 + * @param fn The function that is being deprecated. + * @param msg A warning message to display when the deprecated function is invoked. + * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. + * @return The deprecated function wrapped to emit a warning. + */ + export function deprecate(fn: T, msg: string, code?: string): T; + /** + * Returns `true` if there is deep strict equality between `val1` and `val2`. + * Otherwise, returns `false`. + * + * See `assert.deepStrictEqual()` for more information about deep strict + * equality. + * @since v9.0.0 + */ + export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; + /** + * Returns `str` with any ANSI escape codes removed. + * + * ```js + * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); + * // Prints "value" + * ``` + * @since v16.11.0 + */ + export function stripVTControlCharacters(str: string): string; + /** + * Takes an `async` function (or a function that returns a `Promise`) and returns a + * function following the error-first callback style, i.e. taking + * an `(err, value) => ...` callback as the last argument. In the callback, the + * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value. + * + * ```js + * const util = require('util'); + * + * async function fn() { + * return 'hello world'; + * } + * const callbackFunction = util.callbackify(fn); + * + * callbackFunction((err, ret) => { + * if (err) throw err; + * console.log(ret); + * }); + * ``` + * + * Will print: + * + * ```text + * hello world + * ``` + * + * The callback is executed asynchronously, and will have a limited stack trace. + * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. + * + * Since `null` has a special meaning as the first argument to a callback, if a + * wrapped function rejects a `Promise` with a falsy value as a reason, the value + * is wrapped in an `Error` with the original value stored in a field named`reason`. + * + * ```js + * function fn() { + * return Promise.reject(null); + * } + * const callbackFunction = util.callbackify(fn); + * + * callbackFunction((err, ret) => { + * // When the Promise was rejected with `null` it is wrapped with an Error and + * // the original value is stored in `reason`. + * err && Object.hasOwn(err, 'reason') && err.reason === null; // true + * }); + * ``` + * @since v8.2.0 + * @param fn An `async` function + * @return a callback style function + */ + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export interface CustomPromisifyLegacy extends Function { + __promisify__: TCustom; + } + export interface CustomPromisifySymbol extends Function { + [promisify.custom]: TCustom; + } + export type CustomPromisify = CustomPromisifySymbol | CustomPromisifyLegacy; + /** + * Takes a function following the common error-first callback style, i.e. taking + * an `(err, value) => ...` callback as the last argument, and returns a version + * that returns promises. + * + * ```js + * const util = require('util'); + * const fs = require('fs'); + * + * const stat = util.promisify(fs.stat); + * stat('.').then((stats) => { + * // Do something with `stats` + * }).catch((error) => { + * // Handle the error. + * }); + * ``` + * + * Or, equivalently using `async function`s: + * + * ```js + * const util = require('util'); + * const fs = require('fs'); + * + * const stat = util.promisify(fs.stat); + * + * async function callStat() { + * const stats = await stat('.'); + * console.log(`This directory is owned by ${stats.uid}`); + * } + * ``` + * + * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`. + * + * `promisify()` assumes that `original` is a function taking a callback as its + * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not + * an error-first callback, it will still be passed an error-first + * callback as its last argument. + * + * Using `promisify()` on class methods or other methods that use `this` may not + * work as expected unless handled specially: + * + * ```js + * const util = require('util'); + * + * class Foo { + * constructor() { + * this.a = 42; + * } + * + * bar(callback) { + * callback(null, this.a); + * } + * } + * + * const foo = new Foo(); + * + * const naiveBar = util.promisify(foo.bar); + * // TypeError: Cannot read property 'a' of undefined + * // naiveBar().then(a => console.log(a)); + * + * naiveBar.call(foo).then((a) => console.log(a)); // '42' + * + * const bindBar = naiveBar.bind(foo); + * bindBar().then((a) => console.log(a)); // '42' + * ``` + * @since v8.0.0 + */ + export function promisify(fn: CustomPromisify): TCustom; + export function promisify(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise; + export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; + export function promisify(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: Function): Function; + export namespace promisify { + /** + * That can be used to declare custom promisified variants of functions. + */ + const custom: unique symbol; + } + /** + * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API. + * + * ```js + * const decoder = new TextDecoder(); + * const u8arr = new Uint8Array([72, 101, 108, 108, 111]); + * console.log(decoder.decode(u8arr)); // Hello + * ``` + * @since v8.3.0 + */ + export class TextDecoder { + /** + * The encoding supported by the `TextDecoder` instance. + */ + readonly encoding: string; + /** + * The value will be `true` if decoding errors result in a `TypeError` being + * thrown. + */ + readonly fatal: boolean; + /** + * The value will be `true` if the decoding result will include the byte order + * mark. + */ + readonly ignoreBOM: boolean; + constructor( + encoding?: string, + options?: { + fatal?: boolean | undefined; + ignoreBOM?: boolean | undefined; + } + ); + /** + * Decodes the `input` and returns a string. If `options.stream` is `true`, any + * incomplete byte sequences occurring at the end of the `input` are buffered + * internally and emitted after the next call to `textDecoder.decode()`. + * + * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown. + * @param input An `ArrayBuffer`, `DataView` or `TypedArray` instance containing the encoded data. + */ + decode( + input?: NodeJS.ArrayBufferView | ArrayBuffer | null, + options?: { + stream?: boolean | undefined; + } + ): string; + } + export interface EncodeIntoResult { + /** + * The read Unicode code units of input. + */ + read: number; + /** + * The written UTF-8 bytes of output. + */ + written: number; + } + export { types }; + + //// TextEncoder/Decoder + /** + * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All + * instances of `TextEncoder` only support UTF-8 encoding. + * + * ```js + * const encoder = new TextEncoder(); + * const uint8array = encoder.encode('this is some data'); + * ``` + * + * The `TextEncoder` class is also available on the global object. + * @since v8.3.0 + */ + export class TextEncoder { + /** + * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. + */ + readonly encoding: string; + /** + * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the + * encoded bytes. + * @param [input='an empty string'] The text to encode. + */ + encode(input?: string): Uint8Array; + /** + * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object + * containing the read Unicode code units and written UTF-8 bytes. + * + * ```js + * const encoder = new TextEncoder(); + * const src = 'this is some data'; + * const dest = new Uint8Array(10); + * const { read, written } = encoder.encodeInto(src, dest); + * ``` + * @param src The text to encode. + * @param dest The array to hold the encode result. + */ + encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; + } + + import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from 'util'; + global { + /** + * `TextDecoder` class is a global reference for `require('util').TextDecoder` + * https://nodejs.org/api/globals.html#textdecoder + * @since v11.0.0 + */ + var TextDecoder: typeof globalThis extends { + onmessage: any; + TextDecoder: infer TextDecoder; + } + ? TextDecoder + : typeof _TextDecoder; + + /** + * `TextEncoder` class is a global reference for `require('util').TextEncoder` + * https://nodejs.org/api/globals.html#textencoder + * @since v11.0.0 + */ + var TextEncoder: typeof globalThis extends { + onmessage: any; + TextEncoder: infer TextEncoder; + } + ? TextEncoder + : typeof _TextEncoder; + } + + //// parseArgs + /** + * Provides a high-level API for command-line argument parsing. Takes a + * specification for the expected arguments and returns a structured object + * with the parsed values and positionals. + * + * `config` provides arguments for parsing and configures the parser. It + * supports the following properties: + * + * - `args` The array of argument strings. **Default:** `process.argv` with + * `execPath` and `filename` removed. + * - `options` Arguments known to the parser. Keys of `options` are the long + * names of options and values are objects accepting the following properties: + * + * - `type` Type of argument, which must be either `boolean` (for options + * which do not take values) or `string` (for options which do). + * - `multiple` Whether this option can be provided multiple + * times. If `true`, all values will be collected in an array. If + * `false`, values for the option are last-wins. **Default:** `false`. + * - `short` A single character alias for the option. + * - `default` The default option value when it is not set by args. It + * must be of the same type as the `type` property. When `multiple` + * is `true`, it must be an array. + * + * - `strict`: Whether an error should be thrown when unknown arguments + * are encountered, or when arguments are passed that do not match the + * `type` configured in `options`. **Default:** `true`. + * - `allowPositionals`: Whether this command accepts positional arguments. + * **Default:** `false` if `strict` is `true`, otherwise `true`. + * - `tokens`: Whether tokens {boolean} Return the parsed tokens. This is useful + * for extending the built-in behavior, from adding additional checks through + * to reprocessing the tokens in different ways. + * **Default:** `false`. + * + * @returns The parsed command line arguments: + * + * - `values` A mapping of parsed option names with their string + * or boolean values. + * - `positionals` Positional arguments. + * - `tokens` Detailed parse information (only if `tokens` was specified). + * + */ + export function parseArgs(config?: T): ParsedResults; + + interface ParseArgsOptionConfig { + /** + * Type of argument. + */ + type: 'string' | 'boolean'; + /** + * Whether this option can be provided multiple times. + * If `true`, all values will be collected in an array. + * If `false`, values for the option are last-wins. + * @default false. + */ + multiple?: boolean | undefined; + /** + * A single character alias for the option. + */ + short?: string | undefined; + /** + * The default option value when it is not set by args. + * It must be of the same type as the the `type` property. + * When `multiple` is `true`, it must be an array. + * @since v18.11.0 + */ + default?: string | boolean | string[] | boolean[] | undefined; + } + + interface ParseArgsOptionsConfig { + [longOption: string]: ParseArgsOptionConfig; + } + + export interface ParseArgsConfig { + /** + * Array of argument strings. + */ + args?: string[] | undefined; + /** + * Used to describe arguments known to the parser. + */ + options?: ParseArgsOptionsConfig | undefined; + /** + * Should an error be thrown when unknown arguments are encountered, + * or when arguments are passed that do not match the `type` configured in `options`. + * @default true + */ + strict?: boolean | undefined; + /** + * Whether this command accepts positional arguments. + */ + allowPositionals?: boolean | undefined; + /** + * Return the parsed tokens. This is useful for extending the built-in behavior, + * from adding additional checks through to reprocessing the tokens in different ways. + * @default false + */ + tokens?: boolean | undefined; + } + + /* + IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties. + TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936 + This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present". + But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present. + So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value. + This is technically incorrect but is a much nicer UX for the common case. + The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false. + */ + type IfDefaultsTrue = T extends true + ? IfTrue + : T extends false + ? IfFalse + : IfTrue; + + // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` + type IfDefaultsFalse = T extends false + ? IfFalse + : T extends true + ? IfTrue + : IfFalse; + + type ExtractOptionValue = IfDefaultsTrue< + T['strict'], + O['type'] extends 'string' ? string : O['type'] extends 'boolean' ? boolean : string | boolean, + string | boolean + >; + + type ParsedValues = + & IfDefaultsTrue + & (T['options'] extends ParseArgsOptionsConfig + ? { + -readonly [LongOption in keyof T['options']]: IfDefaultsFalse< + T['options'][LongOption]['multiple'], + undefined | Array>, + undefined | ExtractOptionValue + >; + } + : {}); + + type ParsedPositionals = IfDefaultsTrue< + T['strict'], + IfDefaultsFalse, + IfDefaultsTrue + >; + + type PreciseTokenForOptions< + K extends string, + O extends ParseArgsOptionConfig, + > = O['type'] extends 'string' + ? { + kind: 'option'; + index: number; + name: K; + rawName: string; + value: string; + inlineValue: boolean; + } + : O['type'] extends 'boolean' + ? { + kind: 'option'; + index: number; + name: K; + rawName: string; + value: undefined; + inlineValue: undefined; + } + : OptionToken & { name: K }; + + type TokenForOptions< + T extends ParseArgsConfig, + K extends keyof T['options'] = keyof T['options'], + > = K extends unknown + ? T['options'] extends ParseArgsOptionsConfig + ? PreciseTokenForOptions + : OptionToken + : never; + + type ParsedOptionToken = IfDefaultsTrue, OptionToken>; + + type ParsedPositionalToken = IfDefaultsTrue< + T['strict'], + IfDefaultsFalse, + IfDefaultsTrue + >; + + type ParsedTokens = Array< + ParsedOptionToken | ParsedPositionalToken | { kind: 'option-terminator'; index: number } + >; + + type PreciseParsedResults = IfDefaultsFalse< + T['tokens'], + { + values: ParsedValues; + positionals: ParsedPositionals; + tokens: ParsedTokens; + }, + { + values: ParsedValues; + positionals: ParsedPositionals; + } + >; + + type OptionToken = + | { kind: 'option'; index: number; name: string; rawName: string; value: string; inlineValue: boolean } + | { + kind: 'option'; + index: number; + name: string; + rawName: string; + value: undefined; + inlineValue: undefined; + }; + + type Token = + | OptionToken + | { kind: 'positional'; index: number; value: string } + | { kind: 'option-terminator'; index: number }; + + // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. + // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. + type ParsedResults = ParseArgsConfig extends T + ? { + values: { [longOption: string]: undefined | string | boolean | Array }; + positionals: string[]; + tokens?: Token[]; + } + : PreciseParsedResults; +} +declare module 'util/types' { + export * from 'util/types'; +} +declare module 'util/types' { + import { KeyObject, webcrypto } from 'node:crypto'; + /** + * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or + * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. + * + * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. + * + * ```js + * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true + * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true + * ``` + * @since v10.0.0 + */ + function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; + /** + * Returns `true` if the value is an `arguments` object. + * + * ```js + * function foo() { + * util.types.isArgumentsObject(arguments); // Returns true + * } + * ``` + * @since v10.0.0 + */ + function isArgumentsObject(object: unknown): object is IArguments; + /** + * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. + * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is + * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. + * + * ```js + * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true + * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false + * ``` + * @since v10.0.0 + */ + function isArrayBuffer(object: unknown): object is ArrayBuffer; + /** + * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed + * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to + * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * + * ```js + * util.types.isArrayBufferView(new Int8Array()); // true + * util.types.isArrayBufferView(Buffer.from('hello world')); // true + * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true + * util.types.isArrayBufferView(new ArrayBuffer()); // false + * ``` + * @since v10.0.0 + */ + function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; + /** + * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * util.types.isAsyncFunction(function foo() {}); // Returns false + * util.types.isAsyncFunction(async function foo() {}); // Returns true + * ``` + * @since v10.0.0 + */ + function isAsyncFunction(object: unknown): boolean; + /** + * Returns `true` if the value is a `BigInt64Array` instance. + * + * ```js + * util.types.isBigInt64Array(new BigInt64Array()); // Returns true + * util.types.isBigInt64Array(new BigUint64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isBigInt64Array(value: unknown): value is BigInt64Array; + /** + * Returns `true` if the value is a `BigUint64Array` instance. + * + * ```js + * util.types.isBigUint64Array(new BigInt64Array()); // Returns false + * util.types.isBigUint64Array(new BigUint64Array()); // Returns true + * ``` + * @since v10.0.0 + */ + function isBigUint64Array(value: unknown): value is BigUint64Array; + /** + * Returns `true` if the value is a boolean object, e.g. created + * by `new Boolean()`. + * + * ```js + * util.types.isBooleanObject(false); // Returns false + * util.types.isBooleanObject(true); // Returns false + * util.types.isBooleanObject(new Boolean(false)); // Returns true + * util.types.isBooleanObject(new Boolean(true)); // Returns true + * util.types.isBooleanObject(Boolean(false)); // Returns false + * util.types.isBooleanObject(Boolean(true)); // Returns false + * ``` + * @since v10.0.0 + */ + function isBooleanObject(object: unknown): object is Boolean; + /** + * Returns `true` if the value is any boxed primitive object, e.g. created + * by `new Boolean()`, `new String()` or `Object(Symbol())`. + * + * For example: + * + * ```js + * util.types.isBoxedPrimitive(false); // Returns false + * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true + * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false + * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true + * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true + * ``` + * @since v10.11.0 + */ + function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; + /** + * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. + * + * ```js + * const ab = new ArrayBuffer(20); + * util.types.isDataView(new DataView(ab)); // Returns true + * util.types.isDataView(new Float64Array()); // Returns false + * ``` + * + * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * @since v10.0.0 + */ + function isDataView(object: unknown): object is DataView; + /** + * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. + * + * ```js + * util.types.isDate(new Date()); // Returns true + * ``` + * @since v10.0.0 + */ + function isDate(object: unknown): object is Date; + /** + * Returns `true` if the value is a native `External` value. + * + * A native `External` value is a special type of object that contains a + * raw C++ pointer (`void*`) for access from native code, and has no other + * properties. Such objects are created either by Node.js internals or native + * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. + * + * ```c + * #include + * #include + * napi_value result; + * static napi_value MyNapi(napi_env env, napi_callback_info info) { + * int* raw = (int*) malloc(1024); + * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); + * if (status != napi_ok) { + * napi_throw_error(env, NULL, "napi_create_external failed"); + * return NULL; + * } + * return result; + * } + * ... + * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) + * ... + * ``` + * + * ```js + * const native = require('napi_addon.node'); + * const data = native.myNapi(); + * util.types.isExternal(data); // returns true + * util.types.isExternal(0); // returns false + * util.types.isExternal(new String('foo')); // returns false + * ``` + * + * For further information on `napi_create_external`, refer to `napi_create_external()`. + * @since v10.0.0 + */ + function isExternal(object: unknown): boolean; + /** + * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. + * + * ```js + * util.types.isFloat32Array(new ArrayBuffer()); // Returns false + * util.types.isFloat32Array(new Float32Array()); // Returns true + * util.types.isFloat32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isFloat32Array(object: unknown): object is Float32Array; + /** + * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. + * + * ```js + * util.types.isFloat64Array(new ArrayBuffer()); // Returns false + * util.types.isFloat64Array(new Uint8Array()); // Returns false + * util.types.isFloat64Array(new Float64Array()); // Returns true + * ``` + * @since v10.0.0 + */ + function isFloat64Array(object: unknown): object is Float64Array; + /** + * Returns `true` if the value is a generator function. + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * util.types.isGeneratorFunction(function foo() {}); // Returns false + * util.types.isGeneratorFunction(function* foo() {}); // Returns true + * ``` + * @since v10.0.0 + */ + function isGeneratorFunction(object: unknown): object is GeneratorFunction; + /** + * Returns `true` if the value is a generator object as returned from a + * built-in generator function. + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * function* foo() {} + * const generator = foo(); + * util.types.isGeneratorObject(generator); // Returns true + * ``` + * @since v10.0.0 + */ + function isGeneratorObject(object: unknown): object is Generator; + /** + * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. + * + * ```js + * util.types.isInt8Array(new ArrayBuffer()); // Returns false + * util.types.isInt8Array(new Int8Array()); // Returns true + * util.types.isInt8Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt8Array(object: unknown): object is Int8Array; + /** + * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. + * + * ```js + * util.types.isInt16Array(new ArrayBuffer()); // Returns false + * util.types.isInt16Array(new Int16Array()); // Returns true + * util.types.isInt16Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt16Array(object: unknown): object is Int16Array; + /** + * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. + * + * ```js + * util.types.isInt32Array(new ArrayBuffer()); // Returns false + * util.types.isInt32Array(new Int32Array()); // Returns true + * util.types.isInt32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt32Array(object: unknown): object is Int32Array; + /** + * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. + * + * ```js + * util.types.isMap(new Map()); // Returns true + * ``` + * @since v10.0.0 + */ + function isMap(object: T | {}): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) : Map; + /** + * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. + * + * ```js + * const map = new Map(); + * util.types.isMapIterator(map.keys()); // Returns true + * util.types.isMapIterator(map.values()); // Returns true + * util.types.isMapIterator(map.entries()); // Returns true + * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true + * ``` + * @since v10.0.0 + */ + function isMapIterator(object: unknown): boolean; + /** + * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). + * + * ```js + * import * as ns from './a.js'; + * + * util.types.isModuleNamespaceObject(ns); // Returns true + * ``` + * @since v10.0.0 + */ + function isModuleNamespaceObject(value: unknown): boolean; + /** + * Returns `true` if the value is an instance of a built-in `Error` type. + * + * ```js + * util.types.isNativeError(new Error()); // Returns true + * util.types.isNativeError(new TypeError()); // Returns true + * util.types.isNativeError(new RangeError()); // Returns true + * ``` + * @since v10.0.0 + */ + function isNativeError(object: unknown): object is Error; + /** + * Returns `true` if the value is a number object, e.g. created + * by `new Number()`. + * + * ```js + * util.types.isNumberObject(0); // Returns false + * util.types.isNumberObject(new Number(0)); // Returns true + * ``` + * @since v10.0.0 + */ + function isNumberObject(object: unknown): object is Number; + /** + * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). + * + * ```js + * util.types.isPromise(Promise.resolve(42)); // Returns true + * ``` + * @since v10.0.0 + */ + function isPromise(object: unknown): object is Promise; + /** + * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. + * + * ```js + * const target = {}; + * const proxy = new Proxy(target, {}); + * util.types.isProxy(target); // Returns false + * util.types.isProxy(proxy); // Returns true + * ``` + * @since v10.0.0 + */ + function isProxy(object: unknown): boolean; + /** + * Returns `true` if the value is a regular expression object. + * + * ```js + * util.types.isRegExp(/abc/); // Returns true + * util.types.isRegExp(new RegExp('abc')); // Returns true + * ``` + * @since v10.0.0 + */ + function isRegExp(object: unknown): object is RegExp; + /** + * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. + * + * ```js + * util.types.isSet(new Set()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSet(object: T | {}): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; + /** + * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. + * + * ```js + * const set = new Set(); + * util.types.isSetIterator(set.keys()); // Returns true + * util.types.isSetIterator(set.values()); // Returns true + * util.types.isSetIterator(set.entries()); // Returns true + * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSetIterator(object: unknown): boolean; + /** + * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. + * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is + * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. + * + * ```js + * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false + * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; + /** + * Returns `true` if the value is a string object, e.g. created + * by `new String()`. + * + * ```js + * util.types.isStringObject('foo'); // Returns false + * util.types.isStringObject(new String('foo')); // Returns true + * ``` + * @since v10.0.0 + */ + function isStringObject(object: unknown): object is String; + /** + * Returns `true` if the value is a symbol object, created + * by calling `Object()` on a `Symbol` primitive. + * + * ```js + * const symbol = Symbol('foo'); + * util.types.isSymbolObject(symbol); // Returns false + * util.types.isSymbolObject(Object(symbol)); // Returns true + * ``` + * @since v10.0.0 + */ + function isSymbolObject(object: unknown): object is Symbol; + /** + * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. + * + * ```js + * util.types.isTypedArray(new ArrayBuffer()); // Returns false + * util.types.isTypedArray(new Uint8Array()); // Returns true + * util.types.isTypedArray(new Float64Array()); // Returns true + * ``` + * + * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * @since v10.0.0 + */ + function isTypedArray(object: unknown): object is NodeJS.TypedArray; + /** + * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. + * + * ```js + * util.types.isUint8Array(new ArrayBuffer()); // Returns false + * util.types.isUint8Array(new Uint8Array()); // Returns true + * util.types.isUint8Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint8Array(object: unknown): object is Uint8Array; + /** + * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. + * + * ```js + * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false + * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true + * util.types.isUint8ClampedArray(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; + /** + * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. + * + * ```js + * util.types.isUint16Array(new ArrayBuffer()); // Returns false + * util.types.isUint16Array(new Uint16Array()); // Returns true + * util.types.isUint16Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint16Array(object: unknown): object is Uint16Array; + /** + * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. + * + * ```js + * util.types.isUint32Array(new ArrayBuffer()); // Returns false + * util.types.isUint32Array(new Uint32Array()); // Returns true + * util.types.isUint32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint32Array(object: unknown): object is Uint32Array; + /** + * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. + * + * ```js + * util.types.isWeakMap(new WeakMap()); // Returns true + * ``` + * @since v10.0.0 + */ + function isWeakMap(object: unknown): object is WeakMap; + /** + * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. + * + * ```js + * util.types.isWeakSet(new WeakSet()); // Returns true + * ``` + * @since v10.0.0 + */ + function isWeakSet(object: unknown): object is WeakSet; + /** + * Returns `true` if `value` is a `KeyObject`, `false` otherwise. + * @since v16.2.0 + */ + function isKeyObject(object: unknown): object is KeyObject; + /** + * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. + * @since v16.2.0 + */ + function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; +} +declare module 'node:util' { + export * from 'util'; +} +declare module 'node:util/types' { + export * from 'util/types'; +} diff --git a/server/node_modules/@types/node/ts4.8/v8.d.ts b/server/node_modules/@types/node/ts4.8/v8.d.ts new file mode 100755 index 0000000000..6685dc253c --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/v8.d.ts @@ -0,0 +1,396 @@ +/** + * The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using: + * + * ```js + * const v8 = require('v8'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/v8.js) + */ +declare module 'v8' { + import { Readable } from 'node:stream'; + interface HeapSpaceInfo { + space_name: string; + space_size: number; + space_used_size: number; + space_available_size: number; + physical_space_size: number; + } + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ + type DoesZapCodeSpaceFlag = 0 | 1; + interface HeapInfo { + total_heap_size: number; + total_heap_size_executable: number; + total_physical_size: number; + total_available_size: number; + used_heap_size: number; + heap_size_limit: number; + malloced_memory: number; + peak_malloced_memory: number; + does_zap_garbage: DoesZapCodeSpaceFlag; + number_of_native_contexts: number; + number_of_detached_contexts: number; + } + interface HeapCodeStatistics { + code_and_metadata_size: number; + bytecode_and_metadata_size: number; + external_script_source_size: number; + } + /** + * Returns an integer representing a version tag derived from the V8 version, + * command-line flags, and detected CPU features. This is useful for determining + * whether a `vm.Script` `cachedData` buffer is compatible with this instance + * of V8. + * + * ```js + * console.log(v8.cachedDataVersionTag()); // 3947234607 + * // The value returned by v8.cachedDataVersionTag() is derived from the V8 + * // version, command-line flags, and detected CPU features. Test that the value + * // does indeed update when flags are toggled. + * v8.setFlagsFromString('--allow_natives_syntax'); + * console.log(v8.cachedDataVersionTag()); // 183726201 + * ``` + * @since v8.0.0 + */ + function cachedDataVersionTag(): number; + /** + * Returns an object with the following properties: + * + * `does_zap_garbage` is a 0/1 boolean, which signifies whether the`--zap_code_space` option is enabled or not. This makes V8 overwrite heap + * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger + * because it continuously touches all heap pages and that makes them less likely + * to get swapped out by the operating system. + * + * `number_of_native_contexts` The value of native\_context is the number of the + * top-level contexts currently active. Increase of this number over time indicates + * a memory leak. + * + * `number_of_detached_contexts` The value of detached\_context is the number + * of contexts that were detached and not yet garbage collected. This number + * being non-zero indicates a potential memory leak. + * + * ```js + * { + * total_heap_size: 7326976, + * total_heap_size_executable: 4194304, + * total_physical_size: 7326976, + * total_available_size: 1152656, + * used_heap_size: 3476208, + * heap_size_limit: 1535115264, + * malloced_memory: 16384, + * peak_malloced_memory: 1127496, + * does_zap_garbage: 0, + * number_of_native_contexts: 1, + * number_of_detached_contexts: 0 + * } + * ``` + * @since v1.0.0 + */ + function getHeapStatistics(): HeapInfo; + /** + * Returns statistics about the V8 heap spaces, i.e. the segments which make up + * the V8 heap. Neither the ordering of heap spaces, nor the availability of a + * heap space can be guaranteed as the statistics are provided via the + * V8[`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the + * next. + * + * The value returned is an array of objects containing the following properties: + * + * ```json + * [ + * { + * "space_name": "new_space", + * "space_size": 2063872, + * "space_used_size": 951112, + * "space_available_size": 80824, + * "physical_space_size": 2063872 + * }, + * { + * "space_name": "old_space", + * "space_size": 3090560, + * "space_used_size": 2493792, + * "space_available_size": 0, + * "physical_space_size": 3090560 + * }, + * { + * "space_name": "code_space", + * "space_size": 1260160, + * "space_used_size": 644256, + * "space_available_size": 960, + * "physical_space_size": 1260160 + * }, + * { + * "space_name": "map_space", + * "space_size": 1094160, + * "space_used_size": 201608, + * "space_available_size": 0, + * "physical_space_size": 1094160 + * }, + * { + * "space_name": "large_object_space", + * "space_size": 0, + * "space_used_size": 0, + * "space_available_size": 1490980608, + * "physical_space_size": 0 + * } + * ] + * ``` + * @since v6.0.0 + */ + function getHeapSpaceStatistics(): HeapSpaceInfo[]; + /** + * The `v8.setFlagsFromString()` method can be used to programmatically set + * V8 command-line flags. This method should be used with care. Changing settings + * after the VM has started may result in unpredictable behavior, including + * crashes and data loss; or it may simply do nothing. + * + * The V8 options available for a version of Node.js may be determined by running`node --v8-options`. + * + * Usage: + * + * ```js + * // Print GC events to stdout for one minute. + * const v8 = require('v8'); + * v8.setFlagsFromString('--trace_gc'); + * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); + * ``` + * @since v1.0.0 + */ + function setFlagsFromString(flags: string): void; + /** + * Generates a snapshot of the current V8 heap and returns a Readable + * Stream that may be used to read the JSON serialized representation. + * This JSON stream format is intended to be used with tools such as + * Chrome DevTools. The JSON schema is undocumented and specific to the + * V8 engine. Therefore, the schema may change from one version of V8 to the next. + * + * Creating a heap snapshot requires memory about twice the size of the heap at + * the time the snapshot is created. This results in the risk of OOM killers + * terminating the process. + * + * Generating a snapshot is a synchronous operation which blocks the event loop + * for a duration depending on the heap size. + * + * ```js + * // Print heap snapshot to the console + * const v8 = require('v8'); + * const stream = v8.getHeapSnapshot(); + * stream.pipe(process.stdout); + * ``` + * @since v11.13.0 + * @return A Readable Stream containing the V8 heap snapshot + */ + function getHeapSnapshot(): Readable; + /** + * Generates a snapshot of the current V8 heap and writes it to a JSON + * file. This file is intended to be used with tools such as Chrome + * DevTools. The JSON schema is undocumented and specific to the V8 + * engine, and may change from one version of V8 to the next. + * + * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will + * not contain any information about the workers, and vice versa. + * + * Creating a heap snapshot requires memory about twice the size of the heap at + * the time the snapshot is created. This results in the risk of OOM killers + * terminating the process. + * + * Generating a snapshot is a synchronous operation which blocks the event loop + * for a duration depending on the heap size. + * + * ```js + * const { writeHeapSnapshot } = require('v8'); + * const { + * Worker, + * isMainThread, + * parentPort + * } = require('worker_threads'); + * + * if (isMainThread) { + * const worker = new Worker(__filename); + * + * worker.once('message', (filename) => { + * console.log(`worker heapdump: ${filename}`); + * // Now get a heapdump for the main thread. + * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); + * }); + * + * // Tell the worker to create a heapdump. + * worker.postMessage('heapdump'); + * } else { + * parentPort.once('message', (message) => { + * if (message === 'heapdump') { + * // Generate a heapdump for the worker + * // and return the filename to the parent. + * parentPort.postMessage(writeHeapSnapshot()); + * } + * }); + * } + * ``` + * @since v11.13.0 + * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be + * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a + * worker thread. + * @return The filename where the snapshot was saved. + */ + function writeHeapSnapshot(filename?: string): string; + /** + * Returns an object with the following properties: + * + * ```js + * { + * code_and_metadata_size: 212208, + * bytecode_and_metadata_size: 161368, + * external_script_source_size: 1410794 + * } + * ``` + * @since v12.8.0 + */ + function getHeapCodeStatistics(): HeapCodeStatistics; + /** + * @since v8.0.0 + */ + class Serializer { + /** + * Writes out a header, which includes the serialization format version. + */ + writeHeader(): void; + /** + * Serializes a JavaScript value and adds the serialized representation to the + * internal buffer. + * + * This throws an error if `value` cannot be serialized. + */ + writeValue(val: any): boolean; + /** + * Returns the stored internal buffer. This serializer should not be used once + * the buffer is released. Calling this method results in undefined behavior + * if a previous write has failed. + */ + releaseBuffer(): Buffer; + /** + * Marks an `ArrayBuffer` as having its contents transferred out of band. + * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. + * @param id A 32-bit unsigned integer. + * @param arrayBuffer An `ArrayBuffer` instance. + */ + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; + /** + * Write a raw 32-bit unsigned integer. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeUint32(value: number): void; + /** + * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeUint64(hi: number, lo: number): void; + /** + * Write a JS `number` value. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeDouble(value: number): void; + /** + * Write raw bytes into the serializer’s internal buffer. The deserializer + * will require a way to compute the length of the buffer. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeRawBytes(buffer: NodeJS.TypedArray): void; + } + /** + * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only + * stores the part of their underlying `ArrayBuffer`s that they are referring to. + * @since v8.0.0 + */ + class DefaultSerializer extends Serializer {} + /** + * @since v8.0.0 + */ + class Deserializer { + constructor(data: NodeJS.TypedArray); + /** + * Reads and validates a header (including the format version). + * May, for example, reject an invalid or unsupported wire format. In that case, + * an `Error` is thrown. + */ + readHeader(): boolean; + /** + * Deserializes a JavaScript value from the buffer and returns it. + */ + readValue(): any; + /** + * Marks an `ArrayBuffer` as having its contents transferred out of band. + * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of + * `SharedArrayBuffer`s). + * @param id A 32-bit unsigned integer. + * @param arrayBuffer An `ArrayBuffer` instance. + */ + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; + /** + * Reads the underlying wire format version. Likely mostly to be useful to + * legacy code reading old wire format versions. May not be called before`.readHeader()`. + */ + getWireFormatVersion(): number; + /** + * Read a raw 32-bit unsigned integer and return it. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readUint32(): number; + /** + * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]`with two 32-bit unsigned integer entries. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readUint64(): [number, number]; + /** + * Read a JS `number` value. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readDouble(): number; + /** + * Read raw bytes from the deserializer’s internal buffer. The `length` parameter + * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readRawBytes(length: number): Buffer; + } + /** + * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. + * @since v8.0.0 + */ + class DefaultDeserializer extends Deserializer {} + /** + * Uses a `DefaultSerializer` to serialize `value` into a buffer. + * + * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to + * serialize a huge object which requires buffer + * larger than `buffer.constants.MAX_LENGTH`. + * @since v8.0.0 + */ + function serialize(value: any): Buffer; + /** + * Uses a `DefaultDeserializer` with default options to read a JS value + * from a buffer. + * @since v8.0.0 + * @param buffer A buffer returned by {@link serialize}. + */ + function deserialize(buffer: NodeJS.TypedArray): any; + /** + * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple + * times during the lifetime of the process. Each time the execution counter will + * be reset and a new coverage report will be written to the directory specified + * by `NODE_V8_COVERAGE`. + * + * When the process is about to exit, one last coverage will still be written to + * disk unless {@link stopCoverage} is invoked before the process exits. + * @since v15.1.0, v14.18.0, v12.22.0 + */ + function takeCoverage(): void; + /** + * The `v8.stopCoverage()` method allows the user to stop the coverage collection + * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count + * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. + * @since v15.1.0, v14.18.0, v12.22.0 + */ + function stopCoverage(): void; +} +declare module 'node:v8' { + export * from 'v8'; +} diff --git a/server/node_modules/@types/node/ts4.8/vm.d.ts b/server/node_modules/@types/node/ts4.8/vm.d.ts new file mode 100755 index 0000000000..c96513a505 --- /dev/null +++ b/server/node_modules/@types/node/ts4.8/vm.d.ts @@ -0,0 +1,509 @@ +/** + * The `vm` module enables compiling and running code within V8 Virtual + * Machine contexts. + * + * **The `vm` module is not a security** + * **mechanism. Do not use it to run untrusted code.** + * + * JavaScript code can be compiled and run immediately or + * compiled, saved, and run later. + * + * A common use case is to run the code in a different V8 Context. This means + * invoked code has a different global object than the invoking code. + * + * One can provide the context by `contextifying` an + * object. The invoked code treats any property in the context like a + * global variable. Any changes to global variables caused by the invoked + * code are reflected in the context object. + * + * ```js + * const vm = require('vm'); + * + * const x = 1; + * + * const context = { x: 2 }; + * vm.createContext(context); // Contextify the object. + * + * const code = 'x += 40; var y = 17;'; + * // `x` and `y` are global variables in the context. + * // Initially, x has the value 2 because that is the value of context.x. + * vm.runInContext(code, context); + * + * console.log(context.x); // 42 + * console.log(context.y); // 17 + * + * console.log(x); // 1; y is not defined. + * ``` + * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/vm.js) + */ +declare module 'vm' { + interface Context extends NodeJS.Dict {} + interface BaseOptions { + /** + * Specifies the filename used in stack traces produced by this script. + * Default: `''`. + */ + filename?: string | undefined; + /** + * Specifies the line number offset that is displayed in stack traces produced by this script. + * Default: `0`. + */ + lineOffset?: number | undefined; + /** + * Specifies the column number offset that is displayed in stack traces produced by this script. + * @default 0 + */ + columnOffset?: number | undefined; + } + interface ScriptOptions extends BaseOptions { + displayErrors?: boolean | undefined; + timeout?: number | undefined; + cachedData?: Buffer | undefined; + /** @deprecated in favor of `script.createCachedData()` */ + produceCachedData?: boolean | undefined; + } + interface RunningScriptOptions extends BaseOptions { + /** + * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. + * Default: `true`. + */ + displayErrors?: boolean | undefined; + /** + * Specifies the number of milliseconds to execute code before terminating execution. + * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. + */ + timeout?: number | undefined; + /** + * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. + * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. + * If execution is terminated, an `Error` will be thrown. + * Default: `false`. + */ + breakOnSigint?: boolean | undefined; + /** + * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. + */ + microtaskMode?: 'afterEvaluate' | undefined; + } + interface CompileFunctionOptions extends BaseOptions { + /** + * Provides an optional data with V8's code cache data for the supplied source. + */ + cachedData?: Buffer | undefined; + /** + * Specifies whether to produce new cache data. + * Default: `false`, + */ + produceCachedData?: boolean | undefined; + /** + * The sandbox/context in which the said function should be compiled in. + */ + parsingContext?: Context | undefined; + /** + * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling + */ + contextExtensions?: Object[] | undefined; + } + interface CreateContextOptions { + /** + * Human-readable name of the newly created context. + * @default 'VM Context i' Where i is an ascending numerical index of the created context. + */ + name?: string | undefined; + /** + * Corresponds to the newly created context for display purposes. + * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), + * like the value of the `url.origin` property of a URL object. + * Most notably, this string should omit the trailing slash, as that denotes a path. + * @default '' + */ + origin?: string | undefined; + codeGeneration?: + | { + /** + * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) + * will throw an EvalError. + * @default true + */ + strings?: boolean | undefined; + /** + * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. + * @default true + */ + wasm?: boolean | undefined; + } + | undefined; + /** + * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. + */ + microtaskMode?: 'afterEvaluate' | undefined; + } + type MeasureMemoryMode = 'summary' | 'detailed'; + interface MeasureMemoryOptions { + /** + * @default 'summary' + */ + mode?: MeasureMemoryMode | undefined; + context?: Context | undefined; + } + interface MemoryMeasurement { + total: { + jsMemoryEstimate: number; + jsMemoryRange: [number, number]; + }; + } + /** + * Instances of the `vm.Script` class contain precompiled scripts that can be + * executed in specific contexts. + * @since v0.3.1 + */ + class Script { + constructor(code: string, options?: ScriptOptions); + /** + * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access + * to local scope. + * + * The following example compiles code that increments a global variable, sets + * the value of another global variable, then execute the code multiple times. + * The globals are contained in the `context` object. + * + * ```js + * const vm = require('vm'); + * + * const context = { + * animal: 'cat', + * count: 2 + * }; + * + * const script = new vm.Script('count += 1; name = "kitty";'); + * + * vm.createContext(context); + * for (let i = 0; i < 10; ++i) { + * script.runInContext(context); + * } + * + * console.log(context); + * // Prints: { animal: 'cat', count: 12, name: 'kitty' } + * ``` + * + * Using the `timeout` or `breakOnSigint` options will result in new event loops + * and corresponding threads being started, which have a non-zero performance + * overhead. + * @since v0.3.1 + * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method. + * @return the result of the very last statement executed in the script. + */ + runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any; + /** + * First contextifies the given `contextObject`, runs the compiled code contained + * by the `vm.Script` object within the created context, and returns the result. + * Running code does not have access to local scope. + * + * The following example compiles code that sets a global variable, then executes + * the code multiple times in different contexts. The globals are set on and + * contained within each individual `context`. + * + * ```js + * const vm = require('vm'); + * + * const script = new vm.Script('globalVar = "set"'); + * + * const contexts = [{}, {}, {}]; + * contexts.forEach((context) => { + * script.runInNewContext(context); + * }); + * + * console.log(contexts); + * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] + * ``` + * @since v0.3.1 + * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. + * @return the result of the very last statement executed in the script. + */ + runInNewContext(contextObject?: Context, options?: RunningScriptOptions): any; + /** + * Runs the compiled code contained by the `vm.Script` within the context of the + * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object. + * + * The following example compiles code that increments a `global` variable then + * executes that code multiple times: + * + * ```js + * const vm = require('vm'); + * + * global.globalVar = 0; + * + * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); + * + * for (let i = 0; i < 1000; ++i) { + * script.runInThisContext(); + * } + * + * console.log(globalVar); + * + * // 1000 + * ``` + * @since v0.3.1 + * @return the result of the very last statement executed in the script. + */ + runInThisContext(options?: RunningScriptOptions): any; + /** + * Creates a code cache that can be used with the `Script` constructor's`cachedData` option. Returns a `Buffer`. This method may be called at any + * time and any number of times. + * + * ```js + * const script = new vm.Script(` + * function add(a, b) { + * return a + b; + * } + * + * const x = add(1, 2); + * `); + * + * const cacheWithoutX = script.createCachedData(); + * + * script.runInThisContext(); + * + * const cacheWithX = script.createCachedData(); + * ``` + * @since v10.6.0 + */ + createCachedData(): Buffer; + /** @deprecated in favor of `script.createCachedData()` */ + cachedDataProduced?: boolean | undefined; + cachedDataRejected?: boolean | undefined; + cachedData?: Buffer | undefined; + } + /** + * If given a `contextObject`, the `vm.createContext()` method will `prepare + * that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts, + * the `contextObject` will be the global object, retaining all of its existing + * properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables + * will remain unchanged. + * + * ```js + * const vm = require('vm'); + * + * global.globalVar = 3; + * + * const context = { globalVar: 1 }; + * vm.createContext(context); + * + * vm.runInContext('globalVar *= 2;', context); + * + * console.log(context); + * // Prints: { globalVar: 2 } + * + * console.log(global.globalVar); + * // Prints: 3 + * ``` + * + * If `contextObject` is omitted (or passed explicitly as `undefined`), a new, + * empty `contextified` object will be returned. + * + * The `vm.createContext()` method is primarily useful for creating a single + * context that can be used to run multiple scripts. For instance, if emulating a + * web browser, the method can be used to create a single context representing a + * window's global object, then run all `` + +[Get supported base64-js with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-base64-js?utm_source=npm-base64-js&utm_medium=referral&utm_campaign=readme) + +## methods + +`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument. + +* `byteLength` - Takes a base64 string and returns length of byte array +* `toByteArray` - Takes a base64 string and returns a byte array +* `fromByteArray` - Takes a byte array and returns a base64 string + +## license + +MIT diff --git a/server/node_modules/base64-js/base64js.min.js b/server/node_modules/base64-js/base64js.min.js new file mode 100644 index 0000000000..908ac83fd1 --- /dev/null +++ b/server/node_modules/base64-js/base64js.min.js @@ -0,0 +1 @@ +(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.base64js=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c>16,j[k++]=255&b>>8,j[k++]=255&b;return 2===h&&(b=l[a.charCodeAt(c)]<<2|l[a.charCodeAt(c+1)]>>4,j[k++]=255&b),1===h&&(b=l[a.charCodeAt(c)]<<10|l[a.charCodeAt(c+1)]<<4|l[a.charCodeAt(c+2)]>>2,j[k++]=255&b>>8,j[k++]=255&b),j}function g(a){return k[63&a>>18]+k[63&a>>12]+k[63&a>>6]+k[63&a]}function h(a,b,c){for(var d,e=[],f=b;fj?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] +} + +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) + + var curByte = 0 + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen + + var i + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } + + return parts.join('') +} diff --git a/server/node_modules/base64-js/package.json b/server/node_modules/base64-js/package.json new file mode 100644 index 0000000000..c3972e39f2 --- /dev/null +++ b/server/node_modules/base64-js/package.json @@ -0,0 +1,47 @@ +{ + "name": "base64-js", + "description": "Base64 encoding/decoding in pure JS", + "version": "1.5.1", + "author": "T. Jameson Little ", + "typings": "index.d.ts", + "bugs": { + "url": "https://github.com/beatgammit/base64-js/issues" + }, + "devDependencies": { + "babel-minify": "^0.5.1", + "benchmark": "^2.1.4", + "browserify": "^16.3.0", + "standard": "*", + "tape": "4.x" + }, + "homepage": "https://github.com/beatgammit/base64-js", + "keywords": [ + "base64" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/beatgammit/base64-js.git" + }, + "scripts": { + "build": "browserify -s base64js -r ./ | minify > base64js.min.js", + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/server/node_modules/bowser/CHANGELOG.md b/server/node_modules/bowser/CHANGELOG.md new file mode 100644 index 0000000000..260a03d914 --- /dev/null +++ b/server/node_modules/bowser/CHANGELOG.md @@ -0,0 +1,218 @@ +# Bowser Changelog + +### 2.11.0 (Sep 12, 2020) +- [ADD] Added support for aliases in `Parser#is` method (#437) +- [ADD] Added more typings (#438, #427) +- [ADD] Added support for MIUI Browserr (#436) + +### 2.10.0 (Jul 9, 2020) +- [FIX] Fix for Firefox detection on iOS 13 [#415] +- [FIX] Fixes for typings.d.ts [#409] +- [FIX] Updated development dependencies + +### 2.9.0 (Jan 28, 2020) +- [ADD] Export more methods and constants via .d.ts [#388], [#390] + +### 2.8.1 (Dec 26, 2019) +- [FIX] Reverted [#382] as it broke build + +### 2.8.0 (Dec 26, 2019) +- [ADD] Add polyfills for Array.find & Object.assign [#383] +- [ADD] Export constants with types.d.ts [#382] +- [FIX] Add support for WeChat on Windows [#381] +- [FIX] Fix detection of Firefox on iPad [#379] +- [FIX] Add detection of Electron [#375] +- [FIX] Updated dev-dependencies + +### 2.7.0 (Oct 2, 2019) +- [FIX] Add support for QQ Browser [#362] +- [FIX] Add support for GSA [#364] +- [FIX] Updated dependencies + +### 2.6.0 (Sep 6, 2019) +- [ADD] Define "module" export in package.json [#354] +- [FIX] Fix Tablet PC detection [#334] + +### 2.5.4 (Sep 2, 2019) +- [FIX] Exclude docs from the npm package [#349] + +### 2.5.3 (Aug 4, 2019) +- [FIX] Add MacOS names support [#338] +- [FIX] Point typings.d.ts from package.json [#341] +- [FIX] Upgrade dependencies + +### 2.5.2 (July 17, 2019) +- [FIX] Fixes the bug undefined method because of failed build (#335) + +### 2.5.1 (July 17, 2019) +- [FIX] Fixes the bug with a custom Error class (#335) +- [FIX] Fixes the settings for Babel to reduce the bundle size (#259) + +### 2.5.0 (July 16, 2019) +- [ADD] Add constant output so that users can quickly get all types (#325) +- [FIX] Add support for Roku OS (#332) +- [FIX] Update devDependencies +- [FIX] Fix docs, README and added funding information + +### 2.4.0 (May 3, 2019) +- [FIX] Update regexp for generic browsers (#310) +- [FIX] Fix issues with module.exports (#318) +- [FIX] Update devDependencies (#316, #321, #322) +- [FIX] Fix docs (#320) + +### 2.3.0 (April 14, 2019) +- [ADD] Add support for Blink-based MS Edge (#311) +- [ADD] Add more types for TS (#289) +- [FIX] Update dev-dependencies +- [FIX] Update docs + +### 2.2.1 (April 12, 2019) +- [ADD] Add an alias for Samsung Internet +- [FIX] Fix browser name detection for browsers without an alias (#313) + +### 2.2.0 (April 7, 2019) +- [ADD] Add short aliases for browser names (#295) +- [FIX] Fix Yandex Browser version detection (#308) + +### 2.1.2 (March 6, 2019) +- [FIX] Fix buggy `getFirstMatch` reference + +### 2.1.1 (March 6, 2019) +- [ADD] Add detection of PlayStation 4 (#291) +- [ADD] Deploy docs on GH Pages (#293) +- [FIX] Fix files extensions for importing (#294) +- [FIX] Fix docs (#295) + +### 2.1.0 (January 24, 2019) +- [ADD] Add new `Parser.getEngineName()` method (#288) +- [ADD] Add detection of ChromeOS (#287) +- [FIX] Fix README + +### 2.0.0 (January 19, 2019) +- [ADD] Support a non strict equality in `Parser.satisfies()` (#275) +- [ADD] Add Android versions names (#276) +- [ADD] Add a typings file (#277) +- [ADD] Added support for Googlebot recognition (#278) +- [FIX] Update building tools, avoid security issues + +### 2.0.0-beta.3 (September 15, 2018) +- [FIX] Fix Chrome Mobile detection (#253) +- [FIX] Use built bowser for CI (#252) +- [FIX] Update babel-plugin-add-module-exports (#251) + +### 2.0.0-beta.2 (September 9, 2018) +- [FIX] Fix failing comparing version through `Parser.satisfies` (#243) +- [FIX] Fix travis testing, include eslint into CI testing +- [FIX] Add support for Maxthon desktop browser (#246) +- [FIX] Add support for Swing browser (#248) +- [DOCS] Regenerate docs + +### 2.0.0-beta.1 (August 18, 2018) +- [ADD] Add loose version comparison to `Parser.compareVersion()` and `Parser.satisfies()` +- [CHORE] Add CONTRIBUTING.md +- [DOCS] Regenerate docs + +### 2.0.0-alpha.4 (August 2, 2018) +- [DOCS] Fix usage docs (#238) +- [CHANGE] Make `./es5.js` the main file of the package (#239) + +### 2.0.0-alpha.3 (July 22, 2018) +- [CHANGE] Rename split and rename `compiled.js` to `es5.js` and `bundled.js` (#231, #236, #237) +- [ADD] Add `Parser.some` (#235) + +### 2.0.0-alpha.2 (July 17, 2018) +- [CHANGE] Make `src/bowser` main file instead of the bundled one +- [CHANGE] Move the bundled file to the root of the package to make it possible to `require('bowser/compiled')` (#231) +- [REMOVE] Remove `typings.d.ts` before stable release (#232) +- [FIX] Improve Nexus devices detection (#233) + +### 2.0.0-alpha.1 (July 9, 2018) +- [ADD] `Bowser.getParser()` +- [ADD] `Bowser.parse` +- [ADD] `Parser` class which describes parsing process +- [CHANGE] Change bowser's returning object +- [REMOVE] Remove bower support + +### 1.9.4 (June 28, 2018) +- [FIX] Fix NAVER Whale browser detection (#220) +- [FIX] Fix MZ Browser browser detection (#219) +- [FIX] Fix Firefox Focus browser detection (#191) +- [FIX] Fix webOS browser detection (#186) + +### 1.9.3 (March 12, 2018) +- [FIX] Fix `typings.d.ts` — add `ipad`, `iphone`, `ipod` flags to the interface + +### 1.9.2 (February 5, 2018) +- [FIX] Fix `typings.d.ts` — add `osname` flag to the interface + +### 1.9.1 (December 22, 2017) +- [FIX] Fix `typings.d.ts` — add `chromium` flag to the interface + +### 1.9.0 (December 20, 2017) +- [ADD] Add a public method `.detect()` (#205) +- [DOCS] Fix description of `chromium` flag in docs (#206) + +### 1.8.1 (October 7, 2017) +- [FIX] Fix detection of MS Edge on Android and iOS (#201) + +### 1.8.0 (October 7, 2017) +- [ADD] Add `osname` into result object (#200) + +### 1.7.3 (August 30, 2017) +- [FIX] Fix detection of Chrome on Android 8 OPR6 (#193) + +### 1.7.2 (August 17, 2017) +- [FIX] Fix typings.d.ts according to #185 + +### 1.7.1 (July 13, 2017) +- [ADD] Fix detecting of Tablet PC as tablet (#183) + +### 1.7.0 (May 18, 2017) +- [ADD] Add OS version support for Windows and macOS (#178) + +### 1.6.0 (December 5, 2016) +- [ADD] Add some tests for Windows devices (#89) +- [ADD] Add `root` to initialization process (#170) +- [FIX] Upgrade .travis.yml config + +### 1.5.0 (October 31, 2016) +- [ADD] Throw an error when `minVersion` map has not a string as a version and fix readme (#165) +- [FIX] Fix truly detection of Windows Phones (#167) + +### 1.4.6 (September 19, 2016) +- [FIX] Fix mobile Opera's version detection on Android +- [FIX] Fix typescript typings — add `mobile` and `tablet` flags +- [DOC] Fix description of `bowser.check` + +### 1.4.5 (August 30, 2016) + +- [FIX] Add support of Samsung Internet for Android +- [FIX] Fix case when `navigator.userAgent` is `undefined` +- [DOC] Add information about `strictMode` in `check` function +- [DOC] Consistent use of `bowser` variable in the README + +### 1.4.4 (August 10, 2016) + +- [FIX] Fix AMD `define` call — pass name to the function + +### 1.4.3 (July 27, 2016) + +- [FIX] Fix error `Object doesn't support this property or method` on IE8 + +### 1.4.2 (July 26, 2016) + +- [FIX] Fix missing `isUnsupportedBrowser` in typings description +- [DOC] Fix `check`'s declaration in README + +### 1.4.1 (July 7, 2016) + +- [FIX] Fix `strictMode` logic for `isUnsupportedBrowser` + +### 1.4.0 (June 28, 2016) + +- [FEATURE] Add `bowser.compareVersions` method +- [FEATURE] Add `bowser.isUnsupportedBrowser` method +- [FEATURE] Add `bowser.check` method +- [DOC] Changelog started +- [DOC] Add API section to README +- [FIX] Fix detection of browser type (A/C/X) for Chromium diff --git a/server/node_modules/bowser/LICENSE b/server/node_modules/bowser/LICENSE new file mode 100644 index 0000000000..94085f02b1 --- /dev/null +++ b/server/node_modules/bowser/LICENSE @@ -0,0 +1,39 @@ +Copyright 2015, Dustin Diaz (the "Original Author") +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +Distributions of all or part of the Software intended to be used +by the recipients as they would use the unmodified Software, +containing modifications that substantially alter, remove, or +disable functionality of the Software, outside of the documented +configuration mechanisms provided by the Software, shall be +modified such that the Original Author's bug reporting email +addresses and urls are either replaced with the contact information +of the parties responsible for the changes, or removed entirely. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + +Except where noted, this license applies to any and all software +programs and associated documentation files created by the +Original Author, when distributed with the Software. diff --git a/server/node_modules/bowser/README.md b/server/node_modules/bowser/README.md new file mode 100644 index 0000000000..8f5f915b02 --- /dev/null +++ b/server/node_modules/bowser/README.md @@ -0,0 +1,179 @@ +## Bowser +A small, fast and rich-API browser/platform/engine detector for both browser and node. +- **Small.** Use plain ES5-version which is ~4.8kB gzipped. +- **Optimized.** Use only those parsers you need — it doesn't do useless work. +- **Multi-platform.** It's browser- and node-ready, so you can use it in any environment. + +Don't hesitate to support the project on Github or [OpenCollective](https://opencollective.com/bowser) if you like it ❤️ Also, contributors are always welcome! + +[![Financial Contributors on Open Collective](https://opencollective.com/bowser/all/badge.svg?label=financial+contributors)](https://opencollective.com/bowser) [![Build Status](https://travis-ci.org/lancedikson/bowser.svg?branch=master)](https://travis-ci.org/lancedikson/bowser/) [![Greenkeeper badge](https://badges.greenkeeper.io/lancedikson/bowser.svg)](https://greenkeeper.io/) [![Coverage Status](https://coveralls.io/repos/github/lancedikson/bowser/badge.svg?branch=master)](https://coveralls.io/github/lancedikson/bowser?branch=master) ![Downloads](https://img.shields.io/npm/dm/bowser) + +# Contents +- [Overview](#overview) +- [Use cases](#use-cases) +- [Advanced usage](#advanced-usage) +- [How can I help?](#contributing) + +# Overview + +The library is made to help to detect what browser your user has and gives you a convenient API to filter the users somehow depending on their browsers. Check it out on this page: https://bowser-js.github.io/bowser-online/. + +### ⚠️ Version 2.0 breaking changes ⚠️ + +Version 2.0 has drastically changed the API. All available methods are on the [docs page](https://lancedikson.github.io/bowser/docs). + +_For legacy code, check out the [1.x](https://github.com/lancedikson/bowser/tree/v1.x) branch and install it through `npm install bowser@1.9.4`._ + +# Use cases + +First of all, require the library. This is a UMD Module, so it will work for AMD, TypeScript, ES6, and CommonJS module systems. + +```javascript +const Bowser = require("bowser"); // CommonJS + +import * as Bowser from "bowser"; // TypeScript + +import Bowser from "bowser"; // ES6 (and TypeScript with --esModuleInterop enabled) +``` + +By default, the exported version is the *ES5 transpiled version*, which **do not** include any polyfills. + +In case you don't use your own `babel-polyfill` you may need to have pre-built bundle with all needed polyfills. +So, for you it's suitable to require bowser like this: `require('bowser/bundled')`. +As the result, you get a ES5 version of bowser with `babel-polyfill` bundled together. + +You may need to use the source files, so they will be available in the package as well. + +## Browser props detection + +Often we need to pick users' browser properties such as the name, the version, the rendering engine and so on. Here is an example how to do it with Bowser: + +```javascript +const browser = Bowser.getParser(window.navigator.userAgent); + +console.log(`The current browser name is "${browser.getBrowserName()}"`); +// The current browser name is "Internet Explorer" +``` + +or + +```javascript +const browser = Bowser.getParser(window.navigator.userAgent); +console.log(browser.getBrowser()); + +// outputs +{ + name: "Internet Explorer" + version: "11.0" +} +``` + +or + +```javascript +console.log(Bowser.parse(window.navigator.userAgent)); + +// outputs +{ + browser: { + name: "Internet Explorer" + version: "11.0" + }, + os: { + name: "Windows" + version: "NT 6.3" + versionName: "8.1" + }, + platform: { + type: "desktop" + }, + engine: { + name: "Trident" + version: "7.0" + } +} +``` + + +## Filtering browsers + +You could want to filter some particular browsers to provide any special support for them or make any workarounds. +It could look like this: + +```javascript +const browser = Bowser.getParser(window.navigator.userAgent); +const isValidBrowser = browser.satisfies({ + // declare browsers per OS + windows: { + "internet explorer": ">10", + }, + macos: { + safari: ">10.1" + }, + + // per platform (mobile, desktop or tablet) + mobile: { + safari: '>=9', + 'android browser': '>3.10' + }, + + // or in general + chrome: "~20.1.1432", + firefox: ">31", + opera: ">=22", + + // also supports equality operator + chrome: "=20.1.1432", // will match particular build only + + // and loose-equality operator + chrome: "~20", // will match any 20.* sub-version + chrome: "~20.1" // will match any 20.1.* sub-version (20.1.19 as well as 20.1.12.42-alpha.1) +}); +``` + +Settings for any particular OS or platform has more priority and redefines settings of standalone browsers. +Thus, you can define OS or platform specific rules and they will have more priority in the end. + +More of API and possibilities you will find in the `docs` folder. + +### Browser names for `.satisfies()` + +By default you are supposed to use the full browser name for `.satisfies`. +But, there's a short way to define a browser using short aliases. The full +list of aliases can be found in [the file](src/constants.js). + +## Similar Projects +* [Kong](https://github.com/BigBadBleuCheese/Kong) - A C# port of Bowser. + +## Contributors + +### Code Contributors + +This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. + + +### Financial Contributors + +Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/bowser/contribute)] + +#### Individuals + + + +#### Organizations + +Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/bowser/contribute)] + + + + + + + + + + + + +## License +Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/server/node_modules/bowser/bundled.js b/server/node_modules/bowser/bundled.js new file mode 100644 index 0000000000..066ac4090c --- /dev/null +++ b/server/node_modules/bowser/bundled.js @@ -0,0 +1 @@ +!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.bowser=n():t.bowser=n()}(this,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=129)}([function(t,n,e){var r=e(1),i=e(7),o=e(14),u=e(11),a=e(19),c=function(t,n,e){var s,f,l,h,d=t&c.F,p=t&c.G,v=t&c.S,g=t&c.P,y=t&c.B,m=p?r:v?r[n]||(r[n]={}):(r[n]||{}).prototype,b=p?i:i[n]||(i[n]={}),S=b.prototype||(b.prototype={});for(s in p&&(e=n),e)l=((f=!d&&m&&void 0!==m[s])?m:e)[s],h=y&&f?a(l,r):g&&"function"==typeof l?a(Function.call,l):l,m&&u(m,s,l,t&c.U),b[s]!=l&&o(b,s,h),g&&S[s]!=l&&(S[s]=l)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,e){var r=e(4);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){var r=e(50)("wks"),i=e(31),o=e(1).Symbol,u="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=r},function(t,n,e){var r=e(21),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,n){var e=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=e)},function(t,n,e){t.exports=!e(2)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,n,e){var r=e(3),i=e(96),o=e(28),u=Object.defineProperty;n.f=e(8)?Object.defineProperty:function(t,n,e){if(r(t),n=o(n,!0),r(e),i)try{return u(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(26);t.exports=function(t){return Object(r(t))}},function(t,n,e){var r=e(1),i=e(14),o=e(13),u=e(31)("src"),a=e(134),c=(""+a).split("toString");e(7).inspectSource=function(t){return a.call(t)},(t.exports=function(t,n,e,a){var s="function"==typeof e;s&&(o(e,"name")||i(e,"name",n)),t[n]!==e&&(s&&(o(e,u)||i(e,u,t[n]?""+t[n]:c.join(String(n)))),t===r?t[n]=e:a?t[n]?t[n]=e:i(t,n,e):(delete t[n],i(t,n,e)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[u]||a.call(this)}))},function(t,n,e){var r=e(0),i=e(2),o=e(26),u=/"/g,a=function(t,n,e,r){var i=String(o(t)),a="<"+n;return""!==e&&(a+=" "+e+'="'+String(r).replace(u,""")+'"'),a+">"+i+""};t.exports=function(t,n){var e={};e[t]=n(a),r(r.P+r.F*i((function(){var n=""[t]('"');return n!==n.toLowerCase()||n.split('"').length>3})),"String",e)}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){var r=e(9),i=e(30);t.exports=e(8)?function(t,n,e){return r.f(t,n,i(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(46),i=e(26);t.exports=function(t){return r(i(t))}},function(t,n,e){"use strict";var r=e(2);t.exports=function(t,n){return!!t&&r((function(){n?t.call(null,(function(){}),1):t.call(null)}))}},function(t,n,e){"use strict";n.__esModule=!0,n.default=void 0;var r=e(18),i=function(){function t(){}return t.getFirstMatch=function(t,n){var e=n.match(t);return e&&e.length>0&&e[1]||""},t.getSecondMatch=function(t,n){var e=n.match(t);return e&&e.length>1&&e[2]||""},t.matchAndReturnConst=function(t,n,e){if(t.test(n))return e},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var n=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(n.push(0),10===n[0])switch(n[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var n=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(n.push(0),!(1===n[0]&&n[1]<5))return 1===n[0]&&n[1]<6?"Cupcake":1===n[0]&&n[1]>=6?"Donut":2===n[0]&&n[1]<2?"Eclair":2===n[0]&&2===n[1]?"Froyo":2===n[0]&&n[1]>2?"Gingerbread":3===n[0]?"Honeycomb":4===n[0]&&n[1]<1?"Ice Cream Sandwich":4===n[0]&&n[1]<4?"Jelly Bean":4===n[0]&&n[1]>=4?"KitKat":5===n[0]?"Lollipop":6===n[0]?"Marshmallow":7===n[0]?"Nougat":8===n[0]?"Oreo":9===n[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(n,e,r){void 0===r&&(r=!1);var i=t.getVersionPrecision(n),o=t.getVersionPrecision(e),u=Math.max(i,o),a=0,c=t.map([n,e],(function(n){var e=u-t.getVersionPrecision(n),r=n+new Array(e+1).join(".0");return t.map(r.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(r&&(a=u-Math.min(i,o)),u-=1;u>=a;){if(c[0][u]>c[1][u])return 1;if(c[0][u]===c[1][u]){if(u===a)return 0;u-=1}else if(c[0][u]1?i-1:0),u=1;u0?r:e)(t)}},function(t,n,e){var r=e(47),i=e(30),o=e(15),u=e(28),a=e(13),c=e(96),s=Object.getOwnPropertyDescriptor;n.f=e(8)?s:function(t,n){if(t=o(t),n=u(n,!0),c)try{return s(t,n)}catch(t){}if(a(t,n))return i(!r.f.call(t,n),t[n])}},function(t,n,e){var r=e(0),i=e(7),o=e(2);t.exports=function(t,n){var e=(i.Object||{})[t]||Object[t],u={};u[t]=n(e),r(r.S+r.F*o((function(){e(1)})),"Object",u)}},function(t,n,e){var r=e(19),i=e(46),o=e(10),u=e(6),a=e(112);t.exports=function(t,n){var e=1==t,c=2==t,s=3==t,f=4==t,l=6==t,h=5==t||l,d=n||a;return function(n,a,p){for(var v,g,y=o(n),m=i(y),b=r(a,p,3),S=u(m.length),w=0,_=e?d(n,S):c?d(n,0):void 0;S>w;w++)if((h||w in m)&&(g=b(v=m[w],w,y),t))if(e)_[w]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return w;case 2:_.push(v)}else if(f)return!1;return l?-1:s||f?f:_}}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){"use strict";if(e(8)){var r=e(32),i=e(1),o=e(2),u=e(0),a=e(61),c=e(86),s=e(19),f=e(44),l=e(30),h=e(14),d=e(45),p=e(21),v=e(6),g=e(123),y=e(34),m=e(28),b=e(13),S=e(48),w=e(4),_=e(10),M=e(78),x=e(35),P=e(37),O=e(36).f,F=e(80),A=e(31),E=e(5),N=e(24),R=e(51),k=e(49),T=e(82),I=e(42),j=e(54),L=e(43),B=e(81),C=e(114),W=e(9),V=e(22),G=W.f,D=V.f,U=i.RangeError,z=i.TypeError,q=i.Uint8Array,K=Array.prototype,Y=c.ArrayBuffer,Q=c.DataView,H=N(0),J=N(2),X=N(3),Z=N(4),$=N(5),tt=N(6),nt=R(!0),et=R(!1),rt=T.values,it=T.keys,ot=T.entries,ut=K.lastIndexOf,at=K.reduce,ct=K.reduceRight,st=K.join,ft=K.sort,lt=K.slice,ht=K.toString,dt=K.toLocaleString,pt=E("iterator"),vt=E("toStringTag"),gt=A("typed_constructor"),yt=A("def_constructor"),mt=a.CONSTR,bt=a.TYPED,St=a.VIEW,wt=N(1,(function(t,n){return Ot(k(t,t[yt]),n)})),_t=o((function(){return 1===new q(new Uint16Array([1]).buffer)[0]})),Mt=!!q&&!!q.prototype.set&&o((function(){new q(1).set({})})),xt=function(t,n){var e=p(t);if(e<0||e%n)throw U("Wrong offset!");return e},Pt=function(t){if(w(t)&&bt in t)return t;throw z(t+" is not a typed array!")},Ot=function(t,n){if(!(w(t)&> in t))throw z("It is not a typed array constructor!");return new t(n)},Ft=function(t,n){return At(k(t,t[yt]),n)},At=function(t,n){for(var e=0,r=n.length,i=Ot(t,r);r>e;)i[e]=n[e++];return i},Et=function(t,n,e){G(t,n,{get:function(){return this._d[e]}})},Nt=function(t){var n,e,r,i,o,u,a=_(t),c=arguments.length,f=c>1?arguments[1]:void 0,l=void 0!==f,h=F(a);if(null!=h&&!M(h)){for(u=h.call(a),r=[],n=0;!(o=u.next()).done;n++)r.push(o.value);a=r}for(l&&c>2&&(f=s(f,arguments[2],2)),n=0,e=v(a.length),i=Ot(this,e);e>n;n++)i[n]=l?f(a[n],n):a[n];return i},Rt=function(){for(var t=0,n=arguments.length,e=Ot(this,n);n>t;)e[t]=arguments[t++];return e},kt=!!q&&o((function(){dt.call(new q(1))})),Tt=function(){return dt.apply(kt?lt.call(Pt(this)):Pt(this),arguments)},It={copyWithin:function(t,n){return C.call(Pt(this),t,n,arguments.length>2?arguments[2]:void 0)},every:function(t){return Z(Pt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return B.apply(Pt(this),arguments)},filter:function(t){return Ft(this,J(Pt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return $(Pt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(Pt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){H(Pt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return et(Pt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return nt(Pt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return st.apply(Pt(this),arguments)},lastIndexOf:function(t){return ut.apply(Pt(this),arguments)},map:function(t){return wt(Pt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return at.apply(Pt(this),arguments)},reduceRight:function(t){return ct.apply(Pt(this),arguments)},reverse:function(){for(var t,n=Pt(this).length,e=Math.floor(n/2),r=0;r1?arguments[1]:void 0)},sort:function(t){return ft.call(Pt(this),t)},subarray:function(t,n){var e=Pt(this),r=e.length,i=y(t,r);return new(k(e,e[yt]))(e.buffer,e.byteOffset+i*e.BYTES_PER_ELEMENT,v((void 0===n?r:y(n,r))-i))}},jt=function(t,n){return Ft(this,lt.call(Pt(this),t,n))},Lt=function(t){Pt(this);var n=xt(arguments[1],1),e=this.length,r=_(t),i=v(r.length),o=0;if(i+n>e)throw U("Wrong length!");for(;o255?255:255&r),i.v[d](e*n+i.o,r,_t)}(this,e,t)},enumerable:!0})};b?(p=e((function(t,e,r,i){f(t,p,s,"_d");var o,u,a,c,l=0,d=0;if(w(e)){if(!(e instanceof Y||"ArrayBuffer"==(c=S(e))||"SharedArrayBuffer"==c))return bt in e?At(p,e):Nt.call(p,e);o=e,d=xt(r,n);var y=e.byteLength;if(void 0===i){if(y%n)throw U("Wrong length!");if((u=y-d)<0)throw U("Wrong length!")}else if((u=v(i)*n)+d>y)throw U("Wrong length!");a=u/n}else a=g(e),o=new Y(u=a*n);for(h(t,"_d",{b:o,o:d,l:u,e:a,v:new Q(o)});ldocument.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[o[r]];return c()};t.exports=Object.create||function(t,n){var e;return null!==t?(a.prototype=r(t),e=new a,a.prototype=null,e[u]=t):e=c(),void 0===n?e:i(e,n)}},function(t,n,e){var r=e(98),i=e(65).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,n,e){var r=e(13),i=e(10),o=e(64)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,e){var r=e(5)("unscopables"),i=Array.prototype;null==i[r]&&e(14)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,n,e){var r=e(4);t.exports=function(t,n){if(!r(t)||t._t!==n)throw TypeError("Incompatible receiver, "+n+" required!");return t}},function(t,n,e){var r=e(9).f,i=e(13),o=e(5)("toStringTag");t.exports=function(t,n,e){t&&!i(t=e?t:t.prototype,o)&&r(t,o,{configurable:!0,value:n})}},function(t,n,e){var r=e(0),i=e(26),o=e(2),u=e(68),a="["+u+"]",c=RegExp("^"+a+a+"*"),s=RegExp(a+a+"*$"),f=function(t,n,e){var i={},a=o((function(){return!!u[t]()||"​…"!="​…"[t]()})),c=i[t]=a?n(l):u[t];e&&(i[e]=c),r(r.P+r.F*a,"String",i)},l=f.trim=function(t,n){return t=String(i(t)),1&n&&(t=t.replace(c,"")),2&n&&(t=t.replace(s,"")),t};t.exports=f},function(t,n){t.exports={}},function(t,n,e){"use strict";var r=e(1),i=e(9),o=e(8),u=e(5)("species");t.exports=function(t){var n=r[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n){t.exports=function(t,n,e,r){if(!(t instanceof n)||void 0!==r&&r in t)throw TypeError(e+": incorrect invocation!");return t}},function(t,n,e){var r=e(11);t.exports=function(t,n,e){for(var i in n)r(t,i,n[i],e);return t}},function(t,n,e){var r=e(25);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,e){var r=e(25),i=e(5)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var n,e,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),i))?e:o?r(n):"Object"==(u=r(n))&&"function"==typeof n.callee?"Arguments":u}},function(t,n,e){var r=e(3),i=e(20),o=e(5)("species");t.exports=function(t,n){var e,u=r(t).constructor;return void 0===u||null==(e=r(u)[o])?n:i(e)}},function(t,n,e){var r=e(7),i=e(1),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:e(32)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n,e){var r=e(15),i=e(6),o=e(34);t.exports=function(t){return function(n,e,u){var a,c=r(n),s=i(c.length),f=o(u,s);if(t&&e!=e){for(;s>f;)if((a=c[f++])!=a)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===e)return t||f||0;return!t&&-1}}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,e){var r=e(25);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,n,e){var r=e(5)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,n){if(!n&&!i)return!1;var e=!1;try{var o=[7],u=o[r]();u.next=function(){return{done:e=!0}},o[r]=function(){return u},t(o)}catch(t){}return e}},function(t,n,e){"use strict";var r=e(3);t.exports=function(){var t=r(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},function(t,n,e){"use strict";var r=e(48),i=RegExp.prototype.exec;t.exports=function(t,n){var e=t.exec;if("function"==typeof e){var o=e.call(t,n);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,n)}},function(t,n,e){"use strict";e(116);var r=e(11),i=e(14),o=e(2),u=e(26),a=e(5),c=e(83),s=a("species"),f=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),l=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var e="ab".split(t);return 2===e.length&&"a"===e[0]&&"b"===e[1]}();t.exports=function(t,n,e){var h=a(t),d=!o((function(){var n={};return n[h]=function(){return 7},7!=""[t](n)})),p=d?!o((function(){var n=!1,e=/a/;return e.exec=function(){return n=!0,null},"split"===t&&(e.constructor={},e.constructor[s]=function(){return e}),e[h](""),!n})):void 0;if(!d||!p||"replace"===t&&!f||"split"===t&&!l){var v=/./[h],g=e(u,h,""[t],(function(t,n,e,r,i){return n.exec===c?d&&!i?{done:!0,value:v.call(n,e,r)}:{done:!0,value:t.call(e,n,r)}:{done:!1}})),y=g[0],m=g[1];r(String.prototype,t,y),i(RegExp.prototype,h,2==n?function(t,n){return m.call(t,this,n)}:function(t){return m.call(t,this)})}}},function(t,n,e){var r=e(19),i=e(111),o=e(78),u=e(3),a=e(6),c=e(80),s={},f={};(n=t.exports=function(t,n,e,l,h){var d,p,v,g,y=h?function(){return t}:c(t),m=r(e,l,n?2:1),b=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(d=a(t.length);d>b;b++)if((g=n?m(u(p=t[b])[0],p[1]):m(t[b]))===s||g===f)return g}else for(v=y.call(t);!(p=v.next()).done;)if((g=i(v,m,p.value,n))===s||g===f)return g}).BREAK=s,n.RETURN=f},function(t,n,e){var r=e(1).navigator;t.exports=r&&r.userAgent||""},function(t,n,e){"use strict";var r=e(1),i=e(0),o=e(11),u=e(45),a=e(29),c=e(58),s=e(44),f=e(4),l=e(2),h=e(54),d=e(40),p=e(69);t.exports=function(t,n,e,v,g,y){var m=r[t],b=m,S=g?"set":"add",w=b&&b.prototype,_={},M=function(t){var n=w[t];o(w,t,"delete"==t?function(t){return!(y&&!f(t))&&n.call(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!f(t))&&n.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!f(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function(t){return n.call(this,0===t?0:t),this}:function(t,e){return n.call(this,0===t?0:t,e),this})};if("function"==typeof b&&(y||w.forEach&&!l((function(){(new b).entries().next()})))){var x=new b,P=x[S](y?{}:-0,1)!=x,O=l((function(){x.has(1)})),F=h((function(t){new b(t)})),A=!y&&l((function(){for(var t=new b,n=5;n--;)t[S](n,n);return!t.has(-0)}));F||((b=n((function(n,e){s(n,b,t);var r=p(new m,n,b);return null!=e&&c(e,g,r[S],r),r}))).prototype=w,w.constructor=b),(O||A)&&(M("delete"),M("has"),g&&M("get")),(A||P)&&M(S),y&&w.clear&&delete w.clear}else b=v.getConstructor(n,t,g,S),u(b.prototype,e),a.NEED=!0;return d(b,t),_[t]=b,i(i.G+i.W+i.F*(b!=m),_),y||v.setStrong(b,t,g),b}},function(t,n,e){for(var r,i=e(1),o=e(14),u=e(31),a=u("typed_array"),c=u("view"),s=!(!i.ArrayBuffer||!i.DataView),f=s,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(r=i[h[l++]])?(o(r.prototype,a,!0),o(r.prototype,c,!0)):f=!1;t.exports={ABV:s,CONSTR:f,TYPED:a,VIEW:c}},function(t,n,e){var r=e(4),i=e(1).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,n,e){n.f=e(5)},function(t,n,e){var r=e(50)("keys"),i=e(31);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,e){var r=e(1).document;t.exports=r&&r.documentElement},function(t,n,e){var r=e(4),i=e(3),o=function(t,n){if(i(t),!r(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,n,r){try{(r=e(19)(Function.call,e(22).f(Object.prototype,"__proto__").set,2))(t,[]),n=!(t instanceof Array)}catch(t){n=!0}return function(t,e){return o(t,e),n?t.__proto__=e:r(t,e),t}}({},!1):void 0),check:o}},function(t,n){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,n,e){var r=e(4),i=e(67).set;t.exports=function(t,n,e){var o,u=n.constructor;return u!==e&&"function"==typeof u&&(o=u.prototype)!==e.prototype&&r(o)&&i&&i(t,o),t}},function(t,n,e){"use strict";var r=e(21),i=e(26);t.exports=function(t){var n=String(i(this)),e="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(n+=n))1&o&&(e+=n);return e}},function(t,n){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var e=Math.expm1;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},function(t,n,e){var r=e(21),i=e(26);t.exports=function(t){return function(n,e){var o,u,a=String(i(n)),c=r(e),s=a.length;return c<0||c>=s?t?"":void 0:(o=a.charCodeAt(c))<55296||o>56319||c+1===s||(u=a.charCodeAt(c+1))<56320||u>57343?t?a.charAt(c):o:t?a.slice(c,c+2):u-56320+(o-55296<<10)+65536}}},function(t,n,e){"use strict";var r=e(32),i=e(0),o=e(11),u=e(14),a=e(42),c=e(110),s=e(40),f=e(37),l=e(5)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,n,e,p,v,g,y){c(e,n,p);var m,b,S,w=function(t){if(!h&&t in P)return P[t];switch(t){case"keys":case"values":return function(){return new e(this,t)}}return function(){return new e(this,t)}},_=n+" Iterator",M="values"==v,x=!1,P=t.prototype,O=P[l]||P["@@iterator"]||v&&P[v],F=O||w(v),A=v?M?w("entries"):F:void 0,E="Array"==n&&P.entries||O;if(E&&(S=f(E.call(new t)))!==Object.prototype&&S.next&&(s(S,_,!0),r||"function"==typeof S[l]||u(S,l,d)),M&&O&&"values"!==O.name&&(x=!0,F=function(){return O.call(this)}),r&&!y||!h&&!x&&P[l]||u(P,l,F),a[n]=F,a[_]=d,v)if(m={values:M?F:w("values"),keys:g?F:w("keys"),entries:A},y)for(b in m)b in P||o(P,b,m[b]);else i(i.P+i.F*(h||x),n,m);return m}},function(t,n,e){var r=e(76),i=e(26);t.exports=function(t,n,e){if(r(n))throw TypeError("String#"+e+" doesn't accept regex!");return String(i(t))}},function(t,n,e){var r=e(4),i=e(25),o=e(5)("match");t.exports=function(t){var n;return r(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},function(t,n,e){var r=e(5)("match");t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[r]=!1,!"/./"[t](n)}catch(t){}}return!0}},function(t,n,e){var r=e(42),i=e(5)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,n,e){"use strict";var r=e(9),i=e(30);t.exports=function(t,n,e){n in t?r.f(t,n,i(0,e)):t[n]=e}},function(t,n,e){var r=e(48),i=e(5)("iterator"),o=e(42);t.exports=e(7).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,n,e){"use strict";var r=e(10),i=e(34),o=e(6);t.exports=function(t){for(var n=r(this),e=o(n.length),u=arguments.length,a=i(u>1?arguments[1]:void 0,e),c=u>2?arguments[2]:void 0,s=void 0===c?e:i(c,e);s>a;)n[a++]=t;return n}},function(t,n,e){"use strict";var r=e(38),i=e(115),o=e(42),u=e(15);t.exports=e(74)(Array,"Array",(function(t,n){this._t=u(t),this._i=0,this._k=n}),(function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,i(1)):i(0,"keys"==n?e:"values"==n?t[e]:[e,t[e]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,n,e){"use strict";var r,i,o=e(55),u=RegExp.prototype.exec,a=String.prototype.replace,c=u,s=(r=/a/,i=/b*/g,u.call(r,"a"),u.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),f=void 0!==/()??/.exec("")[1];(s||f)&&(c=function(t){var n,e,r,i,c=this;return f&&(e=new RegExp("^"+c.source+"$(?!\\s)",o.call(c))),s&&(n=c.lastIndex),r=u.call(c,t),s&&r&&(c.lastIndex=c.global?r.index+r[0].length:n),f&&r&&r.length>1&&a.call(r[0],e,(function(){for(i=1;ie;)n.push(arguments[e++]);return y[++g]=function(){a("function"==typeof t?t:Function(t),n)},r(g),g},d=function(t){delete y[t]},"process"==e(25)(l)?r=function(t){l.nextTick(u(m,t,1))}:v&&v.now?r=function(t){v.now(u(m,t,1))}:p?(o=(i=new p).port2,i.port1.onmessage=b,r=u(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",b,!1)):r="onreadystatechange"in s("script")?function(t){c.appendChild(s("script")).onreadystatechange=function(){c.removeChild(this),m.call(t)}}:function(t){setTimeout(u(m,t,1),0)}),t.exports={set:h,clear:d}},function(t,n,e){"use strict";var r=e(1),i=e(8),o=e(32),u=e(61),a=e(14),c=e(45),s=e(2),f=e(44),l=e(21),h=e(6),d=e(123),p=e(36).f,v=e(9).f,g=e(81),y=e(40),m="prototype",b="Wrong index!",S=r.ArrayBuffer,w=r.DataView,_=r.Math,M=r.RangeError,x=r.Infinity,P=S,O=_.abs,F=_.pow,A=_.floor,E=_.log,N=_.LN2,R=i?"_b":"buffer",k=i?"_l":"byteLength",T=i?"_o":"byteOffset";function I(t,n,e){var r,i,o,u=new Array(e),a=8*e-n-1,c=(1<>1,f=23===n?F(2,-24)-F(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=O(t))!=t||t===x?(i=t!=t?1:0,r=c):(r=A(E(t)/N),t*(o=F(2,-r))<1&&(r--,o*=2),(t+=r+s>=1?f/o:f*F(2,1-s))*o>=2&&(r++,o/=2),r+s>=c?(i=0,r=c):r+s>=1?(i=(t*o-1)*F(2,n),r+=s):(i=t*F(2,s-1)*F(2,n),r=0));n>=8;u[l++]=255&i,i/=256,n-=8);for(r=r<0;u[l++]=255&r,r/=256,a-=8);return u[--l]|=128*h,u}function j(t,n,e){var r,i=8*e-n-1,o=(1<>1,a=i-7,c=e-1,s=t[c--],f=127&s;for(s>>=7;a>0;f=256*f+t[c],c--,a-=8);for(r=f&(1<<-a)-1,f>>=-a,a+=n;a>0;r=256*r+t[c],c--,a-=8);if(0===f)f=1-u;else{if(f===o)return r?NaN:s?-x:x;r+=F(2,n),f-=u}return(s?-1:1)*r*F(2,f-n)}function L(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function B(t){return[255&t]}function C(t){return[255&t,t>>8&255]}function W(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function V(t){return I(t,52,8)}function G(t){return I(t,23,4)}function D(t,n,e){v(t[m],n,{get:function(){return this[e]}})}function U(t,n,e,r){var i=d(+e);if(i+n>t[k])throw M(b);var o=t[R]._b,u=i+t[T],a=o.slice(u,u+n);return r?a:a.reverse()}function z(t,n,e,r,i,o){var u=d(+e);if(u+n>t[k])throw M(b);for(var a=t[R]._b,c=u+t[T],s=r(+i),f=0;fQ;)(q=Y[Q++])in S||a(S,q,P[q]);o||(K.constructor=S)}var H=new w(new S(2)),J=w[m].setInt8;H.setInt8(0,2147483648),H.setInt8(1,2147483649),!H.getInt8(0)&&H.getInt8(1)||c(w[m],{setInt8:function(t,n){J.call(this,t,n<<24>>24)},setUint8:function(t,n){J.call(this,t,n<<24>>24)}},!0)}else S=function(t){f(this,S,"ArrayBuffer");var n=d(t);this._b=g.call(new Array(n),0),this[k]=n},w=function(t,n,e){f(this,w,"DataView"),f(t,S,"DataView");var r=t[k],i=l(n);if(i<0||i>r)throw M("Wrong offset!");if(i+(e=void 0===e?r-i:h(e))>r)throw M("Wrong length!");this[R]=t,this[T]=i,this[k]=e},i&&(D(S,"byteLength","_l"),D(w,"buffer","_b"),D(w,"byteLength","_l"),D(w,"byteOffset","_o")),c(w[m],{getInt8:function(t){return U(this,1,t)[0]<<24>>24},getUint8:function(t){return U(this,1,t)[0]},getInt16:function(t){var n=U(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function(t){var n=U(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function(t){return L(U(this,4,t,arguments[1]))},getUint32:function(t){return L(U(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return j(U(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return j(U(this,8,t,arguments[1]),52,8)},setInt8:function(t,n){z(this,1,t,B,n)},setUint8:function(t,n){z(this,1,t,B,n)},setInt16:function(t,n){z(this,2,t,C,n,arguments[2])},setUint16:function(t,n){z(this,2,t,C,n,arguments[2])},setInt32:function(t,n){z(this,4,t,W,n,arguments[2])},setUint32:function(t,n){z(this,4,t,W,n,arguments[2])},setFloat32:function(t,n){z(this,4,t,G,n,arguments[2])},setFloat64:function(t,n){z(this,8,t,V,n,arguments[2])}});y(S,"ArrayBuffer"),y(w,"DataView"),a(w[m],u.VIEW,!0),n.ArrayBuffer=S,n.DataView=w},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){t.exports=!e(128)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,n,e){"use strict";n.__esModule=!0,n.default=void 0;var r,i=(r=e(91))&&r.__esModule?r:{default:r},o=e(18);function u(t,n){for(var e=0;e0){var u=Object.keys(e),c=a.default.find(u,(function(t){return n.isOS(t)}));if(c){var s=this.satisfies(e[c]);if(void 0!==s)return s}var f=a.default.find(u,(function(t){return n.isPlatform(t)}));if(f){var l=this.satisfies(e[f]);if(void 0!==l)return l}}if(o>0){var h=Object.keys(i),d=a.default.find(h,(function(t){return n.isBrowser(t,!0)}));if(void 0!==d)return this.compareVersion(i[d])}},n.isBrowser=function(t,n){void 0===n&&(n=!1);var e=this.getBrowserName().toLowerCase(),r=t.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return n&&i&&(r=i.toLowerCase()),r===e},n.compareVersion=function(t){var n=[0],e=t,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===t[0]||"<"===t[0]?(e=t.substr(1),"="===t[1]?(r=!0,e=t.substr(2)):n=[],">"===t[0]?n.push(1):n.push(-1)):"="===t[0]?e=t.substr(1):"~"===t[0]&&(r=!0,e=t.substr(1)),n.indexOf(a.default.compareVersions(i,e,r))>-1},n.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},n.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},n.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},n.is=function(t,n){return void 0===n&&(n=!1),this.isBrowser(t,n)||this.isOS(t)||this.isPlatform(t)},n.some=function(t){var n=this;return void 0===t&&(t=[]),t.some((function(t){return n.is(t)}))},t}();n.default=s,t.exports=n.default},function(t,n,e){"use strict";n.__esModule=!0,n.default=void 0;var r,i=(r=e(17))&&r.__esModule?r:{default:r};var o=/version\/(\d+(\.?_?\d+)+)/i,u=[{test:[/googlebot/i],describe:function(t){var n={name:"Googlebot"},e=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/opera/i],describe:function(t){var n={name:"Opera"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/opr\/|opios/i],describe:function(t){var n={name:"Opera"},e=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/SamsungBrowser/i],describe:function(t){var n={name:"Samsung Internet for Android"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/Whale/i],describe:function(t){var n={name:"NAVER Whale Browser"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/MZBrowser/i],describe:function(t){var n={name:"MZ Browser"},e=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/focus/i],describe:function(t){var n={name:"Focus"},e=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/swing/i],describe:function(t){var n={name:"Swing"},e=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/coast/i],describe:function(t){var n={name:"Opera Coast"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var n={name:"Opera Touch"},e=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/yabrowser/i],describe:function(t){var n={name:"Yandex Browser"},e=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/ucbrowser/i],describe:function(t){var n={name:"UC Browser"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/Maxthon|mxios/i],describe:function(t){var n={name:"Maxthon"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/epiphany/i],describe:function(t){var n={name:"Epiphany"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/puffin/i],describe:function(t){var n={name:"Puffin"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/sleipnir/i],describe:function(t){var n={name:"Sleipnir"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/k-meleon/i],describe:function(t){var n={name:"K-Meleon"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/micromessenger/i],describe:function(t){var n={name:"WeChat"},e=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/qqbrowser/i],describe:function(t){var n={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},e=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/msie|trident/i],describe:function(t){var n={name:"Internet Explorer"},e=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/\sedg\//i],describe:function(t){var n={name:"Microsoft Edge"},e=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/edg([ea]|ios)/i],describe:function(t){var n={name:"Microsoft Edge"},e=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/vivaldi/i],describe:function(t){var n={name:"Vivaldi"},e=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/seamonkey/i],describe:function(t){var n={name:"SeaMonkey"},e=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/sailfish/i],describe:function(t){var n={name:"Sailfish"},e=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return e&&(n.version=e),n}},{test:[/silk/i],describe:function(t){var n={name:"Amazon Silk"},e=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/phantom/i],describe:function(t){var n={name:"PhantomJS"},e=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/slimerjs/i],describe:function(t){var n={name:"SlimerJS"},e=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var n={name:"BlackBerry"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var n={name:"WebOS Browser"},e=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/bada/i],describe:function(t){var n={name:"Bada"},e=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/tizen/i],describe:function(t){var n={name:"Tizen"},e=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/qupzilla/i],describe:function(t){var n={name:"QupZilla"},e=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var n={name:"Firefox"},e=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/electron/i],describe:function(t){var n={name:"Electron"},e=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/MiuiBrowser/i],describe:function(t){var n={name:"Miui"},e=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/chromium/i],describe:function(t){var n={name:"Chromium"},e=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/chrome|crios|crmo/i],describe:function(t){var n={name:"Chrome"},e=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/GSA/i],describe:function(t){var n={name:"Google Search"},e=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:function(t){var n=!t.test(/like android/i),e=t.test(/android/i);return n&&e},describe:function(t){var n={name:"Android Browser"},e=i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/playstation 4/i],describe:function(t){var n={name:"PlayStation 4"},e=i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/safari|applewebkit/i],describe:function(t){var n={name:"Safari"},e=i.default.getFirstMatch(o,t);return e&&(n.version=e),n}},{test:[/.*/i],describe:function(t){var n=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(n,t),version:i.default.getSecondMatch(n,t)}}}];n.default=u,t.exports=n.default},function(t,n,e){"use strict";n.__esModule=!0,n.default=void 0;var r,i=(r=e(17))&&r.__esModule?r:{default:r},o=e(18);var u=[{test:[/Roku\/DVP/],describe:function(t){var n=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:o.OS_MAP.Roku,version:n}}},{test:[/windows phone/i],describe:function(t){var n=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.WindowsPhone,version:n}}},{test:[/windows /i],describe:function(t){var n=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),e=i.default.getWindowsVersionName(n);return{name:o.OS_MAP.Windows,version:n,versionName:e}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var n={name:o.OS_MAP.iOS},e=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return e&&(n.version=e),n}},{test:[/macintosh/i],describe:function(t){var n=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),e=i.default.getMacOSVersionName(n),r={name:o.OS_MAP.MacOS,version:n};return e&&(r.versionName=e),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var n=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:n}}},{test:function(t){var n=!t.test(/like android/i),e=t.test(/android/i);return n&&e},describe:function(t){var n=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),e=i.default.getAndroidVersionName(n),r={name:o.OS_MAP.Android,version:n};return e&&(r.versionName=e),r}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var n=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),e={name:o.OS_MAP.WebOS};return n&&n.length&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var n=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||i.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:o.OS_MAP.BlackBerry,version:n}}},{test:[/bada/i],describe:function(t){var n=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.Bada,version:n}}},{test:[/tizen/i],describe:function(t){var n=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.Tizen,version:n}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var n=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.PlayStation4,version:n}}}];n.default=u,t.exports=n.default},function(t,n,e){"use strict";n.__esModule=!0,n.default=void 0;var r,i=(r=e(17))&&r.__esModule?r:{default:r},o=e(18);var u=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var n=i.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",e={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return n&&(e.model=n),e}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(t){var n=t.test(/ipod|iphone/i),e=t.test(/like (ipod|iphone)/i);return n&&!e},describe:function(t){var n=i.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:n}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var n=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&n>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];n.default=u,t.exports=n.default},function(t,n,e){"use strict";n.__esModule=!0,n.default=void 0;var r,i=(r=e(17))&&r.__esModule?r:{default:r},o=e(18);var u=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:o.ENGINE_MAP.Blink};var n=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:o.ENGINE_MAP.EdgeHTML,version:n}}},{test:[/trident/i],describe:function(t){var n={name:o.ENGINE_MAP.Trident},e=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:function(t){return t.test(/presto/i)},describe:function(t){var n={name:o.ENGINE_MAP.Presto},e=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:function(t){var n=t.test(/gecko/i),e=t.test(/like gecko/i);return n&&!e},describe:function(t){var n={name:o.ENGINE_MAP.Gecko},e=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var n={name:o.ENGINE_MAP.WebKit},e=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return e&&(n.version=e),n}}];n.default=u,t.exports=n.default},function(t,n,e){t.exports=!e(8)&&!e(2)((function(){return 7!=Object.defineProperty(e(62)("div"),"a",{get:function(){return 7}}).a}))},function(t,n,e){var r=e(1),i=e(7),o=e(32),u=e(63),a=e(9).f;t.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in n||a(n,t,{value:u.f(t)})}},function(t,n,e){var r=e(13),i=e(15),o=e(51)(!1),u=e(64)("IE_PROTO");t.exports=function(t,n){var e,a=i(t),c=0,s=[];for(e in a)e!=u&&r(a,e)&&s.push(e);for(;n.length>c;)r(a,e=n[c++])&&(~o(s,e)||s.push(e));return s}},function(t,n,e){var r=e(9),i=e(3),o=e(33);t.exports=e(8)?Object.defineProperties:function(t,n){i(t);for(var e,u=o(n),a=u.length,c=0;a>c;)r.f(t,e=u[c++],n[e]);return t}},function(t,n,e){var r=e(15),i=e(36).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return u.slice()}}(t):i(r(t))}},function(t,n,e){"use strict";var r=e(8),i=e(33),o=e(52),u=e(47),a=e(10),c=e(46),s=Object.assign;t.exports=!s||e(2)((function(){var t={},n={},e=Symbol(),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach((function(t){n[t]=t})),7!=s({},t)[e]||Object.keys(s({},n)).join("")!=r}))?function(t,n){for(var e=a(t),s=arguments.length,f=1,l=o.f,h=u.f;s>f;)for(var d,p=c(arguments[f++]),v=l?i(p).concat(l(p)):i(p),g=v.length,y=0;g>y;)d=v[y++],r&&!h.call(p,d)||(e[d]=p[d]);return e}:s},function(t,n){t.exports=Object.is||function(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}},function(t,n,e){"use strict";var r=e(20),i=e(4),o=e(104),u=[].slice,a={},c=function(t,n,e){if(!(n in a)){for(var r=[],i=0;i>>0||(u.test(e)?16:10))}:r},function(t,n,e){var r=e(1).parseFloat,i=e(41).trim;t.exports=1/r(e(68)+"-0")!=-1/0?function(t){var n=i(String(t),3),e=r(n);return 0===e&&"-"==n.charAt(0)?-0:e}:r},function(t,n,e){var r=e(25);t.exports=function(t,n){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(n);return+t}},function(t,n,e){var r=e(4),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},function(t,n){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,e){"use strict";var r=e(35),i=e(30),o=e(40),u={};e(14)(u,e(5)("iterator"),(function(){return this})),t.exports=function(t,n,e){t.prototype=r(u,{next:i(1,e)}),o(t,n+" Iterator")}},function(t,n,e){var r=e(3);t.exports=function(t,n,e,i){try{return i?n(r(e)[0],e[1]):n(e)}catch(n){var o=t.return;throw void 0!==o&&r(o.call(t)),n}}},function(t,n,e){var r=e(224);t.exports=function(t,n){return new(r(t))(n)}},function(t,n,e){var r=e(20),i=e(10),o=e(46),u=e(6);t.exports=function(t,n,e,a,c){r(n);var s=i(t),f=o(s),l=u(s.length),h=c?l-1:0,d=c?-1:1;if(e<2)for(;;){if(h in f){a=f[h],h+=d;break}if(h+=d,c?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;c?h>=0:l>h;h+=d)h in f&&(a=n(a,f[h],h,s));return a}},function(t,n,e){"use strict";var r=e(10),i=e(34),o=e(6);t.exports=[].copyWithin||function(t,n){var e=r(this),u=o(e.length),a=i(t,u),c=i(n,u),s=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===s?u:i(s,u))-c,u-a),l=1;for(c0;)c in e?e[a]=e[c]:delete e[a],a+=l,c+=l;return e}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,e){"use strict";var r=e(83);e(0)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(t,n,e){e(8)&&"g"!=/./g.flags&&e(9).f(RegExp.prototype,"flags",{configurable:!0,get:e(55)})},function(t,n,e){"use strict";var r,i,o,u,a=e(32),c=e(1),s=e(19),f=e(48),l=e(0),h=e(4),d=e(20),p=e(44),v=e(58),g=e(49),y=e(85).set,m=e(244)(),b=e(119),S=e(245),w=e(59),_=e(120),M=c.TypeError,x=c.process,P=x&&x.versions,O=P&&P.v8||"",F=c.Promise,A="process"==f(x),E=function(){},N=i=b.f,R=!!function(){try{var t=F.resolve(1),n=(t.constructor={})[e(5)("species")]=function(t){t(E,E)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then(E)instanceof n&&0!==O.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(t){}}(),k=function(t){var n;return!(!h(t)||"function"!=typeof(n=t.then))&&n},T=function(t,n){if(!t._n){t._n=!0;var e=t._c;m((function(){for(var r=t._v,i=1==t._s,o=0,u=function(n){var e,o,u,a=i?n.ok:n.fail,c=n.resolve,s=n.reject,f=n.domain;try{a?(i||(2==t._h&&L(t),t._h=1),!0===a?e=r:(f&&f.enter(),e=a(r),f&&(f.exit(),u=!0)),e===n.promise?s(M("Promise-chain cycle")):(o=k(e))?o.call(e,c,s):c(e)):s(r)}catch(t){f&&!u&&f.exit(),s(t)}};e.length>o;)u(e[o++]);t._c=[],t._n=!1,n&&!t._h&&I(t)}))}},I=function(t){y.call(c,(function(){var n,e,r,i=t._v,o=j(t);if(o&&(n=S((function(){A?x.emit("unhandledRejection",i,t):(e=c.onunhandledrejection)?e({promise:t,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=A||j(t)?2:1),t._a=void 0,o&&n.e)throw n.v}))},j=function(t){return 1!==t._h&&0===(t._a||t._c).length},L=function(t){y.call(c,(function(){var n;A?x.emit("rejectionHandled",t):(n=c.onrejectionhandled)&&n({promise:t,reason:t._v})}))},B=function(t){var n=this;n._d||(n._d=!0,(n=n._w||n)._v=t,n._s=2,n._a||(n._a=n._c.slice()),T(n,!0))},C=function(t){var n,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===t)throw M("Promise can't be resolved itself");(n=k(t))?m((function(){var r={_w:e,_d:!1};try{n.call(t,s(C,r,1),s(B,r,1))}catch(t){B.call(r,t)}})):(e._v=t,e._s=1,T(e,!1))}catch(t){B.call({_w:e,_d:!1},t)}}};R||(F=function(t){p(this,F,"Promise","_h"),d(t),r.call(this);try{t(s(C,this,1),s(B,this,1))}catch(t){B.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=e(45)(F.prototype,{then:function(t,n){var e=N(g(this,F));return e.ok="function"!=typeof t||t,e.fail="function"==typeof n&&n,e.domain=A?x.domain:void 0,this._c.push(e),this._a&&this._a.push(e),this._s&&T(this,!1),e.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=s(C,t,1),this.reject=s(B,t,1)},b.f=N=function(t){return t===F||t===u?new o(t):i(t)}),l(l.G+l.W+l.F*!R,{Promise:F}),e(40)(F,"Promise"),e(43)("Promise"),u=e(7).Promise,l(l.S+l.F*!R,"Promise",{reject:function(t){var n=N(this);return(0,n.reject)(t),n.promise}}),l(l.S+l.F*(a||!R),"Promise",{resolve:function(t){return _(a&&this===u?F:this,t)}}),l(l.S+l.F*!(R&&e(54)((function(t){F.all(t).catch(E)}))),"Promise",{all:function(t){var n=this,e=N(n),r=e.resolve,i=e.reject,o=S((function(){var e=[],o=0,u=1;v(t,!1,(function(t){var a=o++,c=!1;e.push(void 0),u++,n.resolve(t).then((function(t){c||(c=!0,e[a]=t,--u||r(e))}),i)})),--u||r(e)}));return o.e&&i(o.v),e.promise},race:function(t){var n=this,e=N(n),r=e.reject,i=S((function(){v(t,!1,(function(t){n.resolve(t).then(e.resolve,r)}))}));return i.e&&r(i.v),e.promise}})},function(t,n,e){"use strict";var r=e(20);function i(t){var n,e;this.promise=new t((function(t,r){if(void 0!==n||void 0!==e)throw TypeError("Bad Promise constructor");n=t,e=r})),this.resolve=r(n),this.reject=r(e)}t.exports.f=function(t){return new i(t)}},function(t,n,e){var r=e(3),i=e(4),o=e(119);t.exports=function(t,n){if(r(t),i(n)&&n.constructor===t)return n;var e=o.f(t);return(0,e.resolve)(n),e.promise}},function(t,n,e){"use strict";var r=e(9).f,i=e(35),o=e(45),u=e(19),a=e(44),c=e(58),s=e(74),f=e(115),l=e(43),h=e(8),d=e(29).fastKey,p=e(39),v=h?"_s":"size",g=function(t,n){var e,r=d(n);if("F"!==r)return t._i[r];for(e=t._f;e;e=e.n)if(e.k==n)return e};t.exports={getConstructor:function(t,n,e,s){var f=t((function(t,r){a(t,f,n,"_i"),t._t=n,t._i=i(null),t._f=void 0,t._l=void 0,t[v]=0,null!=r&&c(r,e,t[s],t)}));return o(f.prototype,{clear:function(){for(var t=p(this,n),e=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete e[r.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var e=p(this,n),r=g(e,t);if(r){var i=r.n,o=r.p;delete e._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),e._f==r&&(e._f=i),e._l==r&&(e._l=o),e[v]--}return!!r},forEach:function(t){p(this,n);for(var e,r=u(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(r(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!g(p(this,n),t)}}),h&&r(f.prototype,"size",{get:function(){return p(this,n)[v]}}),f},def:function(t,n,e){var r,i,o=g(t,n);return o?o.v=e:(t._l=o={i:i=d(n,!0),k:n,v:e,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[v]++,"F"!==i&&(t._i[i]=o)),t},getEntry:g,setStrong:function(t,n,e){s(t,n,(function(t,e){this._t=p(t,n),this._k=e,this._l=void 0}),(function(){for(var t=this._k,n=this._l;n&&n.r;)n=n.p;return this._t&&(this._l=n=n?n.n:this._t._f)?f(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(this._t=void 0,f(1))}),e?"entries":"values",!e,!0),l(n)}}},function(t,n,e){"use strict";var r=e(45),i=e(29).getWeak,o=e(3),u=e(4),a=e(44),c=e(58),s=e(24),f=e(13),l=e(39),h=s(5),d=s(6),p=0,v=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},y=function(t,n){return h(t.a,(function(t){return t[0]===n}))};g.prototype={get:function(t){var n=y(this,t);if(n)return n[1]},has:function(t){return!!y(this,t)},set:function(t,n){var e=y(this,t);e?e[1]=n:this.a.push([t,n])},delete:function(t){var n=d(this.a,(function(n){return n[0]===t}));return~n&&this.a.splice(n,1),!!~n}},t.exports={getConstructor:function(t,n,e,o){var s=t((function(t,r){a(t,s,n,"_i"),t._t=n,t._i=p++,t._l=void 0,null!=r&&c(r,e,t[o],t)}));return r(s.prototype,{delete:function(t){if(!u(t))return!1;var e=i(t);return!0===e?v(l(this,n)).delete(t):e&&f(e,this._i)&&delete e[this._i]},has:function(t){if(!u(t))return!1;var e=i(t);return!0===e?v(l(this,n)).has(t):e&&f(e,this._i)}}),s},def:function(t,n,e){var r=i(o(n),!0);return!0===r?v(t).set(n,e):r[t._i]=e,t},ufstore:v}},function(t,n,e){var r=e(21),i=e(6);t.exports=function(t){if(void 0===t)return 0;var n=r(t),e=i(n);if(n!==e)throw RangeError("Wrong length!");return e}},function(t,n,e){var r=e(36),i=e(52),o=e(3),u=e(1).Reflect;t.exports=u&&u.ownKeys||function(t){var n=r.f(o(t)),e=i.f;return e?n.concat(e(t)):n}},function(t,n,e){var r=e(6),i=e(70),o=e(26);t.exports=function(t,n,e,u){var a=String(o(t)),c=a.length,s=void 0===e?" ":String(e),f=r(n);if(f<=c||""==s)return a;var l=f-c,h=i.call(s,Math.ceil(l/s.length));return h.length>l&&(h=h.slice(0,l)),u?h+a:a+h}},function(t,n,e){var r=e(8),i=e(33),o=e(15),u=e(47).f;t.exports=function(t){return function(n){for(var e,a=o(n),c=i(a),s=c.length,f=0,l=[];s>f;)e=c[f++],r&&!u.call(a,e)||l.push(t?[e,a[e]]:a[e]);return l}}},function(t,n){var e=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=e)},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,e){e(130),t.exports=e(90)},function(t,n,e){"use strict";e(131);var r,i=(r=e(303))&&r.__esModule?r:{default:r};i.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),i.default._babelPolyfill=!0},function(t,n,e){"use strict";e(132),e(275),e(277),e(280),e(282),e(284),e(286),e(288),e(290),e(292),e(294),e(296),e(298),e(302)},function(t,n,e){e(133),e(136),e(137),e(138),e(139),e(140),e(141),e(142),e(143),e(144),e(145),e(146),e(147),e(148),e(149),e(150),e(151),e(152),e(153),e(154),e(155),e(156),e(157),e(158),e(159),e(160),e(161),e(162),e(163),e(164),e(165),e(166),e(167),e(168),e(169),e(170),e(171),e(172),e(173),e(174),e(175),e(176),e(177),e(179),e(180),e(181),e(182),e(183),e(184),e(185),e(186),e(187),e(188),e(189),e(190),e(191),e(192),e(193),e(194),e(195),e(196),e(197),e(198),e(199),e(200),e(201),e(202),e(203),e(204),e(205),e(206),e(207),e(208),e(209),e(210),e(211),e(212),e(214),e(215),e(217),e(218),e(219),e(220),e(221),e(222),e(223),e(225),e(226),e(227),e(228),e(229),e(230),e(231),e(232),e(233),e(234),e(235),e(236),e(237),e(82),e(238),e(116),e(239),e(117),e(240),e(241),e(242),e(243),e(118),e(246),e(247),e(248),e(249),e(250),e(251),e(252),e(253),e(254),e(255),e(256),e(257),e(258),e(259),e(260),e(261),e(262),e(263),e(264),e(265),e(266),e(267),e(268),e(269),e(270),e(271),e(272),e(273),e(274),t.exports=e(7)},function(t,n,e){"use strict";var r=e(1),i=e(13),o=e(8),u=e(0),a=e(11),c=e(29).KEY,s=e(2),f=e(50),l=e(40),h=e(31),d=e(5),p=e(63),v=e(97),g=e(135),y=e(53),m=e(3),b=e(4),S=e(10),w=e(15),_=e(28),M=e(30),x=e(35),P=e(100),O=e(22),F=e(52),A=e(9),E=e(33),N=O.f,R=A.f,k=P.f,T=r.Symbol,I=r.JSON,j=I&&I.stringify,L=d("_hidden"),B=d("toPrimitive"),C={}.propertyIsEnumerable,W=f("symbol-registry"),V=f("symbols"),G=f("op-symbols"),D=Object.prototype,U="function"==typeof T&&!!F.f,z=r.QObject,q=!z||!z.prototype||!z.prototype.findChild,K=o&&s((function(){return 7!=x(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a}))?function(t,n,e){var r=N(D,n);r&&delete D[n],R(t,n,e),r&&t!==D&&R(D,n,r)}:R,Y=function(t){var n=V[t]=x(T.prototype);return n._k=t,n},Q=U&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},H=function(t,n,e){return t===D&&H(G,n,e),m(t),n=_(n,!0),m(e),i(V,n)?(e.enumerable?(i(t,L)&&t[L][n]&&(t[L][n]=!1),e=x(e,{enumerable:M(0,!1)})):(i(t,L)||R(t,L,M(1,{})),t[L][n]=!0),K(t,n,e)):R(t,n,e)},J=function(t,n){m(t);for(var e,r=g(n=w(n)),i=0,o=r.length;o>i;)H(t,e=r[i++],n[e]);return t},X=function(t){var n=C.call(this,t=_(t,!0));return!(this===D&&i(V,t)&&!i(G,t))&&(!(n||!i(this,t)||!i(V,t)||i(this,L)&&this[L][t])||n)},Z=function(t,n){if(t=w(t),n=_(n,!0),t!==D||!i(V,n)||i(G,n)){var e=N(t,n);return!e||!i(V,n)||i(t,L)&&t[L][n]||(e.enumerable=!0),e}},$=function(t){for(var n,e=k(w(t)),r=[],o=0;e.length>o;)i(V,n=e[o++])||n==L||n==c||r.push(n);return r},tt=function(t){for(var n,e=t===D,r=k(e?G:w(t)),o=[],u=0;r.length>u;)!i(V,n=r[u++])||e&&!i(D,n)||o.push(V[n]);return o};U||(a((T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),n=function(e){this===D&&n.call(G,e),i(this,L)&&i(this[L],t)&&(this[L][t]=!1),K(this,t,M(1,e))};return o&&q&&K(D,t,{configurable:!0,set:n}),Y(t)}).prototype,"toString",(function(){return this._k})),O.f=Z,A.f=H,e(36).f=P.f=$,e(47).f=X,F.f=tt,o&&!e(32)&&a(D,"propertyIsEnumerable",X,!0),p.f=function(t){return Y(d(t))}),u(u.G+u.W+u.F*!U,{Symbol:T});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;nt.length>et;)d(nt[et++]);for(var rt=E(d.store),it=0;rt.length>it;)v(rt[it++]);u(u.S+u.F*!U,"Symbol",{for:function(t){return i(W,t+="")?W[t]:W[t]=T(t)},keyFor:function(t){if(!Q(t))throw TypeError(t+" is not a symbol!");for(var n in W)if(W[n]===t)return n},useSetter:function(){q=!0},useSimple:function(){q=!1}}),u(u.S+u.F*!U,"Object",{create:function(t,n){return void 0===n?x(t):J(x(t),n)},defineProperty:H,defineProperties:J,getOwnPropertyDescriptor:Z,getOwnPropertyNames:$,getOwnPropertySymbols:tt});var ot=s((function(){F.f(1)}));u(u.S+u.F*ot,"Object",{getOwnPropertySymbols:function(t){return F.f(S(t))}}),I&&u(u.S+u.F*(!U||s((function(){var t=T();return"[null]"!=j([t])||"{}"!=j({a:t})||"{}"!=j(Object(t))}))),"JSON",{stringify:function(t){for(var n,e,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(e=n=r[1],(b(n)||void 0!==t)&&!Q(t))return y(n)||(n=function(t,n){if("function"==typeof e&&(n=e.call(this,t,n)),!Q(n))return n}),r[1]=n,j.apply(I,r)}}),T.prototype[B]||e(14)(T.prototype,B,T.prototype.valueOf),l(T,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,n,e){t.exports=e(50)("native-function-to-string",Function.toString)},function(t,n,e){var r=e(33),i=e(52),o=e(47);t.exports=function(t){var n=r(t),e=i.f;if(e)for(var u,a=e(t),c=o.f,s=0;a.length>s;)c.call(t,u=a[s++])&&n.push(u);return n}},function(t,n,e){var r=e(0);r(r.S,"Object",{create:e(35)})},function(t,n,e){var r=e(0);r(r.S+r.F*!e(8),"Object",{defineProperty:e(9).f})},function(t,n,e){var r=e(0);r(r.S+r.F*!e(8),"Object",{defineProperties:e(99)})},function(t,n,e){var r=e(15),i=e(22).f;e(23)("getOwnPropertyDescriptor",(function(){return function(t,n){return i(r(t),n)}}))},function(t,n,e){var r=e(10),i=e(37);e(23)("getPrototypeOf",(function(){return function(t){return i(r(t))}}))},function(t,n,e){var r=e(10),i=e(33);e(23)("keys",(function(){return function(t){return i(r(t))}}))},function(t,n,e){e(23)("getOwnPropertyNames",(function(){return e(100).f}))},function(t,n,e){var r=e(4),i=e(29).onFreeze;e(23)("freeze",(function(t){return function(n){return t&&r(n)?t(i(n)):n}}))},function(t,n,e){var r=e(4),i=e(29).onFreeze;e(23)("seal",(function(t){return function(n){return t&&r(n)?t(i(n)):n}}))},function(t,n,e){var r=e(4),i=e(29).onFreeze;e(23)("preventExtensions",(function(t){return function(n){return t&&r(n)?t(i(n)):n}}))},function(t,n,e){var r=e(4);e(23)("isFrozen",(function(t){return function(n){return!r(n)||!!t&&t(n)}}))},function(t,n,e){var r=e(4);e(23)("isSealed",(function(t){return function(n){return!r(n)||!!t&&t(n)}}))},function(t,n,e){var r=e(4);e(23)("isExtensible",(function(t){return function(n){return!!r(n)&&(!t||t(n))}}))},function(t,n,e){var r=e(0);r(r.S+r.F,"Object",{assign:e(101)})},function(t,n,e){var r=e(0);r(r.S,"Object",{is:e(102)})},function(t,n,e){var r=e(0);r(r.S,"Object",{setPrototypeOf:e(67).set})},function(t,n,e){"use strict";var r=e(48),i={};i[e(5)("toStringTag")]="z",i+""!="[object z]"&&e(11)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(t,n,e){var r=e(0);r(r.P,"Function",{bind:e(103)})},function(t,n,e){var r=e(9).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||e(8)&&r(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,n,e){"use strict";var r=e(4),i=e(37),o=e(5)("hasInstance"),u=Function.prototype;o in u||e(9).f(u,o,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},function(t,n,e){var r=e(0),i=e(105);r(r.G+r.F*(parseInt!=i),{parseInt:i})},function(t,n,e){var r=e(0),i=e(106);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},function(t,n,e){"use strict";var r=e(1),i=e(13),o=e(25),u=e(69),a=e(28),c=e(2),s=e(36).f,f=e(22).f,l=e(9).f,h=e(41).trim,d=r.Number,p=d,v=d.prototype,g="Number"==o(e(35)(v)),y="trim"in String.prototype,m=function(t){var n=a(t,!1);if("string"==typeof n&&n.length>2){var e,r,i,o=(n=y?n.trim():h(n,3)).charCodeAt(0);if(43===o||45===o){if(88===(e=n.charCodeAt(2))||120===e)return NaN}else if(48===o){switch(n.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+n}for(var u,c=n.slice(2),s=0,f=c.length;si)return NaN;return parseInt(c,r)}}return+n};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var n=arguments.length<1?0:t,e=this;return e instanceof d&&(g?c((function(){v.valueOf.call(e)})):"Number"!=o(e))?u(new p(m(n)),e,d):m(n)};for(var b,S=e(8)?s(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;S.length>w;w++)i(p,b=S[w])&&!i(d,b)&&l(d,b,f(p,b));d.prototype=v,v.constructor=d,e(11)(r,"Number",d)}},function(t,n,e){"use strict";var r=e(0),i=e(21),o=e(107),u=e(70),a=1..toFixed,c=Math.floor,s=[0,0,0,0,0,0],f="Number.toFixed: incorrect invocation!",l=function(t,n){for(var e=-1,r=n;++e<6;)r+=t*s[e],s[e]=r%1e7,r=c(r/1e7)},h=function(t){for(var n=6,e=0;--n>=0;)e+=s[n],s[n]=c(e/t),e=e%t*1e7},d=function(){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==s[t]){var e=String(s[t]);n=""===n?e:n+u.call("0",7-e.length)+e}return n},p=function(t,n,e){return 0===n?e:n%2==1?p(t,n-1,e*t):p(t*t,n/2,e)};r(r.P+r.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!e(2)((function(){a.call({})}))),"Number",{toFixed:function(t){var n,e,r,a,c=o(this,f),s=i(t),v="",g="0";if(s<0||s>20)throw RangeError(f);if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(v="-",c=-c),c>1e-21)if(e=(n=function(t){for(var n=0,e=t;e>=4096;)n+=12,e/=4096;for(;e>=2;)n+=1,e/=2;return n}(c*p(2,69,1))-69)<0?c*p(2,-n,1):c/p(2,n,1),e*=4503599627370496,(n=52-n)>0){for(l(0,e),r=s;r>=7;)l(1e7,0),r-=7;for(l(p(10,r,1),0),r=n-1;r>=23;)h(1<<23),r-=23;h(1<0?v+((a=g.length)<=s?"0."+u.call("0",s-a)+g:g.slice(0,a-s)+"."+g.slice(a-s)):v+g}})},function(t,n,e){"use strict";var r=e(0),i=e(2),o=e(107),u=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==u.call(1,void 0)}))||!i((function(){u.call({})}))),"Number",{toPrecision:function(t){var n=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?u.call(n):u.call(n,t)}})},function(t,n,e){var r=e(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,n,e){var r=e(0),i=e(1).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},function(t,n,e){var r=e(0);r(r.S,"Number",{isInteger:e(108)})},function(t,n,e){var r=e(0);r(r.S,"Number",{isNaN:function(t){return t!=t}})},function(t,n,e){var r=e(0),i=e(108),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},function(t,n,e){var r=e(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,n,e){var r=e(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,n,e){var r=e(0),i=e(106);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(t,n,e){var r=e(0),i=e(105);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(t,n,e){var r=e(0),i=e(109),o=Math.sqrt,u=Math.acosh;r(r.S+r.F*!(u&&710==Math.floor(u(Number.MAX_VALUE))&&u(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},function(t,n,e){var r=e(0),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function t(n){return isFinite(n=+n)&&0!=n?n<0?-t(-n):Math.log(n+Math.sqrt(n*n+1)):n}})},function(t,n,e){var r=e(0),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,n,e){var r=e(0),i=e(71);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,n,e){var r=e(0);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,e){var r=e(0),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},function(t,n,e){var r=e(0),i=e(72);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,e){var r=e(0);r(r.S,"Math",{fround:e(178)})},function(t,n,e){var r=e(71),i=Math.pow,o=i(2,-52),u=i(2,-23),a=i(2,127)*(2-u),c=i(2,-126);t.exports=Math.fround||function(t){var n,e,i=Math.abs(t),s=r(t);return ia||e!=e?s*(1/0):s*e}},function(t,n,e){var r=e(0),i=Math.abs;r(r.S,"Math",{hypot:function(t,n){for(var e,r,o=0,u=0,a=arguments.length,c=0;u0?(r=e/c)*r:e;return c===1/0?1/0:c*Math.sqrt(o)}})},function(t,n,e){var r=e(0),i=Math.imul;r(r.S+r.F*e(2)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(t,n){var e=+t,r=+n,i=65535&e,o=65535&r;return 0|i*o+((65535&e>>>16)*o+i*(65535&r>>>16)<<16>>>0)}})},function(t,n,e){var r=e(0);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,n,e){var r=e(0);r(r.S,"Math",{log1p:e(109)})},function(t,n,e){var r=e(0);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,n,e){var r=e(0);r(r.S,"Math",{sign:e(71)})},function(t,n,e){var r=e(0),i=e(72),o=Math.exp;r(r.S+r.F*e(2)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,e){var r=e(0),i=e(72),o=Math.exp;r(r.S,"Math",{tanh:function(t){var n=i(t=+t),e=i(-t);return n==1/0?1:e==1/0?-1:(n-e)/(o(t)+o(-t))}})},function(t,n,e){var r=e(0);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,n,e){var r=e(0),i=e(34),o=String.fromCharCode,u=String.fromCodePoint;r(r.S+r.F*(!!u&&1!=u.length),"String",{fromCodePoint:function(t){for(var n,e=[],r=arguments.length,u=0;r>u;){if(n=+arguments[u++],i(n,1114111)!==n)throw RangeError(n+" is not a valid code point");e.push(n<65536?o(n):o(55296+((n-=65536)>>10),n%1024+56320))}return e.join("")}})},function(t,n,e){var r=e(0),i=e(15),o=e(6);r(r.S,"String",{raw:function(t){for(var n=i(t.raw),e=o(n.length),r=arguments.length,u=[],a=0;e>a;)u.push(String(n[a++])),a=n.length?{value:void 0,done:!0}:(t=r(n,e),this._i+=t.length,{value:t,done:!1})}))},function(t,n,e){"use strict";var r=e(0),i=e(73)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,n,e){"use strict";var r=e(0),i=e(6),o=e(75),u="".endsWith;r(r.P+r.F*e(77)("endsWith"),"String",{endsWith:function(t){var n=o(this,t,"endsWith"),e=arguments.length>1?arguments[1]:void 0,r=i(n.length),a=void 0===e?r:Math.min(i(e),r),c=String(t);return u?u.call(n,c,a):n.slice(a-c.length,a)===c}})},function(t,n,e){"use strict";var r=e(0),i=e(75);r(r.P+r.F*e(77)("includes"),"String",{includes:function(t){return!!~i(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,n,e){var r=e(0);r(r.P,"String",{repeat:e(70)})},function(t,n,e){"use strict";var r=e(0),i=e(6),o=e(75),u="".startsWith;r(r.P+r.F*e(77)("startsWith"),"String",{startsWith:function(t){var n=o(this,t,"startsWith"),e=i(Math.min(arguments.length>1?arguments[1]:void 0,n.length)),r=String(t);return u?u.call(n,r,e):n.slice(e,e+r.length)===r}})},function(t,n,e){"use strict";e(12)("anchor",(function(t){return function(n){return t(this,"a","name",n)}}))},function(t,n,e){"use strict";e(12)("big",(function(t){return function(){return t(this,"big","","")}}))},function(t,n,e){"use strict";e(12)("blink",(function(t){return function(){return t(this,"blink","","")}}))},function(t,n,e){"use strict";e(12)("bold",(function(t){return function(){return t(this,"b","","")}}))},function(t,n,e){"use strict";e(12)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},function(t,n,e){"use strict";e(12)("fontcolor",(function(t){return function(n){return t(this,"font","color",n)}}))},function(t,n,e){"use strict";e(12)("fontsize",(function(t){return function(n){return t(this,"font","size",n)}}))},function(t,n,e){"use strict";e(12)("italics",(function(t){return function(){return t(this,"i","","")}}))},function(t,n,e){"use strict";e(12)("link",(function(t){return function(n){return t(this,"a","href",n)}}))},function(t,n,e){"use strict";e(12)("small",(function(t){return function(){return t(this,"small","","")}}))},function(t,n,e){"use strict";e(12)("strike",(function(t){return function(){return t(this,"strike","","")}}))},function(t,n,e){"use strict";e(12)("sub",(function(t){return function(){return t(this,"sub","","")}}))},function(t,n,e){"use strict";e(12)("sup",(function(t){return function(){return t(this,"sup","","")}}))},function(t,n,e){var r=e(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,n,e){"use strict";var r=e(0),i=e(10),o=e(28);r(r.P+r.F*e(2)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var n=i(this),e=o(n);return"number"!=typeof e||isFinite(e)?n.toISOString():null}})},function(t,n,e){var r=e(0),i=e(213);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(t,n,e){"use strict";var r=e(2),i=Date.prototype.getTime,o=Date.prototype.toISOString,u=function(t){return t>9?t:"0"+t};t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),e=t.getUTCMilliseconds(),r=n<0?"-":n>9999?"+":"";return r+("00000"+Math.abs(n)).slice(r?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(e>99?e:"0"+u(e))+"Z"}:o},function(t,n,e){var r=Date.prototype,i=r.toString,o=r.getTime;new Date(NaN)+""!="Invalid Date"&&e(11)(r,"toString",(function(){var t=o.call(this);return t==t?i.call(this):"Invalid Date"}))},function(t,n,e){var r=e(5)("toPrimitive"),i=Date.prototype;r in i||e(14)(i,r,e(216))},function(t,n,e){"use strict";var r=e(3),i=e(28);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(r(this),"number"!=t)}},function(t,n,e){var r=e(0);r(r.S,"Array",{isArray:e(53)})},function(t,n,e){"use strict";var r=e(19),i=e(0),o=e(10),u=e(111),a=e(78),c=e(6),s=e(79),f=e(80);i(i.S+i.F*!e(54)((function(t){Array.from(t)})),"Array",{from:function(t){var n,e,i,l,h=o(t),d="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,g=void 0!==v,y=0,m=f(h);if(g&&(v=r(v,p>2?arguments[2]:void 0,2)),null==m||d==Array&&a(m))for(e=new d(n=c(h.length));n>y;y++)s(e,y,g?v(h[y],y):h[y]);else for(l=m.call(h),e=new d;!(i=l.next()).done;y++)s(e,y,g?u(l,v,[i.value,y],!0):i.value);return e.length=y,e}})},function(t,n,e){"use strict";var r=e(0),i=e(79);r(r.S+r.F*e(2)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,n=arguments.length,e=new("function"==typeof this?this:Array)(n);n>t;)i(e,t,arguments[t++]);return e.length=n,e}})},function(t,n,e){"use strict";var r=e(0),i=e(15),o=[].join;r(r.P+r.F*(e(46)!=Object||!e(16)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},function(t,n,e){"use strict";var r=e(0),i=e(66),o=e(25),u=e(34),a=e(6),c=[].slice;r(r.P+r.F*e(2)((function(){i&&c.call(i)})),"Array",{slice:function(t,n){var e=a(this.length),r=o(this);if(n=void 0===n?e:n,"Array"==r)return c.call(this,t,n);for(var i=u(t,e),s=u(n,e),f=a(s-i),l=new Array(f),h=0;h1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=e+r);r>=0;r--)if(r in n&&n[r]===t)return r||0;return-1}})},function(t,n,e){var r=e(0);r(r.P,"Array",{copyWithin:e(114)}),e(38)("copyWithin")},function(t,n,e){var r=e(0);r(r.P,"Array",{fill:e(81)}),e(38)("fill")},function(t,n,e){"use strict";var r=e(0),i=e(24)(5),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),e(38)("find")},function(t,n,e){"use strict";var r=e(0),i=e(24)(6),o="findIndex",u=!0;o in[]&&Array(1)[o]((function(){u=!1})),r(r.P+r.F*u,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),e(38)(o)},function(t,n,e){e(43)("Array")},function(t,n,e){var r=e(1),i=e(69),o=e(9).f,u=e(36).f,a=e(76),c=e(55),s=r.RegExp,f=s,l=s.prototype,h=/a/g,d=/a/g,p=new s(h)!==h;if(e(8)&&(!p||e(2)((function(){return d[e(5)("match")]=!1,s(h)!=h||s(d)==d||"/a/i"!=s(h,"i")})))){s=function(t,n){var e=this instanceof s,r=a(t),o=void 0===n;return!e&&r&&t.constructor===s&&o?t:i(p?new f(r&&!o?t.source:t,n):f((r=t instanceof s)?t.source:t,r&&o?c.call(t):n),e?this:l,s)};for(var v=function(t){t in s||o(s,t,{configurable:!0,get:function(){return f[t]},set:function(n){f[t]=n}})},g=u(f),y=0;g.length>y;)v(g[y++]);l.constructor=s,s.prototype=l,e(11)(r,"RegExp",s)}e(43)("RegExp")},function(t,n,e){"use strict";e(117);var r=e(3),i=e(55),o=e(8),u=/./.toString,a=function(t){e(11)(RegExp.prototype,"toString",t,!0)};e(2)((function(){return"/a/b"!=u.call({source:"a",flags:"b"})}))?a((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)})):"toString"!=u.name&&a((function(){return u.call(this)}))},function(t,n,e){"use strict";var r=e(3),i=e(6),o=e(84),u=e(56);e(57)("match",1,(function(t,n,e,a){return[function(e){var r=t(this),i=null==e?void 0:e[n];return void 0!==i?i.call(e,r):new RegExp(e)[n](String(r))},function(t){var n=a(e,t,this);if(n.done)return n.value;var c=r(t),s=String(this);if(!c.global)return u(c,s);var f=c.unicode;c.lastIndex=0;for(var l,h=[],d=0;null!==(l=u(c,s));){var p=String(l[0]);h[d]=p,""===p&&(c.lastIndex=o(s,i(c.lastIndex),f)),d++}return 0===d?null:h}]}))},function(t,n,e){"use strict";var r=e(3),i=e(10),o=e(6),u=e(21),a=e(84),c=e(56),s=Math.max,f=Math.min,l=Math.floor,h=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;e(57)("replace",2,(function(t,n,e,p){return[function(r,i){var o=t(this),u=null==r?void 0:r[n];return void 0!==u?u.call(r,o,i):e.call(String(o),r,i)},function(t,n){var i=p(e,t,this,n);if(i.done)return i.value;var l=r(t),h=String(this),d="function"==typeof n;d||(n=String(n));var g=l.global;if(g){var y=l.unicode;l.lastIndex=0}for(var m=[];;){var b=c(l,h);if(null===b)break;if(m.push(b),!g)break;""===String(b[0])&&(l.lastIndex=a(h,o(l.lastIndex),y))}for(var S,w="",_=0,M=0;M=_&&(w+=h.slice(_,P)+N,_=P+x.length)}return w+h.slice(_)}];function v(t,n,r,o,u,a){var c=r+t.length,s=o.length,f=d;return void 0!==u&&(u=i(u),f=h),e.call(a,f,(function(e,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,r);case"'":return n.slice(c);case"<":a=u[i.slice(1,-1)];break;default:var f=+i;if(0===f)return e;if(f>s){var h=l(f/10);return 0===h?e:h<=s?void 0===o[h-1]?i.charAt(1):o[h-1]+i.charAt(1):e}a=o[f-1]}return void 0===a?"":a}))}}))},function(t,n,e){"use strict";var r=e(3),i=e(102),o=e(56);e(57)("search",1,(function(t,n,e,u){return[function(e){var r=t(this),i=null==e?void 0:e[n];return void 0!==i?i.call(e,r):new RegExp(e)[n](String(r))},function(t){var n=u(e,t,this);if(n.done)return n.value;var a=r(t),c=String(this),s=a.lastIndex;i(s,0)||(a.lastIndex=0);var f=o(a,c);return i(a.lastIndex,s)||(a.lastIndex=s),null===f?-1:f.index}]}))},function(t,n,e){"use strict";var r=e(76),i=e(3),o=e(49),u=e(84),a=e(6),c=e(56),s=e(83),f=e(2),l=Math.min,h=[].push,d=!f((function(){RegExp(4294967295,"y")}));e(57)("split",2,(function(t,n,e,f){var p;return p="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=String(this);if(void 0===t&&0===n)return[];if(!r(t))return e.call(i,t,n);for(var o,u,a,c=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,d=void 0===n?4294967295:n>>>0,p=new RegExp(t.source,f+"g");(o=s.call(p,i))&&!((u=p.lastIndex)>l&&(c.push(i.slice(l,o.index)),o.length>1&&o.index=d));)p.lastIndex===o.index&&p.lastIndex++;return l===i.length?!a&&p.test("")||c.push(""):c.push(i.slice(l)),c.length>d?c.slice(0,d):c}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,r){var i=t(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,i,r):p.call(String(i),e,r)},function(t,n){var r=f(p,t,this,n,p!==e);if(r.done)return r.value;var s=i(t),h=String(this),v=o(s,RegExp),g=s.unicode,y=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(d?"y":"g"),m=new v(d?s:"^(?:"+s.source+")",y),b=void 0===n?4294967295:n>>>0;if(0===b)return[];if(0===h.length)return null===c(m,h)?[h]:[];for(var S=0,w=0,_=[];w0?arguments[0]:void 0)}}),{get:function(t){var n=r.getEntry(i(this,"Map"),t);return n&&n.v},set:function(t,n){return r.def(i(this,"Map"),0===t?0:t,n)}},r,!0)},function(t,n,e){"use strict";var r=e(121),i=e(39);t.exports=e(60)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,"Set"),t=0===t?0:t,t)}},r)},function(t,n,e){"use strict";var r,i=e(1),o=e(24)(0),u=e(11),a=e(29),c=e(101),s=e(122),f=e(4),l=e(39),h=e(39),d=!i.ActiveXObject&&"ActiveXObject"in i,p=a.getWeak,v=Object.isExtensible,g=s.ufstore,y=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},m={get:function(t){if(f(t)){var n=p(t);return!0===n?g(l(this,"WeakMap")).get(t):n?n[this._i]:void 0}},set:function(t,n){return s.def(l(this,"WeakMap"),t,n)}},b=t.exports=e(60)("WeakMap",y,m,s,!0,!0);h&&d&&(c((r=s.getConstructor(y,"WeakMap")).prototype,m),a.NEED=!0,o(["delete","has","get","set"],(function(t){var n=b.prototype,e=n[t];u(n,t,(function(n,i){if(f(n)&&!v(n)){this._f||(this._f=new r);var o=this._f[t](n,i);return"set"==t?this:o}return e.call(this,n,i)}))})))},function(t,n,e){"use strict";var r=e(122),i=e(39);e(60)("WeakSet",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,"WeakSet"),t,!0)}},r,!1,!0)},function(t,n,e){"use strict";var r=e(0),i=e(61),o=e(86),u=e(3),a=e(34),c=e(6),s=e(4),f=e(1).ArrayBuffer,l=e(49),h=o.ArrayBuffer,d=o.DataView,p=i.ABV&&f.isView,v=h.prototype.slice,g=i.VIEW;r(r.G+r.W+r.F*(f!==h),{ArrayBuffer:h}),r(r.S+r.F*!i.CONSTR,"ArrayBuffer",{isView:function(t){return p&&p(t)||s(t)&&g in t}}),r(r.P+r.U+r.F*e(2)((function(){return!new h(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(t,n){if(void 0!==v&&void 0===n)return v.call(u(this),t);for(var e=u(this).byteLength,r=a(t,e),i=a(void 0===n?e:n,e),o=new(l(this,h))(c(i-r)),s=new d(this),f=new d(o),p=0;r=n.length)return{value:void 0,done:!0}}while(!((t=n[this._i++])in this._t));return{value:t,done:!1}})),r(r.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,n,e){var r=e(22),i=e(37),o=e(13),u=e(0),a=e(4),c=e(3);u(u.S,"Reflect",{get:function t(n,e){var u,s,f=arguments.length<3?n:arguments[2];return c(n)===f?n[e]:(u=r.f(n,e))?o(u,"value")?u.value:void 0!==u.get?u.get.call(f):void 0:a(s=i(n))?t(s,e,f):void 0}})},function(t,n,e){var r=e(22),i=e(0),o=e(3);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,n){return r.f(o(t),n)}})},function(t,n,e){var r=e(0),i=e(37),o=e(3);r(r.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},function(t,n,e){var r=e(0);r(r.S,"Reflect",{has:function(t,n){return n in t}})},function(t,n,e){var r=e(0),i=e(3),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},function(t,n,e){var r=e(0);r(r.S,"Reflect",{ownKeys:e(124)})},function(t,n,e){var r=e(0),i=e(3),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},function(t,n,e){var r=e(9),i=e(22),o=e(37),u=e(13),a=e(0),c=e(30),s=e(3),f=e(4);a(a.S,"Reflect",{set:function t(n,e,a){var l,h,d=arguments.length<4?n:arguments[3],p=i.f(s(n),e);if(!p){if(f(h=o(n)))return t(h,e,a,d);p=c(0)}if(u(p,"value")){if(!1===p.writable||!f(d))return!1;if(l=i.f(d,e)){if(l.get||l.set||!1===l.writable)return!1;l.value=a,r.f(d,e,l)}else r.f(d,e,c(0,a));return!0}return void 0!==p.set&&(p.set.call(d,a),!0)}})},function(t,n,e){var r=e(0),i=e(67);i&&r(r.S,"Reflect",{setPrototypeOf:function(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(t){return!1}}})},function(t,n,e){e(276),t.exports=e(7).Array.includes},function(t,n,e){"use strict";var r=e(0),i=e(51)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),e(38)("includes")},function(t,n,e){e(278),t.exports=e(7).Array.flatMap},function(t,n,e){"use strict";var r=e(0),i=e(279),o=e(10),u=e(6),a=e(20),c=e(112);r(r.P,"Array",{flatMap:function(t){var n,e,r=o(this);return a(t),n=u(r.length),e=c(r,0),i(e,r,r,n,0,1,t,arguments[1]),e}}),e(38)("flatMap")},function(t,n,e){"use strict";var r=e(53),i=e(4),o=e(6),u=e(19),a=e(5)("isConcatSpreadable");t.exports=function t(n,e,c,s,f,l,h,d){for(var p,v,g=f,y=0,m=!!h&&u(h,d,3);y0)g=t(n,e,p,o(p.length),g,l-1)-1;else{if(g>=9007199254740991)throw TypeError();n[g]=p}g++}y++}return g}},function(t,n,e){e(281),t.exports=e(7).String.padStart},function(t,n,e){"use strict";var r=e(0),i=e(125),o=e(59),u=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*u,"String",{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,n,e){e(283),t.exports=e(7).String.padEnd},function(t,n,e){"use strict";var r=e(0),i=e(125),o=e(59),u=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*u,"String",{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},function(t,n,e){e(285),t.exports=e(7).String.trimLeft},function(t,n,e){"use strict";e(41)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},function(t,n,e){e(287),t.exports=e(7).String.trimRight},function(t,n,e){"use strict";e(41)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},function(t,n,e){e(289),t.exports=e(63).f("asyncIterator")},function(t,n,e){e(97)("asyncIterator")},function(t,n,e){e(291),t.exports=e(7).Object.getOwnPropertyDescriptors},function(t,n,e){var r=e(0),i=e(124),o=e(15),u=e(22),a=e(79);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var n,e,r=o(t),c=u.f,s=i(r),f={},l=0;s.length>l;)void 0!==(e=c(r,n=s[l++]))&&a(f,n,e);return f}})},function(t,n,e){e(293),t.exports=e(7).Object.values},function(t,n,e){var r=e(0),i=e(126)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},function(t,n,e){e(295),t.exports=e(7).Object.entries},function(t,n,e){var r=e(0),i=e(126)(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},function(t,n,e){"use strict";e(118),e(297),t.exports=e(7).Promise.finally},function(t,n,e){"use strict";var r=e(0),i=e(7),o=e(1),u=e(49),a=e(120);r(r.P+r.R,"Promise",{finally:function(t){var n=u(this,i.Promise||o.Promise),e="function"==typeof t;return this.then(e?function(e){return a(n,t()).then((function(){return e}))}:t,e?function(e){return a(n,t()).then((function(){throw e}))}:t)}})},function(t,n,e){e(299),e(300),e(301),t.exports=e(7)},function(t,n,e){var r=e(1),i=e(0),o=e(59),u=[].slice,a=/MSIE .\./.test(o),c=function(t){return function(n,e){var r=arguments.length>2,i=!!r&&u.call(arguments,2);return t(r?function(){("function"==typeof n?n:Function(n)).apply(this,i)}:n,e)}};i(i.G+i.B+i.F*a,{setTimeout:c(r.setTimeout),setInterval:c(r.setInterval)})},function(t,n,e){var r=e(0),i=e(85);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(t,n,e){for(var r=e(82),i=e(33),o=e(11),u=e(1),a=e(14),c=e(42),s=e(5),f=s("iterator"),l=s("toStringTag"),h=c.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(d),v=0;v=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var c=r.call(u,"catchLoc"),s=r.call(u,"finallyLoc");if(c&&s){if(this.prev=0;--e){var i=this.tryEntries[e];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),O(e),p}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var i=r.arg;O(e)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),p}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,n,e){e(304),t.exports=e(127).global},function(t,n,e){var r=e(305);r(r.G,{global:e(87)})},function(t,n,e){var r=e(87),i=e(127),o=e(306),u=e(308),a=e(315),c=function(t,n,e){var s,f,l,h=t&c.F,d=t&c.G,p=t&c.S,v=t&c.P,g=t&c.B,y=t&c.W,m=d?i:i[n]||(i[n]={}),b=m.prototype,S=d?r:p?r[n]:(r[n]||{}).prototype;for(s in d&&(e=n),e)(f=!h&&S&&void 0!==S[s])&&a(m,s)||(l=f?S[s]:e[s],m[s]=d&&"function"!=typeof S[s]?e[s]:g&&f?o(l,r):y&&S[s]==l?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n.prototype=t.prototype,n}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[s]=l,t&c.R&&b&&!b[s]&&u(b,s,l)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,n,e){var r=e(307);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,i){return t.call(n,e,r,i)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,e){var r=e(309),i=e(314);t.exports=e(89)?function(t,n,e){return r.f(t,n,i(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n,e){var r=e(310),i=e(311),o=e(313),u=Object.defineProperty;n.f=e(89)?Object.defineProperty:function(t,n,e){if(r(t),n=o(n,!0),r(e),i)try{return u(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(88);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n,e){t.exports=!e(89)&&!e(128)((function(){return 7!=Object.defineProperty(e(312)("div"),"a",{get:function(){return 7}}).a}))},function(t,n,e){var r=e(88),i=e(87).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,n,e){var r=e(88);t.exports=function(t,n){if(!r(t))return t;var e,i;if(n&&"function"==typeof(e=t.toString)&&!r(i=e.call(t)))return i;if("function"==typeof(e=t.valueOf)&&!r(i=e.call(t)))return i;if(!n&&"function"==typeof(e=t.toString)&&!r(i=e.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}}])})); \ No newline at end of file diff --git a/server/node_modules/bowser/es5.js b/server/node_modules/bowser/es5.js new file mode 100644 index 0000000000..bb8ec3dd76 --- /dev/null +++ b/server/node_modules/bowser/es5.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bowser=t():e.bowser=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),s=e.getVersionPrecision(r),a=Math.max(i,s),o=0,u=e.map([t,r],(function(t){var r=a-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(o=a-Math.min(i,s)),a-=1;a>=o;){if(u[0][a]>u[1][a])return 1;if(u[0][a]===u[1][a]){if(a===o)return 0;a-=1}else if(u[0][a]1?i-1:0),a=1;a0){var a=Object.keys(r),u=o.default.find(a,(function(e){return t.isOS(e)}));if(u){var d=this.satisfies(r[u]);if(void 0!==d)return d}var c=o.default.find(a,(function(e){return t.isPlatform(e)}));if(c){var f=this.satisfies(r[c]);if(void 0!==f)return f}}if(s>0){var l=Object.keys(i),h=o.default.find(l,(function(e){return t.isBrowser(e,!0)}));if(void 0!==h)return this.compareVersion(i[h])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=o.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(o.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n};var s=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:s.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:s.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:s.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:s.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=a,e.exports=t.default}})})); \ No newline at end of file diff --git a/server/node_modules/bowser/index.d.ts b/server/node_modules/bowser/index.d.ts new file mode 100644 index 0000000000..d95656a4de --- /dev/null +++ b/server/node_modules/bowser/index.d.ts @@ -0,0 +1,250 @@ +// Type definitions for Bowser v2 +// Project: https://github.com/lancedikson/bowser +// Definitions by: Alexander P. Cerutti , + +export = Bowser; +export as namespace Bowser; + +declare namespace Bowser { + /** + * Creates a Parser instance + * @param {string} UA - User agent string + * @param {boolean} skipParsing + */ + + function getParser(UA: string, skipParsing?: boolean): Parser.Parser; + + /** + * Creates a Parser instance and runs Parser.getResult immediately + * @param UA - User agent string + * @returns {Parser.ParsedResult} + */ + + function parse(UA: string): Parser.ParsedResult; + + /** + * Constants exposed via bowser getters + */ + const BROWSER_MAP: Record; + const ENGINE_MAP: Record; + const OS_MAP: Record; + const PLATFORMS_MAP: Record; + + namespace Parser { + interface Parser { + constructor(UA: string, skipParsing?: boolean): Parser.Parser; + + /** + * Get parsed browser object + * @return {BrowserDetails} Browser's details + */ + + getBrowser(): BrowserDetails; + + /** + * Get browser's name + * @param {Boolean} [toLowerCase] return lower-cased value + * @return {String} Browser's name or an empty string + */ + + getBrowserName(toLowerCase?: boolean): string; + + /** + * Get browser's version + * @return {String} version of browser + */ + + getBrowserVersion(): string; + + /** + * Get OS + * @return {OSDetails} - OS Details + * + * @example + * this.getOS(); // { + * // name: 'macOS', + * // version: '10.11.12', + * // } + */ + + getOS(): OSDetails; + + /** + * Get OS name + * @param {Boolean} [toLowerCase] return lower-cased value + * @return {String} name of the OS — macOS, Windows, Linux, etc. + */ + + getOSName(toLowerCase?: boolean): string; + + /** + * Get OS version + * @return {String} full version with dots ('10.11.12', '5.6', etc) + */ + + getOSVersion(): string; + + /** + * Get parsed platform + * @returns {PlatformDetails} + */ + + getPlatform(): PlatformDetails; + + /** + * Get platform name + * @param {boolean} toLowerCase + */ + + getPlatformType(toLowerCase?: boolean): string; + + /** + * Get parsed engine + * @returns {EngineDetails} + */ + + getEngine(): EngineDetails; + + /** + * Get parsed engine's name + * @returns {String} Engine's name or an empty string + */ + + getEngineName(): string; + + /** + * Get parsed result + * @return {ParsedResult} + */ + + getResult(): ParsedResult; + + /** + * Get UserAgent string of current Parser instance + * @return {String} User-Agent String of the current object + */ + + getUA(): string; + + /** + * Is anything? Check if the browser is called "anything", + * the OS called "anything" or the platform called "anything" + * @param {String} anything + * @returns {Boolean} + */ + + is(anything: any): boolean; + + /** + * Parse full information about the browser + * @returns {Parser.Parser} + */ + + parse(): Parser.Parser; + + /** + * Get parsed browser object + * @returns {BrowserDetails} + */ + + parseBrowser(): BrowserDetails; + + /** + * Get parsed engine + * @returns {EngineDetails} + */ + + parseEngine(): EngineDetails; + + /** + * Parse OS and save it to this.parsedResult.os + * @returns {OSDetails} + */ + + parseOS(): OSDetails; + + /** + * Get parsed platform + * @returns {PlatformDetails} + */ + + parsePlatform(): PlatformDetails; + + /** + * Check if parsed browser matches certain conditions + * + * @param {checkTree} checkTree It's one or two layered object, + * which can include a platform or an OS on the first layer + * and should have browsers specs on the bottom-laying layer + * + * @returns {Boolean|undefined} Whether the browser satisfies the set conditions or not. + * Returns `undefined` when the browser is no described in the checkTree object. + * + * @example + * const browser = new Bowser(UA); + * if (browser.check({chrome: '>118.01.1322' })) + * // or with os + * if (browser.check({windows: { chrome: '>118.01.1322' } })) + * // or with platforms + * if (browser.check({desktop: { chrome: '>118.01.1322' } })) + */ + + satisfies(checkTree: checkTree): boolean | undefined; + + /** + * Check if the browser name equals the passed string + * @param browserName The string to compare with the browser name + * @param [includingAlias=false] The flag showing whether alias will be included into comparison + * @returns {boolean} + */ + + + isBrowser(browserName: string, includingAlias?: boolean): boolean; + + /** + * Check if any of the given values satifies `.is(anything)` + * @param {string[]} anythings + * @returns {boolean} true if at least one condition is satisfied, false otherwise. + */ + + some(anythings: string[]): boolean | undefined; + + /** + * Test a UA string for a regexp + * @param regex + * @returns {boolean} true if the regex matches the UA, false otherwise. + */ + + test(regex: RegExp): boolean; + } + + interface ParsedResult { + browser: BrowserDetails; + os: OSDetails; + platform: PlatformDetails; + engine: EngineDetails; + } + + interface Details { + name?: string; + version?: string; + } + + interface OSDetails extends Details { + versionName?: string; + } + + interface PlatformDetails { + type?: string; + vendor?: string; + model?: string; + } + + type BrowserDetails = Details; + type EngineDetails = Details; + + interface checkTree { + [key: string]: any; + } + } +} diff --git a/server/node_modules/bowser/package.json b/server/node_modules/bowser/package.json new file mode 100644 index 0000000000..3fb7c83ffd --- /dev/null +++ b/server/node_modules/bowser/package.json @@ -0,0 +1,83 @@ +{ + "name": "bowser", + "version": "2.11.0", + "description": "Lightweight browser detector", + "keywords": [ + "browser", + "useragent", + "user-agent", + "parser", + "ua", + "detection", + "ender", + "sniff" + ], + "homepage": "https://github.com/lancedikson/bowser", + "author": "Dustin Diaz (http://dustindiaz.com)", + "contributors": [ + { + "name": "Denis Demchenko", + "url": "http://twitter.com/lancedikson" + } + ], + "main": "es5.js", + "browser": "es5.js", + "module": "src/bowser.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/lancedikson/bowser.git" + }, + "devDependencies": { + "@babel/cli": "^7.11.6", + "@babel/core": "^7.8.0", + "@babel/polyfill": "^7.8.3", + "@babel/preset-env": "^7.8.2", + "@babel/register": "^7.8.3", + "ava": "^3.0.0", + "babel-eslint": "^10.0.3", + "babel-loader": "^8.0.6", + "babel-plugin-add-module-exports": "^1.0.2", + "babel-plugin-istanbul": "^6.0.0", + "compression-webpack-plugin": "^4.0.0", + "coveralls": "^3.0.6", + "docdash": "^1.1.1", + "eslint": "^6.5.1", + "eslint-config-airbnb-base": "^13.2.0", + "eslint-plugin-ava": "^10.0.0", + "eslint-plugin-import": "^2.18.2", + "gh-pages": "^3.0.0", + "jsdoc": "^3.6.3", + "nyc": "^15.0.0", + "sinon": "^9.0.0", + "testem": "^3.0.0", + "webpack": "^4.41.0", + "webpack-bundle-analyzer": "^3.5.2", + "webpack-cli": "^3.3.9", + "yamljs": "^0.3.0" + }, + "ava": { + "require": [ + "@babel/register" + ] + }, + "bugs": { + "url": "https://github.com/lancedikson/bowser/issues" + }, + "directories": { + "test": "test" + }, + "scripts": { + "build": "webpack --config webpack.config.js", + "generate-and-deploy-docs": "npm run generate-docs && gh-pages --dist docs --dest docs", + "watch": "webpack --watch --config webpack.config.js", + "prepublishOnly": "npm run build", + "lint": "eslint ./src", + "testem": "testem", + "test": "nyc --reporter=html --reporter=text ava", + "test:watch": "ava --watch", + "coverage": "nyc report --reporter=text-lcov | coveralls", + "generate-docs": "jsdoc -c jsdoc.json" + }, + "license": "MIT" +} diff --git a/server/node_modules/bowser/src/bowser.js b/server/node_modules/bowser/src/bowser.js new file mode 100644 index 0000000000..f79e6e0e87 --- /dev/null +++ b/server/node_modules/bowser/src/bowser.js @@ -0,0 +1,77 @@ +/*! + * Bowser - a browser detector + * https://github.com/lancedikson/bowser + * MIT License | (c) Dustin Diaz 2012-2015 + * MIT License | (c) Denis Demchenko 2015-2019 + */ +import Parser from './parser.js'; +import { + BROWSER_MAP, + ENGINE_MAP, + OS_MAP, + PLATFORMS_MAP, +} from './constants.js'; + +/** + * Bowser class. + * Keep it simple as much as it can be. + * It's supposed to work with collections of {@link Parser} instances + * rather then solve one-instance problems. + * All the one-instance stuff is located in Parser class. + * + * @class + * @classdesc Bowser is a static object, that provides an API to the Parsers + * @hideconstructor + */ +class Bowser { + /** + * Creates a {@link Parser} instance + * + * @param {String} UA UserAgent string + * @param {Boolean} [skipParsing=false] Will make the Parser postpone parsing until you ask it + * explicitly. Same as `skipParsing` for {@link Parser}. + * @returns {Parser} + * @throws {Error} when UA is not a String + * + * @example + * const parser = Bowser.getParser(window.navigator.userAgent); + * const result = parser.getResult(); + */ + static getParser(UA, skipParsing = false) { + if (typeof UA !== 'string') { + throw new Error('UserAgent should be a string'); + } + return new Parser(UA, skipParsing); + } + + /** + * Creates a {@link Parser} instance and runs {@link Parser.getResult} immediately + * + * @param UA + * @return {ParsedResult} + * + * @example + * const result = Bowser.parse(window.navigator.userAgent); + */ + static parse(UA) { + return (new Parser(UA)).getResult(); + } + + static get BROWSER_MAP() { + return BROWSER_MAP; + } + + static get ENGINE_MAP() { + return ENGINE_MAP; + } + + static get OS_MAP() { + return OS_MAP; + } + + static get PLATFORMS_MAP() { + return PLATFORMS_MAP; + } +} + +export default Bowser; diff --git a/server/node_modules/bowser/src/constants.js b/server/node_modules/bowser/src/constants.js new file mode 100644 index 0000000000..f335032520 --- /dev/null +++ b/server/node_modules/bowser/src/constants.js @@ -0,0 +1,116 @@ +// NOTE: this list must be up-to-date with browsers listed in +// test/acceptance/useragentstrings.yml +export const BROWSER_ALIASES_MAP = { + 'Amazon Silk': 'amazon_silk', + 'Android Browser': 'android', + Bada: 'bada', + BlackBerry: 'blackberry', + Chrome: 'chrome', + Chromium: 'chromium', + Electron: 'electron', + Epiphany: 'epiphany', + Firefox: 'firefox', + Focus: 'focus', + Generic: 'generic', + 'Google Search': 'google_search', + Googlebot: 'googlebot', + 'Internet Explorer': 'ie', + 'K-Meleon': 'k_meleon', + Maxthon: 'maxthon', + 'Microsoft Edge': 'edge', + 'MZ Browser': 'mz', + 'NAVER Whale Browser': 'naver', + Opera: 'opera', + 'Opera Coast': 'opera_coast', + PhantomJS: 'phantomjs', + Puffin: 'puffin', + QupZilla: 'qupzilla', + QQ: 'qq', + QQLite: 'qqlite', + Safari: 'safari', + Sailfish: 'sailfish', + 'Samsung Internet for Android': 'samsung_internet', + SeaMonkey: 'seamonkey', + Sleipnir: 'sleipnir', + Swing: 'swing', + Tizen: 'tizen', + 'UC Browser': 'uc', + Vivaldi: 'vivaldi', + 'WebOS Browser': 'webos', + WeChat: 'wechat', + 'Yandex Browser': 'yandex', + Roku: 'roku', +}; + +export const BROWSER_MAP = { + amazon_silk: 'Amazon Silk', + android: 'Android Browser', + bada: 'Bada', + blackberry: 'BlackBerry', + chrome: 'Chrome', + chromium: 'Chromium', + electron: 'Electron', + epiphany: 'Epiphany', + firefox: 'Firefox', + focus: 'Focus', + generic: 'Generic', + googlebot: 'Googlebot', + google_search: 'Google Search', + ie: 'Internet Explorer', + k_meleon: 'K-Meleon', + maxthon: 'Maxthon', + edge: 'Microsoft Edge', + mz: 'MZ Browser', + naver: 'NAVER Whale Browser', + opera: 'Opera', + opera_coast: 'Opera Coast', + phantomjs: 'PhantomJS', + puffin: 'Puffin', + qupzilla: 'QupZilla', + qq: 'QQ Browser', + qqlite: 'QQ Browser Lite', + safari: 'Safari', + sailfish: 'Sailfish', + samsung_internet: 'Samsung Internet for Android', + seamonkey: 'SeaMonkey', + sleipnir: 'Sleipnir', + swing: 'Swing', + tizen: 'Tizen', + uc: 'UC Browser', + vivaldi: 'Vivaldi', + webos: 'WebOS Browser', + wechat: 'WeChat', + yandex: 'Yandex Browser', +}; + +export const PLATFORMS_MAP = { + tablet: 'tablet', + mobile: 'mobile', + desktop: 'desktop', + tv: 'tv', +}; + +export const OS_MAP = { + WindowsPhone: 'Windows Phone', + Windows: 'Windows', + MacOS: 'macOS', + iOS: 'iOS', + Android: 'Android', + WebOS: 'WebOS', + BlackBerry: 'BlackBerry', + Bada: 'Bada', + Tizen: 'Tizen', + Linux: 'Linux', + ChromeOS: 'Chrome OS', + PlayStation4: 'PlayStation 4', + Roku: 'Roku', +}; + +export const ENGINE_MAP = { + EdgeHTML: 'EdgeHTML', + Blink: 'Blink', + Trident: 'Trident', + Presto: 'Presto', + Gecko: 'Gecko', + WebKit: 'WebKit', +}; diff --git a/server/node_modules/bowser/src/parser-browsers.js b/server/node_modules/bowser/src/parser-browsers.js new file mode 100644 index 0000000000..ee7840c5d6 --- /dev/null +++ b/server/node_modules/bowser/src/parser-browsers.js @@ -0,0 +1,700 @@ +/** + * Browsers' descriptors + * + * The idea of descriptors is simple. You should know about them two simple things: + * 1. Every descriptor has a method or property called `test` and a `describe` method. + * 2. Order of descriptors is important. + * + * More details: + * 1. Method or property `test` serves as a way to detect whether the UA string + * matches some certain browser or not. The `describe` method helps to make a result + * object with params that show some browser-specific things: name, version, etc. + * 2. Order of descriptors is important because a Parser goes through them one by one + * in course. For example, if you insert Chrome's descriptor as the first one, + * more then a half of browsers will be described as Chrome, because they will pass + * the Chrome descriptor's test. + * + * Descriptor's `test` could be a property with an array of RegExps, where every RegExp + * will be applied to a UA string to test it whether it matches or not. + * If a descriptor has two or more regexps in the `test` array it tests them one by one + * with a logical sum operation. Parser stops if it has found any RegExp that matches the UA. + * + * Or `test` could be a method. In that case it gets a Parser instance and should + * return true/false to get the Parser know if this browser descriptor matches the UA or not. + */ + +import Utils from './utils.js'; + +const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i; + +const browsersList = [ + /* Googlebot */ + { + test: [/googlebot/i], + describe(ua) { + const browser = { + name: 'Googlebot', + }; + const version = Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Opera < 13.0 */ + { + test: [/opera/i], + describe(ua) { + const browser = { + name: 'Opera', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Opera > 13.0 */ + { + test: [/opr\/|opios/i], + describe(ua) { + const browser = { + name: 'Opera', + }; + const version = Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/SamsungBrowser/i], + describe(ua) { + const browser = { + name: 'Samsung Internet for Android', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/Whale/i], + describe(ua) { + const browser = { + name: 'NAVER Whale Browser', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/MZBrowser/i], + describe(ua) { + const browser = { + name: 'MZ Browser', + }; + const version = Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/focus/i], + describe(ua) { + const browser = { + name: 'Focus', + }; + const version = Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/swing/i], + describe(ua) { + const browser = { + name: 'Swing', + }; + const version = Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/coast/i], + describe(ua) { + const browser = { + name: 'Opera Coast', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/opt\/\d+(?:.?_?\d+)+/i], + describe(ua) { + const browser = { + name: 'Opera Touch', + }; + const version = Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/yabrowser/i], + describe(ua) { + const browser = { + name: 'Yandex Browser', + }; + const version = Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/ucbrowser/i], + describe(ua) { + const browser = { + name: 'UC Browser', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/Maxthon|mxios/i], + describe(ua) { + const browser = { + name: 'Maxthon', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/epiphany/i], + describe(ua) { + const browser = { + name: 'Epiphany', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/puffin/i], + describe(ua) { + const browser = { + name: 'Puffin', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/sleipnir/i], + describe(ua) { + const browser = { + name: 'Sleipnir', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/k-meleon/i], + describe(ua) { + const browser = { + name: 'K-Meleon', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/micromessenger/i], + describe(ua) { + const browser = { + name: 'WeChat', + }; + const version = Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/qqbrowser/i], + describe(ua) { + const browser = { + name: (/qqbrowserlite/i).test(ua) ? 'QQ Browser Lite' : 'QQ Browser', + }; + const version = Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/msie|trident/i], + describe(ua) { + const browser = { + name: 'Internet Explorer', + }; + const version = Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/\sedg\//i], + describe(ua) { + const browser = { + name: 'Microsoft Edge', + }; + + const version = Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/edg([ea]|ios)/i], + describe(ua) { + const browser = { + name: 'Microsoft Edge', + }; + + const version = Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/vivaldi/i], + describe(ua) { + const browser = { + name: 'Vivaldi', + }; + const version = Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/seamonkey/i], + describe(ua) { + const browser = { + name: 'SeaMonkey', + }; + const version = Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/sailfish/i], + describe(ua) { + const browser = { + name: 'Sailfish', + }; + + const version = Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/silk/i], + describe(ua) { + const browser = { + name: 'Amazon Silk', + }; + const version = Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/phantom/i], + describe(ua) { + const browser = { + name: 'PhantomJS', + }; + const version = Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/slimerjs/i], + describe(ua) { + const browser = { + name: 'SlimerJS', + }; + const version = Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/blackberry|\bbb\d+/i, /rim\stablet/i], + describe(ua) { + const browser = { + name: 'BlackBerry', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/(web|hpw)[o0]s/i], + describe(ua) { + const browser = { + name: 'WebOS Browser', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/bada/i], + describe(ua) { + const browser = { + name: 'Bada', + }; + const version = Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/tizen/i], + describe(ua) { + const browser = { + name: 'Tizen', + }; + const version = Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/qupzilla/i], + describe(ua) { + const browser = { + name: 'QupZilla', + }; + const version = Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/firefox|iceweasel|fxios/i], + describe(ua) { + const browser = { + name: 'Firefox', + }; + const version = Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/electron/i], + describe(ua) { + const browser = { + name: 'Electron', + }; + const version = Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/MiuiBrowser/i], + describe(ua) { + const browser = { + name: 'Miui', + }; + const version = Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/chromium/i], + describe(ua) { + const browser = { + name: 'Chromium', + }; + const version = Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/chrome|crios|crmo/i], + describe(ua) { + const browser = { + name: 'Chrome', + }; + const version = Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + { + test: [/GSA/i], + describe(ua) { + const browser = { + name: 'Google Search', + }; + const version = Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Android Browser */ + { + test(parser) { + const notLikeAndroid = !parser.test(/like android/i); + const butAndroid = parser.test(/android/i); + return notLikeAndroid && butAndroid; + }, + describe(ua) { + const browser = { + name: 'Android Browser', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* PlayStation 4 */ + { + test: [/playstation 4/i], + describe(ua) { + const browser = { + name: 'PlayStation 4', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Safari */ + { + test: [/safari|applewebkit/i], + describe(ua) { + const browser = { + name: 'Safari', + }; + const version = Utils.getFirstMatch(commonVersionIdentifier, ua); + + if (version) { + browser.version = version; + } + + return browser; + }, + }, + + /* Something else */ + { + test: [/.*/i], + describe(ua) { + /* Here we try to make sure that there are explicit details about the device + * in order to decide what regexp exactly we want to apply + * (as there is a specific decision based on that conclusion) + */ + const regexpWithoutDeviceSpec = /^(.*)\/(.*) /; + const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/; + const hasDeviceSpec = ua.search('\\(') !== -1; + const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec; + return { + name: Utils.getFirstMatch(regexp, ua), + version: Utils.getSecondMatch(regexp, ua), + }; + }, + }, +]; + +export default browsersList; diff --git a/server/node_modules/bowser/src/parser-engines.js b/server/node_modules/bowser/src/parser-engines.js new file mode 100644 index 0000000000..d46d0e5147 --- /dev/null +++ b/server/node_modules/bowser/src/parser-engines.js @@ -0,0 +1,120 @@ +import Utils from './utils.js'; +import { ENGINE_MAP } from './constants.js'; + +/* + * More specific goes first + */ +export default [ + /* EdgeHTML */ + { + test(parser) { + return parser.getBrowserName(true) === 'microsoft edge'; + }, + describe(ua) { + const isBlinkBased = /\sedg\//i.test(ua); + + // return blink if it's blink-based one + if (isBlinkBased) { + return { + name: ENGINE_MAP.Blink, + }; + } + + // otherwise match the version and return EdgeHTML + const version = Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, ua); + + return { + name: ENGINE_MAP.EdgeHTML, + version, + }; + }, + }, + + /* Trident */ + { + test: [/trident/i], + describe(ua) { + const engine = { + name: ENGINE_MAP.Trident, + }; + + const version = Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + engine.version = version; + } + + return engine; + }, + }, + + /* Presto */ + { + test(parser) { + return parser.test(/presto/i); + }, + describe(ua) { + const engine = { + name: ENGINE_MAP.Presto, + }; + + const version = Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + engine.version = version; + } + + return engine; + }, + }, + + /* Gecko */ + { + test(parser) { + const isGecko = parser.test(/gecko/i); + const likeGecko = parser.test(/like gecko/i); + return isGecko && !likeGecko; + }, + describe(ua) { + const engine = { + name: ENGINE_MAP.Gecko, + }; + + const version = Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + engine.version = version; + } + + return engine; + }, + }, + + /* Blink */ + { + test: [/(apple)?webkit\/537\.36/i], + describe() { + return { + name: ENGINE_MAP.Blink, + }; + }, + }, + + /* WebKit */ + { + test: [/(apple)?webkit/i], + describe(ua) { + const engine = { + name: ENGINE_MAP.WebKit, + }; + + const version = Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, ua); + + if (version) { + engine.version = version; + } + + return engine; + }, + }, +]; diff --git a/server/node_modules/bowser/src/parser-os.js b/server/node_modules/bowser/src/parser-os.js new file mode 100644 index 0000000000..4c516dd6f4 --- /dev/null +++ b/server/node_modules/bowser/src/parser-os.js @@ -0,0 +1,199 @@ +import Utils from './utils.js'; +import { OS_MAP } from './constants.js'; + +export default [ + /* Roku */ + { + test: [/Roku\/DVP/], + describe(ua) { + const version = Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, ua); + return { + name: OS_MAP.Roku, + version, + }; + }, + }, + + /* Windows Phone */ + { + test: [/windows phone/i], + describe(ua) { + const version = Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i, ua); + return { + name: OS_MAP.WindowsPhone, + version, + }; + }, + }, + + /* Windows */ + { + test: [/windows /i], + describe(ua) { + const version = Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, ua); + const versionName = Utils.getWindowsVersionName(version); + + return { + name: OS_MAP.Windows, + version, + versionName, + }; + }, + }, + + /* Firefox on iPad */ + { + test: [/Macintosh(.*?) FxiOS(.*?)\//], + describe(ua) { + const result = { + name: OS_MAP.iOS, + }; + const version = Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/, ua); + if (version) { + result.version = version; + } + return result; + }, + }, + + /* macOS */ + { + test: [/macintosh/i], + describe(ua) { + const version = Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, ua).replace(/[_\s]/g, '.'); + const versionName = Utils.getMacOSVersionName(version); + + const os = { + name: OS_MAP.MacOS, + version, + }; + if (versionName) { + os.versionName = versionName; + } + return os; + }, + }, + + /* iOS */ + { + test: [/(ipod|iphone|ipad)/i], + describe(ua) { + const version = Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, ua).replace(/[_\s]/g, '.'); + + return { + name: OS_MAP.iOS, + version, + }; + }, + }, + + /* Android */ + { + test(parser) { + const notLikeAndroid = !parser.test(/like android/i); + const butAndroid = parser.test(/android/i); + return notLikeAndroid && butAndroid; + }, + describe(ua) { + const version = Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, ua); + const versionName = Utils.getAndroidVersionName(version); + const os = { + name: OS_MAP.Android, + version, + }; + if (versionName) { + os.versionName = versionName; + } + return os; + }, + }, + + /* WebOS */ + { + test: [/(web|hpw)[o0]s/i], + describe(ua) { + const version = Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, ua); + const os = { + name: OS_MAP.WebOS, + }; + + if (version && version.length) { + os.version = version; + } + return os; + }, + }, + + /* BlackBerry */ + { + test: [/blackberry|\bbb\d+/i, /rim\stablet/i], + describe(ua) { + const version = Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i, ua) + || Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i, ua) + || Utils.getFirstMatch(/\bbb(\d+)/i, ua); + + return { + name: OS_MAP.BlackBerry, + version, + }; + }, + }, + + /* Bada */ + { + test: [/bada/i], + describe(ua) { + const version = Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, ua); + + return { + name: OS_MAP.Bada, + version, + }; + }, + }, + + /* Tizen */ + { + test: [/tizen/i], + describe(ua) { + const version = Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, ua); + + return { + name: OS_MAP.Tizen, + version, + }; + }, + }, + + /* Linux */ + { + test: [/linux/i], + describe() { + return { + name: OS_MAP.Linux, + }; + }, + }, + + /* Chrome OS */ + { + test: [/CrOS/], + describe() { + return { + name: OS_MAP.ChromeOS, + }; + }, + }, + + /* Playstation 4 */ + { + test: [/PlayStation 4/], + describe(ua) { + const version = Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, ua); + return { + name: OS_MAP.PlayStation4, + version, + }; + }, + }, +]; diff --git a/server/node_modules/bowser/src/parser-platforms.js b/server/node_modules/bowser/src/parser-platforms.js new file mode 100644 index 0000000000..48b1eb10ae --- /dev/null +++ b/server/node_modules/bowser/src/parser-platforms.js @@ -0,0 +1,266 @@ +import Utils from './utils.js'; +import { PLATFORMS_MAP } from './constants.js'; + +/* + * Tablets go first since usually they have more specific + * signs to detect. + */ + +export default [ + /* Googlebot */ + { + test: [/googlebot/i], + describe() { + return { + type: 'bot', + vendor: 'Google', + }; + }, + }, + + /* Huawei */ + { + test: [/huawei/i], + describe(ua) { + const model = Utils.getFirstMatch(/(can-l01)/i, ua) && 'Nova'; + const platform = { + type: PLATFORMS_MAP.mobile, + vendor: 'Huawei', + }; + if (model) { + platform.model = model; + } + return platform; + }, + }, + + /* Nexus Tablet */ + { + test: [/nexus\s*(?:7|8|9|10).*/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Nexus', + }; + }, + }, + + /* iPad */ + { + test: [/ipad/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Apple', + model: 'iPad', + }; + }, + }, + + /* Firefox on iPad */ + { + test: [/Macintosh(.*?) FxiOS(.*?)\//], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Apple', + model: 'iPad', + }; + }, + }, + + /* Amazon Kindle Fire */ + { + test: [/kftt build/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Amazon', + model: 'Kindle Fire HD 7', + }; + }, + }, + + /* Another Amazon Tablet with Silk */ + { + test: [/silk/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + vendor: 'Amazon', + }; + }, + }, + + /* Tablet */ + { + test: [/tablet(?! pc)/i], + describe() { + return { + type: PLATFORMS_MAP.tablet, + }; + }, + }, + + /* iPod/iPhone */ + { + test(parser) { + const iDevice = parser.test(/ipod|iphone/i); + const likeIDevice = parser.test(/like (ipod|iphone)/i); + return iDevice && !likeIDevice; + }, + describe(ua) { + const model = Utils.getFirstMatch(/(ipod|iphone)/i, ua); + return { + type: PLATFORMS_MAP.mobile, + vendor: 'Apple', + model, + }; + }, + }, + + /* Nexus Mobile */ + { + test: [/nexus\s*[0-6].*/i, /galaxy nexus/i], + describe() { + return { + type: PLATFORMS_MAP.mobile, + vendor: 'Nexus', + }; + }, + }, + + /* Mobile */ + { + test: [/[^-]mobi/i], + describe() { + return { + type: PLATFORMS_MAP.mobile, + }; + }, + }, + + /* BlackBerry */ + { + test(parser) { + return parser.getBrowserName(true) === 'blackberry'; + }, + describe() { + return { + type: PLATFORMS_MAP.mobile, + vendor: 'BlackBerry', + }; + }, + }, + + /* Bada */ + { + test(parser) { + return parser.getBrowserName(true) === 'bada'; + }, + describe() { + return { + type: PLATFORMS_MAP.mobile, + }; + }, + }, + + /* Windows Phone */ + { + test(parser) { + return parser.getBrowserName() === 'windows phone'; + }, + describe() { + return { + type: PLATFORMS_MAP.mobile, + vendor: 'Microsoft', + }; + }, + }, + + /* Android Tablet */ + { + test(parser) { + const osMajorVersion = Number(String(parser.getOSVersion()).split('.')[0]); + return parser.getOSName(true) === 'android' && (osMajorVersion >= 3); + }, + describe() { + return { + type: PLATFORMS_MAP.tablet, + }; + }, + }, + + /* Android Mobile */ + { + test(parser) { + return parser.getOSName(true) === 'android'; + }, + describe() { + return { + type: PLATFORMS_MAP.mobile, + }; + }, + }, + + /* desktop */ + { + test(parser) { + return parser.getOSName(true) === 'macos'; + }, + describe() { + return { + type: PLATFORMS_MAP.desktop, + vendor: 'Apple', + }; + }, + }, + + /* Windows */ + { + test(parser) { + return parser.getOSName(true) === 'windows'; + }, + describe() { + return { + type: PLATFORMS_MAP.desktop, + }; + }, + }, + + /* Linux */ + { + test(parser) { + return parser.getOSName(true) === 'linux'; + }, + describe() { + return { + type: PLATFORMS_MAP.desktop, + }; + }, + }, + + /* PlayStation 4 */ + { + test(parser) { + return parser.getOSName(true) === 'playstation 4'; + }, + describe() { + return { + type: PLATFORMS_MAP.tv, + }; + }, + }, + + /* Roku */ + { + test(parser) { + return parser.getOSName(true) === 'roku'; + }, + describe() { + return { + type: PLATFORMS_MAP.tv, + }; + }, + }, +]; diff --git a/server/node_modules/bowser/src/parser.js b/server/node_modules/bowser/src/parser.js new file mode 100644 index 0000000000..2f9f39f2f8 --- /dev/null +++ b/server/node_modules/bowser/src/parser.js @@ -0,0 +1,496 @@ +import browserParsersList from './parser-browsers.js'; +import osParsersList from './parser-os.js'; +import platformParsersList from './parser-platforms.js'; +import enginesParsersList from './parser-engines.js'; +import Utils from './utils.js'; + +/** + * The main class that arranges the whole parsing process. + */ +class Parser { + /** + * Create instance of Parser + * + * @param {String} UA User-Agent string + * @param {Boolean} [skipParsing=false] parser can skip parsing in purpose of performance + * improvements if you need to make a more particular parsing + * like {@link Parser#parseBrowser} or {@link Parser#parsePlatform} + * + * @throw {Error} in case of empty UA String + * + * @constructor + */ + constructor(UA, skipParsing = false) { + if (UA === void (0) || UA === null || UA === '') { + throw new Error("UserAgent parameter can't be empty"); + } + + this._ua = UA; + + /** + * @typedef ParsedResult + * @property {Object} browser + * @property {String|undefined} [browser.name] + * Browser name, like `"Chrome"` or `"Internet Explorer"` + * @property {String|undefined} [browser.version] Browser version as a String `"12.01.45334.10"` + * @property {Object} os + * @property {String|undefined} [os.name] OS name, like `"Windows"` or `"macOS"` + * @property {String|undefined} [os.version] OS version, like `"NT 5.1"` or `"10.11.1"` + * @property {String|undefined} [os.versionName] OS name, like `"XP"` or `"High Sierra"` + * @property {Object} platform + * @property {String|undefined} [platform.type] + * platform type, can be either `"desktop"`, `"tablet"` or `"mobile"` + * @property {String|undefined} [platform.vendor] Vendor of the device, + * like `"Apple"` or `"Samsung"` + * @property {String|undefined} [platform.model] Device model, + * like `"iPhone"` or `"Kindle Fire HD 7"` + * @property {Object} engine + * @property {String|undefined} [engine.name] + * Can be any of this: `WebKit`, `Blink`, `Gecko`, `Trident`, `Presto`, `EdgeHTML` + * @property {String|undefined} [engine.version] String version of the engine + */ + this.parsedResult = {}; + + if (skipParsing !== true) { + this.parse(); + } + } + + /** + * Get UserAgent string of current Parser instance + * @return {String} User-Agent String of the current object + * + * @public + */ + getUA() { + return this._ua; + } + + /** + * Test a UA string for a regexp + * @param {RegExp} regex + * @return {Boolean} + */ + test(regex) { + return regex.test(this._ua); + } + + /** + * Get parsed browser object + * @return {Object} + */ + parseBrowser() { + this.parsedResult.browser = {}; + + const browserDescriptor = Utils.find(browserParsersList, (_browser) => { + if (typeof _browser.test === 'function') { + return _browser.test(this); + } + + if (_browser.test instanceof Array) { + return _browser.test.some(condition => this.test(condition)); + } + + throw new Error("Browser's test function is not valid"); + }); + + if (browserDescriptor) { + this.parsedResult.browser = browserDescriptor.describe(this.getUA()); + } + + return this.parsedResult.browser; + } + + /** + * Get parsed browser object + * @return {Object} + * + * @public + */ + getBrowser() { + if (this.parsedResult.browser) { + return this.parsedResult.browser; + } + + return this.parseBrowser(); + } + + /** + * Get browser's name + * @return {String} Browser's name or an empty string + * + * @public + */ + getBrowserName(toLowerCase) { + if (toLowerCase) { + return String(this.getBrowser().name).toLowerCase() || ''; + } + return this.getBrowser().name || ''; + } + + + /** + * Get browser's version + * @return {String} version of browser + * + * @public + */ + getBrowserVersion() { + return this.getBrowser().version; + } + + /** + * Get OS + * @return {Object} + * + * @example + * this.getOS(); + * { + * name: 'macOS', + * version: '10.11.12' + * } + */ + getOS() { + if (this.parsedResult.os) { + return this.parsedResult.os; + } + + return this.parseOS(); + } + + /** + * Parse OS and save it to this.parsedResult.os + * @return {*|{}} + */ + parseOS() { + this.parsedResult.os = {}; + + const os = Utils.find(osParsersList, (_os) => { + if (typeof _os.test === 'function') { + return _os.test(this); + } + + if (_os.test instanceof Array) { + return _os.test.some(condition => this.test(condition)); + } + + throw new Error("Browser's test function is not valid"); + }); + + if (os) { + this.parsedResult.os = os.describe(this.getUA()); + } + + return this.parsedResult.os; + } + + /** + * Get OS name + * @param {Boolean} [toLowerCase] return lower-cased value + * @return {String} name of the OS — macOS, Windows, Linux, etc. + */ + getOSName(toLowerCase) { + const { name } = this.getOS(); + + if (toLowerCase) { + return String(name).toLowerCase() || ''; + } + + return name || ''; + } + + /** + * Get OS version + * @return {String} full version with dots ('10.11.12', '5.6', etc) + */ + getOSVersion() { + return this.getOS().version; + } + + /** + * Get parsed platform + * @return {{}} + */ + getPlatform() { + if (this.parsedResult.platform) { + return this.parsedResult.platform; + } + + return this.parsePlatform(); + } + + /** + * Get platform name + * @param {Boolean} [toLowerCase=false] + * @return {*} + */ + getPlatformType(toLowerCase = false) { + const { type } = this.getPlatform(); + + if (toLowerCase) { + return String(type).toLowerCase() || ''; + } + + return type || ''; + } + + /** + * Get parsed platform + * @return {{}} + */ + parsePlatform() { + this.parsedResult.platform = {}; + + const platform = Utils.find(platformParsersList, (_platform) => { + if (typeof _platform.test === 'function') { + return _platform.test(this); + } + + if (_platform.test instanceof Array) { + return _platform.test.some(condition => this.test(condition)); + } + + throw new Error("Browser's test function is not valid"); + }); + + if (platform) { + this.parsedResult.platform = platform.describe(this.getUA()); + } + + return this.parsedResult.platform; + } + + /** + * Get parsed engine + * @return {{}} + */ + getEngine() { + if (this.parsedResult.engine) { + return this.parsedResult.engine; + } + + return this.parseEngine(); + } + + /** + * Get engines's name + * @return {String} Engines's name or an empty string + * + * @public + */ + getEngineName(toLowerCase) { + if (toLowerCase) { + return String(this.getEngine().name).toLowerCase() || ''; + } + return this.getEngine().name || ''; + } + + /** + * Get parsed platform + * @return {{}} + */ + parseEngine() { + this.parsedResult.engine = {}; + + const engine = Utils.find(enginesParsersList, (_engine) => { + if (typeof _engine.test === 'function') { + return _engine.test(this); + } + + if (_engine.test instanceof Array) { + return _engine.test.some(condition => this.test(condition)); + } + + throw new Error("Browser's test function is not valid"); + }); + + if (engine) { + this.parsedResult.engine = engine.describe(this.getUA()); + } + + return this.parsedResult.engine; + } + + /** + * Parse full information about the browser + * @returns {Parser} + */ + parse() { + this.parseBrowser(); + this.parseOS(); + this.parsePlatform(); + this.parseEngine(); + + return this; + } + + /** + * Get parsed result + * @return {ParsedResult} + */ + getResult() { + return Utils.assign({}, this.parsedResult); + } + + /** + * Check if parsed browser matches certain conditions + * + * @param {Object} checkTree It's one or two layered object, + * which can include a platform or an OS on the first layer + * and should have browsers specs on the bottom-laying layer + * + * @returns {Boolean|undefined} Whether the browser satisfies the set conditions or not. + * Returns `undefined` when the browser is no described in the checkTree object. + * + * @example + * const browser = Bowser.getParser(window.navigator.userAgent); + * if (browser.satisfies({chrome: '>118.01.1322' })) + * // or with os + * if (browser.satisfies({windows: { chrome: '>118.01.1322' } })) + * // or with platforms + * if (browser.satisfies({desktop: { chrome: '>118.01.1322' } })) + */ + satisfies(checkTree) { + const platformsAndOSes = {}; + let platformsAndOSCounter = 0; + const browsers = {}; + let browsersCounter = 0; + + const allDefinitions = Object.keys(checkTree); + + allDefinitions.forEach((key) => { + const currentDefinition = checkTree[key]; + if (typeof currentDefinition === 'string') { + browsers[key] = currentDefinition; + browsersCounter += 1; + } else if (typeof currentDefinition === 'object') { + platformsAndOSes[key] = currentDefinition; + platformsAndOSCounter += 1; + } + }); + + if (platformsAndOSCounter > 0) { + const platformsAndOSNames = Object.keys(platformsAndOSes); + const OSMatchingDefinition = Utils.find(platformsAndOSNames, name => (this.isOS(name))); + + if (OSMatchingDefinition) { + const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]); + + if (osResult !== void 0) { + return osResult; + } + } + + const platformMatchingDefinition = Utils.find( + platformsAndOSNames, + name => (this.isPlatform(name)), + ); + if (platformMatchingDefinition) { + const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]); + + if (platformResult !== void 0) { + return platformResult; + } + } + } + + if (browsersCounter > 0) { + const browserNames = Object.keys(browsers); + const matchingDefinition = Utils.find(browserNames, name => (this.isBrowser(name, true))); + + if (matchingDefinition !== void 0) { + return this.compareVersion(browsers[matchingDefinition]); + } + } + + return undefined; + } + + /** + * Check if the browser name equals the passed string + * @param browserName The string to compare with the browser name + * @param [includingAlias=false] The flag showing whether alias will be included into comparison + * @returns {boolean} + */ + isBrowser(browserName, includingAlias = false) { + const defaultBrowserName = this.getBrowserName().toLowerCase(); + let browserNameLower = browserName.toLowerCase(); + const alias = Utils.getBrowserTypeByAlias(browserNameLower); + + if (includingAlias && alias) { + browserNameLower = alias.toLowerCase(); + } + return browserNameLower === defaultBrowserName; + } + + compareVersion(version) { + let expectedResults = [0]; + let comparableVersion = version; + let isLoose = false; + + const currentBrowserVersion = this.getBrowserVersion(); + + if (typeof currentBrowserVersion !== 'string') { + return void 0; + } + + if (version[0] === '>' || version[0] === '<') { + comparableVersion = version.substr(1); + if (version[1] === '=') { + isLoose = true; + comparableVersion = version.substr(2); + } else { + expectedResults = []; + } + if (version[0] === '>') { + expectedResults.push(1); + } else { + expectedResults.push(-1); + } + } else if (version[0] === '=') { + comparableVersion = version.substr(1); + } else if (version[0] === '~') { + isLoose = true; + comparableVersion = version.substr(1); + } + + return expectedResults.indexOf( + Utils.compareVersions(currentBrowserVersion, comparableVersion, isLoose), + ) > -1; + } + + isOS(osName) { + return this.getOSName(true) === String(osName).toLowerCase(); + } + + isPlatform(platformType) { + return this.getPlatformType(true) === String(platformType).toLowerCase(); + } + + isEngine(engineName) { + return this.getEngineName(true) === String(engineName).toLowerCase(); + } + + /** + * Is anything? Check if the browser is called "anything", + * the OS called "anything" or the platform called "anything" + * @param {String} anything + * @param [includingAlias=false] The flag showing whether alias will be included into comparison + * @returns {Boolean} + */ + is(anything, includingAlias = false) { + return this.isBrowser(anything, includingAlias) || this.isOS(anything) + || this.isPlatform(anything); + } + + /** + * Check if any of the given values satisfies this.is(anything) + * @param {String[]} anythings + * @returns {Boolean} + */ + some(anythings = []) { + return anythings.some(anything => this.is(anything)); + } +} + +export default Parser; diff --git a/server/node_modules/bowser/src/utils.js b/server/node_modules/bowser/src/utils.js new file mode 100644 index 0000000000..d1174bf0a1 --- /dev/null +++ b/server/node_modules/bowser/src/utils.js @@ -0,0 +1,309 @@ +import { BROWSER_MAP, BROWSER_ALIASES_MAP } from './constants.js'; + +export default class Utils { + /** + * Get first matched item for a string + * @param {RegExp} regexp + * @param {String} ua + * @return {Array|{index: number, input: string}|*|boolean|string} + */ + static getFirstMatch(regexp, ua) { + const match = ua.match(regexp); + return (match && match.length > 0 && match[1]) || ''; + } + + /** + * Get second matched item for a string + * @param regexp + * @param {String} ua + * @return {Array|{index: number, input: string}|*|boolean|string} + */ + static getSecondMatch(regexp, ua) { + const match = ua.match(regexp); + return (match && match.length > 1 && match[2]) || ''; + } + + /** + * Match a regexp and return a constant or undefined + * @param {RegExp} regexp + * @param {String} ua + * @param {*} _const Any const that will be returned if regexp matches the string + * @return {*} + */ + static matchAndReturnConst(regexp, ua, _const) { + if (regexp.test(ua)) { + return _const; + } + return void (0); + } + + static getWindowsVersionName(version) { + switch (version) { + case 'NT': return 'NT'; + case 'XP': return 'XP'; + case 'NT 5.0': return '2000'; + case 'NT 5.1': return 'XP'; + case 'NT 5.2': return '2003'; + case 'NT 6.0': return 'Vista'; + case 'NT 6.1': return '7'; + case 'NT 6.2': return '8'; + case 'NT 6.3': return '8.1'; + case 'NT 10.0': return '10'; + default: return undefined; + } + } + + /** + * Get macOS version name + * 10.5 - Leopard + * 10.6 - Snow Leopard + * 10.7 - Lion + * 10.8 - Mountain Lion + * 10.9 - Mavericks + * 10.10 - Yosemite + * 10.11 - El Capitan + * 10.12 - Sierra + * 10.13 - High Sierra + * 10.14 - Mojave + * 10.15 - Catalina + * + * @example + * getMacOSVersionName("10.14") // 'Mojave' + * + * @param {string} version + * @return {string} versionName + */ + static getMacOSVersionName(version) { + const v = version.split('.').splice(0, 2).map(s => parseInt(s, 10) || 0); + v.push(0); + if (v[0] !== 10) return undefined; + switch (v[1]) { + case 5: return 'Leopard'; + case 6: return 'Snow Leopard'; + case 7: return 'Lion'; + case 8: return 'Mountain Lion'; + case 9: return 'Mavericks'; + case 10: return 'Yosemite'; + case 11: return 'El Capitan'; + case 12: return 'Sierra'; + case 13: return 'High Sierra'; + case 14: return 'Mojave'; + case 15: return 'Catalina'; + default: return undefined; + } + } + + /** + * Get Android version name + * 1.5 - Cupcake + * 1.6 - Donut + * 2.0 - Eclair + * 2.1 - Eclair + * 2.2 - Froyo + * 2.x - Gingerbread + * 3.x - Honeycomb + * 4.0 - Ice Cream Sandwich + * 4.1 - Jelly Bean + * 4.4 - KitKat + * 5.x - Lollipop + * 6.x - Marshmallow + * 7.x - Nougat + * 8.x - Oreo + * 9.x - Pie + * + * @example + * getAndroidVersionName("7.0") // 'Nougat' + * + * @param {string} version + * @return {string} versionName + */ + static getAndroidVersionName(version) { + const v = version.split('.').splice(0, 2).map(s => parseInt(s, 10) || 0); + v.push(0); + if (v[0] === 1 && v[1] < 5) return undefined; + if (v[0] === 1 && v[1] < 6) return 'Cupcake'; + if (v[0] === 1 && v[1] >= 6) return 'Donut'; + if (v[0] === 2 && v[1] < 2) return 'Eclair'; + if (v[0] === 2 && v[1] === 2) return 'Froyo'; + if (v[0] === 2 && v[1] > 2) return 'Gingerbread'; + if (v[0] === 3) return 'Honeycomb'; + if (v[0] === 4 && v[1] < 1) return 'Ice Cream Sandwich'; + if (v[0] === 4 && v[1] < 4) return 'Jelly Bean'; + if (v[0] === 4 && v[1] >= 4) return 'KitKat'; + if (v[0] === 5) return 'Lollipop'; + if (v[0] === 6) return 'Marshmallow'; + if (v[0] === 7) return 'Nougat'; + if (v[0] === 8) return 'Oreo'; + if (v[0] === 9) return 'Pie'; + return undefined; + } + + /** + * Get version precisions count + * + * @example + * getVersionPrecision("1.10.3") // 3 + * + * @param {string} version + * @return {number} + */ + static getVersionPrecision(version) { + return version.split('.').length; + } + + /** + * Calculate browser version weight + * + * @example + * compareVersions('1.10.2.1', '1.8.2.1.90') // 1 + * compareVersions('1.010.2.1', '1.09.2.1.90'); // 1 + * compareVersions('1.10.2.1', '1.10.2.1'); // 0 + * compareVersions('1.10.2.1', '1.0800.2'); // -1 + * compareVersions('1.10.2.1', '1.10', true); // 0 + * + * @param {String} versionA versions versions to compare + * @param {String} versionB versions versions to compare + * @param {boolean} [isLoose] enable loose comparison + * @return {Number} comparison result: -1 when versionA is lower, + * 1 when versionA is bigger, 0 when both equal + */ + /* eslint consistent-return: 1 */ + static compareVersions(versionA, versionB, isLoose = false) { + // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 + const versionAPrecision = Utils.getVersionPrecision(versionA); + const versionBPrecision = Utils.getVersionPrecision(versionB); + + let precision = Math.max(versionAPrecision, versionBPrecision); + let lastPrecision = 0; + + const chunks = Utils.map([versionA, versionB], (version) => { + const delta = precision - Utils.getVersionPrecision(version); + + // 2) "9" -> "9.0" (for precision = 2) + const _version = version + new Array(delta + 1).join('.0'); + + // 3) "9.0" -> ["000000000"", "000000009"] + return Utils.map(_version.split('.'), chunk => new Array(20 - chunk.length).join('0') + chunk).reverse(); + }); + + // adjust precision for loose comparison + if (isLoose) { + lastPrecision = precision - Math.min(versionAPrecision, versionBPrecision); + } + + // iterate in reverse order by reversed chunks array + precision -= 1; + while (precision >= lastPrecision) { + // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) + if (chunks[0][precision] > chunks[1][precision]) { + return 1; + } + + if (chunks[0][precision] === chunks[1][precision]) { + if (precision === lastPrecision) { + // all version chunks are same + return 0; + } + + precision -= 1; + } else if (chunks[0][precision] < chunks[1][precision]) { + return -1; + } + } + + return undefined; + } + + /** + * Array::map polyfill + * + * @param {Array} arr + * @param {Function} iterator + * @return {Array} + */ + static map(arr, iterator) { + const result = []; + let i; + if (Array.prototype.map) { + return Array.prototype.map.call(arr, iterator); + } + for (i = 0; i < arr.length; i += 1) { + result.push(iterator(arr[i])); + } + return result; + } + + /** + * Array::find polyfill + * + * @param {Array} arr + * @param {Function} predicate + * @return {Array} + */ + static find(arr, predicate) { + let i; + let l; + if (Array.prototype.find) { + return Array.prototype.find.call(arr, predicate); + } + for (i = 0, l = arr.length; i < l; i += 1) { + const value = arr[i]; + if (predicate(value, i)) { + return value; + } + } + return undefined; + } + + /** + * Object::assign polyfill + * + * @param {Object} obj + * @param {Object} ...objs + * @return {Object} + */ + static assign(obj, ...assigners) { + const result = obj; + let i; + let l; + if (Object.assign) { + return Object.assign(obj, ...assigners); + } + for (i = 0, l = assigners.length; i < l; i += 1) { + const assigner = assigners[i]; + if (typeof assigner === 'object' && assigner !== null) { + const keys = Object.keys(assigner); + keys.forEach((key) => { + result[key] = assigner[key]; + }); + } + } + return obj; + } + + /** + * Get short version/alias for a browser name + * + * @example + * getBrowserAlias('Microsoft Edge') // edge + * + * @param {string} browserName + * @return {string} + */ + static getBrowserAlias(browserName) { + return BROWSER_ALIASES_MAP[browserName]; + } + + /** + * Get short version/alias for a browser name + * + * @example + * getBrowserAlias('edge') // Microsoft Edge + * + * @param {string} browserAlias + * @return {string} + */ + static getBrowserTypeByAlias(browserAlias) { + return BROWSER_MAP[browserAlias] || ''; + } +} diff --git a/server/node_modules/boxen/index.d.ts b/server/node_modules/boxen/index.d.ts deleted file mode 100644 index 60c13100c1..0000000000 --- a/server/node_modules/boxen/index.d.ts +++ /dev/null @@ -1,175 +0,0 @@ -import {LiteralUnion} from 'type-fest'; -import cliBoxes, {BoxStyle} from 'cli-boxes'; - -declare namespace boxen { - /** - Characters used for custom border. - - @example - ``` - // affffb - // e e - // dffffc - - const border: CustomBorderStyle = { - topLeft: 'a', - topRight: 'b', - bottomRight: 'c', - bottomLeft: 'd', - vertical: 'e', - horizontal: 'f' - }; - ``` - */ - interface CustomBorderStyle extends BoxStyle {} - - /** - Spacing used for `padding` and `margin`. - */ - interface Spacing { - readonly top: number; - readonly right: number; - readonly bottom: number; - readonly left: number; - } - - interface Options { - /** - Color of the box border. - */ - readonly borderColor?: LiteralUnion< - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray' - | 'grey' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright', - string - >; - - /** - Style of the box border. - - @default BorderStyle.Single - */ - readonly borderStyle?: BorderStyle | CustomBorderStyle; - - /** - Reduce opacity of the border. - - @default false - */ - readonly dimBorder?: boolean; - - /** - Space between the text and box border. - - @default 0 - */ - readonly padding?: number | Spacing; - - /** - Space around the box. - - @default 0 - */ - readonly margin?: number | Spacing; - - /** - Float the box on the available terminal screen space. - - @default 'left' - */ - readonly float?: 'left' | 'right' | 'center'; - - /** - Color of the background. - */ - readonly backgroundColor?: LiteralUnion< - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright', - string - >; - - /** - Align the text in the box based on the widest line. - - @default 'left' - */ - readonly align?: 'left' | 'right' | 'center'; - } -} - -declare const enum BorderStyle { - Single = 'single', - Double = 'double', - Round = 'round', - Bold = 'bold', - SingleDouble = 'singleDouble', - DoubleSingle = 'doubleSingle', - Classic = 'classic' -} - -declare const boxen: { - /** - Creates a box in the terminal. - - @param text - The text inside the box. - @returns The box. - - @example - ``` - import boxen = require('boxen'); - - console.log(boxen('unicorn', {padding: 1})); - // ┌─────────────┐ - // │ │ - // │ unicorn │ - // │ │ - // └─────────────┘ - - console.log(boxen('unicorn', {padding: 1, margin: 1, borderStyle: 'double'})); - // - // ╔═════════════╗ - // ║ ║ - // ║ unicorn ║ - // ║ ║ - // ╚═════════════╝ - // - ``` - */ - (text: string, options?: boxen.Options): string; - - /** - Border styles from [`cli-boxes`](https://github.com/sindresorhus/cli-boxes). - */ - BorderStyle: typeof BorderStyle; -}; - -export = boxen; diff --git a/server/node_modules/boxen/index.js b/server/node_modules/boxen/index.js deleted file mode 100644 index a54524cf01..0000000000 --- a/server/node_modules/boxen/index.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; -const stringWidth = require('string-width'); -const chalk = require('chalk'); -const widestLine = require('widest-line'); -const cliBoxes = require('cli-boxes'); -const camelCase = require('camelcase'); -const ansiAlign = require('ansi-align'); -const termSize = require('term-size'); - -const getObject = detail => { - let object; - - if (typeof detail === 'number') { - object = { - top: detail, - right: detail * 3, - bottom: detail, - left: detail * 3 - }; - } else { - object = { - top: 0, - right: 0, - bottom: 0, - left: 0, - ...detail - }; - } - - return object; -}; - -const getBorderChars = borderStyle => { - const sides = [ - 'topLeft', - 'topRight', - 'bottomRight', - 'bottomLeft', - 'vertical', - 'horizontal' - ]; - - let chararacters; - - if (typeof borderStyle === 'string') { - chararacters = cliBoxes[borderStyle]; - - if (!chararacters) { - throw new TypeError(`Invalid border style: ${borderStyle}`); - } - } else { - for (const side of sides) { - if (!borderStyle[side] || typeof borderStyle[side] !== 'string') { - throw new TypeError(`Invalid border style: ${side}`); - } - } - - chararacters = borderStyle; - } - - return chararacters; -}; - -const isHex = color => color.match(/^#[0-f]{3}(?:[0-f]{3})?$/i); -const isColorValid = color => typeof color === 'string' && ((chalk[color]) || isHex(color)); -const getColorFn = color => isHex(color) ? chalk.hex(color) : chalk[color]; -const getBGColorFn = color => isHex(color) ? chalk.bgHex(color) : chalk[camelCase(['bg', color])]; - -module.exports = (text, options) => { - options = { - padding: 0, - borderStyle: 'single', - dimBorder: false, - align: 'left', - float: 'left', - ...options - }; - - if (options.borderColor && !isColorValid(options.borderColor)) { - throw new Error(`${options.borderColor} is not a valid borderColor`); - } - - if (options.backgroundColor && !isColorValid(options.backgroundColor)) { - throw new Error(`${options.backgroundColor} is not a valid backgroundColor`); - } - - const chars = getBorderChars(options.borderStyle); - const padding = getObject(options.padding); - const margin = getObject(options.margin); - - const colorizeBorder = border => { - const newBorder = options.borderColor ? getColorFn(options.borderColor)(border) : border; - return options.dimBorder ? chalk.dim(newBorder) : newBorder; - }; - - const colorizeContent = content => options.backgroundColor ? getBGColorFn(options.backgroundColor)(content) : content; - - text = ansiAlign(text, {align: options.align}); - - const NL = '\n'; - const PAD = ' '; - - let lines = text.split(NL); - - if (padding.top > 0) { - lines = new Array(padding.top).fill('').concat(lines); - } - - if (padding.bottom > 0) { - lines = lines.concat(new Array(padding.bottom).fill('')); - } - - const contentWidth = widestLine(text) + padding.left + padding.right; - const paddingLeft = PAD.repeat(padding.left); - const {columns} = termSize(); - let marginLeft = PAD.repeat(margin.left); - - if (options.float === 'center') { - const padWidth = Math.max((columns - contentWidth) / 2, 0); - marginLeft = PAD.repeat(padWidth); - } else if (options.float === 'right') { - const padWidth = Math.max(columns - contentWidth - margin.right - 2, 0); - marginLeft = PAD.repeat(padWidth); - } - - const horizontal = chars.horizontal.repeat(contentWidth); - const top = colorizeBorder(NL.repeat(margin.top) + marginLeft + chars.topLeft + horizontal + chars.topRight); - const bottom = colorizeBorder(marginLeft + chars.bottomLeft + horizontal + chars.bottomRight + NL.repeat(margin.bottom)); - const side = colorizeBorder(chars.vertical); - - const middle = lines.map(line => { - const paddingRight = PAD.repeat(contentWidth - stringWidth(line) - padding.left); - return marginLeft + side + colorizeContent(paddingLeft + line + paddingRight) + side; - }).join(NL); - - return top + NL + middle + NL + bottom; -}; - -module.exports._borderStyles = cliBoxes; diff --git a/server/node_modules/boxen/license b/server/node_modules/boxen/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/server/node_modules/boxen/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/boxen/package.json b/server/node_modules/boxen/package.json deleted file mode 100644 index 2018742cf1..0000000000 --- a/server/node_modules/boxen/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "boxen@^4.2.0", - "_id": "boxen@4.2.0", - "_inBundle": false, - "_integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", - "_location": "/boxen", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "boxen@^4.2.0", - "name": "boxen", - "escapedName": "boxen", - "rawSpec": "^4.2.0", - "saveSpec": null, - "fetchSpec": "^4.2.0" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", - "_shasum": "e411b62357d6d6d36587c8ac3d5d974daa070e64", - "_spec": "boxen@^4.2.0", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/boxen/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-align": "^3.0.0", - "camelcase": "^5.3.1", - "chalk": "^3.0.0", - "cli-boxes": "^2.2.0", - "string-width": "^4.1.0", - "term-size": "^2.1.0", - "type-fest": "^0.8.1", - "widest-line": "^3.1.0" - }, - "deprecated": false, - "description": "Create boxes in the terminal", - "devDependencies": { - "ava": "^2.1.0", - "nyc": "^14.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/boxen#readme", - "keywords": [ - "cli", - "box", - "boxes", - "terminal", - "term", - "console", - "ascii", - "unicode", - "border", - "text" - ], - "license": "MIT", - "name": "boxen", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/boxen.git" - }, - "scripts": { - "test": "xo && nyc ava && tsd" - }, - "version": "4.2.0" -} diff --git a/server/node_modules/boxen/readme.md b/server/node_modules/boxen/readme.md deleted file mode 100644 index dbfbd5aee2..0000000000 --- a/server/node_modules/boxen/readme.md +++ /dev/null @@ -1,187 +0,0 @@ -# boxen [![Build Status](https://travis-ci.org/sindresorhus/boxen.svg?branch=master)](https://travis-ci.org/sindresorhus/boxen) - -> Create boxes in the terminal - -![](screenshot.png) - -## Install - -``` -$ npm install boxen -``` - -## Usage - -```js -const boxen = require('boxen'); - -console.log(boxen('unicorn', {padding: 1})); -/* -┌─────────────┐ -│ │ -│ unicorn │ -│ │ -└─────────────┘ -*/ - -console.log(boxen('unicorn', {padding: 1, margin: 1, borderStyle: 'double'})); -/* - - ╔═════════════╗ - ║ ║ - ║ unicorn ║ - ║ ║ - ╚═════════════╝ - -*/ -``` - -## API - -### boxen(text, options?) - -#### text - -Type: `string` - -Text inside the box. - -#### options - -Type: `object` - -##### borderColor - -Type: `string`\ -Values: `'black'` `'red'` `'green'` `'yellow'` `'blue'` `'magenta'` `'cyan'` `'white'` `'gray'` or a hex value like `'#ff0000'` - -Color of the box border. - -##### borderStyle - -Type: `string | object`\ -Default: `'single'`\ -Values: -- `'single'` -``` -┌───┐ -│foo│ -└───┘ -``` -- `'double'` -``` -╔═══╗ -║foo║ -╚═══╝ -``` -- `'round'` (`'single'` sides with round corners) -``` -╭───╮ -│foo│ -╰───╯ -``` -- `'bold'` -``` -┏━━━┓ -┃foo┃ -┗━━━┛ -``` -- `'singleDouble'` (`'single'` on top and bottom, `'double'` on right and left) -``` -╓───╖ -║foo║ -╙───╜ -``` -- `'doubleSingle'` (`'double'` on top and bottom, `'single'` on right and left) -``` -╒═══╕ -│foo│ -╘═══╛ -``` -- `'classic'` -``` -+---+ -|foo| -+---+ -``` - -Style of the box border. - -Can be any of the above predefined styles or an object with the following keys: - -```js -{ - topLeft: '+', - topRight: '+', - bottomLeft: '+', - bottomRight: '+', - horizontal: '-', - vertical: '|' -} -``` - -##### dimBorder - -Type: `boolean`\ -Default: `false` - -Reduce opacity of the border. - -##### padding - -Type: `number | object`\ -Default: `0` - -Space between the text and box border. - -Accepts a number or an object with any of the `top`, `right`, `bottom`, `left` properties. When a number is specified, the left/right padding is 3 times the top/bottom to make it look nice. - -##### margin - -Type: `number | object`\ -Default: `0` - -Space around the box. - -Accepts a number or an object with any of the `top`, `right`, `bottom`, `left` properties. When a number is specified, the left/right margin is 3 times the top/bottom to make it look nice. - -##### float - -Type: `string`\ -Default: `'left'`\ -Values: `'right'` `'center'` `'left'` - -Float the box on the available terminal screen space. - -##### backgroundColor - -Type: `string`\ -Values: `'black'` `'red'` `'green'` `'yellow'` `'blue'` `'magenta'` `'cyan'` `'white'` `'gray'` or a hex value like `'#ff0000'` - -Color of the background. - -##### align - -Type: `string`\ -Default: `'left'`\ -Values: `'left'` `'center'` `'right'` - -Align the text in the box based on the widest line. - -## Related - -- [boxen-cli](https://github.com/sindresorhus/boxen-cli) - CLI for this module -- [cli-boxes](https://github.com/sindresorhus/cli-boxes) - Boxes for use in the terminal -- [ink-box](https://github.com/sindresorhus/ink-box) - Box component for Ink that uses this package - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/server/node_modules/bson/LICENSE.md b/server/node_modules/bson/LICENSE.md new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/server/node_modules/bson/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/server/node_modules/bson/README.md b/server/node_modules/bson/README.md new file mode 100644 index 0000000000..cd7242fdf2 --- /dev/null +++ b/server/node_modules/bson/README.md @@ -0,0 +1,376 @@ +# BSON parser + +BSON is short for "Binary JSON," and is the binary-encoded serialization of JSON-like documents. You can learn more about it in [the specification](http://bsonspec.org). + +This browser version of the BSON parser is compiled using [rollup](https://rollupjs.org/) and the current version is pre-compiled in the `dist` directory. + +This is the default BSON parser, however, there is a C++ Node.js addon version as well that does not support the browser. It can be found at [mongod-js/bson-ext](https://github.com/mongodb-js/bson-ext). + +### Table of Contents +- [Usage](#usage) +- [Bugs/Feature Requests](#bugs--feature-requests) +- [Installation](#installation) +- [Documentation](#documentation) +- [FAQ](#faq) + +## Bugs / Feature Requests + +Think you've found a bug? Want to see a new feature in `bson`? Please open a case in our issue management tool, JIRA: + +1. Create an account and login: [jira.mongodb.org](https://jira.mongodb.org) +2. Navigate to the NODE project: [jira.mongodb.org/browse/NODE](https://jira.mongodb.org/browse/NODE) +3. Click **Create Issue** - Please provide as much information as possible about the issue and how to reproduce it. + +Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the Core Server (i.e. SERVER) project are **public**. + +## Usage + +To build a new version perform the following operations: + +``` +npm install +npm run build +``` + +### Node (no bundling) +A simple example of how to use BSON in `Node.js`: + +```js +const BSON = require('bson'); +const Long = BSON.Long; + +// Serialize a document +const doc = { long: Long.fromNumber(100) }; +const data = BSON.serialize(doc); +console.log('data:', data); + +// Deserialize the resulting Buffer +const doc_2 = BSON.deserialize(data); +console.log('doc_2:', doc_2); +``` + +### Browser (no bundling) + +If you are not using a bundler like webpack, you can include `dist/bson.bundle.js` using a script tag. It includes polyfills for built-in node types like `Buffer`. + +```html + + + +``` + +### Using webpack + +If using webpack, you can use your normal import/require syntax of your project to pull in the `bson` library. + +ES6 Example: + +```js +import { Long, serialize, deserialize } from 'bson'; + +// Serialize a document +const doc = { long: Long.fromNumber(100) }; +const data = serialize(doc); +console.log('data:', data); + +// De serialize it again +const doc_2 = deserialize(data); +console.log('doc_2:', doc_2); +``` + +ES5 Example: + +```js +const BSON = require('bson'); +const Long = BSON.Long; + +// Serialize a document +const doc = { long: Long.fromNumber(100) }; +const data = BSON.serialize(doc); +console.log('data:', data); + +// Deserialize the resulting Buffer +const doc_2 = BSON.deserialize(data); +console.log('doc_2:', doc_2); +``` + +Depending on your settings, webpack will under the hood resolve to one of the following: + +- `dist/bson.browser.esm.js` If your project is in the browser and using ES6 modules (Default for `webworker` and `web` targets) +- `dist/bson.browser.umd.js` If your project is in the browser and not using ES6 modules +- `dist/bson.esm.js` If your project is in Node.js and using ES6 modules (Default for `node` targets) +- `lib/bson.js` (the normal include path) If your project is in Node.js and not using ES6 modules + +For more information, see [this page on webpack's `resolve.mainFields`](https://webpack.js.org/configuration/resolve/#resolvemainfields) and [the `package.json` for this project](./package.json#L52) + +### Usage with Angular + +Starting with Angular 6, Angular CLI removed the shim for `global` and other node built-in variables (original comment [here](https://github.com/angular/angular-cli/issues/9827#issuecomment-386154063)). If you are using BSON with Angular, you may need to add the following shim to your `polyfills.ts` file: + +```js +// In polyfills.ts +(window as any).global = window; +``` + +- [Original Comment by Angular CLI](https://github.com/angular/angular-cli/issues/9827#issuecomment-386154063) +- [Original Source for Solution](https://stackoverflow.com/a/50488337/4930088) + +## Installation + +`npm install bson` + +## Documentation + +### Objects + +
+
EJSON : object
+
+
+ +### Functions + +
+
setInternalBufferSize(size)
+

Sets the size of the internal serialization buffer.

+
+
serialize(object)Buffer
+

Serialize a Javascript object.

+
+
serializeWithBufferAndIndex(object, buffer)Number
+

Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.

+
+
deserialize(buffer)Object
+

Deserialize data as BSON.

+
+
calculateObjectSize(object)Number
+

Calculate the bson size for a passed in Javascript object.

+
+
deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, [options])Number
+

Deserialize stream data as BSON documents.

+
+
+ + + +### EJSON + +* [EJSON](#EJSON) + + * [.parse(text, [options])](#EJSON.parse) + + * [.stringify(value, [replacer], [space], [options])](#EJSON.stringify) + + * [.serialize(bson, [options])](#EJSON.serialize) + + * [.deserialize(ejson, [options])](#EJSON.deserialize) + + + + +#### *EJSON*.parse(text, [options]) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| text | string | | | +| [options] | object | | Optional settings | +| [options.relaxed] | boolean | true | Attempt to return native JS types where possible, rather than BSON types (if true) | + +Parse an Extended JSON string, constructing the JavaScript value or object described by that +string. + +**Example** +```js +const { EJSON } = require('bson'); +const text = '{ "int32": { "$numberInt": "10" } }'; + +// prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } +console.log(EJSON.parse(text, { relaxed: false })); + +// prints { int32: 10 } +console.log(EJSON.parse(text)); +``` + + +#### *EJSON*.stringify(value, [replacer], [space], [options]) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| value | object | | The value to convert to extended JSON | +| [replacer] | function \| array | | A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string | +| [space] | string \| number | | A String or Number object that's used to insert white space into the output JSON string for readability purposes. | +| [options] | object | | Optional settings | +| [options.relaxed] | boolean | true | Enabled Extended JSON's `relaxed` mode | +| [options.legacy] | boolean | true | Output in Extended JSON v1 | + +Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer +function is specified or optionally including only the specified properties if a replacer array +is specified. + +**Example** +```js +const { EJSON } = require('bson'); +const Int32 = require('mongodb').Int32; +const doc = { int32: new Int32(10) }; + +// prints '{"int32":{"$numberInt":"10"}}' +console.log(EJSON.stringify(doc, { relaxed: false })); + +// prints '{"int32":10}' +console.log(EJSON.stringify(doc)); +``` + + +#### *EJSON*.serialize(bson, [options]) + +| Param | Type | Description | +| --- | --- | --- | +| bson | object | The object to serialize | +| [options] | object | Optional settings passed to the `stringify` function | + +Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + + + +#### *EJSON*.deserialize(ejson, [options]) + +| Param | Type | Description | +| --- | --- | --- | +| ejson | object | The Extended JSON object to deserialize | +| [options] | object | Optional settings passed to the parse method | + +Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + + + +### setInternalBufferSize(size) + +| Param | Type | Description | +| --- | --- | --- | +| size | number | The desired size for the internal serialization buffer | + +Sets the size of the internal serialization buffer. + + + +### serialize(object) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| object | Object | | the Javascript object to serialize. | +| [options.checkKeys] | Boolean | | the serializer will check if keys are valid. | +| [options.serializeFunctions] | Boolean | false | serialize the javascript functions **(default:false)**. | +| [options.ignoreUndefined] | Boolean | true | ignore undefined fields **(default:true)**. | + +Serialize a Javascript object. + +**Returns**: Buffer - returns the Buffer object containing the serialized object. + + +### serializeWithBufferAndIndex(object, buffer) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| object | Object | | the Javascript object to serialize. | +| buffer | Buffer | | the Buffer you pre-allocated to store the serialized BSON object. | +| [options.checkKeys] | Boolean | | the serializer will check if keys are valid. | +| [options.serializeFunctions] | Boolean | false | serialize the javascript functions **(default:false)**. | +| [options.ignoreUndefined] | Boolean | true | ignore undefined fields **(default:true)**. | +| [options.index] | Number | | the index in the buffer where we wish to start serializing into. | + +Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization. + +**Returns**: Number - returns the index pointing to the last written byte in the buffer. + + +### deserialize(buffer) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| buffer | Buffer | | the buffer containing the serialized set of BSON documents. | +| [options.evalFunctions] | Object | false | evaluate functions in the BSON document scoped to the object deserialized. | +| [options.cacheFunctions] | Object | false | cache evaluated functions for reuse. | +| [options.promoteLongs] | Object | true | when deserializing a Long will fit it into a Number if it's smaller than 53 bits | +| [options.promoteBuffers] | Object | false | when deserializing a Binary will return it as a node.js Buffer instance. | +| [options.promoteValues] | Object | false | when deserializing will promote BSON values to their Node.js closest equivalent types. | +| [options.fieldsAsRaw] | Object | | allow to specify if there what fields we wish to return as unserialized raw buffer. | +| [options.bsonRegExp] | Object | false | return BSON regular expressions as BSONRegExp instances. | +| [options.allowObjectSmallerThanBufferSize] | boolean | false | allows the buffer to be larger than the parsed BSON object | + +Deserialize data as BSON. + +**Returns**: Object - returns the deserialized Javascript Object. + + +### calculateObjectSize(object) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| object | Object | | the Javascript object to calculate the BSON byte size for. | +| [options.serializeFunctions] | Boolean | false | serialize the javascript functions **(default:false)**. | +| [options.ignoreUndefined] | Boolean | true | ignore undefined fields **(default:true)**. | + +Calculate the bson size for a passed in Javascript object. + +**Returns**: Number - returns the number of bytes the BSON object will take up. + + +### deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, [options]) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| data | Buffer | | the buffer containing the serialized set of BSON documents. | +| startIndex | Number | | the start index in the data Buffer where the deserialization is to start. | +| numberOfDocuments | Number | | number of documents to deserialize. | +| documents | Array | | an array where to store the deserialized documents. | +| docStartIndex | Number | | the index in the documents array from where to start inserting documents. | +| [options] | Object | | additional options used for the deserialization. | +| [options.evalFunctions] | Object | false | evaluate functions in the BSON document scoped to the object deserialized. | +| [options.cacheFunctions] | Object | false | cache evaluated functions for reuse. | +| [options.promoteLongs] | Object | true | when deserializing a Long will fit it into a Number if it's smaller than 53 bits | +| [options.promoteBuffers] | Object | false | when deserializing a Binary will return it as a node.js Buffer instance. | +| [options.promoteValues] | Object | false | when deserializing will promote BSON values to their Node.js closest equivalent types. | +| [options.fieldsAsRaw] | Object | | allow to specify if there what fields we wish to return as unserialized raw buffer. | +| [options.bsonRegExp] | Object | false | return BSON regular expressions as BSONRegExp instances. | + +Deserialize stream data as BSON documents. + +**Returns**: Number - returns the next index in the buffer after deserialization **x** numbers of documents. + +## FAQ + +#### Why does `undefined` get converted to `null`? + +The `undefined` BSON type has been [deprecated for many years](http://bsonspec.org/spec.html), so this library has dropped support for it. Use the `ignoreUndefined` option (for example, from the [driver](http://mongodb.github.io/node-mongodb-native/2.2/api/MongoClient.html#connect) ) to instead remove `undefined` keys. + +#### How do I add custom serialization logic? + +This library looks for `toBSON()` functions on every path, and calls the `toBSON()` function to get the value to serialize. + +```javascript +const BSON = require('bson'); + +class CustomSerialize { + toBSON() { + return 42; + } +} + +const obj = { answer: new CustomSerialize() }; +// "{ answer: 42 }" +console.log(BSON.deserialize(BSON.serialize(obj))); +``` diff --git a/server/node_modules/bson/bower.json b/server/node_modules/bson/bower.json new file mode 100644 index 0000000000..2883b37f8a --- /dev/null +++ b/server/node_modules/bson/bower.json @@ -0,0 +1,26 @@ +{ + "name": "bson", + "description": "A bson parser for node.js and the browser", + "keywords": [ + "mongodb", + "bson", + "parser" + ], + "author": "Christian Amor Kvalheim ", + "main": "./dist/bson.js", + "license": "Apache-2.0", + "moduleType": [ + "globals", + "node" + ], + "ignore": [ + "**/.*", + "alternate_parsers", + "benchmarks", + "bower_components", + "node_modules", + "test", + "tools" + ], + "version": "4.7.2" +} diff --git a/server/node_modules/bson/bson.d.ts b/server/node_modules/bson/bson.d.ts new file mode 100644 index 0000000000..5a5cf19ffb --- /dev/null +++ b/server/node_modules/bson/bson.d.ts @@ -0,0 +1,1228 @@ +import { Buffer } from 'buffer'; + +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +export declare class Binary { + _bsontype: 'Binary'; + /* Excluded from this release type: BSON_BINARY_SUBTYPE_DEFAULT */ + /** Initial buffer default size */ + static readonly BUFFER_SIZE = 256; + /** Default BSON type */ + static readonly SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + static readonly SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + static readonly SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + static readonly SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + static readonly SUBTYPE_UUID = 4; + /** MD5 BSON type */ + static readonly SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + static readonly SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + static readonly SUBTYPE_COLUMN = 7; + /** User BSON type */ + static readonly SUBTYPE_USER_DEFINED = 128; + buffer: Buffer; + sub_type: number; + position: number; + /** + * Create a new Binary instance. + * + * This constructor can accept a string as its first argument. In this case, + * this string will be encoded using ISO-8859-1, **not** using UTF-8. + * This is almost certainly not what you want. Use `new Binary(Buffer.from(string))` + * instead to convert the string to a Buffer using UTF-8 first. + * + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + constructor(buffer?: string | BinarySequence, subType?: number); + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + put(byteValue: string | number | Uint8Array | Buffer | number[]): void; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + write(sequence: string | BinarySequence, offset: number): void; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + read(position: number, length: number): BinarySequence; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + value(asRaw?: boolean): string | BinarySequence; + /** the length of the binary sequence */ + length(): number; + toJSON(): string; + toString(format?: string): string; + /* Excluded from this release type: toExtendedJSON */ + toUUID(): UUID; + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface BinaryExtended { + $binary: { + subType: string; + base64: string; + }; +} + +/** @public */ +export declare interface BinaryExtendedLegacy { + $type: string; + $binary: string; +} + +/** @public */ +export declare type BinarySequence = Uint8Array | Buffer | number[]; + +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +declare const BSON: { + Binary: typeof Binary; + Code: typeof Code; + DBRef: typeof DBRef; + Decimal128: typeof Decimal128; + Double: typeof Double; + Int32: typeof Int32; + Long: typeof Long; + UUID: typeof UUID; + Map: MapConstructor; + MaxKey: typeof MaxKey; + MinKey: typeof MinKey; + ObjectId: typeof ObjectId; + ObjectID: typeof ObjectId; + BSONRegExp: typeof BSONRegExp; + BSONSymbol: typeof BSONSymbol; + Timestamp: typeof Timestamp; + EJSON: typeof EJSON; + setInternalBufferSize: typeof setInternalBufferSize; + serialize: typeof serialize; + serializeWithBufferAndIndex: typeof serializeWithBufferAndIndex; + deserialize: typeof deserialize; + calculateObjectSize: typeof calculateObjectSize; + deserializeStream: typeof deserializeStream; + BSONError: typeof BSONError; + BSONTypeError: typeof BSONTypeError; +}; +export default BSON; + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_BYTE_ARRAY */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_COLUMN */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_DEFAULT */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_ENCRYPTED */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_FUNCTION */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_MD5 */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_USER_DEFINED */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_UUID */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_UUID_NEW */ + +/* Excluded from this release type: BSON_DATA_ARRAY */ + +/* Excluded from this release type: BSON_DATA_BINARY */ + +/* Excluded from this release type: BSON_DATA_BOOLEAN */ + +/* Excluded from this release type: BSON_DATA_CODE */ + +/* Excluded from this release type: BSON_DATA_CODE_W_SCOPE */ + +/* Excluded from this release type: BSON_DATA_DATE */ + +/* Excluded from this release type: BSON_DATA_DBPOINTER */ + +/* Excluded from this release type: BSON_DATA_DECIMAL128 */ + +/* Excluded from this release type: BSON_DATA_INT */ + +/* Excluded from this release type: BSON_DATA_LONG */ + +/* Excluded from this release type: BSON_DATA_MAX_KEY */ + +/* Excluded from this release type: BSON_DATA_MIN_KEY */ + +/* Excluded from this release type: BSON_DATA_NULL */ + +/* Excluded from this release type: BSON_DATA_NUMBER */ + +/* Excluded from this release type: BSON_DATA_OBJECT */ + +/* Excluded from this release type: BSON_DATA_OID */ + +/* Excluded from this release type: BSON_DATA_REGEXP */ + +/* Excluded from this release type: BSON_DATA_STRING */ + +/* Excluded from this release type: BSON_DATA_SYMBOL */ + +/* Excluded from this release type: BSON_DATA_TIMESTAMP */ + +/* Excluded from this release type: BSON_DATA_UNDEFINED */ + +/* Excluded from this release type: BSON_INT32_MAX */ + +/* Excluded from this release type: BSON_INT32_MIN */ + +/* Excluded from this release type: BSON_INT64_MAX */ + +/* Excluded from this release type: BSON_INT64_MIN */ + +/** @public */ +export declare class BSONError extends Error { + constructor(message: string); + get name(): string; +} + +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +export declare class BSONRegExp { + _bsontype: 'BSONRegExp'; + pattern: string; + options: string; + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + constructor(pattern: string, options?: string); + static parseOptions(options?: string): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ +} + +/** @public */ +export declare interface BSONRegExpExtended { + $regularExpression: { + pattern: string; + options: string; + }; +} + +/** @public */ +export declare interface BSONRegExpExtendedLegacy { + $regex: string | BSONRegExp; + $options: string; +} + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +export declare class BSONSymbol { + _bsontype: 'Symbol'; + value: string; + /** + * @param value - the string representing the symbol. + */ + constructor(value: string); + /** Access the wrapped string value. */ + valueOf(): string; + toString(): string; + /* Excluded from this release type: inspect */ + toJSON(): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ +} + +/** @public */ +export declare interface BSONSymbolExtended { + $symbol: string; +} + +/** @public */ +export declare class BSONTypeError extends TypeError { + constructor(message: string); + get name(): string; +} + +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +export declare function calculateObjectSize(object: Document, options?: CalculateObjectSizeOptions): number; + +/** @public */ +export declare type CalculateObjectSizeOptions = Pick; + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +export declare class Code { + _bsontype: 'Code'; + code: string | Function; + scope?: Document; + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + constructor(code: string | Function, scope?: Document); + toJSON(): { + code: string | Function; + scope?: Document; + }; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface CodeExtended { + $code: string | Function; + $scope?: Document; +} + +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +export declare class DBRef { + _bsontype: 'DBRef'; + collection: string; + oid: ObjectId; + db?: string; + fields: Document; + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + constructor(collection: string, oid: ObjectId, db?: string, fields?: Document); + /* Excluded from this release type: namespace */ + /* Excluded from this release type: namespace */ + toJSON(): DBRefLike & Document; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface DBRefLike { + $ref: string; + $id: ObjectId; + $db?: string; +} + +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +export declare class Decimal128 { + _bsontype: 'Decimal128'; + readonly bytes: Buffer; + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + constructor(bytes: Buffer | string); + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + static fromString(representation: string): Decimal128; + /** Create a string representation of the raw Decimal128 value */ + toString(): string; + toJSON(): Decimal128Extended; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface Decimal128Extended { + $numberDecimal: string; +} + +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +export declare function deserialize(buffer: Buffer | ArrayBufferView | ArrayBuffer, options?: DeserializeOptions): Document; + +/** @public */ +export declare interface DeserializeOptions { + /** evaluate functions in the BSON document scoped to the object deserialized. */ + evalFunctions?: boolean; + /** cache evaluated functions for reuse. */ + cacheFunctions?: boolean; + /** + * use a crc32 code for caching, otherwise use the string of the function. + * @deprecated this option to use the crc32 function never worked as intended + * due to the fact that the crc32 function itself was never implemented. + * */ + cacheFunctionsCrc32?: boolean; + /** when deserializing a Long will fit it into a Number if it's smaller than 53 bits */ + promoteLongs?: boolean; + /** when deserializing a Binary will return it as a node.js Buffer instance. */ + promoteBuffers?: boolean; + /** when deserializing will promote BSON values to their Node.js closest equivalent types. */ + promoteValues?: boolean; + /** allow to specify if there what fields we wish to return as unserialized raw buffer. */ + fieldsAsRaw?: Document; + /** return BSON regular expressions as BSONRegExp instances. */ + bsonRegExp?: boolean; + /** allows the buffer to be larger than the parsed BSON object */ + allowObjectSmallerThanBufferSize?: boolean; + /** Offset into buffer to begin reading document from */ + index?: number; + raw?: boolean; + /** Allows for opt-out utf-8 validation for all keys or + * specified keys. Must be all true or all false. + * + * @example + * ```js + * // disables validation on all keys + * validation: { utf8: false } + * + * // enables validation only on specified keys a, b, and c + * validation: { utf8: { a: true, b: true, c: true } } + * + * // disables validation only on specified keys a, b + * validation: { utf8: { a: false, b: false } } + * ``` + */ + validation?: { + utf8: boolean | Record | Record; + }; +} + +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +export declare function deserializeStream(data: Buffer | ArrayBufferView | ArrayBuffer, startIndex: number, numberOfDocuments: number, documents: Document[], docStartIndex: number, options: DeserializeOptions): number; + +/** @public */ +export declare interface Document { + [key: string]: any; +} + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +export declare class Double { + _bsontype: 'Double'; + value: number; + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + constructor(value: number); + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + valueOf(): number; + toJSON(): number; + toString(radix?: number): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface DoubleExtended { + $numberDouble: string; +} + +/** + * EJSON parse / stringify API + * @public + */ +export declare namespace EJSON { + export interface Options { + /** Output using the Extended JSON v1 spec */ + legacy?: boolean; + /** Enable Extended JSON's `relaxed` mode, which attempts to return native JS types where possible, rather than BSON types */ + relaxed?: boolean; + /** + * Disable Extended JSON's `relaxed` mode, which attempts to return BSON types where possible, rather than native JS types + * @deprecated Please use the relaxed property instead + */ + strict?: boolean; + } + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + export function parse(text: string, options?: EJSON.Options): SerializableTypes; + export type JSONPrimitive = string | number | boolean | null; + export type SerializableTypes = Document | Array | JSONPrimitive; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + export function stringify(value: SerializableTypes, replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSON.Options, space?: string | number, options?: EJSON.Options): string; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + export function serialize(value: SerializableTypes, options?: EJSON.Options): Document; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + export function deserialize(ejson: Document, options?: EJSON.Options): SerializableTypes; +} + +/** @public */ +export declare type EJSONOptions = EJSON.Options; + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +export declare class Int32 { + _bsontype: 'Int32'; + value: number; + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + constructor(value: number | string); + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + valueOf(): number; + toString(radix?: number): string; + toJSON(): number; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface Int32Extended { + $numberInt: string; +} + +declare const kId: unique symbol; + +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +export declare class Long { + _bsontype: 'Long'; + /** An indicator used to reliably determine if an object is a Long or not. */ + __isLong__: true; + /** + * The high 32 bits as a signed value. + */ + high: number; + /** + * The low 32 bits as a signed value. + */ + low: number; + /** + * Whether unsigned or not. + */ + unsigned: boolean; + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(low?: number | bigint | string, high?: number | boolean, unsigned?: boolean); + static TWO_PWR_24: Long; + /** Maximum unsigned value. */ + static MAX_UNSIGNED_VALUE: Long; + /** Signed zero */ + static ZERO: Long; + /** Unsigned zero. */ + static UZERO: Long; + /** Signed one. */ + static ONE: Long; + /** Unsigned one. */ + static UONE: Long; + /** Signed negative one. */ + static NEG_ONE: Long; + /** Maximum signed value. */ + static MAX_VALUE: Long; + /** Minimum signed value. */ + static MIN_VALUE: Long; + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromInt(value: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromNumber(value: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBigInt(value: bigint, unsigned?: boolean): Long; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean, radix?: number): Long; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long; + /** + * Tests if the specified object is a Long. + */ + static isLong(value: unknown): value is Long; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + static fromValue(val: number | string | { + low: number; + high: number; + unsigned?: boolean; + }, unsigned?: boolean): Long; + /** Returns the sum of this and the specified Long. */ + add(addend: string | number | Long | Timestamp): Long; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + and(other: string | number | Long | Timestamp): Long; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + compare(other: string | number | Long | Timestamp): 0 | 1 | -1; + /** This is an alias of {@link Long.compare} */ + comp(other: string | number | Long | Timestamp): 0 | 1 | -1; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + divide(divisor: string | number | Long | Timestamp): Long; + /**This is an alias of {@link Long.divide} */ + div(divisor: string | number | Long | Timestamp): Long; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + equals(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.equals} */ + eq(other: string | number | Long | Timestamp): boolean; + /** Gets the high 32 bits as a signed integer. */ + getHighBits(): number; + /** Gets the high 32 bits as an unsigned integer. */ + getHighBitsUnsigned(): number; + /** Gets the low 32 bits as a signed integer. */ + getLowBits(): number; + /** Gets the low 32 bits as an unsigned integer. */ + getLowBitsUnsigned(): number; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + getNumBitsAbs(): number; + /** Tests if this Long's value is greater than the specified's. */ + greaterThan(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThan} */ + gt(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is greater than or equal the specified's. */ + greaterThanOrEqual(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + gte(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + ge(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is even. */ + isEven(): boolean; + /** Tests if this Long's value is negative. */ + isNegative(): boolean; + /** Tests if this Long's value is odd. */ + isOdd(): boolean; + /** Tests if this Long's value is positive. */ + isPositive(): boolean; + /** Tests if this Long's value equals zero. */ + isZero(): boolean; + /** Tests if this Long's value is less than the specified's. */ + lessThan(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long#lessThan}. */ + lt(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is less than or equal the specified's. */ + lessThanOrEqual(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.lessThanOrEqual} */ + lte(other: string | number | Long | Timestamp): boolean; + /** Returns this Long modulo the specified. */ + modulo(divisor: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.modulo} */ + mod(divisor: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.modulo} */ + rem(divisor: string | number | Long | Timestamp): Long; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + multiply(multiplier: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.multiply} */ + mul(multiplier: string | number | Long | Timestamp): Long; + /** Returns the Negation of this Long's value. */ + negate(): Long; + /** This is an alias of {@link Long.negate} */ + neg(): Long; + /** Returns the bitwise NOT of this Long. */ + not(): Long; + /** Tests if this Long's value differs from the specified's. */ + notEquals(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.notEquals} */ + neq(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.notEquals} */ + ne(other: string | number | Long | Timestamp): boolean; + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: number | string | Long): Long; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftLeft(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftLeft} */ + shl(numBits: number | Long): Long; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRight(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftRight} */ + shr(numBits: number | Long): Long; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRightUnsigned(numBits: Long | number): Long; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shr_u(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shru(numBits: number | Long): Long; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + subtract(subtrahend: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.subtract} */ + sub(subtrahend: string | number | Long | Timestamp): Long; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + toInt(): number; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + toNumber(): number; + /** Converts the Long to a BigInt (arbitrary precision). */ + toBigInt(): bigint; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + toBytes(le?: boolean): number[]; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + toBytesLE(): number[]; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + toBytesBE(): number[]; + /** + * Converts this Long to signed. + */ + toSigned(): Long; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + toString(radix?: number): string; + /** Converts this Long to unsigned. */ + toUnsigned(): Long; + /** Returns the bitwise XOR of this Long and the given one. */ + xor(other: Long | number | string): Long; + /** This is an alias of {@link Long.isZero} */ + eqz(): boolean; + /** This is an alias of {@link Long.lessThanOrEqual} */ + le(other: string | number | Long | Timestamp): boolean; + toExtendedJSON(options?: EJSONOptions): number | LongExtended; + static fromExtendedJSON(doc: { + $numberLong: string; + }, options?: EJSONOptions): number | Long; + inspect(): string; +} + +/** @public */ +export declare interface LongExtended { + $numberLong: string; +} + +/** @public */ +export declare type LongWithoutOverrides = new (low: unknown, high?: number, unsigned?: boolean) => { + [P in Exclude]: Long[P]; +}; + +/** @public */ +export declare const LongWithoutOverridesClass: LongWithoutOverrides; + +/** @public */ +declare let Map_2: MapConstructor; +export { Map_2 as Map } + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +export declare class MaxKey { + _bsontype: 'MaxKey'; + constructor(); + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface MaxKeyExtended { + $maxKey: 1; +} + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +export declare class MinKey { + _bsontype: 'MinKey'; + constructor(); + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface MinKeyExtended { + $minKey: 1; +} + +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +declare class ObjectId { + _bsontype: 'ObjectID'; + /* Excluded from this release type: index */ + static cacheHexString: boolean; + /* Excluded from this release type: [kId] */ + /* Excluded from this release type: __id */ + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + constructor(inputId?: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array); + /** + * The ObjectId bytes + * @readonly + */ + get id(): Buffer; + set id(value: Buffer); + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get generationTime(): number; + set generationTime(value: number); + /** Returns the ObjectId id as a 24 character hex string representation */ + toHexString(): string; + /* Excluded from this release type: getInc */ + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + static generate(time?: number): Buffer; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + toString(format?: string): string; + /** Converts to its JSON the 24 character hex string representation. */ + toJSON(): string; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + equals(otherId: string | ObjectId | ObjectIdLike): boolean; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + getTimestamp(): Date; + /* Excluded from this release type: createPk */ + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + static createFromTime(time: number): ObjectId; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + static createFromHexString(hexString: string): ObjectId; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + static isValid(id: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array): boolean; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +export { ObjectId as ObjectID } +export { ObjectId } + +/** @public */ +export declare interface ObjectIdExtended { + $oid: string; +} + +/** @public */ +export declare interface ObjectIdLike { + id: string | Buffer; + __id?: string; + toHexString(): string; +} + +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +export declare function serialize(object: Document, options?: SerializeOptions): Buffer; + +/** @public */ +export declare interface SerializeOptions { + /** the serializer will check if keys are valid. */ + checkKeys?: boolean; + /** serialize the javascript functions **(default:false)**. */ + serializeFunctions?: boolean; + /** serialize will not emit undefined fields **(default:true)** */ + ignoreUndefined?: boolean; + /* Excluded from this release type: minInternalBufferSize */ + /** the index in the buffer where we wish to start serializing into */ + index?: number; +} + +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +export declare function serializeWithBufferAndIndex(object: Document, finalBuffer: Buffer, options?: SerializeOptions): number; + +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +export declare function setInternalBufferSize(size: number): void; + +/** + * @public + * @category BSONType + * */ +export declare class Timestamp extends LongWithoutOverridesClass { + _bsontype: 'Timestamp'; + static readonly MAX_VALUE: Long; + /** + * @param low - A 64-bit Long representing the Timestamp. + */ + constructor(long: Long); + /** + * @param value - A pair of two values indicating timestamp and increment. + */ + constructor(value: { + t: number; + i: number; + }); + /** + * @param low - the low (signed) 32 bits of the Timestamp. + * @param high - the high (signed) 32 bits of the Timestamp. + * @deprecated Please use `Timestamp({ t: high, i: low })` or `Timestamp(Long(low, high))` instead. + */ + constructor(low: number, high: number); + toJSON(): { + $timestamp: string; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + static fromInt(value: number): Timestamp; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + static fromNumber(value: number): Timestamp; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Timestamp; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + static fromString(str: string, optRadix: number): Timestamp; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface TimestampExtended { + $timestamp: { + t: number; + i: number; + }; +} + +/** @public */ +export declare type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect'; + +/** + * A class representation of the BSON UUID type. + * @public + */ +export declare class UUID extends Binary { + static cacheHexString: boolean; + /* Excluded from this release type: __id */ + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + constructor(input?: string | Buffer | UUID); + /** + * The UUID bytes + * @readonly + */ + get id(): Buffer; + set id(value: Buffer); + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + toHexString(includeDashes?: boolean): string; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + toString(encoding?: string): string; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + toJSON(): string; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + equals(otherId: string | Buffer | UUID): boolean; + /** + * Creates a Binary instance from the current UUID. + */ + toBinary(): Binary; + /** + * Generates a populated buffer containing a v4 uuid + */ + static generate(): Buffer; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + static isValid(input: string | Buffer | UUID): boolean; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + static createFromHexString(hexString: string): UUID; + inspect(): string; +} + +/** @public */ +export declare type UUIDExtended = { + $uuid: string; +}; + +export { } diff --git a/server/node_modules/bson/dist/bson.browser.esm.js b/server/node_modules/bson/dist/bson.browser.esm.js new file mode 100644 index 0000000000..dfc20ac3a3 --- /dev/null +++ b/server/node_modules/bson/dist/bson.browser.esm.js @@ -0,0 +1,7462 @@ +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var byteLength_1 = byteLength; +var toByteArray_1 = toByteArray; +var fromByteArray_1 = fromByteArray; +var lookup = []; +var revLookup = []; +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; +} // Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications + + +revLookup['-'.charCodeAt(0)] = 62; +revLookup['_'.charCodeAt(0)] = 63; + +function getLens(b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + + + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; +} // base64 is 4/3 + up to two characters of the original data + + +function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; +} + +function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; +} + +function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars + + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + + for (i = 0; i < len; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = tmp >> 16 & 0xFF; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr; +} + +function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; +} + +function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + + return output.join(''); +} + +function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } // pad the end with zeros, but make sure to not forget the extra bytes + + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '=='); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '='); + } + + return parts.join(''); +} + +var base64Js = { + byteLength: byteLength_1, + toByteArray: toByteArray_1, + fromByteArray: fromByteArray_1 +}; + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +var read = function read(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); +}; + +var write = function write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = e << mLen | m; + eLen += mLen; + + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; +}; + +var ieee754 = { + read: read, + write: write +}; + +var buffer$1 = createCommonjsModule(function (module, exports) { + + var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? // eslint-disable-line dot-notation + Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { + console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); + } + + function typedArraySupport() { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1); + var proto = { + foo: function foo() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + } + }); + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + } + }); + + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } // Return an augmented `Uint8Array` instance + + + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + + function Buffer(arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + + return allocUnsafe(arg); + } + + return from(arg, encodingOrOffset, length); + } + + Buffer.poolSize = 8192; // not used by this implementation + + function from(value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset); + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + + if (value == null) { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + + var valueOf = value.valueOf && value.valueOf(); + + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + + var b = fromObject(value); + if (b) return b; + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); + } + + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + + + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + + + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + + function alloc(size, fill, encoding) { + assertSize(size); + + if (size <= 0) { + return createBuffer(size); + } + + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + + return createBuffer(size); + } + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + + + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + + + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + + + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + + function fromString(string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + + return buf; + } + + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + + return buf; + } + + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + + return fromArrayLike(arrayView); + } + + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + + var buf; + + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } // Return an augmented `Uint8Array` instance + + + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + + if (buf.length === 0) { + return buf; + } + + obj.copy(buf, 0, 0, len); + return buf; + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0); + } + + return fromArrayLike(obj); + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + + function checked(length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes'); + } + + return length | 0; + } + + function SlowBuffer(length) { + if (+length != length) { + // eslint-disable-line eqeqeq + length = 0; + } + + return Buffer.alloc(+length); + } + + Buffer.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false + }; + + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + + if (a === b) return 0; + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true; + + default: + return false; + } + }; + + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + + if (list.length === 0) { + return Buffer.alloc(0); + } + + var i; + + if (length === undefined) { + length = 0; + + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + + pos += buf.length; + } + + return buffer; + }; + + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + + if (typeof string !== 'string') { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + babelHelpers["typeof"](string)); + } + + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; // Use a for loop to avoid recursion + + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len; + + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length; + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2; + + case 'hex': + return len >>> 1; + + case 'base64': + return base64ToBytes(string).length; + + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8 + } + + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + + Buffer.byteLength = byteLength; + + function slowToString(encoding, start, end) { + var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + + if (start === undefined || start < 0) { + start = 0; + } // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + + + if (start > this.length) { + return ''; + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return ''; + } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + + + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return ''; + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end); + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end); + + case 'ascii': + return asciiSlice(this, start, end); + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end); + + case 'base64': + return base64Slice(this, start, end); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + + + Buffer.prototype._isBuffer = true; + + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits'); + } + + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + + return this; + }; + + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + + return this; + }; + + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits'); + } + + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + + return this; + }; + + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ''; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + + Buffer.prototype.inspect = function inspect() { + var str = ''; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return ''; + }; + + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + + if (!Buffer.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + babelHelpers["typeof"](target)); + } + + if (start === undefined) { + start = 0; + } + + if (end === undefined) { + end = target ? target.length : 0; + } + + if (thisStart === undefined) { + thisStart = 0; + } + + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index'); + } + + if (thisStart >= thisEnd && start >= end) { + return 0; + } + + if (thisStart >= thisEnd) { + return -1; + } + + if (start >= end) { + return 1; + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + + + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1; // Normalize byteOffset + + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000; + } + + byteOffset = +byteOffset; // Coerce to Number. + + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : buffer.length - 1; + } // Normalize byteOffset: negative offsets start from the end of the buffer + + + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + + if (byteOffset >= buffer.length) { + if (dir) return -1;else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0;else return -1; + } // Normalize val + + + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } // Finally, search either indexOf (if dir is true) or lastIndexOf + + + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1; + } + + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + + throw new TypeError('val must be string, number or Buffer'); + } + + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + + if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1; + } + + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + + var i; + + if (dir) { + var foundIndex = -1; + + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + + for (i = byteOffset; i >= 0; i--) { + var found = true; + + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + + if (found) return i; + } + } + + return -1; + } + + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + + if (!length) { + length = remaining; + } else { + length = Number(length); + + if (length > remaining) { + length = remaining; + } + } + + var strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + + return i; + } + + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + + Buffer.prototype.write = function write(string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); + } + + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds'); + } + + if (!encoding) encoding = 'utf8'; + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length); + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length); + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length); + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64Js.fromByteArray(buf); + } else { + return base64Js.fromByteArray(buf.slice(start, end)); + } + } + + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + + break; + + case 2: + secondByte = buf[i + 1]; + + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; + + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + + break; + + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; + + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + + break; + + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; + + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res); + } // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + + + var MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); // avoid extra slice() + } // Decode in chunks to avoid "call stack size exceeded". + + + var res = ''; + var i = 0; + + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + + return res; + } + + function asciiSlice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + + return ret; + } + + function latin1Slice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + + return ret; + } + + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ''; + + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + + return out; + } + + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + + return res; + } + + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + var newBuf = this.subarray(start, end); // Return an augmented `Uint8Array` instance + + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + + + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); + } + + Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val; + }; + + Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + var val = this[offset + --byteLength]; + var mul = 1; + + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val; + }; + + Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + + Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + + Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + + Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; + }; + + Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return this[offset]; + return (0xff - this[offset] + 1) * -1; + }; + + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + } + + Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var mul = 1; + var i = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); + if (value < 0) value = 0xff + value + 1; + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + if (offset < 0) throw new RangeError('Index out of range'); + } + + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + + + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done + + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions + + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds'); + } + + if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); + if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob? + + if (end > this.length) end = this.length; + + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + var len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + + return len; + }; // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + + + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + if (val.length === 1) { + var code = val.charCodeAt(0); + + if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } // Invalid ranges are not set to a default, so can range check early. + + + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index'); + } + + if (end <= start) { + return this; + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); + var len = bytes.length; + + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this; + }; // HELPER FUNCTIONS + // ================ + + + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean(str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; // Node strips out invalid characters like \n and \t from the string, base64-js does not + + str = str.trim().replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to '' + + if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + + while (str.length % 4 !== 0) { + str = str + '='; + } + + return str; + } + + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); // is surrogate component + + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } // valid lead + + + leadSurrogate = codePoint; + continue; + } // 2 leads in a row + + + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue; + } // valid surrogate pair + + + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; // encode utf8 + + if (codePoint < 0x80) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break; + bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break; + bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break; + bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else { + throw new Error('Invalid code point'); + } + } + + return bytes; + } + + function asciiToBytes(str) { + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + + return byteArray; + } + + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray; + } + + function base64ToBytes(str) { + return base64Js.toByteArray(base64clean(str)); + } + + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + + return i; + } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + + + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + + function numberIsNaN(obj) { + // For IE11 support + return obj !== obj; // eslint-disable-line no-self-compare + } // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + + + var hexSliceLookupTable = function () { + var alphabet = '0123456789abcdef'; + var table = new Array(256); + + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + + return table; + }(); +}); +var buffer_1 = buffer$1.Buffer; +buffer$1.SlowBuffer; +buffer$1.INSPECT_MAX_BYTES; +buffer$1.kMaxLength; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/* global Reflect, Promise */ +var _extendStatics = function extendStatics(d, b) { + _extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + + return _extendStatics(d, b); +}; + +function __extends(d, b) { + _extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var _assign = function __assign() { + _assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + } + + return t; + }; + + return _assign.apply(this, arguments); +}; + +/** @public */ +var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; +}(Error)); +/** @public */ +var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; +}(TypeError)); + +function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; +} +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +function getGlobal() { + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + // eslint-disable-next-line @typescript-eslint/no-implied-eval + Function('return this')()); +} + +/** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ +function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); +} +function isReactNative() { + var g = getGlobal(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; +} +var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = buffer_1.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; +}; +var detectRandomBytes = function () { + { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + var target_1 = window.crypto || window.msCrypto; // allow for IE11 + if (target_1 && target_1.getRandomValues) { + return function (size) { return target_1.getRandomValues(buffer_1.alloc(size)); }; + } + } + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return function (size) { return global.crypto.getRandomValues(buffer_1.alloc(size)); }; + } + return insecureRandomBytes; + } +}; +var randomBytes = detectRandomBytes(); +function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); +} +function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; +} +function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; +} +function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; +} +function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; +} +function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; +} +// To ensure that 0.4 of node works correctly +function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; +} +/** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ +function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; +} +function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; +} + +/** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ +function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return buffer_1.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if (isAnyArrayBuffer(potentialBuffer)) { + return buffer_1.from(potentialBuffer); + } + throw new BSONTypeError('Must use either Buffer or TypedArray'); +} + +// Validation regex for v4 uuid (validates with or without dashes) +var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; +var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); +}; +var uuidHexStringToBuffer = function (hexString) { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return buffer_1.from(sanitizedHexString, 'hex'); +}; +var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); +}; + +/** @internal */ +var BSON_INT32_MAX$1 = 0x7fffffff; +/** @internal */ +var BSON_INT32_MIN$1 = -0x80000000; +/** @internal */ +var BSON_INT64_MAX$1 = Math.pow(2, 63) - 1; +/** @internal */ +var BSON_INT64_MIN$1 = -Math.pow(2, 63); +/** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ +var JS_INT_MAX = Math.pow(2, 53); +/** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ +var JS_INT_MIN = -Math.pow(2, 53); +/** Number BSON Type @internal */ +var BSON_DATA_NUMBER = 1; +/** String BSON Type @internal */ +var BSON_DATA_STRING = 2; +/** Object BSON Type @internal */ +var BSON_DATA_OBJECT = 3; +/** Array BSON Type @internal */ +var BSON_DATA_ARRAY = 4; +/** Binary BSON Type @internal */ +var BSON_DATA_BINARY = 5; +/** Binary BSON Type @internal */ +var BSON_DATA_UNDEFINED = 6; +/** ObjectId BSON Type @internal */ +var BSON_DATA_OID = 7; +/** Boolean BSON Type @internal */ +var BSON_DATA_BOOLEAN = 8; +/** Date BSON Type @internal */ +var BSON_DATA_DATE = 9; +/** null BSON Type @internal */ +var BSON_DATA_NULL = 10; +/** RegExp BSON Type @internal */ +var BSON_DATA_REGEXP = 11; +/** Code BSON Type @internal */ +var BSON_DATA_DBPOINTER = 12; +/** Code BSON Type @internal */ +var BSON_DATA_CODE = 13; +/** Symbol BSON Type @internal */ +var BSON_DATA_SYMBOL = 14; +/** Code with Scope BSON Type @internal */ +var BSON_DATA_CODE_W_SCOPE = 15; +/** 32 bit Integer BSON Type @internal */ +var BSON_DATA_INT = 16; +/** Timestamp BSON Type @internal */ +var BSON_DATA_TIMESTAMP = 17; +/** Long BSON Type @internal */ +var BSON_DATA_LONG = 18; +/** Decimal128 BSON Type @internal */ +var BSON_DATA_DECIMAL128 = 19; +/** MinKey BSON Type @internal */ +var BSON_DATA_MIN_KEY = 0xff; +/** MaxKey BSON Type @internal */ +var BSON_DATA_MAX_KEY = 0x7f; +/** Binary Default Type @internal */ +var BSON_BINARY_SUBTYPE_DEFAULT = 0; +/** Binary Function Type @internal */ +var BSON_BINARY_SUBTYPE_FUNCTION = 1; +/** Binary Byte Array Type @internal */ +var BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ +var BSON_BINARY_SUBTYPE_UUID = 3; +/** Binary UUID Type @internal */ +var BSON_BINARY_SUBTYPE_UUID_NEW = 4; +/** Binary MD5 Type @internal */ +var BSON_BINARY_SUBTYPE_MD5 = 5; +/** Encrypted BSON type @internal */ +var BSON_BINARY_SUBTYPE_ENCRYPTED = 6; +/** Column BSON type @internal */ +var BSON_BINARY_SUBTYPE_COLUMN = 7; +/** Binary User Defined Type @internal */ +var BSON_BINARY_SUBTYPE_USER_DEFINED = 128; + +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +var Binary = /** @class */ (function () { + /** + * Create a new Binary instance. + * + * This constructor can accept a string as its first argument. In this case, + * this string will be encoded using ISO-8859-1, **not** using UTF-8. + * This is almost certainly not what you want. Use `new Binary(Buffer.from(string))` + * instead to convert the string to a Buffer using UTF-8 first. + * + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = buffer_1.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = buffer_1.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = buffer_1.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = buffer_1.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = buffer_1.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + throw new BSONError("Binary sub_type \"".concat(this.sub_type, "\" is not supported for converting to UUID. Only \"").concat(Binary.SUBTYPE_UUID, "\" is currently supported.")); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = buffer_1.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = buffer_1.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError("Unexpected Binary Extended JSON format ".concat(JSON.stringify(doc))); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"".concat(asBuffer.toString('hex'), "\", \"hex\"), ").concat(this.sub_type, ")"); + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; +}()); +Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); +var UUID_BYTE_LENGTH = 16; +/** + * A class representation of the BSON UUID type. + * @public + */ +var UUID = /** @class */ (function (_super) { + __extends(UUID, _super); + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + var _this = this; + var bytes; + var hexStr; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = buffer_1.from(input.buffer); + hexStr = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ensureBuffer(input); + } + else if (typeof input === 'string') { + bytes = uuidHexStringToBuffer(input); + } + else { + throw new BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + _this = _super.call(this, bytes, BSON_BINARY_SUBTYPE_UUID_NEW) || this; + _this.__id = hexStr; + return _this; + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this.buffer; + }, + set: function (value) { + this.buffer = value; + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = bufferToUuidHexString(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new Binary(this.id, Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = randomBytes(UUID_BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return buffer_1.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return uuidValidateString(input); + } + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== UUID_BYTE_LENGTH) { + return false; + } + return (input[6] & 0xf0) === 0x40 && (input[8] & 0x80) === 0x80; + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"".concat(this.toHexString(), "\")"); + }; + return UUID; +}(Binary)); + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"".concat(String(codeJson.code), "\"").concat(codeJson.scope ? ", ".concat(JSON.stringify(codeJson.scope)) : '', ")"); + }; + return Code; +}()); +Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); + +/** @internal */ +function isDBRefLike(value) { + return (isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); +} +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"".concat(this.namespace, "\", new ObjectId(\"").concat(String(oid), "\")").concat(this.db ? ", \"".concat(this.db, "\"") : '', ")"); + }; + return DBRef; +}()); +Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); + +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +var wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch (_a) { + // no wasm support +} +var TWO_PWR_16_DBL = 1 << 16; +var TWO_PWR_24_DBL = 1 << 24; +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +/** A cache of the Long representations of small integer values. */ +var INT_CACHE = {}; +/** A cache of the Long representations of small unsigned integer values. */ +var UINT_CACHE = {}; +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + Long.isLong = function (value) { + return isObjectLike(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + // eslint-disable-next-line @typescript-eslint/no-this-alias + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"".concat(this.toString(), "\"").concat(this.unsigned ? ', true' : '', ")"); + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; +}()); +Object.defineProperty(Long.prototype, '__isLong__', { value: true }); +Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); + +var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +var EXPONENT_MAX = 6111; +var EXPONENT_MIN = -6176; +var EXPONENT_BIAS = 6176; +var MAX_DIGITS = 34; +// Nan value bits as 32 bit values (due to lack of longs) +var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +// Infinity value bits 32 bit values (due to lack of longs) +var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var EXPONENT_REGEX = /^([-+])?(\d+)?$/; +// Extract least significant 5 bits +var COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +var EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +var COMBINATION_INFINITY = 30; +// Value of combination field for NaN +var COMBINATION_NAN = 31; +// Detect if the value is a digit +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +// Divide two uint128 values +function divideu128(value) { + var DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + var _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +// Multiply two Long values and return the 128 bit value +function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new BSONTypeError("\"".concat(string, "\" is not a valid Decimal128 string - ").concat(message)); +} +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new Long(0, 0); + // The low 17 digits of the significand + var significandLow = new Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(buffer_1.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = buffer_1.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("".concat(0)); + if (exponent > 0) + string.push("E+".concat(exponent)); + else if (exponent < 0) + string.push("E".concat(exponent)); + return string.join(''); + } + string.push("".concat(significand[index++])); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push("+".concat(scientific_exponent)); + } + else { + string.push("".concat(scientific_exponent)); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("".concat(significand[index++])); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("".concat(significand[index++])); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"".concat(this.toString(), "\")"); + }; + return Decimal128; +}()); +Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + return { $numberDouble: "-".concat(this.value.toFixed(1)) }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(".concat(eJSON.$numberDouble, ")"); + }; + return Double; +}()); +Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(".concat(this.valueOf(), ")"); + }; + return Int32; +}()); +Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; +}()); +Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; +}()); +Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); + +// Regular expression that checks for hex value +var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); +// Unique sequence for the current process (initialized on first use) +var PROCESS_UNIQUE = null; +var kId = Symbol('id'); +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = buffer_1.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof buffer_1 ? workingId : ensureBuffer(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = buffer_1.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = buffer_1.from(workingId, 'hex'); + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = buffer_1.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id)) { + return otherId === buffer_1.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return buffer_1.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = buffer_1.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(buffer_1.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"".concat(this.toHexString(), "\")"); + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; +}()); +// Deprecated methods +Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') +}); +Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); + +function alphabetize(str) { + return str.split('').sort().join(''); +} +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern))); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options))); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError("The regular expression option [".concat(this.options[i], "] is not supported")); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONTypeError("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(doc))); + }; + return BSONRegExp; +}()); +Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"".concat(this.value, "\")"); + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; +}()); +Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); + +/** @public */ +var LongWithoutOverridesClass = Long; +/** + * @public + * @category BSONType + * */ +var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: ".concat(this.getHighBits(), ", i: ").concat(this.getLowBits(), " })"); + }; + Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + return Timestamp; +}(LongWithoutOverridesClass)); + +function isBSONType(value) { + return (isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); +} +// INT32 boundaries +var BSON_INT32_MAX = 0x7fffffff; +var BSON_INT32_MIN = -0x80000000; +// INT64 boundaries +// const BSON_INT64_MAX = 0x7fffffffffffffff; // TODO(NODE-4377): This number cannot be precisely represented in JS +var BSON_INT64_MAX = 0x8000000000000000; +var BSON_INT64_MIN = -0x8000000000000000; +// all the types where we don't need to do any special processing and can just pass the EJSON +//straight to type.fromExtendedJSON +var keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) + return new Int32(value); + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) + return Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return DBRef.fromExtendedJSON(v); + } + return value; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index ".concat(index), obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONTypeError('Converting circular structure to EJSON:\n' + + " ".concat(leadingPart).concat(alreadySeen).concat(circularPart).concat(current, "\n") + + " ".concat(leadingSpace, "\\").concat(dashes, "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || isDate(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN && value <= BSON_INT32_MAX, int64Range = value >= BSON_INT64_MIN && value <= BSON_INT64_MAX; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || isRegExp(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new Binary(o.value(), o.sub_type); }, + Code: function (o) { return new Code(o.code, o.scope); }, + DBRef: function (o) { return new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new Decimal128(o.bytes); }, + Double: function (o) { return new Double(o.value); }, + Int32: function (o) { return new Int32(o.value); }, + Long: function (o) { + return Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new MaxKey(); }, + MinKey: function () { return new MinKey(); }, + ObjectID: function (o) { return new ObjectId(o); }, + ObjectId: function (o) { return new ObjectId(o); }, + BSONRegExp: function (o) { return new BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new BSONSymbol(o.value); }, + Timestamp: function (o) { return Timestamp.fromBits(o.low, o.high); } +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + var value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +/** + * EJSON parse / stringify API + * @public + */ +// the namespace here is used to emulate `export * as EJSON from '...'` +// which as of now (sept 2020) api-extractor does not support +// eslint-disable-next-line @typescript-eslint/no-namespace +var EJSON; +(function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new BSONError("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(key))); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; +})(EJSON || (EJSON = {})); + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** @public */ +var bsonMap; +var bsonGlobal = getGlobal(); +if (bsonGlobal.Map) { + bsonMap = bsonGlobal.Map; +} +else { + // We will return a polyfill + bsonMap = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); +} + +function calculateObjectSize$1(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; +} +/** @internal */ +function calculateElement(name, +// eslint-disable-next-line @typescript-eslint/no-explicit-any +value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + buffer_1.byteLength(name, 'utf8') + 1 + 4 + buffer_1.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1) { + // 32 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + var binary = value; + // Check what kind of subtype we have + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + (binary.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (binary.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + buffer_1.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize$1(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || isRegExp(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.pattern, 'utf8') + + 1 + + buffer_1.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize$1(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1); + } + } + } + return 0; +} + +var FIRST_BIT = 0x80; +var FIRST_TWO_BITS = 0xc0; +var FIRST_THREE_BITS = 0xe0; +var FIRST_FOUR_BITS = 0xf0; +var FIRST_FIVE_BITS = 0xf8; +var TWO_BIT_CHAR = 0xc0; +var THREE_BIT_CHAR = 0xe0; +var FOUR_BIT_CHAR = 0xf0; +var CONTINUING_CHAR = 0x80; +/** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ +function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; +} + +// Internal long versions +var JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); +var JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); +var functionCache = {}; +function deserialize$1(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new BSONError("bson size must be >= 5, is ".concat(size)); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError("buffer length ".concat(buffer.length, " must be >= bson size ").concat(size)); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError("buffer length ".concat(buffer.length, " must === bson size ").concat(size)); + } + if (size + index > buffer.byteLength) { + throw new BSONError("(bson size ".concat(size, " + options.index ").concat(index, " must be <= buffer length ").concat(buffer.byteLength, ")")); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); +} +var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + var dataview = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength); + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + var oid = buffer_1.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(dataview.getFloat64(index, true)); + index = index + 8; + } + else if (elementType === BSON_DATA_NUMBER) { + value = dataview.getFloat64(index, true); + index = index + 8; + } + else if (elementType === BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = _assign(_assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = _assign(_assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new BSONError('corrupted array bson'); + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = buffer_1.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW) { + value = value.toUUID(); + } + } + } + else { + var _buffer = buffer_1.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else if (subType === BSON_BINARY_SUBTYPE_UUID_NEW) { + value = new Binary(buffer.slice(index, index + binarySize), subType).toUUID(); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Timestamp(lowBits, highBits); + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new Code(functionString, scopeObject); + } + } + else if (elementType === BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = buffer_1.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } + else { + throw new BSONError("Detected unknown BSON type ".concat(elementType.toString(16), " for fieldname \"").concat(name, "\"")); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if (isDBRefLike(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; +} +/** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ +function isolateEval(functionString, functionCache, object) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); +} +function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; +} + +var regexp = /\x00/; // eslint-disable-line no-control-regex +var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +/* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ +function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; +} +var SPACE_FOR_FLOAT64 = new Uint8Array(8); +var DV_FOR_FLOAT64 = new DataView(SPACE_FOR_FLOAT64.buffer, SPACE_FOR_FLOAT64.byteOffset, SPACE_FOR_FLOAT64.byteLength); +function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= BSON_INT32_MIN$1 && + value <= BSON_INT32_MAX$1) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + } + return index; +} +function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; +} +function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; +} +function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; +} +function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; +} +function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; +} +function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value.value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + return index; +} +function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = normalizedFunctionString(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} +function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; +} +function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; +} +function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; +} +function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = "".concat(i); + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else if (object instanceof bsonMap || isMap(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; +} + +/** @internal */ +// Default Max Size +var MAXSIZE = 1024 * 1024 * 17; +// Current Internal Temporary Serialization Buffer +var buffer = buffer_1.alloc(MAXSIZE); +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = buffer_1.alloc(size); + } +} +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = buffer_1.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = buffer_1.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; +} +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; +} +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return deserialize$1(buffer instanceof buffer_1 ? buffer : ensureBuffer(buffer), options); +} +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return calculateObjectSize$1(object, serializeFunctions, ignoreUndefined); +} +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = ensureBuffer(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = deserialize$1(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; +} +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +var BSON = { + Binary: Binary, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + Int32: Int32, + Long: Long, + UUID: UUID, + Map: bsonMap, + MaxKey: MaxKey, + MinKey: MinKey, + ObjectId: ObjectId, + ObjectID: ObjectId, + BSONRegExp: BSONRegExp, + BSONSymbol: BSONSymbol, + Timestamp: Timestamp, + EJSON: EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: BSONError, + BSONTypeError: BSONTypeError +}; + +export default BSON; +export { BSONError, BSONRegExp, BSONSymbol, BSONTypeError, BSON_BINARY_SUBTYPE_BYTE_ARRAY, BSON_BINARY_SUBTYPE_COLUMN, BSON_BINARY_SUBTYPE_DEFAULT, BSON_BINARY_SUBTYPE_ENCRYPTED, BSON_BINARY_SUBTYPE_FUNCTION, BSON_BINARY_SUBTYPE_MD5, BSON_BINARY_SUBTYPE_USER_DEFINED, BSON_BINARY_SUBTYPE_UUID, BSON_BINARY_SUBTYPE_UUID_NEW, BSON_DATA_ARRAY, BSON_DATA_BINARY, BSON_DATA_BOOLEAN, BSON_DATA_CODE, BSON_DATA_CODE_W_SCOPE, BSON_DATA_DATE, BSON_DATA_DBPOINTER, BSON_DATA_DECIMAL128, BSON_DATA_INT, BSON_DATA_LONG, BSON_DATA_MAX_KEY, BSON_DATA_MIN_KEY, BSON_DATA_NULL, BSON_DATA_NUMBER, BSON_DATA_OBJECT, BSON_DATA_OID, BSON_DATA_REGEXP, BSON_DATA_STRING, BSON_DATA_SYMBOL, BSON_DATA_TIMESTAMP, BSON_DATA_UNDEFINED, BSON_INT32_MAX$1 as BSON_INT32_MAX, BSON_INT32_MIN$1 as BSON_INT32_MIN, BSON_INT64_MAX$1 as BSON_INT64_MAX, BSON_INT64_MIN$1 as BSON_INT64_MIN, Binary, Code, DBRef, Decimal128, Double, EJSON, Int32, Long, LongWithoutOverridesClass, bsonMap as Map, MaxKey, MinKey, ObjectId as ObjectID, ObjectId, Timestamp, UUID, calculateObjectSize, deserialize, deserializeStream, serialize, serializeWithBufferAndIndex, setInternalBufferSize }; +//# sourceMappingURL=bson.browser.esm.js.map diff --git a/server/node_modules/bson/dist/bson.browser.esm.js.map b/server/node_modules/bson/dist/bson.browser.esm.js.map new file mode 100644 index 0000000000..aceabb89b3 --- /dev/null +++ b/server/node_modules/bson/dist/bson.browser.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.browser.esm.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../node_modules/tslib/tslib.es6.js","../src/error.ts","../src/utils/global.ts","../src/parser/utils.ts","../src/ensure_buffer.ts","../src/uuid_utils.ts","../src/constants.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/extended_json.ts","../src/map.ts","../src/parser/calculate_size.ts","../src/validate_utf8.ts","../src/parser/deserializer.ts","../src/parser/serializer.ts","../src/bson.ts"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["byteLength","toByteArray","fromByteArray","lookup","revLookup","Arr","Uint8Array","Array","code","i","len","length","charCodeAt","getLens","b64","Error","validLen","indexOf","placeHoldersLen","lens","_byteLength","tmp","arr","curByte","tripletToBase64","num","encodeChunk","uint8","start","end","output","push","join","extraBytes","parts","maxChunkLength","len2","buffer","offset","isLE","mLen","nBytes","e","m","eLen","eMax","eBias","nBits","d","s","NaN","Infinity","Math","pow","value","c","rt","abs","isNaN","floor","log","LN2","customInspectSymbol","Symbol","exports","Buffer","SlowBuffer","K_MAX_LENGTH","TYPED_ARRAY_SUPPORT","typedArraySupport","console","error","proto","foo","Object","setPrototypeOf","prototype","defineProperty","enumerable","get","isBuffer","undefined","byteOffset","createBuffer","RangeError","buf","arg","encodingOrOffset","TypeError","allocUnsafe","from","poolSize","fromString","ArrayBuffer","isView","fromArrayView","isInstance","fromArrayBuffer","SharedArrayBuffer","valueOf","b","fromObject","toPrimitive","assertSize","size","alloc","fill","encoding","checked","allocUnsafeSlow","string","isEncoding","actual","write","slice","fromArrayLike","array","arrayView","copy","obj","numberIsNaN","type","isArray","data","toString","_isBuffer","compare","a","x","y","min","String","toLowerCase","concat","list","pos","set","call","mustMatch","arguments","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","swap16","swap32","swap64","apply","toLocaleString","equals","inspect","str","max","INSPECT_MAX_BYTES","replace","trim","target","thisStart","thisEnd","thisCopy","targetCopy","bidirectionalIndexOf","val","dir","arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","read","readUInt16BE","foundIndex","found","j","includes","hexWrite","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","asciiToBytes","base64Write","ucs2Write","utf16leToBytes","isFinite","toJSON","_arr","base64","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","MAX_ARGUMENTS_LENGTH","codePoints","fromCharCode","ret","out","hexSliceLookupTable","bytes","newBuf","subarray","checkOffset","ext","readUintLE","readUIntLE","noAssert","mul","readUintBE","readUIntBE","readUint8","readUInt8","readUint16LE","readUInt16LE","readUint16BE","readUint32LE","readUInt32LE","readUint32BE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","ieee754","readFloatBE","readDoubleLE","readDoubleBE","checkInt","writeUintLE","writeUIntLE","maxBytes","writeUintBE","writeUIntBE","writeUint8","writeUInt8","writeUint16LE","writeUInt16LE","writeUint16BE","writeUInt16BE","writeUint32LE","writeUInt32LE","writeUint32BE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","checkIEEE754","writeFloat","littleEndian","writeFloatLE","writeFloatBE","writeDouble","writeDoubleLE","writeDoubleBE","targetStart","copyWithin","INVALID_BASE64_RE","base64clean","split","units","leadSurrogate","byteArray","hi","lo","src","dst","constructor","name","alphabet","table","i16","extendStatics","__proto__","p","hasOwnProperty","__extends","__","create","__assign","assign","t","BSON_INT32_MAX","BSON_INT32_MIN","BSON_INT64_MAX","BSON_INT64_MIN","calculateObjectSize","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","deserialize","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_BINARY_SUBTYPE_UUID_NEW","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT","Map","internalSerialize","internalDeserialize","internalCalculateObjectSize"],"mappings":";;;;AAEA,gBAAkB,GAAGA,UAArB;AACA,iBAAmB,GAAGC,WAAtB;AACA,mBAAqB,GAAGC,aAAxB;AAEA,IAAIC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,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;;QAE9B,SAAS,CAAC,aAAa,GAAG,CAAC,CAAC,GAAGD,aAAmB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;;QAEhF,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;KACtB;;IAGD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;IAQM,IAAI,GAAG;IACX,MAAM,QAAA;IACN,IAAI,MAAA;IACJ,KAAK,OAAA;IACL,UAAU,YAAA;IACV,MAAM,QAAA;IACN,KAAK,OAAA;IACL,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,GAAG,SAAA;IACH,MAAM,QAAA;IACN,MAAM,QAAA;IACN,QAAQ,UAAA;IACR,QAAQ,EAAE,QAAQ;IAClB,UAAU,YAAA;IACV,UAAU,YAAA;IACV,SAAS,WAAA;IACT,KAAK,OAAA;IACL,qBAAqB,uBAAA;IACrB,SAAS,WAAA;IACT,2BAA2B,6BAAA;IAC3B,WAAW,aAAA;IACX,mBAAmB,qBAAA;IACnB,iBAAiB,mBAAA;IACjB,SAAS,WAAA;IACT,aAAa,eAAA;;;;;;"} \ No newline at end of file diff --git a/server/node_modules/bson/dist/bson.browser.umd.js b/server/node_modules/bson/dist/bson.browser.umd.js new file mode 100644 index 0000000000..761e5db1e1 --- /dev/null +++ b/server/node_modules/bson/dist/bson.browser.umd.js @@ -0,0 +1,7529 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BSON = {})); +}(this, (function (exports) { 'use strict'; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var byteLength_1 = byteLength; + var toByteArray_1 = toByteArray; + var fromByteArray_1 = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + + + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + + function getLens(b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + + + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } // base64 is 4/3 + up to two characters of the original data + + + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars + + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + + for (i = 0; i < len; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = tmp >> 16 & 0xFF; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr; + } + + function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; + } + + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + + return output.join(''); + } + + function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } // pad the end with zeros, but make sure to not forget the extra bytes + + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '=='); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '='); + } + + return parts.join(''); + } + + var base64Js = { + byteLength: byteLength_1, + toByteArray: toByteArray_1, + fromByteArray: fromByteArray_1 + }; + + /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + var read = function read(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + + var write = function write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = e << mLen | m; + eLen += mLen; + + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + }; + + var ieee754 = { + read: read, + write: write + }; + + var buffer$1 = createCommonjsModule(function (module, exports) { + + var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? // eslint-disable-line dot-notation + Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { + console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); + } + + function typedArraySupport() { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1); + var proto = { + foo: function foo() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + } + }); + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + } + }); + + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } // Return an augmented `Uint8Array` instance + + + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + + function Buffer(arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + + return allocUnsafe(arg); + } + + return from(arg, encodingOrOffset, length); + } + + Buffer.poolSize = 8192; // not used by this implementation + + function from(value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset); + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + + if (value == null) { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + + var valueOf = value.valueOf && value.valueOf(); + + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + + var b = fromObject(value); + if (b) return b; + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); + } + + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + + + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + + + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + + function alloc(size, fill, encoding) { + assertSize(size); + + if (size <= 0) { + return createBuffer(size); + } + + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + + return createBuffer(size); + } + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + + + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + + + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + + + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + + function fromString(string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + + return buf; + } + + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + + return buf; + } + + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + + return fromArrayLike(arrayView); + } + + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + + var buf; + + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } // Return an augmented `Uint8Array` instance + + + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + + if (buf.length === 0) { + return buf; + } + + obj.copy(buf, 0, 0, len); + return buf; + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0); + } + + return fromArrayLike(obj); + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + + function checked(length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes'); + } + + return length | 0; + } + + function SlowBuffer(length) { + if (+length != length) { + // eslint-disable-line eqeqeq + length = 0; + } + + return Buffer.alloc(+length); + } + + Buffer.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false + }; + + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + + if (a === b) return 0; + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true; + + default: + return false; + } + }; + + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + + if (list.length === 0) { + return Buffer.alloc(0); + } + + var i; + + if (length === undefined) { + length = 0; + + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + + pos += buf.length; + } + + return buffer; + }; + + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + + if (typeof string !== 'string') { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + babelHelpers["typeof"](string)); + } + + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; // Use a for loop to avoid recursion + + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len; + + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length; + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2; + + case 'hex': + return len >>> 1; + + case 'base64': + return base64ToBytes(string).length; + + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8 + } + + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + + Buffer.byteLength = byteLength; + + function slowToString(encoding, start, end) { + var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + + if (start === undefined || start < 0) { + start = 0; + } // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + + + if (start > this.length) { + return ''; + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return ''; + } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + + + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return ''; + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end); + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end); + + case 'ascii': + return asciiSlice(this, start, end); + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end); + + case 'base64': + return base64Slice(this, start, end); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + + + Buffer.prototype._isBuffer = true; + + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits'); + } + + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + + return this; + }; + + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + + return this; + }; + + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits'); + } + + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + + return this; + }; + + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ''; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + + Buffer.prototype.inspect = function inspect() { + var str = ''; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return ''; + }; + + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + + if (!Buffer.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + babelHelpers["typeof"](target)); + } + + if (start === undefined) { + start = 0; + } + + if (end === undefined) { + end = target ? target.length : 0; + } + + if (thisStart === undefined) { + thisStart = 0; + } + + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index'); + } + + if (thisStart >= thisEnd && start >= end) { + return 0; + } + + if (thisStart >= thisEnd) { + return -1; + } + + if (start >= end) { + return 1; + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + + + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1; // Normalize byteOffset + + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000; + } + + byteOffset = +byteOffset; // Coerce to Number. + + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : buffer.length - 1; + } // Normalize byteOffset: negative offsets start from the end of the buffer + + + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + + if (byteOffset >= buffer.length) { + if (dir) return -1;else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0;else return -1; + } // Normalize val + + + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } // Finally, search either indexOf (if dir is true) or lastIndexOf + + + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1; + } + + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + + throw new TypeError('val must be string, number or Buffer'); + } + + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + + if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1; + } + + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + + var i; + + if (dir) { + var foundIndex = -1; + + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + + for (i = byteOffset; i >= 0; i--) { + var found = true; + + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + + if (found) return i; + } + } + + return -1; + } + + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + + if (!length) { + length = remaining; + } else { + length = Number(length); + + if (length > remaining) { + length = remaining; + } + } + + var strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + + return i; + } + + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + + Buffer.prototype.write = function write(string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); + } + + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds'); + } + + if (!encoding) encoding = 'utf8'; + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length); + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length); + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length); + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64Js.fromByteArray(buf); + } else { + return base64Js.fromByteArray(buf.slice(start, end)); + } + } + + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + + break; + + case 2: + secondByte = buf[i + 1]; + + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; + + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + + break; + + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; + + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + + break; + + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; + + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res); + } // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + + + var MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); // avoid extra slice() + } // Decode in chunks to avoid "call stack size exceeded". + + + var res = ''; + var i = 0; + + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + + return res; + } + + function asciiSlice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + + return ret; + } + + function latin1Slice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + + return ret; + } + + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ''; + + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + + return out; + } + + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + + return res; + } + + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + var newBuf = this.subarray(start, end); // Return an augmented `Uint8Array` instance + + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + + + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); + } + + Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val; + }; + + Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + var val = this[offset + --byteLength]; + var mul = 1; + + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val; + }; + + Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + + Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + + Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + + Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; + }; + + Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return this[offset]; + return (0xff - this[offset] + 1) * -1; + }; + + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + } + + Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var mul = 1; + var i = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); + if (value < 0) value = 0xff + value + 1; + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + if (offset < 0) throw new RangeError('Index out of range'); + } + + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + + + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done + + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions + + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds'); + } + + if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); + if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob? + + if (end > this.length) end = this.length; + + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + var len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + + return len; + }; // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + + + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + if (val.length === 1) { + var code = val.charCodeAt(0); + + if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } // Invalid ranges are not set to a default, so can range check early. + + + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index'); + } + + if (end <= start) { + return this; + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); + var len = bytes.length; + + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this; + }; // HELPER FUNCTIONS + // ================ + + + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean(str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; // Node strips out invalid characters like \n and \t from the string, base64-js does not + + str = str.trim().replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to '' + + if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + + while (str.length % 4 !== 0) { + str = str + '='; + } + + return str; + } + + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); // is surrogate component + + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } // valid lead + + + leadSurrogate = codePoint; + continue; + } // 2 leads in a row + + + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue; + } // valid surrogate pair + + + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; // encode utf8 + + if (codePoint < 0x80) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break; + bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break; + bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break; + bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else { + throw new Error('Invalid code point'); + } + } + + return bytes; + } + + function asciiToBytes(str) { + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + + return byteArray; + } + + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray; + } + + function base64ToBytes(str) { + return base64Js.toByteArray(base64clean(str)); + } + + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + + return i; + } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + + + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + + function numberIsNaN(obj) { + // For IE11 support + return obj !== obj; // eslint-disable-line no-self-compare + } // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + + + var hexSliceLookupTable = function () { + var alphabet = '0123456789abcdef'; + var table = new Array(256); + + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + + return table; + }(); + }); + var buffer_1 = buffer$1.Buffer; + buffer$1.SlowBuffer; + buffer$1.INSPECT_MAX_BYTES; + buffer$1.kMaxLength; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + + /* global Reflect, Promise */ + var _extendStatics = function extendStatics(d, b) { + _extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + + return _extendStatics(d, b); + }; + + function __extends(d, b) { + _extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var _assign = function __assign() { + _assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + } + + return t; + }; + + return _assign.apply(this, arguments); + }; + + /** @public */ + var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; + }(Error)); + /** @public */ + var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; + }(TypeError)); + + function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; + } + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + function getGlobal() { + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + // eslint-disable-next-line @typescript-eslint/no-implied-eval + Function('return this')()); + } + + /** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ + function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); + } + function isReactNative() { + var g = getGlobal(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; + } + var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = buffer_1.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; + }; + var detectRandomBytes = function () { + { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + var target_1 = window.crypto || window.msCrypto; // allow for IE11 + if (target_1 && target_1.getRandomValues) { + return function (size) { return target_1.getRandomValues(buffer_1.alloc(size)); }; + } + } + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return function (size) { return global.crypto.getRandomValues(buffer_1.alloc(size)); }; + } + return insecureRandomBytes; + } + }; + var randomBytes = detectRandomBytes(); + function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); + } + function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; + } + function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; + } + function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; + } + function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; + } + function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; + } + // To ensure that 0.4 of node works correctly + function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; + } + /** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ + function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; + } + function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; + } + + /** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ + function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return buffer_1.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if (isAnyArrayBuffer(potentialBuffer)) { + return buffer_1.from(potentialBuffer); + } + throw new BSONTypeError('Must use either Buffer or TypedArray'); + } + + // Validation regex for v4 uuid (validates with or without dashes) + var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; + var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); + }; + var uuidHexStringToBuffer = function (hexString) { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return buffer_1.from(sanitizedHexString, 'hex'); + }; + var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); + }; + + /** @internal */ + var BSON_INT32_MAX$1 = 0x7fffffff; + /** @internal */ + var BSON_INT32_MIN$1 = -0x80000000; + /** @internal */ + var BSON_INT64_MAX$1 = Math.pow(2, 63) - 1; + /** @internal */ + var BSON_INT64_MIN$1 = -Math.pow(2, 63); + /** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ + var JS_INT_MAX = Math.pow(2, 53); + /** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ + var JS_INT_MIN = -Math.pow(2, 53); + /** Number BSON Type @internal */ + var BSON_DATA_NUMBER = 1; + /** String BSON Type @internal */ + var BSON_DATA_STRING = 2; + /** Object BSON Type @internal */ + var BSON_DATA_OBJECT = 3; + /** Array BSON Type @internal */ + var BSON_DATA_ARRAY = 4; + /** Binary BSON Type @internal */ + var BSON_DATA_BINARY = 5; + /** Binary BSON Type @internal */ + var BSON_DATA_UNDEFINED = 6; + /** ObjectId BSON Type @internal */ + var BSON_DATA_OID = 7; + /** Boolean BSON Type @internal */ + var BSON_DATA_BOOLEAN = 8; + /** Date BSON Type @internal */ + var BSON_DATA_DATE = 9; + /** null BSON Type @internal */ + var BSON_DATA_NULL = 10; + /** RegExp BSON Type @internal */ + var BSON_DATA_REGEXP = 11; + /** Code BSON Type @internal */ + var BSON_DATA_DBPOINTER = 12; + /** Code BSON Type @internal */ + var BSON_DATA_CODE = 13; + /** Symbol BSON Type @internal */ + var BSON_DATA_SYMBOL = 14; + /** Code with Scope BSON Type @internal */ + var BSON_DATA_CODE_W_SCOPE = 15; + /** 32 bit Integer BSON Type @internal */ + var BSON_DATA_INT = 16; + /** Timestamp BSON Type @internal */ + var BSON_DATA_TIMESTAMP = 17; + /** Long BSON Type @internal */ + var BSON_DATA_LONG = 18; + /** Decimal128 BSON Type @internal */ + var BSON_DATA_DECIMAL128 = 19; + /** MinKey BSON Type @internal */ + var BSON_DATA_MIN_KEY = 0xff; + /** MaxKey BSON Type @internal */ + var BSON_DATA_MAX_KEY = 0x7f; + /** Binary Default Type @internal */ + var BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Binary Function Type @internal */ + var BSON_BINARY_SUBTYPE_FUNCTION = 1; + /** Binary Byte Array Type @internal */ + var BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; + /** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ + var BSON_BINARY_SUBTYPE_UUID = 3; + /** Binary UUID Type @internal */ + var BSON_BINARY_SUBTYPE_UUID_NEW = 4; + /** Binary MD5 Type @internal */ + var BSON_BINARY_SUBTYPE_MD5 = 5; + /** Encrypted BSON type @internal */ + var BSON_BINARY_SUBTYPE_ENCRYPTED = 6; + /** Column BSON type @internal */ + var BSON_BINARY_SUBTYPE_COLUMN = 7; + /** Binary User Defined Type @internal */ + var BSON_BINARY_SUBTYPE_USER_DEFINED = 128; + + /** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ + var Binary = /** @class */ (function () { + /** + * Create a new Binary instance. + * + * This constructor can accept a string as its first argument. In this case, + * this string will be encoded using ISO-8859-1, **not** using UTF-8. + * This is almost certainly not what you want. Use `new Binary(Buffer.from(string))` + * instead to convert the string to a Buffer using UTF-8 first. + * + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = buffer_1.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = buffer_1.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = buffer_1.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = buffer_1.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = buffer_1.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + throw new BSONError("Binary sub_type \"".concat(this.sub_type, "\" is not supported for converting to UUID. Only \"").concat(Binary.SUBTYPE_UUID, "\" is currently supported.")); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = buffer_1.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = buffer_1.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError("Unexpected Binary Extended JSON format ".concat(JSON.stringify(doc))); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"".concat(asBuffer.toString('hex'), "\", \"hex\"), ").concat(this.sub_type, ")"); + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; + }()); + Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); + var UUID_BYTE_LENGTH = 16; + /** + * A class representation of the BSON UUID type. + * @public + */ + var UUID = /** @class */ (function (_super) { + __extends(UUID, _super); + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + var _this = this; + var bytes; + var hexStr; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = buffer_1.from(input.buffer); + hexStr = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ensureBuffer(input); + } + else if (typeof input === 'string') { + bytes = uuidHexStringToBuffer(input); + } + else { + throw new BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + _this = _super.call(this, bytes, BSON_BINARY_SUBTYPE_UUID_NEW) || this; + _this.__id = hexStr; + return _this; + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this.buffer; + }, + set: function (value) { + this.buffer = value; + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = bufferToUuidHexString(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new Binary(this.id, Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = randomBytes(UUID_BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return buffer_1.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return uuidValidateString(input); + } + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== UUID_BYTE_LENGTH) { + return false; + } + return (input[6] & 0xf0) === 0x40 && (input[8] & 0x80) === 0x80; + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"".concat(this.toHexString(), "\")"); + }; + return UUID; + }(Binary)); + + /** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ + var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"".concat(String(codeJson.code), "\"").concat(codeJson.scope ? ", ".concat(JSON.stringify(codeJson.scope)) : '', ")"); + }; + return Code; + }()); + Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); + + /** @internal */ + function isDBRefLike(value) { + return (isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); + } + /** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ + var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"".concat(this.namespace, "\", new ObjectId(\"").concat(String(oid), "\")").concat(this.db ? ", \"".concat(this.db, "\"") : '', ")"); + }; + return DBRef; + }()); + Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); + + /** + * wasm optimizations, to do native i64 multiplication and divide + */ + var wasm = undefined; + try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; + } + catch (_a) { + // no wasm support + } + var TWO_PWR_16_DBL = 1 << 16; + var TWO_PWR_24_DBL = 1 << 24; + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + /** A cache of the Long representations of small integer values. */ + var INT_CACHE = {}; + /** A cache of the Long representations of small unsigned integer values. */ + var UINT_CACHE = {}; + /** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ + var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + Long.isLong = function (value) { + return isObjectLike(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + // eslint-disable-next-line @typescript-eslint/no-this-alias + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"".concat(this.toString(), "\"").concat(this.unsigned ? ', true' : '', ")"); + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; + }()); + Object.defineProperty(Long.prototype, '__isLong__', { value: true }); + Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); + + var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; + var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; + var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; + var EXPONENT_MAX = 6111; + var EXPONENT_MIN = -6176; + var EXPONENT_BIAS = 6176; + var MAX_DIGITS = 34; + // Nan value bits as 32 bit values (due to lack of longs) + var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + // Infinity value bits 32 bit values (due to lack of longs) + var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + var EXPONENT_REGEX = /^([-+])?(\d+)?$/; + // Extract least significant 5 bits + var COMBINATION_MASK = 0x1f; + // Extract least significant 14 bits + var EXPONENT_MASK = 0x3fff; + // Value of combination field for Inf + var COMBINATION_INFINITY = 30; + // Value of combination field for NaN + var COMBINATION_NAN = 31; + // Detect if the value is a digit + function isDigit(value) { + return !isNaN(parseInt(value, 10)); + } + // Divide two uint128 values + function divideu128(value) { + var DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + var _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; + } + // Multiply two Long values and return the 128 bit value + function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; + } + function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; + } + function invalidErr(string, message) { + throw new BSONTypeError("\"".concat(string, "\" is not a valid Decimal128 string - ").concat(message)); + } + /** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ + var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new Long(0, 0); + // The low 17 digits of the significand + var significandLow = new Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(buffer_1.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = buffer_1.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("".concat(0)); + if (exponent > 0) + string.push("E+".concat(exponent)); + else if (exponent < 0) + string.push("E".concat(exponent)); + return string.join(''); + } + string.push("".concat(significand[index++])); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push("+".concat(scientific_exponent)); + } + else { + string.push("".concat(scientific_exponent)); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("".concat(significand[index++])); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("".concat(significand[index++])); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"".concat(this.toString(), "\")"); + }; + return Decimal128; + }()); + Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); + + /** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ + var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + return { $numberDouble: "-".concat(this.value.toFixed(1)) }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(".concat(eJSON.$numberDouble, ")"); + }; + return Double; + }()); + Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); + + /** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ + var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(".concat(this.valueOf(), ")"); + }; + return Int32; + }()); + Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); + + /** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ + var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; + }()); + Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); + + /** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ + var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; + }()); + Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); + + // Regular expression that checks for hex value + var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); + // Unique sequence for the current process (initialized on first use) + var PROCESS_UNIQUE = null; + var kId = Symbol('id'); + /** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ + var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = buffer_1.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof buffer_1 ? workingId : ensureBuffer(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = buffer_1.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = buffer_1.from(workingId, 'hex'); + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = buffer_1.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id)) { + return otherId === buffer_1.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return buffer_1.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = buffer_1.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(buffer_1.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"".concat(this.toHexString(), "\")"); + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; + }()); + // Deprecated methods + Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') + }); + Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); + + function alphabetize(str) { + return str.split('').sort().join(''); + } + /** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ + var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern))); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options))); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError("The regular expression option [".concat(this.options[i], "] is not supported")); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONTypeError("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(doc))); + }; + return BSONRegExp; + }()); + Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); + + /** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ + var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"".concat(this.value, "\")"); + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; + }()); + Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); + + /** @public */ + var LongWithoutOverridesClass = Long; + /** + * @public + * @category BSONType + * */ + var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: ".concat(this.getHighBits(), ", i: ").concat(this.getLowBits(), " })"); + }; + Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + return Timestamp; + }(LongWithoutOverridesClass)); + + function isBSONType(value) { + return (isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); + } + // INT32 boundaries + var BSON_INT32_MAX = 0x7fffffff; + var BSON_INT32_MIN = -0x80000000; + // INT64 boundaries + // const BSON_INT64_MAX = 0x7fffffffffffffff; // TODO(NODE-4377): This number cannot be precisely represented in JS + var BSON_INT64_MAX = 0x8000000000000000; + var BSON_INT64_MIN = -0x8000000000000000; + // all the types where we don't need to do any special processing and can just pass the EJSON + //straight to type.fromExtendedJSON + var keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) + return new Int32(value); + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) + return Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return DBRef.fromExtendedJSON(v); + } + return value; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index ".concat(index), obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); + } + function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONTypeError('Converting circular structure to EJSON:\n' + + " ".concat(leadingPart).concat(alreadySeen).concat(circularPart).concat(current, "\n") + + " ".concat(leadingSpace, "\\").concat(dashes, "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || isDate(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN && value <= BSON_INT32_MAX, int64Range = value >= BSON_INT64_MIN && value <= BSON_INT64_MAX; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || isRegExp(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; + } + var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new Binary(o.value(), o.sub_type); }, + Code: function (o) { return new Code(o.code, o.scope); }, + DBRef: function (o) { return new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new Decimal128(o.bytes); }, + Double: function (o) { return new Double(o.value); }, + Int32: function (o) { return new Int32(o.value); }, + Long: function (o) { + return Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new MaxKey(); }, + MinKey: function () { return new MinKey(); }, + ObjectID: function (o) { return new ObjectId(o); }, + ObjectId: function (o) { return new ObjectId(o); }, + BSONRegExp: function (o) { return new BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new BSONSymbol(o.value); }, + Timestamp: function (o) { return Timestamp.fromBits(o.low, o.high); } + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + var value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } + } + /** + * EJSON parse / stringify API + * @public + */ + // the namespace here is used to emulate `export * as EJSON from '...'` + // which as of now (sept 2020) api-extractor does not support + // eslint-disable-next-line @typescript-eslint/no-namespace + exports.EJSON = void 0; + (function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new BSONError("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(key))); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; + })(exports.EJSON || (exports.EJSON = {})); + + /* eslint-disable @typescript-eslint/no-explicit-any */ + /** @public */ + exports.Map = void 0; + var bsonGlobal = getGlobal(); + if (bsonGlobal.Map) { + exports.Map = bsonGlobal.Map; + } + else { + // We will return a polyfill + exports.Map = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); + } + + function calculateObjectSize$1(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; + } + /** @internal */ + function calculateElement(name, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + buffer_1.byteLength(name, 'utf8') + 1 + 4 + buffer_1.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1) { + // 32 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + var binary = value; + // Check what kind of subtype we have + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + (binary.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (binary.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + buffer_1.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize$1(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || isRegExp(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.pattern, 'utf8') + + 1 + + buffer_1.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize$1(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1); + } + } + } + return 0; + } + + var FIRST_BIT = 0x80; + var FIRST_TWO_BITS = 0xc0; + var FIRST_THREE_BITS = 0xe0; + var FIRST_FOUR_BITS = 0xf0; + var FIRST_FIVE_BITS = 0xf8; + var TWO_BIT_CHAR = 0xc0; + var THREE_BIT_CHAR = 0xe0; + var FOUR_BIT_CHAR = 0xf0; + var CONTINUING_CHAR = 0x80; + /** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ + function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; + } + + // Internal long versions + var JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); + var JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); + var functionCache = {}; + function deserialize$1(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new BSONError("bson size must be >= 5, is ".concat(size)); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError("buffer length ".concat(buffer.length, " must be >= bson size ").concat(size)); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError("buffer length ".concat(buffer.length, " must === bson size ").concat(size)); + } + if (size + index > buffer.byteLength) { + throw new BSONError("(bson size ".concat(size, " + options.index ").concat(index, " must be <= buffer length ").concat(buffer.byteLength, ")")); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); + } + var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; + function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + var dataview = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength); + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + var oid = buffer_1.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(dataview.getFloat64(index, true)); + index = index + 8; + } + else if (elementType === BSON_DATA_NUMBER) { + value = dataview.getFloat64(index, true); + index = index + 8; + } + else if (elementType === BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = _assign(_assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = _assign(_assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new BSONError('corrupted array bson'); + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = buffer_1.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW) { + value = value.toUUID(); + } + } + } + else { + var _buffer = buffer_1.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else if (subType === BSON_BINARY_SUBTYPE_UUID_NEW) { + value = new Binary(buffer.slice(index, index + binarySize), subType).toUUID(); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Timestamp(lowBits, highBits); + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new Code(functionString, scopeObject); + } + } + else if (elementType === BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = buffer_1.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } + else { + throw new BSONError("Detected unknown BSON type ".concat(elementType.toString(16), " for fieldname \"").concat(name, "\"")); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if (isDBRefLike(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; + } + /** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ + function isolateEval(functionString, functionCache, object) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); + } + function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; + } + + var regexp = /\x00/; // eslint-disable-line no-control-regex + var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); + /* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ + function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; + } + var SPACE_FOR_FLOAT64 = new Uint8Array(8); + var DV_FOR_FLOAT64 = new DataView(SPACE_FOR_FLOAT64.buffer, SPACE_FOR_FLOAT64.byteOffset, SPACE_FOR_FLOAT64.byteLength); + function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= BSON_INT32_MIN$1 && + value <= BSON_INT32_MAX$1) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + } + return index; + } + function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; + } + function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; + } + function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; + } + function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; + } + function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; + } + function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; + } + function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; + } + function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; + } + function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; + } + function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; + } + function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; + } + function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; + } + function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value.value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + return index; + } + function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = normalizedFunctionString(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; + } + function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; + } + function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; + } + function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; + } + function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; + } + function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = "".concat(i); + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else if (object instanceof exports.Map || isMap(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; + } + + /** @internal */ + // Default Max Size + var MAXSIZE = 1024 * 1024 * 17; + // Current Internal Temporary Serialization Buffer + var buffer = buffer_1.alloc(MAXSIZE); + /** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ + function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = buffer_1.alloc(size); + } + } + /** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ + function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = buffer_1.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = buffer_1.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; + } + /** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ + function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; + } + /** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ + function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return deserialize$1(buffer instanceof buffer_1 ? buffer : ensureBuffer(buffer), options); + } + /** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ + function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return calculateObjectSize$1(object, serializeFunctions, ignoreUndefined); + } + /** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ + function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = ensureBuffer(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = deserialize$1(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; + } + /** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ + var BSON = { + Binary: Binary, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + Int32: Int32, + Long: Long, + UUID: UUID, + Map: exports.Map, + MaxKey: MaxKey, + MinKey: MinKey, + ObjectId: ObjectId, + ObjectID: ObjectId, + BSONRegExp: BSONRegExp, + BSONSymbol: BSONSymbol, + Timestamp: Timestamp, + EJSON: exports.EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: BSONError, + BSONTypeError: BSONTypeError + }; + + exports.BSONError = BSONError; + exports.BSONRegExp = BSONRegExp; + exports.BSONSymbol = BSONSymbol; + exports.BSONTypeError = BSONTypeError; + exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = BSON_BINARY_SUBTYPE_BYTE_ARRAY; + exports.BSON_BINARY_SUBTYPE_COLUMN = BSON_BINARY_SUBTYPE_COLUMN; + exports.BSON_BINARY_SUBTYPE_DEFAULT = BSON_BINARY_SUBTYPE_DEFAULT; + exports.BSON_BINARY_SUBTYPE_ENCRYPTED = BSON_BINARY_SUBTYPE_ENCRYPTED; + exports.BSON_BINARY_SUBTYPE_FUNCTION = BSON_BINARY_SUBTYPE_FUNCTION; + exports.BSON_BINARY_SUBTYPE_MD5 = BSON_BINARY_SUBTYPE_MD5; + exports.BSON_BINARY_SUBTYPE_USER_DEFINED = BSON_BINARY_SUBTYPE_USER_DEFINED; + exports.BSON_BINARY_SUBTYPE_UUID = BSON_BINARY_SUBTYPE_UUID; + exports.BSON_BINARY_SUBTYPE_UUID_NEW = BSON_BINARY_SUBTYPE_UUID_NEW; + exports.BSON_DATA_ARRAY = BSON_DATA_ARRAY; + exports.BSON_DATA_BINARY = BSON_DATA_BINARY; + exports.BSON_DATA_BOOLEAN = BSON_DATA_BOOLEAN; + exports.BSON_DATA_CODE = BSON_DATA_CODE; + exports.BSON_DATA_CODE_W_SCOPE = BSON_DATA_CODE_W_SCOPE; + exports.BSON_DATA_DATE = BSON_DATA_DATE; + exports.BSON_DATA_DBPOINTER = BSON_DATA_DBPOINTER; + exports.BSON_DATA_DECIMAL128 = BSON_DATA_DECIMAL128; + exports.BSON_DATA_INT = BSON_DATA_INT; + exports.BSON_DATA_LONG = BSON_DATA_LONG; + exports.BSON_DATA_MAX_KEY = BSON_DATA_MAX_KEY; + exports.BSON_DATA_MIN_KEY = BSON_DATA_MIN_KEY; + exports.BSON_DATA_NULL = BSON_DATA_NULL; + exports.BSON_DATA_NUMBER = BSON_DATA_NUMBER; + exports.BSON_DATA_OBJECT = BSON_DATA_OBJECT; + exports.BSON_DATA_OID = BSON_DATA_OID; + exports.BSON_DATA_REGEXP = BSON_DATA_REGEXP; + exports.BSON_DATA_STRING = BSON_DATA_STRING; + exports.BSON_DATA_SYMBOL = BSON_DATA_SYMBOL; + exports.BSON_DATA_TIMESTAMP = BSON_DATA_TIMESTAMP; + exports.BSON_DATA_UNDEFINED = BSON_DATA_UNDEFINED; + exports.BSON_INT32_MAX = BSON_INT32_MAX$1; + exports.BSON_INT32_MIN = BSON_INT32_MIN$1; + exports.BSON_INT64_MAX = BSON_INT64_MAX$1; + exports.BSON_INT64_MIN = BSON_INT64_MIN$1; + exports.Binary = Binary; + exports.Code = Code; + exports.DBRef = DBRef; + exports.Decimal128 = Decimal128; + exports.Double = Double; + exports.Int32 = Int32; + exports.Long = Long; + exports.LongWithoutOverridesClass = LongWithoutOverridesClass; + exports.MaxKey = MaxKey; + exports.MinKey = MinKey; + exports.ObjectID = ObjectId; + exports.ObjectId = ObjectId; + exports.Timestamp = Timestamp; + exports.UUID = UUID; + exports.calculateObjectSize = calculateObjectSize; + exports.default = BSON; + exports.deserialize = deserialize; + exports.deserializeStream = deserializeStream; + exports.serialize = serialize; + exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex; + exports.setInternalBufferSize = setInternalBufferSize; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=bson.browser.umd.js.map diff --git a/server/node_modules/bson/dist/bson.browser.umd.js.map b/server/node_modules/bson/dist/bson.browser.umd.js.map new file mode 100644 index 0000000000..ef7d7fe7a3 --- /dev/null +++ b/server/node_modules/bson/dist/bson.browser.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.browser.umd.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../node_modules/tslib/tslib.es6.js","../src/error.ts","../src/utils/global.ts","../src/parser/utils.ts","../src/ensure_buffer.ts","../src/uuid_utils.ts","../src/constants.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/extended_json.ts","../src/map.ts","../src/parser/calculate_size.ts","../src/validate_utf8.ts","../src/parser/deserializer.ts","../src/parser/serializer.ts","../src/bson.ts"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["byteLength","toByteArray","fromByteArray","lookup","revLookup","Arr","Uint8Array","Array","code","i","len","length","charCodeAt","getLens","b64","Error","validLen","indexOf","placeHoldersLen","lens","_byteLength","tmp","arr","curByte","tripletToBase64","num","encodeChunk","uint8","start","end","output","push","join","extraBytes","parts","maxChunkLength","len2","buffer","offset","isLE","mLen","nBytes","e","m","eLen","eMax","eBias","nBits","d","s","NaN","Infinity","Math","pow","value","c","rt","abs","isNaN","floor","log","LN2","customInspectSymbol","Symbol","exports","Buffer","SlowBuffer","K_MAX_LENGTH","TYPED_ARRAY_SUPPORT","typedArraySupport","console","error","proto","foo","Object","setPrototypeOf","prototype","defineProperty","enumerable","get","isBuffer","undefined","byteOffset","createBuffer","RangeError","buf","arg","encodingOrOffset","TypeError","allocUnsafe","from","poolSize","fromString","ArrayBuffer","isView","fromArrayView","isInstance","fromArrayBuffer","SharedArrayBuffer","valueOf","b","fromObject","toPrimitive","assertSize","size","alloc","fill","encoding","checked","allocUnsafeSlow","string","isEncoding","actual","write","slice","fromArrayLike","array","arrayView","copy","obj","numberIsNaN","type","isArray","data","toString","_isBuffer","compare","a","x","y","min","String","toLowerCase","concat","list","pos","set","call","mustMatch","arguments","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","swap16","swap32","swap64","apply","toLocaleString","equals","inspect","str","max","INSPECT_MAX_BYTES","replace","trim","target","thisStart","thisEnd","thisCopy","targetCopy","bidirectionalIndexOf","val","dir","arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","read","readUInt16BE","foundIndex","found","j","includes","hexWrite","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","asciiToBytes","base64Write","ucs2Write","utf16leToBytes","isFinite","toJSON","_arr","base64","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","MAX_ARGUMENTS_LENGTH","codePoints","fromCharCode","ret","out","hexSliceLookupTable","bytes","newBuf","subarray","checkOffset","ext","readUintLE","readUIntLE","noAssert","mul","readUintBE","readUIntBE","readUint8","readUInt8","readUint16LE","readUInt16LE","readUint16BE","readUint32LE","readUInt32LE","readUint32BE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","ieee754","readFloatBE","readDoubleLE","readDoubleBE","checkInt","writeUintLE","writeUIntLE","maxBytes","writeUintBE","writeUIntBE","writeUint8","writeUInt8","writeUint16LE","writeUInt16LE","writeUint16BE","writeUInt16BE","writeUint32LE","writeUInt32LE","writeUint32BE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","checkIEEE754","writeFloat","littleEndian","writeFloatLE","writeFloatBE","writeDouble","writeDoubleLE","writeDoubleBE","targetStart","copyWithin","INVALID_BASE64_RE","base64clean","split","units","leadSurrogate","byteArray","hi","lo","src","dst","constructor","name","alphabet","table","i16","extendStatics","__proto__","p","hasOwnProperty","__extends","__","create","__assign","assign","t","BSON_INT32_MAX","BSON_INT32_MIN","BSON_INT64_MAX","BSON_INT64_MIN","EJSON","bsonMap","calculateObjectSize","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","deserialize","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_BINARY_SUBTYPE_UUID_NEW","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT","Map","internalSerialize","internalDeserialize","internalCalculateObjectSize"],"mappings":";;;;;;;;;;CAEA,gBAAkB,GAAGA,UAArB;CACA,iBAAmB,GAAGC,WAAtB;CACA,mBAAqB,GAAGC,aAAxB;CAEA,IAAIC,MAAM,GAAG,EAAb;CACA,IAAIC,SAAS,GAAG,EAAhB;CACA,IAAIC,GAAG,GAAG,OAAOC,UAAP,KAAsB,WAAtB,GAAoCA,UAApC,GAAiDC,KAA3D;CAEA,IAAIC,IAAI,GAAG,kEAAX;;CACA,KAAK,IAAIC,CAAC,GAAG,CAAR,EAAWC,GAAG,GAAGF,IAAI,CAACG,MAA3B,EAAmCF,CAAC,GAAGC,GAAvC,EAA4C,EAAED,CAA9C,EAAiD;CAC/CN,EAAAA,MAAM,CAACM,CAAD,CAAN,GAAYD,IAAI,CAACC,CAAD,CAAhB;CACAL,EAAAA,SAAS,CAACI,IAAI,CAACI,UAAL,CAAgBH,CAAhB,CAAD,CAAT,GAAgCA,CAAhC;CACD;CAGD;;;CACAL,SAAS,CAAC,IAAIQ,UAAJ,CAAe,CAAf,CAAD,CAAT,GAA+B,EAA/B;CACAR,SAAS,CAAC,IAAIQ,UAAJ,CAAe,CAAf,CAAD,CAAT,GAA+B,EAA/B;;CAEA,SAASC,OAAT,CAAkBC,GAAlB,EAAuB;CACrB,MAAIJ,GAAG,GAAGI,GAAG,CAACH,MAAd;;CAEA,MAAID,GAAG,GAAG,CAAN,GAAU,CAAd,EAAiB;CACf,UAAM,IAAIK,KAAJ,CAAU,gDAAV,CAAN;CACD,GALoB;;;;CASrB,MAAIC,QAAQ,GAAGF,GAAG,CAACG,OAAJ,CAAY,GAAZ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js new file mode 100644 index 0000000000..63089c410b --- /dev/null +++ b/server/node_modules/bson/dist/bson.bundle.js @@ -0,0 +1,7528 @@ +var BSON = (function (exports) { + 'use strict'; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var byteLength_1 = byteLength; + var toByteArray_1 = toByteArray; + var fromByteArray_1 = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + + + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + + function getLens(b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + + + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } // base64 is 4/3 + up to two characters of the original data + + + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars + + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + + for (i = 0; i < len; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = tmp >> 16 & 0xFF; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr; + } + + function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; + } + + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + + return output.join(''); + } + + function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } // pad the end with zeros, but make sure to not forget the extra bytes + + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '=='); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '='); + } + + return parts.join(''); + } + + var base64Js = { + byteLength: byteLength_1, + toByteArray: toByteArray_1, + fromByteArray: fromByteArray_1 + }; + + /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + var read = function read(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + + var write = function write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = e << mLen | m; + eLen += mLen; + + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + }; + + var ieee754 = { + read: read, + write: write + }; + + var buffer$1 = createCommonjsModule(function (module, exports) { + + var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? // eslint-disable-line dot-notation + Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { + console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); + } + + function typedArraySupport() { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1); + var proto = { + foo: function foo() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + } + }); + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + } + }); + + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } // Return an augmented `Uint8Array` instance + + + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + + function Buffer(arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + + return allocUnsafe(arg); + } + + return from(arg, encodingOrOffset, length); + } + + Buffer.poolSize = 8192; // not used by this implementation + + function from(value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset); + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + + if (value == null) { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + + var valueOf = value.valueOf && value.valueOf(); + + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + + var b = fromObject(value); + if (b) return b; + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); + } + + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + + + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + + + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + + function alloc(size, fill, encoding) { + assertSize(size); + + if (size <= 0) { + return createBuffer(size); + } + + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + + return createBuffer(size); + } + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + + + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + + + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + + + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + + function fromString(string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + + return buf; + } + + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + + return buf; + } + + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + + return fromArrayLike(arrayView); + } + + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + + var buf; + + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } // Return an augmented `Uint8Array` instance + + + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + + if (buf.length === 0) { + return buf; + } + + obj.copy(buf, 0, 0, len); + return buf; + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0); + } + + return fromArrayLike(obj); + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + + function checked(length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes'); + } + + return length | 0; + } + + function SlowBuffer(length) { + if (+length != length) { + // eslint-disable-line eqeqeq + length = 0; + } + + return Buffer.alloc(+length); + } + + Buffer.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false + }; + + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + + if (a === b) return 0; + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true; + + default: + return false; + } + }; + + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + + if (list.length === 0) { + return Buffer.alloc(0); + } + + var i; + + if (length === undefined) { + length = 0; + + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + + pos += buf.length; + } + + return buffer; + }; + + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + + if (typeof string !== 'string') { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + babelHelpers["typeof"](string)); + } + + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; // Use a for loop to avoid recursion + + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len; + + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length; + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2; + + case 'hex': + return len >>> 1; + + case 'base64': + return base64ToBytes(string).length; + + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8 + } + + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + + Buffer.byteLength = byteLength; + + function slowToString(encoding, start, end) { + var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + + if (start === undefined || start < 0) { + start = 0; + } // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + + + if (start > this.length) { + return ''; + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return ''; + } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + + + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return ''; + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end); + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end); + + case 'ascii': + return asciiSlice(this, start, end); + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end); + + case 'base64': + return base64Slice(this, start, end); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + + + Buffer.prototype._isBuffer = true; + + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits'); + } + + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + + return this; + }; + + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + + return this; + }; + + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits'); + } + + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + + return this; + }; + + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ''; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + + Buffer.prototype.inspect = function inspect() { + var str = ''; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return ''; + }; + + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + + if (!Buffer.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + babelHelpers["typeof"](target)); + } + + if (start === undefined) { + start = 0; + } + + if (end === undefined) { + end = target ? target.length : 0; + } + + if (thisStart === undefined) { + thisStart = 0; + } + + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index'); + } + + if (thisStart >= thisEnd && start >= end) { + return 0; + } + + if (thisStart >= thisEnd) { + return -1; + } + + if (start >= end) { + return 1; + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + + + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1; // Normalize byteOffset + + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000; + } + + byteOffset = +byteOffset; // Coerce to Number. + + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : buffer.length - 1; + } // Normalize byteOffset: negative offsets start from the end of the buffer + + + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + + if (byteOffset >= buffer.length) { + if (dir) return -1;else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0;else return -1; + } // Normalize val + + + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } // Finally, search either indexOf (if dir is true) or lastIndexOf + + + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1; + } + + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + + throw new TypeError('val must be string, number or Buffer'); + } + + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + + if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1; + } + + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + + var i; + + if (dir) { + var foundIndex = -1; + + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + + for (i = byteOffset; i >= 0; i--) { + var found = true; + + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + + if (found) return i; + } + } + + return -1; + } + + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + + if (!length) { + length = remaining; + } else { + length = Number(length); + + if (length > remaining) { + length = remaining; + } + } + + var strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + + return i; + } + + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + + Buffer.prototype.write = function write(string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); + } + + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds'); + } + + if (!encoding) encoding = 'utf8'; + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length); + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length); + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length); + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64Js.fromByteArray(buf); + } else { + return base64Js.fromByteArray(buf.slice(start, end)); + } + } + + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + + break; + + case 2: + secondByte = buf[i + 1]; + + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; + + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + + break; + + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; + + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + + break; + + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; + + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res); + } // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + + + var MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); // avoid extra slice() + } // Decode in chunks to avoid "call stack size exceeded". + + + var res = ''; + var i = 0; + + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + + return res; + } + + function asciiSlice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + + return ret; + } + + function latin1Slice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + + return ret; + } + + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ''; + + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + + return out; + } + + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + + return res; + } + + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + var newBuf = this.subarray(start, end); // Return an augmented `Uint8Array` instance + + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + + + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); + } + + Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val; + }; + + Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + var val = this[offset + --byteLength]; + var mul = 1; + + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val; + }; + + Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + + Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + + Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + + Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; + }; + + Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return this[offset]; + return (0xff - this[offset] + 1) * -1; + }; + + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + } + + Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var mul = 1; + var i = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); + if (value < 0) value = 0xff + value + 1; + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + if (offset < 0) throw new RangeError('Index out of range'); + } + + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + + + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done + + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions + + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds'); + } + + if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); + if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob? + + if (end > this.length) end = this.length; + + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + var len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + + return len; + }; // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + + + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + if (val.length === 1) { + var code = val.charCodeAt(0); + + if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } // Invalid ranges are not set to a default, so can range check early. + + + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index'); + } + + if (end <= start) { + return this; + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); + var len = bytes.length; + + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this; + }; // HELPER FUNCTIONS + // ================ + + + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean(str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; // Node strips out invalid characters like \n and \t from the string, base64-js does not + + str = str.trim().replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to '' + + if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + + while (str.length % 4 !== 0) { + str = str + '='; + } + + return str; + } + + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); // is surrogate component + + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } // valid lead + + + leadSurrogate = codePoint; + continue; + } // 2 leads in a row + + + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue; + } // valid surrogate pair + + + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; // encode utf8 + + if (codePoint < 0x80) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break; + bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break; + bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break; + bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else { + throw new Error('Invalid code point'); + } + } + + return bytes; + } + + function asciiToBytes(str) { + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + + return byteArray; + } + + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray; + } + + function base64ToBytes(str) { + return base64Js.toByteArray(base64clean(str)); + } + + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + + return i; + } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + + + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + + function numberIsNaN(obj) { + // For IE11 support + return obj !== obj; // eslint-disable-line no-self-compare + } // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + + + var hexSliceLookupTable = function () { + var alphabet = '0123456789abcdef'; + var table = new Array(256); + + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + + return table; + }(); + }); + var buffer_1 = buffer$1.Buffer; + buffer$1.SlowBuffer; + buffer$1.INSPECT_MAX_BYTES; + buffer$1.kMaxLength; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + + /* global Reflect, Promise */ + var _extendStatics = function extendStatics(d, b) { + _extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + + return _extendStatics(d, b); + }; + + function __extends(d, b) { + _extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var _assign = function __assign() { + _assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + } + + return t; + }; + + return _assign.apply(this, arguments); + }; + + /** @public */ + var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; + }(Error)); + /** @public */ + var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; + }(TypeError)); + + function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; + } + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + function getGlobal() { + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + // eslint-disable-next-line @typescript-eslint/no-implied-eval + Function('return this')()); + } + + /** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ + function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); + } + function isReactNative() { + var g = getGlobal(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; + } + var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = buffer_1.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; + }; + var detectRandomBytes = function () { + { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + var target_1 = window.crypto || window.msCrypto; // allow for IE11 + if (target_1 && target_1.getRandomValues) { + return function (size) { return target_1.getRandomValues(buffer_1.alloc(size)); }; + } + } + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return function (size) { return global.crypto.getRandomValues(buffer_1.alloc(size)); }; + } + return insecureRandomBytes; + } + }; + var randomBytes = detectRandomBytes(); + function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); + } + function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; + } + function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; + } + function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; + } + function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; + } + function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; + } + // To ensure that 0.4 of node works correctly + function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; + } + /** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ + function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; + } + function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; + } + + /** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ + function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return buffer_1.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if (isAnyArrayBuffer(potentialBuffer)) { + return buffer_1.from(potentialBuffer); + } + throw new BSONTypeError('Must use either Buffer or TypedArray'); + } + + // Validation regex for v4 uuid (validates with or without dashes) + var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; + var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); + }; + var uuidHexStringToBuffer = function (hexString) { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return buffer_1.from(sanitizedHexString, 'hex'); + }; + var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); + }; + + /** @internal */ + var BSON_INT32_MAX$1 = 0x7fffffff; + /** @internal */ + var BSON_INT32_MIN$1 = -0x80000000; + /** @internal */ + var BSON_INT64_MAX$1 = Math.pow(2, 63) - 1; + /** @internal */ + var BSON_INT64_MIN$1 = -Math.pow(2, 63); + /** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ + var JS_INT_MAX = Math.pow(2, 53); + /** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ + var JS_INT_MIN = -Math.pow(2, 53); + /** Number BSON Type @internal */ + var BSON_DATA_NUMBER = 1; + /** String BSON Type @internal */ + var BSON_DATA_STRING = 2; + /** Object BSON Type @internal */ + var BSON_DATA_OBJECT = 3; + /** Array BSON Type @internal */ + var BSON_DATA_ARRAY = 4; + /** Binary BSON Type @internal */ + var BSON_DATA_BINARY = 5; + /** Binary BSON Type @internal */ + var BSON_DATA_UNDEFINED = 6; + /** ObjectId BSON Type @internal */ + var BSON_DATA_OID = 7; + /** Boolean BSON Type @internal */ + var BSON_DATA_BOOLEAN = 8; + /** Date BSON Type @internal */ + var BSON_DATA_DATE = 9; + /** null BSON Type @internal */ + var BSON_DATA_NULL = 10; + /** RegExp BSON Type @internal */ + var BSON_DATA_REGEXP = 11; + /** Code BSON Type @internal */ + var BSON_DATA_DBPOINTER = 12; + /** Code BSON Type @internal */ + var BSON_DATA_CODE = 13; + /** Symbol BSON Type @internal */ + var BSON_DATA_SYMBOL = 14; + /** Code with Scope BSON Type @internal */ + var BSON_DATA_CODE_W_SCOPE = 15; + /** 32 bit Integer BSON Type @internal */ + var BSON_DATA_INT = 16; + /** Timestamp BSON Type @internal */ + var BSON_DATA_TIMESTAMP = 17; + /** Long BSON Type @internal */ + var BSON_DATA_LONG = 18; + /** Decimal128 BSON Type @internal */ + var BSON_DATA_DECIMAL128 = 19; + /** MinKey BSON Type @internal */ + var BSON_DATA_MIN_KEY = 0xff; + /** MaxKey BSON Type @internal */ + var BSON_DATA_MAX_KEY = 0x7f; + /** Binary Default Type @internal */ + var BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Binary Function Type @internal */ + var BSON_BINARY_SUBTYPE_FUNCTION = 1; + /** Binary Byte Array Type @internal */ + var BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; + /** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ + var BSON_BINARY_SUBTYPE_UUID = 3; + /** Binary UUID Type @internal */ + var BSON_BINARY_SUBTYPE_UUID_NEW = 4; + /** Binary MD5 Type @internal */ + var BSON_BINARY_SUBTYPE_MD5 = 5; + /** Encrypted BSON type @internal */ + var BSON_BINARY_SUBTYPE_ENCRYPTED = 6; + /** Column BSON type @internal */ + var BSON_BINARY_SUBTYPE_COLUMN = 7; + /** Binary User Defined Type @internal */ + var BSON_BINARY_SUBTYPE_USER_DEFINED = 128; + + /** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ + var Binary = /** @class */ (function () { + /** + * Create a new Binary instance. + * + * This constructor can accept a string as its first argument. In this case, + * this string will be encoded using ISO-8859-1, **not** using UTF-8. + * This is almost certainly not what you want. Use `new Binary(Buffer.from(string))` + * instead to convert the string to a Buffer using UTF-8 first. + * + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = buffer_1.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = buffer_1.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = buffer_1.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = buffer_1.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = buffer_1.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + throw new BSONError("Binary sub_type \"".concat(this.sub_type, "\" is not supported for converting to UUID. Only \"").concat(Binary.SUBTYPE_UUID, "\" is currently supported.")); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = buffer_1.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = buffer_1.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError("Unexpected Binary Extended JSON format ".concat(JSON.stringify(doc))); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"".concat(asBuffer.toString('hex'), "\", \"hex\"), ").concat(this.sub_type, ")"); + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; + }()); + Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); + var UUID_BYTE_LENGTH = 16; + /** + * A class representation of the BSON UUID type. + * @public + */ + var UUID = /** @class */ (function (_super) { + __extends(UUID, _super); + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + var _this = this; + var bytes; + var hexStr; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = buffer_1.from(input.buffer); + hexStr = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ensureBuffer(input); + } + else if (typeof input === 'string') { + bytes = uuidHexStringToBuffer(input); + } + else { + throw new BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + _this = _super.call(this, bytes, BSON_BINARY_SUBTYPE_UUID_NEW) || this; + _this.__id = hexStr; + return _this; + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this.buffer; + }, + set: function (value) { + this.buffer = value; + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = bufferToUuidHexString(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new Binary(this.id, Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = randomBytes(UUID_BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return buffer_1.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return uuidValidateString(input); + } + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== UUID_BYTE_LENGTH) { + return false; + } + return (input[6] & 0xf0) === 0x40 && (input[8] & 0x80) === 0x80; + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"".concat(this.toHexString(), "\")"); + }; + return UUID; + }(Binary)); + + /** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ + var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"".concat(String(codeJson.code), "\"").concat(codeJson.scope ? ", ".concat(JSON.stringify(codeJson.scope)) : '', ")"); + }; + return Code; + }()); + Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); + + /** @internal */ + function isDBRefLike(value) { + return (isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); + } + /** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ + var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"".concat(this.namespace, "\", new ObjectId(\"").concat(String(oid), "\")").concat(this.db ? ", \"".concat(this.db, "\"") : '', ")"); + }; + return DBRef; + }()); + Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); + + /** + * wasm optimizations, to do native i64 multiplication and divide + */ + var wasm = undefined; + try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; + } + catch (_a) { + // no wasm support + } + var TWO_PWR_16_DBL = 1 << 16; + var TWO_PWR_24_DBL = 1 << 24; + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + /** A cache of the Long representations of small integer values. */ + var INT_CACHE = {}; + /** A cache of the Long representations of small unsigned integer values. */ + var UINT_CACHE = {}; + /** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ + var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + Long.isLong = function (value) { + return isObjectLike(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + // eslint-disable-next-line @typescript-eslint/no-this-alias + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"".concat(this.toString(), "\"").concat(this.unsigned ? ', true' : '', ")"); + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; + }()); + Object.defineProperty(Long.prototype, '__isLong__', { value: true }); + Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); + + var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; + var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; + var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; + var EXPONENT_MAX = 6111; + var EXPONENT_MIN = -6176; + var EXPONENT_BIAS = 6176; + var MAX_DIGITS = 34; + // Nan value bits as 32 bit values (due to lack of longs) + var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + // Infinity value bits 32 bit values (due to lack of longs) + var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + var EXPONENT_REGEX = /^([-+])?(\d+)?$/; + // Extract least significant 5 bits + var COMBINATION_MASK = 0x1f; + // Extract least significant 14 bits + var EXPONENT_MASK = 0x3fff; + // Value of combination field for Inf + var COMBINATION_INFINITY = 30; + // Value of combination field for NaN + var COMBINATION_NAN = 31; + // Detect if the value is a digit + function isDigit(value) { + return !isNaN(parseInt(value, 10)); + } + // Divide two uint128 values + function divideu128(value) { + var DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + var _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; + } + // Multiply two Long values and return the 128 bit value + function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; + } + function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; + } + function invalidErr(string, message) { + throw new BSONTypeError("\"".concat(string, "\" is not a valid Decimal128 string - ").concat(message)); + } + /** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ + var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new Long(0, 0); + // The low 17 digits of the significand + var significandLow = new Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(buffer_1.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = buffer_1.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("".concat(0)); + if (exponent > 0) + string.push("E+".concat(exponent)); + else if (exponent < 0) + string.push("E".concat(exponent)); + return string.join(''); + } + string.push("".concat(significand[index++])); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push("+".concat(scientific_exponent)); + } + else { + string.push("".concat(scientific_exponent)); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("".concat(significand[index++])); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("".concat(significand[index++])); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"".concat(this.toString(), "\")"); + }; + return Decimal128; + }()); + Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); + + /** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ + var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + return { $numberDouble: "-".concat(this.value.toFixed(1)) }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(".concat(eJSON.$numberDouble, ")"); + }; + return Double; + }()); + Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); + + /** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ + var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(".concat(this.valueOf(), ")"); + }; + return Int32; + }()); + Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); + + /** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ + var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; + }()); + Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); + + /** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ + var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; + }()); + Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); + + // Regular expression that checks for hex value + var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); + // Unique sequence for the current process (initialized on first use) + var PROCESS_UNIQUE = null; + var kId = Symbol('id'); + /** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ + var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = buffer_1.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof buffer_1 ? workingId : ensureBuffer(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = buffer_1.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = buffer_1.from(workingId, 'hex'); + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = buffer_1.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id)) { + return otherId === buffer_1.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return buffer_1.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = buffer_1.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(buffer_1.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"".concat(this.toHexString(), "\")"); + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; + }()); + // Deprecated methods + Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') + }); + Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); + + function alphabetize(str) { + return str.split('').sort().join(''); + } + /** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ + var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern))); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options))); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError("The regular expression option [".concat(this.options[i], "] is not supported")); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONTypeError("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(doc))); + }; + return BSONRegExp; + }()); + Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); + + /** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ + var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"".concat(this.value, "\")"); + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; + }()); + Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); + + /** @public */ + var LongWithoutOverridesClass = Long; + /** + * @public + * @category BSONType + * */ + var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: ".concat(this.getHighBits(), ", i: ").concat(this.getLowBits(), " })"); + }; + Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + return Timestamp; + }(LongWithoutOverridesClass)); + + function isBSONType(value) { + return (isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); + } + // INT32 boundaries + var BSON_INT32_MAX = 0x7fffffff; + var BSON_INT32_MIN = -0x80000000; + // INT64 boundaries + // const BSON_INT64_MAX = 0x7fffffffffffffff; // TODO(NODE-4377): This number cannot be precisely represented in JS + var BSON_INT64_MAX = 0x8000000000000000; + var BSON_INT64_MIN = -0x8000000000000000; + // all the types where we don't need to do any special processing and can just pass the EJSON + //straight to type.fromExtendedJSON + var keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) + return new Int32(value); + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) + return Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return DBRef.fromExtendedJSON(v); + } + return value; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index ".concat(index), obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); + } + function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONTypeError('Converting circular structure to EJSON:\n' + + " ".concat(leadingPart).concat(alreadySeen).concat(circularPart).concat(current, "\n") + + " ".concat(leadingSpace, "\\").concat(dashes, "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || isDate(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN && value <= BSON_INT32_MAX, int64Range = value >= BSON_INT64_MIN && value <= BSON_INT64_MAX; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || isRegExp(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; + } + var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new Binary(o.value(), o.sub_type); }, + Code: function (o) { return new Code(o.code, o.scope); }, + DBRef: function (o) { return new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new Decimal128(o.bytes); }, + Double: function (o) { return new Double(o.value); }, + Int32: function (o) { return new Int32(o.value); }, + Long: function (o) { + return Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new MaxKey(); }, + MinKey: function () { return new MinKey(); }, + ObjectID: function (o) { return new ObjectId(o); }, + ObjectId: function (o) { return new ObjectId(o); }, + BSONRegExp: function (o) { return new BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new BSONSymbol(o.value); }, + Timestamp: function (o) { return Timestamp.fromBits(o.low, o.high); } + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + var value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } + } + /** + * EJSON parse / stringify API + * @public + */ + // the namespace here is used to emulate `export * as EJSON from '...'` + // which as of now (sept 2020) api-extractor does not support + // eslint-disable-next-line @typescript-eslint/no-namespace + exports.EJSON = void 0; + (function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new BSONError("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(key))); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; + })(exports.EJSON || (exports.EJSON = {})); + + /* eslint-disable @typescript-eslint/no-explicit-any */ + /** @public */ + exports.Map = void 0; + var bsonGlobal = getGlobal(); + if (bsonGlobal.Map) { + exports.Map = bsonGlobal.Map; + } + else { + // We will return a polyfill + exports.Map = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); + } + + function calculateObjectSize$1(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; + } + /** @internal */ + function calculateElement(name, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + buffer_1.byteLength(name, 'utf8') + 1 + 4 + buffer_1.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1) { + // 32 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + var binary = value; + // Check what kind of subtype we have + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + (binary.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (binary.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + buffer_1.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize$1(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || isRegExp(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.pattern, 'utf8') + + 1 + + buffer_1.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize$1(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1); + } + } + } + return 0; + } + + var FIRST_BIT = 0x80; + var FIRST_TWO_BITS = 0xc0; + var FIRST_THREE_BITS = 0xe0; + var FIRST_FOUR_BITS = 0xf0; + var FIRST_FIVE_BITS = 0xf8; + var TWO_BIT_CHAR = 0xc0; + var THREE_BIT_CHAR = 0xe0; + var FOUR_BIT_CHAR = 0xf0; + var CONTINUING_CHAR = 0x80; + /** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ + function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; + } + + // Internal long versions + var JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); + var JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); + var functionCache = {}; + function deserialize$1(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new BSONError("bson size must be >= 5, is ".concat(size)); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError("buffer length ".concat(buffer.length, " must be >= bson size ").concat(size)); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError("buffer length ".concat(buffer.length, " must === bson size ").concat(size)); + } + if (size + index > buffer.byteLength) { + throw new BSONError("(bson size ".concat(size, " + options.index ").concat(index, " must be <= buffer length ").concat(buffer.byteLength, ")")); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); + } + var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; + function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + var dataview = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength); + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + var oid = buffer_1.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(dataview.getFloat64(index, true)); + index = index + 8; + } + else if (elementType === BSON_DATA_NUMBER) { + value = dataview.getFloat64(index, true); + index = index + 8; + } + else if (elementType === BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = _assign(_assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = _assign(_assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new BSONError('corrupted array bson'); + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = buffer_1.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW) { + value = value.toUUID(); + } + } + } + else { + var _buffer = buffer_1.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else if (subType === BSON_BINARY_SUBTYPE_UUID_NEW) { + value = new Binary(buffer.slice(index, index + binarySize), subType).toUUID(); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Timestamp(lowBits, highBits); + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new Code(functionString, scopeObject); + } + } + else if (elementType === BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = buffer_1.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } + else { + throw new BSONError("Detected unknown BSON type ".concat(elementType.toString(16), " for fieldname \"").concat(name, "\"")); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if (isDBRefLike(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; + } + /** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ + function isolateEval(functionString, functionCache, object) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); + } + function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; + } + + var regexp = /\x00/; // eslint-disable-line no-control-regex + var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); + /* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ + function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; + } + var SPACE_FOR_FLOAT64 = new Uint8Array(8); + var DV_FOR_FLOAT64 = new DataView(SPACE_FOR_FLOAT64.buffer, SPACE_FOR_FLOAT64.byteOffset, SPACE_FOR_FLOAT64.byteLength); + function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= BSON_INT32_MIN$1 && + value <= BSON_INT32_MAX$1) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + } + return index; + } + function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; + } + function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; + } + function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; + } + function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; + } + function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; + } + function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; + } + function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; + } + function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; + } + function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; + } + function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; + } + function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; + } + function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; + } + function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value.value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + return index; + } + function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = normalizedFunctionString(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; + } + function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; + } + function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; + } + function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; + } + function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; + } + function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = "".concat(i); + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else if (object instanceof exports.Map || isMap(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; + } + + /** @internal */ + // Default Max Size + var MAXSIZE = 1024 * 1024 * 17; + // Current Internal Temporary Serialization Buffer + var buffer = buffer_1.alloc(MAXSIZE); + /** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ + function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = buffer_1.alloc(size); + } + } + /** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ + function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = buffer_1.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = buffer_1.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; + } + /** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ + function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; + } + /** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ + function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return deserialize$1(buffer instanceof buffer_1 ? buffer : ensureBuffer(buffer), options); + } + /** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ + function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return calculateObjectSize$1(object, serializeFunctions, ignoreUndefined); + } + /** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ + function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = ensureBuffer(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = deserialize$1(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; + } + /** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ + var BSON = { + Binary: Binary, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + Int32: Int32, + Long: Long, + UUID: UUID, + Map: exports.Map, + MaxKey: MaxKey, + MinKey: MinKey, + ObjectId: ObjectId, + ObjectID: ObjectId, + BSONRegExp: BSONRegExp, + BSONSymbol: BSONSymbol, + Timestamp: Timestamp, + EJSON: exports.EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: BSONError, + BSONTypeError: BSONTypeError + }; + + exports.BSONError = BSONError; + exports.BSONRegExp = BSONRegExp; + exports.BSONSymbol = BSONSymbol; + exports.BSONTypeError = BSONTypeError; + exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = BSON_BINARY_SUBTYPE_BYTE_ARRAY; + exports.BSON_BINARY_SUBTYPE_COLUMN = BSON_BINARY_SUBTYPE_COLUMN; + exports.BSON_BINARY_SUBTYPE_DEFAULT = BSON_BINARY_SUBTYPE_DEFAULT; + exports.BSON_BINARY_SUBTYPE_ENCRYPTED = BSON_BINARY_SUBTYPE_ENCRYPTED; + exports.BSON_BINARY_SUBTYPE_FUNCTION = BSON_BINARY_SUBTYPE_FUNCTION; + exports.BSON_BINARY_SUBTYPE_MD5 = BSON_BINARY_SUBTYPE_MD5; + exports.BSON_BINARY_SUBTYPE_USER_DEFINED = BSON_BINARY_SUBTYPE_USER_DEFINED; + exports.BSON_BINARY_SUBTYPE_UUID = BSON_BINARY_SUBTYPE_UUID; + exports.BSON_BINARY_SUBTYPE_UUID_NEW = BSON_BINARY_SUBTYPE_UUID_NEW; + exports.BSON_DATA_ARRAY = BSON_DATA_ARRAY; + exports.BSON_DATA_BINARY = BSON_DATA_BINARY; + exports.BSON_DATA_BOOLEAN = BSON_DATA_BOOLEAN; + exports.BSON_DATA_CODE = BSON_DATA_CODE; + exports.BSON_DATA_CODE_W_SCOPE = BSON_DATA_CODE_W_SCOPE; + exports.BSON_DATA_DATE = BSON_DATA_DATE; + exports.BSON_DATA_DBPOINTER = BSON_DATA_DBPOINTER; + exports.BSON_DATA_DECIMAL128 = BSON_DATA_DECIMAL128; + exports.BSON_DATA_INT = BSON_DATA_INT; + exports.BSON_DATA_LONG = BSON_DATA_LONG; + exports.BSON_DATA_MAX_KEY = BSON_DATA_MAX_KEY; + exports.BSON_DATA_MIN_KEY = BSON_DATA_MIN_KEY; + exports.BSON_DATA_NULL = BSON_DATA_NULL; + exports.BSON_DATA_NUMBER = BSON_DATA_NUMBER; + exports.BSON_DATA_OBJECT = BSON_DATA_OBJECT; + exports.BSON_DATA_OID = BSON_DATA_OID; + exports.BSON_DATA_REGEXP = BSON_DATA_REGEXP; + exports.BSON_DATA_STRING = BSON_DATA_STRING; + exports.BSON_DATA_SYMBOL = BSON_DATA_SYMBOL; + exports.BSON_DATA_TIMESTAMP = BSON_DATA_TIMESTAMP; + exports.BSON_DATA_UNDEFINED = BSON_DATA_UNDEFINED; + exports.BSON_INT32_MAX = BSON_INT32_MAX$1; + exports.BSON_INT32_MIN = BSON_INT32_MIN$1; + exports.BSON_INT64_MAX = BSON_INT64_MAX$1; + exports.BSON_INT64_MIN = BSON_INT64_MIN$1; + exports.Binary = Binary; + exports.Code = Code; + exports.DBRef = DBRef; + exports.Decimal128 = Decimal128; + exports.Double = Double; + exports.Int32 = Int32; + exports.Long = Long; + exports.LongWithoutOverridesClass = LongWithoutOverridesClass; + exports.MaxKey = MaxKey; + exports.MinKey = MinKey; + exports.ObjectID = ObjectId; + exports.ObjectId = ObjectId; + exports.Timestamp = Timestamp; + exports.UUID = UUID; + exports.calculateObjectSize = calculateObjectSize; + exports.default = BSON; + exports.deserialize = deserialize; + exports.deserializeStream = deserializeStream; + exports.serialize = serialize; + exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex; + exports.setInternalBufferSize = setInternalBufferSize; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +}({})); +//# sourceMappingURL=bson.bundle.js.map diff --git a/server/node_modules/bson/dist/bson.bundle.js.map b/server/node_modules/bson/dist/bson.bundle.js.map new file mode 100644 index 0000000000..d15d7a4faa --- /dev/null +++ b/server/node_modules/bson/dist/bson.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.bundle.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../node_modules/tslib/tslib.es6.js","../src/error.ts","../src/utils/global.ts","../src/parser/utils.ts","../src/ensure_buffer.ts","../src/uuid_utils.ts","../src/constants.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/extended_json.ts","../src/map.ts","../src/parser/calculate_size.ts","../src/validate_utf8.ts","../src/parser/deserializer.ts","../src/parser/serializer.ts","../src/bson.ts"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["byteLength","toByteArray","fromByteArray","lookup","revLookup","Arr","Uint8Array","Array","code","i","len","length","charCodeAt","getLens","b64","Error","validLen","indexOf","placeHoldersLen","lens","_byteLength","tmp","arr","curByte","tripletToBase64","num","encodeChunk","uint8","start","end","output","push","join","extraBytes","parts","maxChunkLength","len2","buffer","offset","isLE","mLen","nBytes","e","m","eLen","eMax","eBias","nBits","d","s","NaN","Infinity","Math","pow","value","c","rt","abs","isNaN","floor","log","LN2","customInspectSymbol","Symbol","exports","Buffer","SlowBuffer","K_MAX_LENGTH","TYPED_ARRAY_SUPPORT","typedArraySupport","console","error","proto","foo","Object","setPrototypeOf","prototype","defineProperty","enumerable","get","isBuffer","undefined","byteOffset","createBuffer","RangeError","buf","arg","encodingOrOffset","TypeError","allocUnsafe","from","poolSize","fromString","ArrayBuffer","isView","fromArrayView","isInstance","fromArrayBuffer","SharedArrayBuffer","valueOf","b","fromObject","toPrimitive","assertSize","size","alloc","fill","encoding","checked","allocUnsafeSlow","string","isEncoding","actual","write","slice","fromArrayLike","array","arrayView","copy","obj","numberIsNaN","type","isArray","data","toString","_isBuffer","compare","a","x","y","min","String","toLowerCase","concat","list","pos","set","call","mustMatch","arguments","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","swap16","swap32","swap64","apply","toLocaleString","equals","inspect","str","max","INSPECT_MAX_BYTES","replace","trim","target","thisStart","thisEnd","thisCopy","targetCopy","bidirectionalIndexOf","val","dir","arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","read","readUInt16BE","foundIndex","found","j","includes","hexWrite","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","asciiToBytes","base64Write","ucs2Write","utf16leToBytes","isFinite","toJSON","_arr","base64","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","MAX_ARGUMENTS_LENGTH","codePoints","fromCharCode","ret","out","hexSliceLookupTable","bytes","newBuf","subarray","checkOffset","ext","readUintLE","readUIntLE","noAssert","mul","readUintBE","readUIntBE","readUint8","readUInt8","readUint16LE","readUInt16LE","readUint16BE","readUint32LE","readUInt32LE","readUint32BE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","ieee754","readFloatBE","readDoubleLE","readDoubleBE","checkInt","writeUintLE","writeUIntLE","maxBytes","writeUintBE","writeUIntBE","writeUint8","writeUInt8","writeUint16LE","writeUInt16LE","writeUint16BE","writeUInt16BE","writeUint32LE","writeUInt32LE","writeUint32BE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","checkIEEE754","writeFloat","littleEndian","writeFloatLE","writeFloatBE","writeDouble","writeDoubleLE","writeDoubleBE","targetStart","copyWithin","INVALID_BASE64_RE","base64clean","split","units","leadSurrogate","byteArray","hi","lo","src","dst","constructor","name","alphabet","table","i16","extendStatics","__proto__","p","hasOwnProperty","__extends","__","create","__assign","assign","t","BSON_INT32_MAX","BSON_INT32_MIN","BSON_INT64_MAX","BSON_INT64_MIN","EJSON","bsonMap","calculateObjectSize","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","deserialize","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_BINARY_SUBTYPE_UUID_NEW","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT","Map","internalSerialize","internalDeserialize","internalCalculateObjectSize"],"mappings":";;;;;;;CAEA,gBAAkB,GAAGA,UAArB;CACA,iBAAmB,GAAGC,WAAtB;CACA,mBAAqB,GAAGC,aAAxB;CAEA,IAAIC,MAAM,GAAG,EAAb;CACA,IAAIC,SAAS,GAAG,EAAhB;CACA,IAAIC,GAAG,GAAG,OAAOC,UAAP,KAAsB,WAAtB,GAAoCA,UAApC,GAAiDC,KAA3D;CAEA,IAAIC,IAAI,GAAG,kEAAX;;CACA,KAAK,IAAIC,CAAC,GAAG,CAAR,EAAWC,GAAG,GAAGF,IAAI,CAACG,MAA3B,EAAmCF,CAAC,GAAGC,GAAvC,EAA4C,EAAED,CAA9C,EAAiD;CAC/CN,EAAAA,MAAM,CAACM,CAAD,CAAN,GAAYD,IAAI,CAACC,CAAD,CAAhB;CACAL,EAAAA,SAAS,CAACI,IAAI,CAACI,UAAL,CAAgBH,CAAhB,CAAD,CAAT,GAAgCA,CAAhC;CACD;CAGD;;;CACAL,SAAS,CAAC,IAAIQ,UAAJ,CAAe,CAAf,CAAD,CAAT,GAA+B,EAA/B;CACAR,SAAS,CAAC,IAAIQ,UAAJ,CA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AA;KACrB,SAAS,WAAA;KACT,2BAA2B,6BAAA;KAC3B,WAAW,aAAA;KACX,mBAAmB,qBAAA;KACnB,iBAAiB,mBAAA;KACjB,SAAS,WAAA;KACT,aAAa,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/server/node_modules/bson/dist/bson.esm.js b/server/node_modules/bson/dist/bson.esm.js new file mode 100644 index 0000000000..0ad60867e0 --- /dev/null +++ b/server/node_modules/bson/dist/bson.esm.js @@ -0,0 +1,5428 @@ +import { Buffer } from 'buffer'; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/* global Reflect, Promise */ +var _extendStatics = function extendStatics(d, b) { + _extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + + return _extendStatics(d, b); +}; + +function __extends(d, b) { + _extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var _assign = function __assign() { + _assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + } + + return t; + }; + + return _assign.apply(this, arguments); +}; + +/** @public */ +var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; +}(Error)); +/** @public */ +var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; +}(TypeError)); + +function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; +} +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +function getGlobal() { + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + // eslint-disable-next-line @typescript-eslint/no-implied-eval + Function('return this')()); +} + +/** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ +function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); +} +function isReactNative() { + var g = getGlobal(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; +} +var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = Buffer.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; +}; +var detectRandomBytes = function () { + { + var requiredRandomBytes = void 0; + try { + requiredRandomBytes = require('crypto').randomBytes; + } + catch (e) { + // keep the fallback + } + // NOTE: in transpiled cases the above require might return null/undefined + return requiredRandomBytes || insecureRandomBytes; + } +}; +var randomBytes = detectRandomBytes(); +function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); +} +function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; +} +function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; +} +function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; +} +function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; +} +function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; +} +// To ensure that 0.4 of node works correctly +function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; +} +/** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ +function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; +} +function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; +} + +/** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ +function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if (isAnyArrayBuffer(potentialBuffer)) { + return Buffer.from(potentialBuffer); + } + throw new BSONTypeError('Must use either Buffer or TypedArray'); +} + +// Validation regex for v4 uuid (validates with or without dashes) +var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; +var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); +}; +var uuidHexStringToBuffer = function (hexString) { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return Buffer.from(sanitizedHexString, 'hex'); +}; +var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); +}; + +/** @internal */ +var BSON_INT32_MAX$1 = 0x7fffffff; +/** @internal */ +var BSON_INT32_MIN$1 = -0x80000000; +/** @internal */ +var BSON_INT64_MAX$1 = Math.pow(2, 63) - 1; +/** @internal */ +var BSON_INT64_MIN$1 = -Math.pow(2, 63); +/** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ +var JS_INT_MAX = Math.pow(2, 53); +/** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ +var JS_INT_MIN = -Math.pow(2, 53); +/** Number BSON Type @internal */ +var BSON_DATA_NUMBER = 1; +/** String BSON Type @internal */ +var BSON_DATA_STRING = 2; +/** Object BSON Type @internal */ +var BSON_DATA_OBJECT = 3; +/** Array BSON Type @internal */ +var BSON_DATA_ARRAY = 4; +/** Binary BSON Type @internal */ +var BSON_DATA_BINARY = 5; +/** Binary BSON Type @internal */ +var BSON_DATA_UNDEFINED = 6; +/** ObjectId BSON Type @internal */ +var BSON_DATA_OID = 7; +/** Boolean BSON Type @internal */ +var BSON_DATA_BOOLEAN = 8; +/** Date BSON Type @internal */ +var BSON_DATA_DATE = 9; +/** null BSON Type @internal */ +var BSON_DATA_NULL = 10; +/** RegExp BSON Type @internal */ +var BSON_DATA_REGEXP = 11; +/** Code BSON Type @internal */ +var BSON_DATA_DBPOINTER = 12; +/** Code BSON Type @internal */ +var BSON_DATA_CODE = 13; +/** Symbol BSON Type @internal */ +var BSON_DATA_SYMBOL = 14; +/** Code with Scope BSON Type @internal */ +var BSON_DATA_CODE_W_SCOPE = 15; +/** 32 bit Integer BSON Type @internal */ +var BSON_DATA_INT = 16; +/** Timestamp BSON Type @internal */ +var BSON_DATA_TIMESTAMP = 17; +/** Long BSON Type @internal */ +var BSON_DATA_LONG = 18; +/** Decimal128 BSON Type @internal */ +var BSON_DATA_DECIMAL128 = 19; +/** MinKey BSON Type @internal */ +var BSON_DATA_MIN_KEY = 0xff; +/** MaxKey BSON Type @internal */ +var BSON_DATA_MAX_KEY = 0x7f; +/** Binary Default Type @internal */ +var BSON_BINARY_SUBTYPE_DEFAULT = 0; +/** Binary Function Type @internal */ +var BSON_BINARY_SUBTYPE_FUNCTION = 1; +/** Binary Byte Array Type @internal */ +var BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ +var BSON_BINARY_SUBTYPE_UUID = 3; +/** Binary UUID Type @internal */ +var BSON_BINARY_SUBTYPE_UUID_NEW = 4; +/** Binary MD5 Type @internal */ +var BSON_BINARY_SUBTYPE_MD5 = 5; +/** Encrypted BSON type @internal */ +var BSON_BINARY_SUBTYPE_ENCRYPTED = 6; +/** Column BSON type @internal */ +var BSON_BINARY_SUBTYPE_COLUMN = 7; +/** Binary User Defined Type @internal */ +var BSON_BINARY_SUBTYPE_USER_DEFINED = 128; + +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +var Binary = /** @class */ (function () { + /** + * Create a new Binary instance. + * + * This constructor can accept a string as its first argument. In this case, + * this string will be encoded using ISO-8859-1, **not** using UTF-8. + * This is almost certainly not what you want. Use `new Binary(Buffer.from(string))` + * instead to convert the string to a Buffer using UTF-8 first. + * + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = Buffer.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = Buffer.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = Buffer.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = Buffer.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = Buffer.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + throw new BSONError("Binary sub_type \"".concat(this.sub_type, "\" is not supported for converting to UUID. Only \"").concat(Binary.SUBTYPE_UUID, "\" is currently supported.")); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = Buffer.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = Buffer.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError("Unexpected Binary Extended JSON format ".concat(JSON.stringify(doc))); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"".concat(asBuffer.toString('hex'), "\", \"hex\"), ").concat(this.sub_type, ")"); + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; +}()); +Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); +var UUID_BYTE_LENGTH = 16; +/** + * A class representation of the BSON UUID type. + * @public + */ +var UUID = /** @class */ (function (_super) { + __extends(UUID, _super); + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + var _this = this; + var bytes; + var hexStr; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = Buffer.from(input.buffer); + hexStr = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ensureBuffer(input); + } + else if (typeof input === 'string') { + bytes = uuidHexStringToBuffer(input); + } + else { + throw new BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + _this = _super.call(this, bytes, BSON_BINARY_SUBTYPE_UUID_NEW) || this; + _this.__id = hexStr; + return _this; + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this.buffer; + }, + set: function (value) { + this.buffer = value; + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = bufferToUuidHexString(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new Binary(this.id, Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = randomBytes(UUID_BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return Buffer.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return uuidValidateString(input); + } + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== UUID_BYTE_LENGTH) { + return false; + } + return (input[6] & 0xf0) === 0x40 && (input[8] & 0x80) === 0x80; + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"".concat(this.toHexString(), "\")"); + }; + return UUID; +}(Binary)); + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"".concat(String(codeJson.code), "\"").concat(codeJson.scope ? ", ".concat(JSON.stringify(codeJson.scope)) : '', ")"); + }; + return Code; +}()); +Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); + +/** @internal */ +function isDBRefLike(value) { + return (isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); +} +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"".concat(this.namespace, "\", new ObjectId(\"").concat(String(oid), "\")").concat(this.db ? ", \"".concat(this.db, "\"") : '', ")"); + }; + return DBRef; +}()); +Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); + +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +var wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch (_a) { + // no wasm support +} +var TWO_PWR_16_DBL = 1 << 16; +var TWO_PWR_24_DBL = 1 << 24; +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +/** A cache of the Long representations of small integer values. */ +var INT_CACHE = {}; +/** A cache of the Long representations of small unsigned integer values. */ +var UINT_CACHE = {}; +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + Long.isLong = function (value) { + return isObjectLike(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + // eslint-disable-next-line @typescript-eslint/no-this-alias + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"".concat(this.toString(), "\"").concat(this.unsigned ? ', true' : '', ")"); + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; +}()); +Object.defineProperty(Long.prototype, '__isLong__', { value: true }); +Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); + +var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +var EXPONENT_MAX = 6111; +var EXPONENT_MIN = -6176; +var EXPONENT_BIAS = 6176; +var MAX_DIGITS = 34; +// Nan value bits as 32 bit values (due to lack of longs) +var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +// Infinity value bits 32 bit values (due to lack of longs) +var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var EXPONENT_REGEX = /^([-+])?(\d+)?$/; +// Extract least significant 5 bits +var COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +var EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +var COMBINATION_INFINITY = 30; +// Value of combination field for NaN +var COMBINATION_NAN = 31; +// Detect if the value is a digit +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +// Divide two uint128 values +function divideu128(value) { + var DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + var _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +// Multiply two Long values and return the 128 bit value +function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new BSONTypeError("\"".concat(string, "\" is not a valid Decimal128 string - ").concat(message)); +} +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new Long(0, 0); + // The low 17 digits of the significand + var significandLow = new Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(Buffer.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(Buffer.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(Buffer.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = Buffer.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("".concat(0)); + if (exponent > 0) + string.push("E+".concat(exponent)); + else if (exponent < 0) + string.push("E".concat(exponent)); + return string.join(''); + } + string.push("".concat(significand[index++])); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push("+".concat(scientific_exponent)); + } + else { + string.push("".concat(scientific_exponent)); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("".concat(significand[index++])); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("".concat(significand[index++])); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"".concat(this.toString(), "\")"); + }; + return Decimal128; +}()); +Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + return { $numberDouble: "-".concat(this.value.toFixed(1)) }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(".concat(eJSON.$numberDouble, ")"); + }; + return Double; +}()); +Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(".concat(this.valueOf(), ")"); + }; + return Int32; +}()); +Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; +}()); +Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; +}()); +Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); + +// Regular expression that checks for hex value +var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); +// Unique sequence for the current process (initialized on first use) +var PROCESS_UNIQUE = null; +var kId = Symbol('id'); +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = Buffer.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof Buffer ? workingId : ensureBuffer(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = Buffer.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = Buffer.from(workingId, 'hex'); + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = Buffer.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id)) { + return otherId === Buffer.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return Buffer.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(Buffer.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"".concat(this.toHexString(), "\")"); + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; +}()); +// Deprecated methods +Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') +}); +Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); + +function alphabetize(str) { + return str.split('').sort().join(''); +} +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern))); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options))); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError("The regular expression option [".concat(this.options[i], "] is not supported")); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONTypeError("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(doc))); + }; + return BSONRegExp; +}()); +Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"".concat(this.value, "\")"); + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; +}()); +Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); + +/** @public */ +var LongWithoutOverridesClass = Long; +/** + * @public + * @category BSONType + * */ +var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: ".concat(this.getHighBits(), ", i: ").concat(this.getLowBits(), " })"); + }; + Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + return Timestamp; +}(LongWithoutOverridesClass)); + +function isBSONType(value) { + return (isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); +} +// INT32 boundaries +var BSON_INT32_MAX = 0x7fffffff; +var BSON_INT32_MIN = -0x80000000; +// INT64 boundaries +// const BSON_INT64_MAX = 0x7fffffffffffffff; // TODO(NODE-4377): This number cannot be precisely represented in JS +var BSON_INT64_MAX = 0x8000000000000000; +var BSON_INT64_MIN = -0x8000000000000000; +// all the types where we don't need to do any special processing and can just pass the EJSON +//straight to type.fromExtendedJSON +var keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) + return new Int32(value); + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) + return Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return DBRef.fromExtendedJSON(v); + } + return value; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index ".concat(index), obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONTypeError('Converting circular structure to EJSON:\n' + + " ".concat(leadingPart).concat(alreadySeen).concat(circularPart).concat(current, "\n") + + " ".concat(leadingSpace, "\\").concat(dashes, "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || isDate(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN && value <= BSON_INT32_MAX, int64Range = value >= BSON_INT64_MIN && value <= BSON_INT64_MAX; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || isRegExp(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new Binary(o.value(), o.sub_type); }, + Code: function (o) { return new Code(o.code, o.scope); }, + DBRef: function (o) { return new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new Decimal128(o.bytes); }, + Double: function (o) { return new Double(o.value); }, + Int32: function (o) { return new Int32(o.value); }, + Long: function (o) { + return Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new MaxKey(); }, + MinKey: function () { return new MinKey(); }, + ObjectID: function (o) { return new ObjectId(o); }, + ObjectId: function (o) { return new ObjectId(o); }, + BSONRegExp: function (o) { return new BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new BSONSymbol(o.value); }, + Timestamp: function (o) { return Timestamp.fromBits(o.low, o.high); } +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + var value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +/** + * EJSON parse / stringify API + * @public + */ +// the namespace here is used to emulate `export * as EJSON from '...'` +// which as of now (sept 2020) api-extractor does not support +// eslint-disable-next-line @typescript-eslint/no-namespace +var EJSON; +(function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new BSONError("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(key))); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; +})(EJSON || (EJSON = {})); + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** @public */ +var bsonMap; +var bsonGlobal = getGlobal(); +if (bsonGlobal.Map) { + bsonMap = bsonGlobal.Map; +} +else { + // We will return a polyfill + bsonMap = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); +} + +function calculateObjectSize$1(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; +} +/** @internal */ +function calculateElement(name, +// eslint-disable-next-line @typescript-eslint/no-explicit-any +value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1) { + // 32 bit + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + Buffer.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + Buffer.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + var binary = value; + // Check what kind of subtype we have + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + (binary.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (binary.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + Buffer.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize$1(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || isRegExp(value)) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.pattern, 'utf8') + + 1 + + Buffer.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize$1(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + + 1); + } + } + } + return 0; +} + +var FIRST_BIT = 0x80; +var FIRST_TWO_BITS = 0xc0; +var FIRST_THREE_BITS = 0xe0; +var FIRST_FOUR_BITS = 0xf0; +var FIRST_FIVE_BITS = 0xf8; +var TWO_BIT_CHAR = 0xc0; +var THREE_BIT_CHAR = 0xe0; +var FOUR_BIT_CHAR = 0xf0; +var CONTINUING_CHAR = 0x80; +/** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ +function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; +} + +// Internal long versions +var JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); +var JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); +var functionCache = {}; +function deserialize$1(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new BSONError("bson size must be >= 5, is ".concat(size)); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError("buffer length ".concat(buffer.length, " must be >= bson size ").concat(size)); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError("buffer length ".concat(buffer.length, " must === bson size ").concat(size)); + } + if (size + index > buffer.byteLength) { + throw new BSONError("(bson size ".concat(size, " + options.index ").concat(index, " must be <= buffer length ").concat(buffer.byteLength, ")")); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); +} +var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + var dataview = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength); + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + var oid = Buffer.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(dataview.getFloat64(index, true)); + index = index + 8; + } + else if (elementType === BSON_DATA_NUMBER) { + value = dataview.getFloat64(index, true); + index = index + 8; + } + else if (elementType === BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = _assign(_assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = _assign(_assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new BSONError('corrupted array bson'); + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = Buffer.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW) { + value = value.toUUID(); + } + } + } + else { + var _buffer = Buffer.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else if (subType === BSON_BINARY_SUBTYPE_UUID_NEW) { + value = new Binary(buffer.slice(index, index + binarySize), subType).toUUID(); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Timestamp(lowBits, highBits); + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new Code(functionString, scopeObject); + } + } + else if (elementType === BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = Buffer.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } + else { + throw new BSONError("Detected unknown BSON type ".concat(elementType.toString(16), " for fieldname \"").concat(name, "\"")); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if (isDBRefLike(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; +} +/** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ +function isolateEval(functionString, functionCache, object) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); +} +function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; +} + +var regexp = /\x00/; // eslint-disable-line no-control-regex +var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +/* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ +function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; +} +var SPACE_FOR_FLOAT64 = new Uint8Array(8); +var DV_FOR_FLOAT64 = new DataView(SPACE_FOR_FLOAT64.buffer, SPACE_FOR_FLOAT64.byteOffset, SPACE_FOR_FLOAT64.byteLength); +function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= BSON_INT32_MIN$1 && + value <= BSON_INT32_MAX$1) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + } + return index; +} +function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; +} +function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; +} +function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; +} +function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; +} +function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; +} +function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value.value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + return index; +} +function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = normalizedFunctionString(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} +function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; +} +function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; +} +function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; +} +function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = "".concat(i); + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else if (object instanceof bsonMap || isMap(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; +} + +/** @internal */ +// Default Max Size +var MAXSIZE = 1024 * 1024 * 17; +// Current Internal Temporary Serialization Buffer +var buffer = Buffer.alloc(MAXSIZE); +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = Buffer.alloc(size); + } +} +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = Buffer.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = Buffer.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; +} +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; +} +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return deserialize$1(buffer instanceof Buffer ? buffer : ensureBuffer(buffer), options); +} +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return calculateObjectSize$1(object, serializeFunctions, ignoreUndefined); +} +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = ensureBuffer(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = deserialize$1(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; +} +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +var BSON = { + Binary: Binary, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + Int32: Int32, + Long: Long, + UUID: UUID, + Map: bsonMap, + MaxKey: MaxKey, + MinKey: MinKey, + ObjectId: ObjectId, + ObjectID: ObjectId, + BSONRegExp: BSONRegExp, + BSONSymbol: BSONSymbol, + Timestamp: Timestamp, + EJSON: EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: BSONError, + BSONTypeError: BSONTypeError +}; + +export default BSON; +export { BSONError, BSONRegExp, BSONSymbol, BSONTypeError, BSON_BINARY_SUBTYPE_BYTE_ARRAY, BSON_BINARY_SUBTYPE_COLUMN, BSON_BINARY_SUBTYPE_DEFAULT, BSON_BINARY_SUBTYPE_ENCRYPTED, BSON_BINARY_SUBTYPE_FUNCTION, BSON_BINARY_SUBTYPE_MD5, BSON_BINARY_SUBTYPE_USER_DEFINED, BSON_BINARY_SUBTYPE_UUID, BSON_BINARY_SUBTYPE_UUID_NEW, BSON_DATA_ARRAY, BSON_DATA_BINARY, BSON_DATA_BOOLEAN, BSON_DATA_CODE, BSON_DATA_CODE_W_SCOPE, BSON_DATA_DATE, BSON_DATA_DBPOINTER, BSON_DATA_DECIMAL128, BSON_DATA_INT, BSON_DATA_LONG, BSON_DATA_MAX_KEY, BSON_DATA_MIN_KEY, BSON_DATA_NULL, BSON_DATA_NUMBER, BSON_DATA_OBJECT, BSON_DATA_OID, BSON_DATA_REGEXP, BSON_DATA_STRING, BSON_DATA_SYMBOL, BSON_DATA_TIMESTAMP, BSON_DATA_UNDEFINED, BSON_INT32_MAX$1 as BSON_INT32_MAX, BSON_INT32_MIN$1 as BSON_INT32_MIN, BSON_INT64_MAX$1 as BSON_INT64_MAX, BSON_INT64_MIN$1 as BSON_INT64_MIN, Binary, Code, DBRef, Decimal128, Double, EJSON, Int32, Long, LongWithoutOverridesClass, bsonMap as Map, MaxKey, MinKey, ObjectId as ObjectID, ObjectId, Timestamp, UUID, calculateObjectSize, deserialize, deserializeStream, serialize, serializeWithBufferAndIndex, setInternalBufferSize }; +//# sourceMappingURL=bson.esm.js.map diff --git a/server/node_modules/bson/dist/bson.esm.js.map b/server/node_modules/bson/dist/bson.esm.js.map new file mode 100644 index 0000000000..4867234db9 --- /dev/null +++ b/server/node_modules/bson/dist/bson.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.esm.js","sources":["../node_modules/tslib/tslib.es6.js","../src/error.ts","../src/utils/global.ts","../src/parser/utils.ts","../src/ensure_buffer.ts","../src/uuid_utils.ts","../src/constants.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/extended_json.ts","../src/map.ts","../src/parser/calculate_size.ts","../src/validate_utf8.ts","../src/parser/deserializer.ts","../src/parser/serializer.ts","../src/bson.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","BSON_INT32_MAX","BSON_INT32_MIN","BSON_INT64_MAX","BSON_INT64_MIN","calculateObjectSize","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","deserialize","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_BINARY_SUBTYPE_UUID_NEW","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT","Map","internalSerialize","internalDeserialize","internalCalculateObjectSize"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AAEA,IAAIA,cAAa,GAAG,uBAASC,CAAT,EAAYC,CAAZ,EAAe;AAC/BF,EAAAA,cAAa,GAAGG,MAAM,CAACC,cAAP,IACX;AAAEC,IAAAA,SAAS,EAAE;AAAb,eAA6BC,KAA7B,IAAsC,UAAUL,CAAV,EAAaC,CAAb,EAAgB;AAAED,IAAAA,CAAC,CAACI,SAAF,GAAcH,CAAd;AAAkB,GAD/D,IAEZ,UAAUD,CAAV,EAAaC,CAAb,EAAgB;AAAE,SAAK,IAAIK,CAAT,IAAcL,CAAd;AAAiB,UAAIA,CAAC,CAACM,cAAF,CAAiBD,CAAjB,CAAJ,EAAyBN,CAAC,CAACM,CAAD,CAAD,GAAOL,CAAC,CAACK,CAAD,CAAR;AAA1C;AAAwD,GAF9E;;AAGA,SAAOP,cAAa,CAACC,CAAD,EAAIC,CAAJ,CAApB;AACH,CALD;;AAOO,SAASO,SAAT,CAAmBR,CAAnB,EAAsBC,CAAtB,EAAyB;AAC5BF,EAAAA,cAAa,CAACC,CAAD,EAAIC,CAAJ,CAAb;;AACA,WAASQ,EAAT,GAAc;AAAE,SAAKC,WAAL,GAAmBV,CAAnB;AAAuB;;AACvCA,EAAAA,CAAC,CAACW,SAAF,GAAcV,CAAC,KAAK,IAAN,GAAaC,MAAM,CAACU,MAAP,CAAcX,CAAd,CAAb,IAAiCQ,EAAE,CAACE,SAAH,GAAeV,CAAC,CAACU,SAAjB,EAA4B,IAAIF,EAAJ,EAA7D,CAAd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a/server/node_modules/bson/etc/prepare.js b/server/node_modules/bson/etc/prepare.js new file mode 100755 index 0000000000..91e6f3a976 --- /dev/null +++ b/server/node_modules/bson/etc/prepare.js @@ -0,0 +1,19 @@ +#! /usr/bin/env node +var cp = require('child_process'); +var fs = require('fs'); + +var nodeMajorVersion = +process.version.match(/^v(\d+)\.\d+/)[1]; + +if (fs.existsSync('src') && nodeMajorVersion >= 10) { + cp.spawnSync('npm', ['run', 'build'], { stdio: 'inherit', shell: true }); +} else { + if (!fs.existsSync('lib')) { + console.warn('BSON: No compiled javascript present, the library is not installed correctly.'); + if (nodeMajorVersion < 10) { + console.warn( + 'This library can only be compiled in nodejs version 10 or later, currently running: ' + + nodeMajorVersion + ); + } + } +} diff --git a/server/node_modules/bson/lib/binary.js b/server/node_modules/bson/lib/binary.js new file mode 100644 index 0000000000..39e13422e3 --- /dev/null +++ b/server/node_modules/bson/lib/binary.js @@ -0,0 +1,426 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UUID = exports.Binary = void 0; +var buffer_1 = require("buffer"); +var ensure_buffer_1 = require("./ensure_buffer"); +var uuid_utils_1 = require("./uuid_utils"); +var utils_1 = require("./parser/utils"); +var error_1 = require("./error"); +var constants_1 = require("./constants"); +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +var Binary = /** @class */ (function () { + /** + * Create a new Binary instance. + * + * This constructor can accept a string as its first argument. In this case, + * this string will be encoded using ISO-8859-1, **not** using UTF-8. + * This is almost certainly not what you want. Use `new Binary(Buffer.from(string))` + * instead to convert the string to a Buffer using UTF-8 first. + * + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new error_1.BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = buffer_1.Buffer.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = buffer_1.Buffer.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = buffer_1.Buffer.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = (0, ensure_buffer_1.ensureBuffer)(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new error_1.BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new error_1.BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new error_1.BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = buffer_1.Buffer.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = buffer_1.Buffer.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set((0, ensure_buffer_1.ensureBuffer)(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + throw new error_1.BSONError("Binary sub_type \"".concat(this.sub_type, "\" is not supported for converting to UUID. Only \"").concat(Binary.SUBTYPE_UUID, "\" is currently supported.")); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = buffer_1.Buffer.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = buffer_1.Buffer.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = (0, uuid_utils_1.uuidHexStringToBuffer)(doc.$uuid); + } + if (!data) { + throw new error_1.BSONTypeError("Unexpected Binary Extended JSON format ".concat(JSON.stringify(doc))); + } + return type === constants_1.BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"".concat(asBuffer.toString('hex'), "\", \"hex\"), ").concat(this.sub_type, ")"); + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; +}()); +exports.Binary = Binary; +Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); +var UUID_BYTE_LENGTH = 16; +/** + * A class representation of the BSON UUID type. + * @public + */ +var UUID = /** @class */ (function (_super) { + __extends(UUID, _super); + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + var _this = this; + var bytes; + var hexStr; + if (input == null) { + bytes = UUID.generate(); + } + else if (input instanceof UUID) { + bytes = buffer_1.Buffer.from(input.buffer); + hexStr = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = (0, ensure_buffer_1.ensureBuffer)(input); + } + else if (typeof input === 'string') { + bytes = (0, uuid_utils_1.uuidHexStringToBuffer)(input); + } + else { + throw new error_1.BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + _this = _super.call(this, bytes, constants_1.BSON_BINARY_SUBTYPE_UUID_NEW) || this; + _this.__id = hexStr; + return _this; + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this.buffer; + }, + set: function (value) { + this.buffer = value; + if (UUID.cacheHexString) { + this.__id = (0, uuid_utils_1.bufferToUuidHexString)(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = (0, uuid_utils_1.bufferToUuidHexString)(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new Binary(this.id, Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = (0, utils_1.randomBytes)(UUID_BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return buffer_1.Buffer.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return (0, uuid_utils_1.uuidValidateString)(input); + } + if ((0, utils_1.isUint8Array)(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== UUID_BYTE_LENGTH) { + return false; + } + return (input[6] & 0xf0) === 0x40 && (input[8] & 0x80) === 0x80; + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = (0, uuid_utils_1.uuidHexStringToBuffer)(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"".concat(this.toHexString(), "\")"); + }; + return UUID; +}(Binary)); +exports.UUID = UUID; +//# sourceMappingURL=binary.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/binary.js.map b/server/node_modules/bson/lib/binary.js.map new file mode 100644 index 0000000000..412903a290 --- /dev/null +++ b/server/node_modules/bson/lib/binary.js.map @@ -0,0 +1 @@ +{"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iCAAgC;AAChC,iDAA+C;AAC/C,2CAAgG;AAChG,wCAA2D;AAE3D,iCAAmD;AACnD,yCAA2D;AAmB3D;;;;GAIG;AACH;IAkCE;;;;;;;;;;OAUG;IACH,gBAAY,MAAgC,EAAE,OAAgB;QAC5D,IAAI,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC;YAAE,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAElE,IACE,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC;YACjB,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC;YAC7B,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;YAC3B,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC;YAChC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EACtB;YACA,MAAM,I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I,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACH,eAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,sBAAO,GAAP;QACE,OAAO,qBAAa,IAAI,CAAC,WAAW,EAAE,QAAI,CAAC;IAC7C,CAAC;IACH,WAAC;AAAD,CAAC,AA9KD,CAA0B,MAAM,GA8K/B;AA9KY,oBAAI"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/bson.js b/server/node_modules/bson/lib/bson.js new file mode 100644 index 0000000000..265d4a0cb5 --- /dev/null +++ b/server/node_modules/bson/lib/bson.js @@ -0,0 +1,251 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSONRegExp = exports.MaxKey = exports.MinKey = exports.Int32 = exports.Double = exports.Timestamp = exports.Long = exports.UUID = exports.ObjectId = exports.Binary = exports.DBRef = exports.BSONSymbol = exports.Map = exports.Code = exports.LongWithoutOverridesClass = exports.EJSON = exports.BSON_INT64_MIN = exports.BSON_INT64_MAX = exports.BSON_INT32_MIN = exports.BSON_INT32_MAX = exports.BSON_DATA_UNDEFINED = exports.BSON_DATA_TIMESTAMP = exports.BSON_DATA_SYMBOL = exports.BSON_DATA_STRING = exports.BSON_DATA_REGEXP = exports.BSON_DATA_OID = exports.BSON_DATA_OBJECT = exports.BSON_DATA_NUMBER = exports.BSON_DATA_NULL = exports.BSON_DATA_MIN_KEY = exports.BSON_DATA_MAX_KEY = exports.BSON_DATA_LONG = exports.BSON_DATA_INT = exports.BSON_DATA_DECIMAL128 = exports.BSON_DATA_DBPOINTER = exports.BSON_DATA_DATE = exports.BSON_DATA_CODE_W_SCOPE = exports.BSON_DATA_CODE = exports.BSON_DATA_BOOLEAN = exports.BSON_DATA_BINARY = exports.BSON_DATA_ARRAY = exports.BSON_BINARY_SUBTYPE_COLUMN = exports.BSON_BINARY_SUBTYPE_ENCRYPTED = exports.BSON_BINARY_SUBTYPE_UUID_NEW = exports.BSON_BINARY_SUBTYPE_UUID = exports.BSON_BINARY_SUBTYPE_USER_DEFINED = exports.BSON_BINARY_SUBTYPE_MD5 = exports.BSON_BINARY_SUBTYPE_FUNCTION = exports.BSON_BINARY_SUBTYPE_DEFAULT = exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = void 0; +exports.deserializeStream = exports.calculateObjectSize = exports.deserialize = exports.serializeWithBufferAndIndex = exports.serialize = exports.setInternalBufferSize = exports.BSONTypeError = exports.BSONError = exports.ObjectID = exports.Decimal128 = void 0; +var buffer_1 = require("buffer"); +var binary_1 = require("./binary"); +Object.defineProperty(exports, "Binary", { enumerable: true, get: function () { return binary_1.Binary; } }); +Object.defineProperty(exports, "UUID", { enumerable: true, get: function () { return binary_1.UUID; } }); +var code_1 = require("./code"); +Object.defineProperty(exports, "Code", { enumerable: true, get: function () { return code_1.Code; } }); +var db_ref_1 = require("./db_ref"); +Object.defineProperty(exports, "DBRef", { enumerable: true, get: function () { return db_ref_1.DBRef; } }); +var decimal128_1 = require("./decimal128"); +Object.defineProperty(exports, "Decimal128", { enumerable: true, get: function () { return decimal128_1.Decimal128; } }); +var double_1 = require("./double"); +Object.defineProperty(exports, "Double", { enumerable: true, get: function () { return double_1.Double; } }); +var ensure_buffer_1 = require("./ensure_buffer"); +var extended_json_1 = require("./extended_json"); +var int_32_1 = require("./int_32"); +Object.defineProperty(exports, "Int32", { enumerable: true, get: function () { return int_32_1.Int32; } }); +var long_1 = require("./long"); +Object.defineProperty(exports, "Long", { enumerable: true, get: function () { return long_1.Long; } }); +var map_1 = require("./map"); +Object.defineProperty(exports, "Map", { enumerable: true, get: function () { return map_1.Map; } }); +var max_key_1 = require("./max_key"); +Object.defineProperty(exports, "MaxKey", { enumerable: true, get: function () { return max_key_1.MaxKey; } }); +var min_key_1 = require("./min_key"); +Object.defineProperty(exports, "MinKey", { enumerable: true, get: function () { return min_key_1.MinKey; } }); +var objectid_1 = require("./objectid"); +Object.defineProperty(exports, "ObjectId", { enumerable: true, get: function () { return objectid_1.ObjectId; } }); +Object.defineProperty(exports, "ObjectID", { enumerable: true, get: function () { return objectid_1.ObjectId; } }); +var error_1 = require("./error"); +var calculate_size_1 = require("./parser/calculate_size"); +// Parts of the parser +var deserializer_1 = require("./parser/deserializer"); +var serializer_1 = require("./parser/serializer"); +var regexp_1 = require("./regexp"); +Object.defineProperty(exports, "BSONRegExp", { enumerable: true, get: function () { return regexp_1.BSONRegExp; } }); +var symbol_1 = require("./symbol"); +Object.defineProperty(exports, "BSONSymbol", { enumerable: true, get: function () { return symbol_1.BSONSymbol; } }); +var timestamp_1 = require("./timestamp"); +Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return timestamp_1.Timestamp; } }); +var constants_1 = require("./constants"); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_BYTE_ARRAY", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_BYTE_ARRAY; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_DEFAULT", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_DEFAULT; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_FUNCTION", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_FUNCTION; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_MD5", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_MD5; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_USER_DEFINED", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_USER_DEFINED; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_UUID", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_UUID; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_UUID_NEW", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_UUID_NEW; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_ENCRYPTED", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_ENCRYPTED; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_COLUMN", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_COLUMN; } }); +Object.defineProperty(exports, "BSON_DATA_ARRAY", { enumerable: true, get: function () { return constants_1.BSON_DATA_ARRAY; } }); +Object.defineProperty(exports, "BSON_DATA_BINARY", { enumerable: true, get: function () { return constants_1.BSON_DATA_BINARY; } }); +Object.defineProperty(exports, "BSON_DATA_BOOLEAN", { enumerable: true, get: function () { return constants_1.BSON_DATA_BOOLEAN; } }); +Object.defineProperty(exports, "BSON_DATA_CODE", { enumerable: true, get: function () { return constants_1.BSON_DATA_CODE; } }); +Object.defineProperty(exports, "BSON_DATA_CODE_W_SCOPE", { enumerable: true, get: function () { return constants_1.BSON_DATA_CODE_W_SCOPE; } }); +Object.defineProperty(exports, "BSON_DATA_DATE", { enumerable: true, get: function () { return constants_1.BSON_DATA_DATE; } }); +Object.defineProperty(exports, "BSON_DATA_DBPOINTER", { enumerable: true, get: function () { return constants_1.BSON_DATA_DBPOINTER; } }); +Object.defineProperty(exports, "BSON_DATA_DECIMAL128", { enumerable: true, get: function () { return constants_1.BSON_DATA_DECIMAL128; } }); +Object.defineProperty(exports, "BSON_DATA_INT", { enumerable: true, get: function () { return constants_1.BSON_DATA_INT; } }); +Object.defineProperty(exports, "BSON_DATA_LONG", { enumerable: true, get: function () { return constants_1.BSON_DATA_LONG; } }); +Object.defineProperty(exports, "BSON_DATA_MAX_KEY", { enumerable: true, get: function () { return constants_1.BSON_DATA_MAX_KEY; } }); +Object.defineProperty(exports, "BSON_DATA_MIN_KEY", { enumerable: true, get: function () { return constants_1.BSON_DATA_MIN_KEY; } }); +Object.defineProperty(exports, "BSON_DATA_NULL", { enumerable: true, get: function () { return constants_1.BSON_DATA_NULL; } }); +Object.defineProperty(exports, "BSON_DATA_NUMBER", { enumerable: true, get: function () { return constants_1.BSON_DATA_NUMBER; } }); +Object.defineProperty(exports, "BSON_DATA_OBJECT", { enumerable: true, get: function () { return constants_1.BSON_DATA_OBJECT; } }); +Object.defineProperty(exports, "BSON_DATA_OID", { enumerable: true, get: function () { return constants_1.BSON_DATA_OID; } }); +Object.defineProperty(exports, "BSON_DATA_REGEXP", { enumerable: true, get: function () { return constants_1.BSON_DATA_REGEXP; } }); +Object.defineProperty(exports, "BSON_DATA_STRING", { enumerable: true, get: function () { return constants_1.BSON_DATA_STRING; } }); +Object.defineProperty(exports, "BSON_DATA_SYMBOL", { enumerable: true, get: function () { return constants_1.BSON_DATA_SYMBOL; } }); +Object.defineProperty(exports, "BSON_DATA_TIMESTAMP", { enumerable: true, get: function () { return constants_1.BSON_DATA_TIMESTAMP; } }); +Object.defineProperty(exports, "BSON_DATA_UNDEFINED", { enumerable: true, get: function () { return constants_1.BSON_DATA_UNDEFINED; } }); +Object.defineProperty(exports, "BSON_INT32_MAX", { enumerable: true, get: function () { return constants_1.BSON_INT32_MAX; } }); +Object.defineProperty(exports, "BSON_INT32_MIN", { enumerable: true, get: function () { return constants_1.BSON_INT32_MIN; } }); +Object.defineProperty(exports, "BSON_INT64_MAX", { enumerable: true, get: function () { return constants_1.BSON_INT64_MAX; } }); +Object.defineProperty(exports, "BSON_INT64_MIN", { enumerable: true, get: function () { return constants_1.BSON_INT64_MIN; } }); +var extended_json_2 = require("./extended_json"); +Object.defineProperty(exports, "EJSON", { enumerable: true, get: function () { return extended_json_2.EJSON; } }); +var timestamp_2 = require("./timestamp"); +Object.defineProperty(exports, "LongWithoutOverridesClass", { enumerable: true, get: function () { return timestamp_2.LongWithoutOverridesClass; } }); +var error_2 = require("./error"); +Object.defineProperty(exports, "BSONError", { enumerable: true, get: function () { return error_2.BSONError; } }); +Object.defineProperty(exports, "BSONTypeError", { enumerable: true, get: function () { return error_2.BSONTypeError; } }); +/** @internal */ +// Default Max Size +var MAXSIZE = 1024 * 1024 * 17; +// Current Internal Temporary Serialization Buffer +var buffer = buffer_1.Buffer.alloc(MAXSIZE); +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = buffer_1.Buffer.alloc(size); + } +} +exports.setInternalBufferSize = setInternalBufferSize; +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = buffer_1.Buffer.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = (0, serializer_1.serializeInto)(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = buffer_1.Buffer.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; +} +exports.serialize = serialize; +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = (0, serializer_1.serializeInto)(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; +} +exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex; +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return (0, deserializer_1.deserialize)(buffer instanceof buffer_1.Buffer ? buffer : (0, ensure_buffer_1.ensureBuffer)(buffer), options); +} +exports.deserialize = deserialize; +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return (0, calculate_size_1.calculateObjectSize)(object, serializeFunctions, ignoreUndefined); +} +exports.calculateObjectSize = calculateObjectSize; +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = (0, ensure_buffer_1.ensureBuffer)(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = (0, deserializer_1.deserialize)(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; +} +exports.deserializeStream = deserializeStream; +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +var BSON = { + Binary: binary_1.Binary, + Code: code_1.Code, + DBRef: db_ref_1.DBRef, + Decimal128: decimal128_1.Decimal128, + Double: double_1.Double, + Int32: int_32_1.Int32, + Long: long_1.Long, + UUID: binary_1.UUID, + Map: map_1.Map, + MaxKey: max_key_1.MaxKey, + MinKey: min_key_1.MinKey, + ObjectId: objectid_1.ObjectId, + ObjectID: objectid_1.ObjectId, + BSONRegExp: regexp_1.BSONRegExp, + BSONSymbol: symbol_1.BSONSymbol, + Timestamp: timestamp_1.Timestamp, + EJSON: extended_json_1.EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: error_1.BSONError, + BSONTypeError: error_1.BSONTypeError +}; +exports.default = BSON; +//# sourceMappingURL=bson.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/bson.js.map b/server/node_modules/bson/lib/bson.js.map new file mode 100644 index 0000000000..cc4b5c3745 --- /dev/null +++ b/server/node_modules/bson/lib/bson.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.js","sourceRoot":"","sources":["../src/bson.ts"],"names":[],"mappings":";;;;AAAA,iCAAgC;AAChC,mCAAwC;AA+EtC,uFA/EO,eAAM,OA+EP;AAEN,qFAjFe,aAAI,OAiFf;AAhFN,+BAA8B;AA0E5B,qFA1EO,WAAI,OA0EP;AAzEN,mCAAiC;AA4E/B,s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UAAU,yBAAA;IACV,MAAM,iBAAA;IACN,KAAK,gBAAA;IACL,IAAI,aAAA;IACJ,IAAI,eAAA;IACJ,GAAG,WAAA;IACH,MAAM,kBAAA;IACN,MAAM,kBAAA;IACN,QAAQ,qBAAA;IACR,QAAQ,EAAE,mBAAQ;IAClB,UAAU,qBAAA;IACV,UAAU,qBAAA;IACV,SAAS,uBAAA;IACT,KAAK,uBAAA;IACL,qBAAqB,uBAAA;IACrB,SAAS,WAAA;IACT,2BAA2B,6BAAA;IAC3B,WAAW,aAAA;IACX,mBAAmB,qBAAA;IACnB,iBAAiB,mBAAA;IACjB,SAAS,mBAAA;IACT,aAAa,uBAAA;CACd,CAAC;AACF,kBAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/code.js b/server/node_modules/bson/lib/code.js new file mode 100644 index 0000000000..5855393787 --- /dev/null +++ b/server/node_modules/bson/lib/code.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Code = void 0; +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"".concat(String(codeJson.code), "\"").concat(codeJson.scope ? ", ".concat(JSON.stringify(codeJson.scope)) : '', ")"); + }; + return Code; +}()); +exports.Code = Code; +Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); +//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/code.js.map b/server/node_modules/bson/lib/code.js.map new file mode 100644 index 0000000000..2291a6b931 --- /dev/null +++ b/server/node_modules/bson/lib/code.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code.js","sourceRoot":"","sources":["../src/code.ts"],"names":[],"mappings":";;;AAQA;;;;GAIG;AACH;IAKE;;;OAGG;IACH,cAAY,IAAuB,EAAE,KAAgB;QACnD,IAAI,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC;YAAE,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAE1D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,qBAAM,GAAN;QACE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAChD,CAAC;IAED,gBAAgB;IAChB,6BAAc,GAAd;QACE,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;SACjD;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;IAED,gBAAgB;IACT,qBAAgB,GAAvB,UAAwB,GAAiB;QACvC,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;IAChB,eAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,sBAAO,GAAP;QACE,IAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC/B,OAAO,qBAAa,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,eACvC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,YAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAE,CAAC,CAAC,CAAC,EAAE,MAC1D,CAAC;IACN,CAAC;IACH,WAAC;AAAD,CAAC,AA7CD,IA6CC;AA7CY,oBAAI;AA+CjB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/constants.js b/server/node_modules/bson/lib/constants.js new file mode 100644 index 0000000000..ff8b68d3dc --- /dev/null +++ b/server/node_modules/bson/lib/constants.js @@ -0,0 +1,82 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSON_BINARY_SUBTYPE_USER_DEFINED = exports.BSON_BINARY_SUBTYPE_COLUMN = exports.BSON_BINARY_SUBTYPE_ENCRYPTED = exports.BSON_BINARY_SUBTYPE_MD5 = exports.BSON_BINARY_SUBTYPE_UUID_NEW = exports.BSON_BINARY_SUBTYPE_UUID = exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = exports.BSON_BINARY_SUBTYPE_FUNCTION = exports.BSON_BINARY_SUBTYPE_DEFAULT = exports.BSON_DATA_MAX_KEY = exports.BSON_DATA_MIN_KEY = exports.BSON_DATA_DECIMAL128 = exports.BSON_DATA_LONG = exports.BSON_DATA_TIMESTAMP = exports.BSON_DATA_INT = exports.BSON_DATA_CODE_W_SCOPE = exports.BSON_DATA_SYMBOL = exports.BSON_DATA_CODE = exports.BSON_DATA_DBPOINTER = exports.BSON_DATA_REGEXP = exports.BSON_DATA_NULL = exports.BSON_DATA_DATE = exports.BSON_DATA_BOOLEAN = exports.BSON_DATA_OID = exports.BSON_DATA_UNDEFINED = exports.BSON_DATA_BINARY = exports.BSON_DATA_ARRAY = exports.BSON_DATA_OBJECT = exports.BSON_DATA_STRING = exports.BSON_DATA_NUMBER = exports.JS_INT_MIN = exports.JS_INT_MAX = exports.BSON_INT64_MIN = exports.BSON_INT64_MAX = exports.BSON_INT32_MIN = exports.BSON_INT32_MAX = void 0; +/** @internal */ +exports.BSON_INT32_MAX = 0x7fffffff; +/** @internal */ +exports.BSON_INT32_MIN = -0x80000000; +/** @internal */ +exports.BSON_INT64_MAX = Math.pow(2, 63) - 1; +/** @internal */ +exports.BSON_INT64_MIN = -Math.pow(2, 63); +/** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ +exports.JS_INT_MAX = Math.pow(2, 53); +/** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ +exports.JS_INT_MIN = -Math.pow(2, 53); +/** Number BSON Type @internal */ +exports.BSON_DATA_NUMBER = 1; +/** String BSON Type @internal */ +exports.BSON_DATA_STRING = 2; +/** Object BSON Type @internal */ +exports.BSON_DATA_OBJECT = 3; +/** Array BSON Type @internal */ +exports.BSON_DATA_ARRAY = 4; +/** Binary BSON Type @internal */ +exports.BSON_DATA_BINARY = 5; +/** Binary BSON Type @internal */ +exports.BSON_DATA_UNDEFINED = 6; +/** ObjectId BSON Type @internal */ +exports.BSON_DATA_OID = 7; +/** Boolean BSON Type @internal */ +exports.BSON_DATA_BOOLEAN = 8; +/** Date BSON Type @internal */ +exports.BSON_DATA_DATE = 9; +/** null BSON Type @internal */ +exports.BSON_DATA_NULL = 10; +/** RegExp BSON Type @internal */ +exports.BSON_DATA_REGEXP = 11; +/** Code BSON Type @internal */ +exports.BSON_DATA_DBPOINTER = 12; +/** Code BSON Type @internal */ +exports.BSON_DATA_CODE = 13; +/** Symbol BSON Type @internal */ +exports.BSON_DATA_SYMBOL = 14; +/** Code with Scope BSON Type @internal */ +exports.BSON_DATA_CODE_W_SCOPE = 15; +/** 32 bit Integer BSON Type @internal */ +exports.BSON_DATA_INT = 16; +/** Timestamp BSON Type @internal */ +exports.BSON_DATA_TIMESTAMP = 17; +/** Long BSON Type @internal */ +exports.BSON_DATA_LONG = 18; +/** Decimal128 BSON Type @internal */ +exports.BSON_DATA_DECIMAL128 = 19; +/** MinKey BSON Type @internal */ +exports.BSON_DATA_MIN_KEY = 0xff; +/** MaxKey BSON Type @internal */ +exports.BSON_DATA_MAX_KEY = 0x7f; +/** Binary Default Type @internal */ +exports.BSON_BINARY_SUBTYPE_DEFAULT = 0; +/** Binary Function Type @internal */ +exports.BSON_BINARY_SUBTYPE_FUNCTION = 1; +/** Binary Byte Array Type @internal */ +exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ +exports.BSON_BINARY_SUBTYPE_UUID = 3; +/** Binary UUID Type @internal */ +exports.BSON_BINARY_SUBTYPE_UUID_NEW = 4; +/** Binary MD5 Type @internal */ +exports.BSON_BINARY_SUBTYPE_MD5 = 5; +/** Encrypted BSON type @internal */ +exports.BSON_BINARY_SUBTYPE_ENCRYPTED = 6; +/** Column BSON type @internal */ +exports.BSON_BINARY_SUBTYPE_COLUMN = 7; +/** Binary User Defined Type @internal */ +exports.BSON_BINARY_SUBTYPE_USER_DEFINED = 128; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/constants.js.map b/server/node_modules/bson/lib/constants.js.map new file mode 100644 index 0000000000..3b9c0ca6c4 --- /dev/null +++ b/server/node_modules/bson/lib/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AACH,QAAA,cAAc,GAAG,UAAU,CAAC;AACzC,gBAAgB;AACH,QAAA,cAAc,GAAG,CAAC,UAAU,CAAC;AAC1C,gBAAgB;AACH,QAAA,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAClD,gBAAgB;AACH,QAAA,cAAc,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,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAEvC,iCAAiC;AACpB,QAAA,iBAAiB,GAAG,IAAI,CAAC;AAEtC,iCAAiC;AACpB,QAAA,iBAAiB,GAAG,IAAI,CAAC;AAEtC,oCAAoC;AACvB,QAAA,2BAA2B,GAAG,CAAC,CAAC;AAE7C,qCAAqC;AACxB,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAE9C,uCAAuC;AAC1B,QAAA,8BAA8B,GAAG,CAAC,CAAC;AAEhD,gGAAgG;AACnF,QAAA,wBAAwB,GAAG,CAAC,CAAC;AAE1C,iCAAiC;AACpB,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAE9C,gCAAgC;AACnB,QAAA,uBAAuB,GAAG,CAAC,CAAC;AAEzC,oCAAoC;AACvB,QAAA,6BAA6B,GAAG,CAAC,CAAC;AAE/C,iCAAiC;AACpB,QAAA,0BAA0B,GAAG,CAAC,CAAC;AAE5C,yCAAyC;AAC5B,QAAA,gCAAgC,GAAG,GAAG,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/db_ref.js b/server/node_modules/bson/lib/db_ref.js new file mode 100644 index 0000000000..d18bd965e0 --- /dev/null +++ b/server/node_modules/bson/lib/db_ref.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DBRef = exports.isDBRefLike = void 0; +var utils_1 = require("./parser/utils"); +/** @internal */ +function isDBRefLike(value) { + return ((0, utils_1.isObjectLike)(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); +} +exports.isDBRefLike = isDBRefLike; +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"".concat(this.namespace, "\", new ObjectId(\"").concat(String(oid), "\")").concat(this.db ? ", \"".concat(this.db, "\"") : '', ")"); + }; + return DBRef; +}()); +exports.DBRef = DBRef; +Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); +//# sourceMappingURL=db_ref.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/db_ref.js.map b/server/node_modules/bson/lib/db_ref.js.map new file mode 100644 index 0000000000..74e49aac7a --- /dev/null +++ b/server/node_modules/bson/lib/db_ref.js.map @@ -0,0 +1 @@ +{"version":3,"file":"db_ref.js","sourceRoot":"","sources":["../src/db_ref.ts"],"names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;IAED,uBAAO,GAAP;QACE,uEAAuE;QACvE,IAAM,GAAG,GACP,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC7F,OAAO,sBAAc,IAAI,CAAC,SAAS,gCAAoB,MAAM,CAAC,GAAG,CAAC,gBAChE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,cAAM,IAAI,CAAC,EAAE,OAAG,CAAC,CAAC,CAAC,EAAE,MAC9B,CAAC;IACN,CAAC;IACH,YAAC;AAAD,CAAC,AA9FD,IA8FC;AA9FY,sBAAK;AAgGlB,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/decimal128.js b/server/node_modules/bson/lib/decimal128.js new file mode 100644 index 0000000000..2fd7efa84a --- /dev/null +++ b/server/node_modules/bson/lib/decimal128.js @@ -0,0 +1,669 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Decimal128 = void 0; +var buffer_1 = require("buffer"); +var error_1 = require("./error"); +var long_1 = require("./long"); +var utils_1 = require("./parser/utils"); +var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +var EXPONENT_MAX = 6111; +var EXPONENT_MIN = -6176; +var EXPONENT_BIAS = 6176; +var MAX_DIGITS = 34; +// Nan value bits as 32 bit values (due to lack of longs) +var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +// Infinity value bits 32 bit values (due to lack of longs) +var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var EXPONENT_REGEX = /^([-+])?(\d+)?$/; +// Extract least significant 5 bits +var COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +var EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +var COMBINATION_INFINITY = 30; +// Value of combination field for NaN +var COMBINATION_NAN = 31; +// Detect if the value is a digit +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +// Divide two uint128 values +function divideu128(value) { + var DIVISOR = long_1.Long.fromNumber(1000 * 1000 * 1000); + var _rem = long_1.Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new long_1.Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +// Multiply two Long values and return the 128 bit value +function multiply64x2(left, right) { + if (!left && !right) { + return { high: long_1.Long.fromNumber(0), low: long_1.Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new long_1.Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new long_1.Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new long_1.Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new long_1.Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new error_1.BSONTypeError("\"".concat(string, "\" is not a valid Decimal128 string - ").concat(message)); +} +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if ((0, utils_1.isUint8Array)(bytes)) { + if (bytes.byteLength !== 16) { + throw new error_1.BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new error_1.BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new long_1.Long(0, 0); + // The low 17 digits of the significand + var significandLow = new long_1.Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new error_1.BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new error_1.BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(buffer_1.Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(buffer_1.Buffer.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new error_1.BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(buffer_1.Buffer.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(buffer_1.Buffer.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(buffer_1.Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = long_1.Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = long_1.Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = long_1.Long.fromNumber(0); + significandLow = long_1.Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = long_1.Long.fromNumber(digits[dIdx++]); + significandHigh = new long_1.Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(long_1.Long.fromNumber(10)); + significandLow = significandLow.add(long_1.Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = long_1.Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(long_1.Long.fromNumber(10)); + significandHigh = significandHigh.add(long_1.Long.fromNumber(digits[dIdx])); + } + significandLow = long_1.Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(long_1.Long.fromNumber(10)); + significandLow = significandLow.add(long_1.Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, long_1.Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(long_1.Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: long_1.Long.fromNumber(0), high: long_1.Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(long_1.Long.fromNumber(1)).equals(long_1.Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(long_1.Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(long_1.Long.fromNumber(biasedExponent).and(long_1.Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(long_1.Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(long_1.Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(long_1.Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(long_1.Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = buffer_1.Buffer.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new long_1.Long(low, midl), + high: new long_1.Long(midh, high) + }; + if (dec.high.lessThan(long_1.Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("".concat(0)); + if (exponent > 0) + string.push("E+".concat(exponent)); + else if (exponent < 0) + string.push("E".concat(exponent)); + return string.join(''); + } + string.push("".concat(significand[index++])); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push("+".concat(scientific_exponent)); + } + else { + string.push("".concat(scientific_exponent)); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("".concat(significand[index++])); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("".concat(significand[index++])); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("".concat(significand[index++])); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"".concat(this.toString(), "\")"); + }; + return Decimal128; +}()); +exports.Decimal128 = Decimal128; +Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); +//# sourceMappingURL=decimal128.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/decimal128.js.map b/server/node_modules/bson/lib/decimal128.js.map new file mode 100644 index 0000000000..31f0ee87d1 --- /dev/null +++ b/server/node_modules/bson/lib/decimal128.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decimal128.js","sourceRoot":"","sources":["../src/decimal128.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iCAAwC;AACxC,+BAA8B;AAC9B,wCAA8C;AAE9C,IAAM,mBAAmB,GAAG,+CAA+C,CAAC;AAC5E,IAAM,gBAAgB,GAAG,0BAA0B,CAAC;AACpD,IAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,IAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,IAAM,YAAY,GAAG,CAAC,IAAI,CAAC;AAC3B,IAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,IAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,yDAAyD;AACzD,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAC/F,CAAC,OAAO,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AC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,4BAAO,GAAP;QACE,OAAO,2BAAmB,IAAI,CAAC,QAAQ,EAAE,QAAI,CAAC;IAChD,CAAC;IACH,iBAAC;AAAD,CAAC,AAxoBD,IAwoBC;AAxoBY,gCAAU;AA0oBvB,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/double.js b/server/node_modules/bson/lib/double.js new file mode 100644 index 0000000000..b4363bcaeb --- /dev/null +++ b/server/node_modules/bson/lib/double.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Double = void 0; +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + return { $numberDouble: "-".concat(this.value.toFixed(1)) }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(".concat(eJSON.$numberDouble, ")"); + }; + return Double; +}()); +exports.Double = Double; +Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); +//# sourceMappingURL=double.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/double.js.map b/server/node_modules/bson/lib/double.js.map new file mode 100644 index 0000000000..46c8bdfccb --- /dev/null +++ b/server/node_modules/bson/lib/double.js.map @@ -0,0 +1 @@ +{"version":3,"file":"double.js","sourceRoot":"","sources":["../src/double.ts"],"names":[],"mappings":";;;AAOA;;;;GAIG;AACH;IAIE;;;;OAIG;IACH,gBAAY,KAAa;QACvB,IAAI,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC;YAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;QAExD,IAAK,KAAiB,YAAY,MAAM,EAAE;YACxC,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;SACzB;QAED,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,wBAAO,GAAP;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,uBAAM,GAAN;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,yBAAQ,GAAR,UAAS,KAAc;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,gBAAgB;IAChB,+BAAc,GAAd,UAAe,OAAsB;QACnC,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;YAC5E,OAAO,IAAI,CAAC,KAAK,CAAC;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ure_buffer.js new file mode 100644 index 0000000000..d8298ea4a7 --- /dev/null +++ b/server/node_modules/bson/lib/ensure_buffer.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ensureBuffer = void 0; +var buffer_1 = require("buffer"); +var error_1 = require("./error"); +var utils_1 = require("./parser/utils"); +/** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ +function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return buffer_1.Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if ((0, utils_1.isAnyArrayBuffer)(potentialBuffer)) { + return buffer_1.Buffer.from(potentialBuffer); + } + throw new error_1.BSONTypeError('Must use either Buffer or TypedArray'); +} +exports.ensureBuffer = ensureBuffer; +//# sourceMappingURL=ensure_buffer.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/ensure_buffer.js.map b/server/node_modules/bson/lib/ensure_buffer.js.map new file mode 100644 index 0000000000..f39d86a6c4 --- /dev/null +++ b/server/node_modules/bson/lib/ensure_buffer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ensure_buffer.js","sourceRoot":"","sources":["../src/ensure_buffer.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iCAAwC;AACxC,wCAAkD;AAElD;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,eAAuD;IAClF,IAAI,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;QACvC,OAAO,eAAM,CAAC,IAAI,CAChB,eAAe,CAAC,MAAM,EACtB,eAAe,CAAC,UAAU,EAC1B,eAAe,CAAC,UAAU,CAC3B,CAAC;KACH;IAED,IAAI,IAAA,wBAAgB,EAAC,eAAe,CAAC,EAAE;QACrC,OAAO,eAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACrC;IAED,MAAM,IAAI,qBAAa,CAAC,sCAAsC,CAAC,CAAC;AAClE,CAAC;AAdD,oCAcC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/error.js b/server/node_modules/bson/lib/error.js new file mode 100644 index 0000000000..035ce86f10 --- /dev/null +++ b/server/node_modules/bson/lib/error.js @@ -0,0 +1,55 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSONTypeError = exports.BSONError = void 0; +/** @public */ +var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; +}(Error)); +exports.BSONError = BSONError; +/** @public */ +var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; +}(TypeError)); +exports.BSONTypeError = BSONTypeError; +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/error.js.map b/server/node_modules/bson/lib/error.js.map new file mode 100644 index 0000000000..2acd4ef3f6 --- /dev/null +++ b/server/node_modules/bson/lib/error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd;IAA+B,6BAAK;IAClC,mBAAY,OAAe;QAA3B,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;;IACnD,CAAC;IAED,sBAAI,2BAAI;aAAR;YACE,OAAO,WAAW,CAAC;QACrB,CAAC;;;OAAA;IACH,gBAAC;AAAD,CAAC,AATD,CAA+B,KAAK,GASnC;AATY,8BAAS;AAWtB,cAAc;AACd;IAAmC,iCAAS;IAC1C,uBAAY,OAAe;QAA3B,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;;IACvD,CAAC;IAED,sBAAI,+BAAI;aAAR;YACE,OAAO,eAAe,CAAC;QACzB,CAAC;;;OAAA;IACH,oBAAC;AAAD,CAAC,AATD,CAAmC,SAAS,GAS3C;AATY,sCAAa"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/extended_json.js b/server/node_modules/bson/lib/extended_json.js new file mode 100644 index 0000000000..980e4db74e --- /dev/null +++ b/server/node_modules/bson/lib/extended_json.js @@ -0,0 +1,390 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EJSON = exports.isBSONType = void 0; +var binary_1 = require("./binary"); +var code_1 = require("./code"); +var db_ref_1 = require("./db_ref"); +var decimal128_1 = require("./decimal128"); +var double_1 = require("./double"); +var error_1 = require("./error"); +var int_32_1 = require("./int_32"); +var long_1 = require("./long"); +var max_key_1 = require("./max_key"); +var min_key_1 = require("./min_key"); +var objectid_1 = require("./objectid"); +var utils_1 = require("./parser/utils"); +var regexp_1 = require("./regexp"); +var symbol_1 = require("./symbol"); +var timestamp_1 = require("./timestamp"); +function isBSONType(value) { + return ((0, utils_1.isObjectLike)(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); +} +exports.isBSONType = isBSONType; +// INT32 boundaries +var BSON_INT32_MAX = 0x7fffffff; +var BSON_INT32_MIN = -0x80000000; +// INT64 boundaries +// const BSON_INT64_MAX = 0x7fffffffffffffff; // TODO(NODE-4377): This number cannot be precisely represented in JS +var BSON_INT64_MAX = 0x8000000000000000; +var BSON_INT64_MIN = -0x8000000000000000; +// all the types where we don't need to do any special processing and can just pass the EJSON +//straight to type.fromExtendedJSON +var keysToCodecs = { + $oid: objectid_1.ObjectId, + $binary: binary_1.Binary, + $uuid: binary_1.Binary, + $symbol: symbol_1.BSONSymbol, + $numberInt: int_32_1.Int32, + $numberDecimal: decimal128_1.Decimal128, + $numberDouble: double_1.Double, + $numberLong: long_1.Long, + $minKey: min_key_1.MinKey, + $maxKey: max_key_1.MaxKey, + $regex: regexp_1.BSONRegExp, + $regularExpression: regexp_1.BSONRegExp, + $timestamp: timestamp_1.Timestamp +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) + return new int_32_1.Int32(value); + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) + return long_1.Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new double_1.Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (long_1.Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return code_1.Code.fromExtendedJSON(value); + } + if ((0, db_ref_1.isDBRefLike)(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof db_ref_1.DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return db_ref_1.DBRef.fromExtendedJSON(v); + } + return value; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index ".concat(index), obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return "".concat(prop, " -> "); }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new error_1.BSONTypeError('Converting circular structure to EJSON:\n' + + " ".concat(leadingPart).concat(alreadySeen).concat(circularPart).concat(current, "\n") + + " ".concat(leadingSpace, "\\").concat(dashes, "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || (0, utils_1.isDate)(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN && value <= BSON_INT32_MAX, int64Range = value >= BSON_INT64_MIN && value <= BSON_INT64_MAX; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || (0, utils_1.isRegExp)(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new regexp_1.BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new binary_1.Binary(o.value(), o.sub_type); }, + Code: function (o) { return new code_1.Code(o.code, o.scope); }, + DBRef: function (o) { return new db_ref_1.DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new decimal128_1.Decimal128(o.bytes); }, + Double: function (o) { return new double_1.Double(o.value); }, + Int32: function (o) { return new int_32_1.Int32(o.value); }, + Long: function (o) { + return long_1.Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new max_key_1.MaxKey(); }, + MinKey: function () { return new min_key_1.MinKey(); }, + ObjectID: function (o) { return new objectid_1.ObjectId(o); }, + ObjectId: function (o) { return new objectid_1.ObjectId(o); }, + BSONRegExp: function (o) { return new regexp_1.BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new symbol_1.BSONSymbol(o.value); }, + Timestamp: function (o) { return timestamp_1.Timestamp.fromBits(o.low, o.high); } +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new error_1.BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + var value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + _doc[name] = value; + } + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new error_1.BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new code_1.Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new db_ref_1.DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new error_1.BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +/** + * EJSON parse / stringify API + * @public + */ +// the namespace here is used to emulate `export * as EJSON from '...'` +// which as of now (sept 2020) api-extractor does not support +// eslint-disable-next-line @typescript-eslint/no-namespace +var EJSON; +(function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new error_1.BSONError("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(key))); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; +})(EJSON = exports.EJSON || (exports.EJSON = {})); +//# sourceMappingURL=extended_json.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/extended_json.js.map b/server/node_modules/bson/lib/extended_json.js.map new file mode 100644 index 0000000000..d123c0ebbe --- /dev/null +++ b/server/node_modules/bson/lib/extended_json.js.map @@ -0,0 +1 @@ +{"version":3,"file":"extended_json.js","sourceRoot":"","sources":["../src/extended_json.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAElC,+BAA8B;AAC9B,mCAA8C;AAC9C,2CAA0C;AAC1C,mCAAkC;AAClC,i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IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAChF,OAAO,GAAG,QAAQ,CAAC;YACnB,QAAQ,GAAG,SAAS,CAAC;YACrB,KAAK,GAAG,CAAC,CAAC;SACX;QACD,IAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE;YAChF,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;SACrD,CAAC,CAAC;QAEH,IAAM,GAAG,GAAG,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAA4C,EAAE,KAAK,CAAC,CAAC;IAClF,CAAC;IAtBe,eAAS,YAsBxB,CAAA;IAED;;;;;OAKG;IACH,SAAgB,SAAS,CAAC,KAAwB,EAAE,OAAuB;QACzE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,CAAC;IAHe,eAAS,YAGxB,CAAA;IAED;;;;;OAKG;IACH,SAAgB,WAAW,CAAC,KAAe,EAAE,OAAuB;QAClE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAHe,iBAAW,cAG1B,CAAA;AACH,CAAC,EArHgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAqHrB"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/int_32.js b/server/node_modules/bson/lib/int_32.js new file mode 100644 index 0000000000..e862255dfb --- /dev/null +++ b/server/node_modules/bson/lib/int_32.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Int32 = void 0; +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(".concat(this.valueOf(), ")"); + }; + return Int32; +}()); +exports.Int32 = Int32; +Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); +//# sourceMappingURL=int_32.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/int_32.js.map b/server/node_modules/bson/lib/int_32.js.map new file mode 100644 index 0000000000..f55ab8596c --- /dev/null +++ b/server/node_modules/bson/lib/int_32.js.map @@ -0,0 +1 @@ +{"version":3,"file":"int_32.js","sourceRoot":"","sources":["../src/int_32.ts"],"names":[],"mappings":";;;AAOA;;;;GAIG;AACH;IAIE;;;;OAIG;IACH,eAAY,KAAsB;QAChC,IAAI,CAAC,CAAC,IAAI,YAAY,KAAK,CAAC;YAAE,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;QAEtD,IAAK,KAAiB,YAAY,MAAM,EAAE;YACxC,KAAK,GAAG,KAAK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,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/long.js b/server/node_modules/bson/lib/long.js new file mode 100644 index 0000000000..ec7aaec562 --- /dev/null +++ b/server/node_modules/bson/lib/long.js @@ -0,0 +1,900 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Long = void 0; +var utils_1 = require("./parser/utils"); +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +var wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch (_a) { + // no wasm support +} +var TWO_PWR_16_DBL = 1 << 16; +var TWO_PWR_24_DBL = 1 << 24; +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +/** A cache of the Long representations of small integer values. */ +var INT_CACHE = {}; +/** A cache of the Long representations of small unsigned integer values. */ +var UINT_CACHE = {}; +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + Long.isLong = function (value) { + return (0, utils_1.isObjectLike)(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + // eslint-disable-next-line @typescript-eslint/no-this-alias + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"".concat(this.toString(), "\"").concat(this.unsigned ? ', true' : '', ")"); + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; +}()); +exports.Long = Long; +Object.defineProperty(Long.prototype, '__isLong__', { value: true }); +Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); +//# sourceMappingURL=long.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/long.js.map b/server/node_modules/bson/lib/long.js.map new file mode 100644 index 0000000000..c191742c1e --- /dev/null +++ b/server/node_modules/bson/lib/long.js.map @@ -0,0 +1 @@ +{"version":3,"file":"long.js","sourceRoot":"","sources":["../src/long.ts"],"names":[],"mappings":";;;AACA,wCAA8C;AA2C9C;;GAEG;AACH,IAAI,IAAI,GAAgC,SAAS,CAAC;AAMlD,IAAI;IACF,IAAI,GAAG,IAAI,WAAW,CAAC,QAAQ,CAC7B,IAAI,WAAW,CAAC,MAAM;IACpB,kBAAkB;IAClB,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CA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CAAC,CAAC,CAAC;IAC7B,oBAAoB;IACb,SAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACpC,2BAA2B;IACpB,YAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,4BAA4B;IACrB,cAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACxE,4BAA4B;IACrB,cAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IA+1B7D,WAAC;CAAA,AAv6BD,IAu6BC;AAv6BY,oBAAI;AAy6BjB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACrE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/map.js b/server/node_modules/bson/lib/map.js new file mode 100644 index 0000000000..32334f5902 --- /dev/null +++ b/server/node_modules/bson/lib/map.js @@ -0,0 +1,123 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-explicit-any */ +// We have an ES6 Map available, return the native instance +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Map = void 0; +var global_1 = require("./utils/global"); +/** @public */ +var bsonMap; +exports.Map = bsonMap; +var bsonGlobal = (0, global_1.getGlobal)(); +if (bsonGlobal.Map) { + exports.Map = bsonMap = bsonGlobal.Map; +} +else { + // We will return a polyfill + exports.Map = bsonMap = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); +} +//# sourceMappingURL=map.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/map.js.map b/server/node_modules/bson/lib/map.js.map new file mode 100644 index 0000000000..944dcf6df9 --- /dev/null +++ b/server/node_modules/bson/lib/map.js.map @@ -0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KAAK,GAAG,CAAC,CAAC;YAEd,OAAO;gBACL,IAAI,EAAE;oBACJ,IAAM,GAAG,GAAG,KAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;oBAChC,OAAO;wBACL,KAAK,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,KAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;wBAC1D,IAAI,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;qBACvC,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC;QACD,sBAAI,qBAAI;iBAAR;gBACE,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YAC3B,CAAC;;;WAAA;QACH,UAAC;IAAD,CAAC,AAtGS,GAsGoB,CAAC;CAChC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/max_key.js b/server/node_modules/bson/lib/max_key.js new file mode 100644 index 0000000000..f9fd37603c --- /dev/null +++ b/server/node_modules/bson/lib/max_key.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MaxKey = void 0; +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; +}()); +exports.MaxKey = MaxKey; +Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); +//# sourceMappingURL=max_key.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/max_key.js.map b/server/node_modules/bson/lib/max_key.js.map new file mode 100644 index 0000000000..f85a5900f8 --- /dev/null +++ b/server/node_modules/bson/lib/max_key.js.map @@ -0,0 +1 @@ +{"version":3,"file":"max_key.js","sourceRoot":"","sources":["../src/max_key.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACH;IAGE;QACE,IAAI,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC;YAAE,OAAO,IAAI,MAAM,EAAE,CAAC;IACrD,CAAC;IAED,gBAAgB;IAChB,+BAAc,GAAd;QACE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACxB,CAAC;IAED,gBAAgB;IACT,uBAAgB,GAAvB;QACE,OAAO,IAAI,MAAM,EAAE,CAAC;IACtB,CAAC;IAED,gBAAgB;IAChB,iBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,wBAAO,GAAP;QACE,OAAO,cAAc,CAAC;IACxB,CAAC;IACH,aAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,wBAAM;AA2BnB,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/min_key.js b/server/node_modules/bson/lib/min_key.js new file mode 100644 index 0000000000..c67b3df0b2 --- /dev/null +++ b/server/node_modules/bson/lib/min_key.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MinKey = void 0; +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; +}()); +exports.MinKey = MinKey; +Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); +//# sourceMappingURL=min_key.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/min_key.js.map b/server/node_modules/bson/lib/min_key.js.map new file mode 100644 index 0000000000..2d642d17df --- /dev/null +++ b/server/node_modules/bson/lib/min_key.js.map @@ -0,0 +1 @@ +{"version":3,"file":"min_key.js","sourceRoot":"","sources":["../src/min_key.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACH;IAGE;QACE,IAAI,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC;YAAE,OAAO,IAAI,MAAM,EAAE,CAAC;IACrD,CAAC;IAED,gBAAgB;IAChB,+BAAc,GAAd;QACE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACxB,CAAC;IAED,gBAAgB;IACT,uBAAgB,GAAvB;QACE,OAAO,IAAI,MAAM,EAAE,CAAC;IACtB,CAAC;IAED,gBAAgB;IAChB,iBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,wBAAO,GAAP;QACE,OAAO,cAAc,CAAC;IACxB,CAAC;IACH,aAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,wBAAM;AA2BnB,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/objectid.js b/server/node_modules/bson/lib/objectid.js new file mode 100644 index 0000000000..287de6e619 --- /dev/null +++ b/server/node_modules/bson/lib/objectid.js @@ -0,0 +1,299 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ObjectId = void 0; +var buffer_1 = require("buffer"); +var ensure_buffer_1 = require("./ensure_buffer"); +var error_1 = require("./error"); +var utils_1 = require("./parser/utils"); +// Regular expression that checks for hex value +var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); +// Unique sequence for the current process (initialized on first use) +var PROCESS_UNIQUE = null; +var kId = Symbol('id'); +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new error_1.BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = buffer_1.Buffer.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof buffer_1.Buffer ? workingId : (0, ensure_buffer_1.ensureBuffer)(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = buffer_1.Buffer.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new error_1.BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = buffer_1.Buffer.from(workingId, 'hex'); + } + else { + throw new error_1.BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new error_1.BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = buffer_1.Buffer.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = (0, utils_1.randomBytes)(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + (0, utils_1.isUint8Array)(this.id)) { + return otherId === buffer_1.Buffer.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return buffer_1.Buffer.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = buffer_1.Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new error_1.BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(buffer_1.Buffer.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"".concat(this.toHexString(), "\")"); + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; +}()); +exports.ObjectId = ObjectId; +// Deprecated methods +Object.defineProperty(ObjectId.prototype, 'generate', { + value: (0, utils_1.deprecate)(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') +}); +Object.defineProperty(ObjectId.prototype, 'getInc', { + value: (0, utils_1.deprecate)(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: (0, utils_1.deprecate)(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId, 'get_inc', { + value: (0, utils_1.deprecate)(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); +//# sourceMappingURL=objectid.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/objectid.js.map b/server/node_modules/bson/lib/objectid.js.map new file mode 100644 index 0000000000..3238ada043 --- /dev/null +++ b/server/node_modules/bson/lib/objectid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"objectid.js","sourceRoot":"","sources":["../src/objectid.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iDAA+C;AAC/C,iCAAwC;AACxC,wCAAsE;AAEtE,+CAA+C;AAC/C,IAAM,iBAAiB,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE1D,qEAAqE;AACrE,IAAI,cAAc,GAAsB,IAAI,CAAC;AAc7C,IAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAEzB;;;;GAIG;AACH;IAaE;;;;OAIG;IACH,kBAAY,OAAyE;QACnF,IAAI,CAAC,CAAC,IAAI,YAAY,QAAQ,CAAC;YAAE,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;QAE9D,oFAAoF;QACpF,IAAI,SAAS,CAAC;QACd,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,EAAE;YAC7D,IAAI,OAAO,OAAO,CAAC,EAAE,KAAK,QAAQ,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;gBACrE,MAAM,IAAI,qBAAa,CACrB,qEAAqE,CACtE,CAAC;aACH;YACD,IAAI,aAAa,IAAI,OAAO,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE;gBACzE,SAAS,GAAG,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,KA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CAAC,CAAC;IAyStD,eAAC;CAAA,AA7SD,IA6SC;AA7SY,4BAAQ;AA+SrB,qBAAqB;AACrB,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,UAAU,EAAE;IACpD,KAAK,EAAE,IAAA,iBAAS,EACd,UAAC,IAAY,IAAK,OAAA,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAvB,CAAuB,EACzC,yDAAyD,CAC1D;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE;IAClD,KAAK,EAAE,IAAA,iBAAS,EAAC,cAAM,OAAA,QAAQ,CAAC,MAAM,EAAE,EAAjB,CAAiB,EAAE,mDAAmD,CAAC;CAC/F,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE;IACnD,KAAK,EAAE,IAAA,iBAAS,EAAC,cAAM,OAAA,QAAQ,CAAC,MAAM,EAAE,EAAjB,CAAiB,EAAE,mDAAmD,CAAC;CAC/F,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE;IACzC,KAAK,EAAE,IAAA,iBAAS,EAAC,cAAM,OAAA,QAAQ,CAAC,MAAM,EAAE,EAAjB,CAAiB,EAAE,mDAAmD,CAAC;CAC/F,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/parser/calculate_size.js b/server/node_modules/bson/lib/parser/calculate_size.js new file mode 100644 index 0000000000..3d11612b6b --- /dev/null +++ b/server/node_modules/bson/lib/parser/calculate_size.js @@ -0,0 +1,194 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateObjectSize = void 0; +var buffer_1 = require("buffer"); +var binary_1 = require("../binary"); +var constants = require("../constants"); +var utils_1 = require("./utils"); +function calculateObjectSize(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; +} +exports.calculateObjectSize = calculateObjectSize; +/** @internal */ +function calculateElement(name, +// eslint-disable-next-line @typescript-eslint/no-explicit-any +value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + buffer_1.Buffer.byteLength(name, 'utf8') + 1 + 4 + buffer_1.Buffer.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= constants.JS_INT_MIN && + value <= constants.JS_INT_MAX) { + if (value >= constants.BSON_INT32_MIN && value <= constants.BSON_INT32_MAX) { + // 32 bit + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || (0, utils_1.isDate)(value)) { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + (0, utils_1.isAnyArrayBuffer)(value)) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.Buffer.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.Buffer.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + var binary = value; + // Check what kind of subtype we have + if (binary.sub_type === binary_1.Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + (binary.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (binary.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + buffer_1.Buffer.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || (0, utils_1.isRegExp)(value)) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.Buffer.byteLength(value.pattern, 'utf8') + + 1 + + buffer_1.Buffer.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || (0, utils_1.isRegExp)(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.Buffer.byteLength((0, utils_1.normalizedFunctionString)(value), 'utf8') + + 1 + + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.Buffer.byteLength((0, utils_1.normalizedFunctionString)(value), 'utf8') + + 1); + } + } + } + return 0; +} +//# sourceMappingURL=calculate_size.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/parser/calculate_size.js.map b/server/node_modules/bson/lib/parser/calculate_size.js.map new file mode 100644 index 0000000000..f24906c17b --- /dev/null +++ b/server/node_modules/bson/lib/parser/calculate_size.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calculate_size.js","sourceRoot":"","sources":["../../src/parser/calculate_size.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,oCAAmC;AAEnC,wCAA0C;AAC1C,iCAAuF;AAEvF,SAAgB,mBAAmB,CACjC,MAAgB,EAChB,kBAA4B,EAC5B,eAAyB;IAEzB,IAAI,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC;IAExB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,WAAW,IAAI,gBAAgB,CAC7B,CAAC,CAAC,QAAQ,EAAE,EACZ,MAAM,CAAC,CAAC,CAAC,EACT,kBAAkB,EAClB,IAAI,EACJ,eAAe,CAChB,CAAC;SACH;KACF;SAAM;QACL,yDAAyD;QAEzD,IAAI,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,KAAK,UAAU,EAAE;YACxC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;SAC1B;QAED,iBAAiB;QACjB,KAAK,IAAM,GAAG,IAAI,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C,CAAC,CAAC;wBACxD,CAAC;wBACD,CAAC;wBACD,CAAC;wBACD,eAAM,CAAC,UAAU,CAAC,IAAA,gCAAwB,EAAC,KAAK,CAAC,EAAE,MAAM,CAAC;wBAC1D,CAAC;wBACD,mBAAmB,CAAC,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,eAAe,CAAC,CACtE,CAAC;iBACH;qBAAM,IAAI,kBAAkB,EAAE;oBAC7B,OAAO,CACL,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,eAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBACxD,CAAC;wBACD,CAAC;wBACD,eAAM,CAAC,UAAU,CAAC,IAAA,gCAAwB,EAAC,KAAK,CAAC,EAAE,MAAM,CAAC;wBAC1D,CAAC,CACF,CAAC;iBACH;aACF;KACJ;IAED,OAAO,CAAC,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/parser/deserializer.js b/server/node_modules/bson/lib/parser/deserializer.js new file mode 100644 index 0000000000..57f14a1683 --- /dev/null +++ b/server/node_modules/bson/lib/parser/deserializer.js @@ -0,0 +1,665 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deserialize = void 0; +var buffer_1 = require("buffer"); +var binary_1 = require("../binary"); +var code_1 = require("../code"); +var constants = require("../constants"); +var db_ref_1 = require("../db_ref"); +var decimal128_1 = require("../decimal128"); +var double_1 = require("../double"); +var error_1 = require("../error"); +var int_32_1 = require("../int_32"); +var long_1 = require("../long"); +var max_key_1 = require("../max_key"); +var min_key_1 = require("../min_key"); +var objectid_1 = require("../objectid"); +var regexp_1 = require("../regexp"); +var symbol_1 = require("../symbol"); +var timestamp_1 = require("../timestamp"); +var validate_utf8_1 = require("../validate_utf8"); +// Internal long versions +var JS_INT_MAX_LONG = long_1.Long.fromNumber(constants.JS_INT_MAX); +var JS_INT_MIN_LONG = long_1.Long.fromNumber(constants.JS_INT_MIN); +var functionCache = {}; +function deserialize(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new error_1.BSONError("bson size must be >= 5, is ".concat(size)); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new error_1.BSONError("buffer length ".concat(buffer.length, " must be >= bson size ").concat(size)); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new error_1.BSONError("buffer length ".concat(buffer.length, " must === bson size ").concat(size)); + } + if (size + index > buffer.byteLength) { + throw new error_1.BSONError("(bson size ".concat(size, " + options.index ").concat(index, " must be <= buffer length ").concat(buffer.byteLength, ")")); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new error_1.BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); +} +exports.deserialize = deserialize; +var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new error_1.BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new error_1.BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new error_1.BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new error_1.BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new error_1.BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + var dataview = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength); + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === constants.BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new error_1.BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === constants.BSON_DATA_OID) { + var oid = buffer_1.Buffer.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new objectid_1.ObjectId(oid); + index = index + 12; + } + else if (elementType === constants.BSON_DATA_INT && promoteValues === false) { + value = new int_32_1.Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === constants.BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === constants.BSON_DATA_NUMBER && promoteValues === false) { + value = new double_1.Double(dataview.getFloat64(index, true)); + index = index + 8; + } + else if (elementType === constants.BSON_DATA_NUMBER) { + value = dataview.getFloat64(index, true); + index = index + 8; + } + else if (elementType === constants.BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new long_1.Long(lowBits, highBits).toNumber()); + } + else if (elementType === constants.BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new error_1.BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === constants.BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new error_1.BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = __assign(__assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === constants.BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = __assign(__assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new error_1.BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new error_1.BSONError('corrupted array bson'); + } + else if (elementType === constants.BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === constants.BSON_DATA_NULL) { + value = null; + } + else if (elementType === constants.BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new long_1.Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === constants.BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = buffer_1.Buffer.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new decimal128_1.Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === constants.BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new error_1.BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new error_1.BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === binary_1.Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new error_1.BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new error_1.BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new error_1.BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new binary_1.Binary(buffer.slice(index, index + binarySize), subType); + if (subType === constants.BSON_BINARY_SUBTYPE_UUID_NEW) { + value = value.toUUID(); + } + } + } + else { + var _buffer = buffer_1.Buffer.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === binary_1.Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new error_1.BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new error_1.BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new error_1.BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else if (subType === constants.BSON_BINARY_SUBTYPE_UUID_NEW) { + value = new binary_1.Binary(buffer.slice(index, index + binarySize), subType).toUUID(); + } + else { + value = new binary_1.Binary(buffer.slice(index, index + binarySize), subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new regexp_1.BSONRegExp(source, regExpOptions); + } + else if (elementType === constants.BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new error_1.BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new symbol_1.BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === constants.BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new timestamp_1.Timestamp(lowBits, highBits); + } + else if (elementType === constants.BSON_DATA_MIN_KEY) { + value = new min_key_1.MinKey(); + } + else if (elementType === constants.BSON_DATA_MAX_KEY) { + value = new max_key_1.MaxKey(); + } + else if (elementType === constants.BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new error_1.BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new code_1.Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === constants.BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new error_1.BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new error_1.BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new error_1.BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new error_1.BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new code_1.Code(functionString, scopeObject); + } + } + else if (elementType === constants.BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new error_1.BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!(0, validate_utf8_1.validateUtf8)(buffer, index, index + stringSize - 1)) { + throw new error_1.BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = buffer_1.Buffer.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new objectid_1.ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new db_ref_1.DBRef(namespace, oid); + } + else { + throw new error_1.BSONError("Detected unknown BSON type ".concat(elementType.toString(16), " for fieldname \"").concat(name, "\"")); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new error_1.BSONError('corrupt array bson'); + throw new error_1.BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if ((0, db_ref_1.isDBRefLike)(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new db_ref_1.DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; +} +/** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ +function isolateEval(functionString, functionCache, object) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); +} +function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!(0, validate_utf8_1.validateUtf8)(buffer, start, end)) { + throw new error_1.BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; +} +//# sourceMappingURL=deserializer.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/parser/deserializer.js.map b/server/node_modules/bson/lib/parser/deserializer.js.map new file mode 100644 index 0000000000..fc65ae3bd0 --- /dev/null +++ b/server/node_modules/bson/lib/parser/deserializer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"deserializer.js","sourceRoot":"","sources":["../../src/parser/deserializer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iCAAgC;AAChC,oCAAmC;AAEnC,gCAA+B;AAC/B,wCAA0C;AAC1C,oCAA0D;AAC1D,4CAA2C;AAC3C,oCAAmC;AACnC,kCAAqC;AACrC,oCAAkC;AAClC,gCAA+B;AAC/B,sCAAoC;AACpC,sCAAoC;AACpC,wCAAuC;AACvC,oCAAuC;AACvC,oCAAuC;AACvC,0CAAyC;AACzC,kDAAgD;AAgDhD,yBAAyB;AACzB,IAAM,eAAe,GAAG,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC9D,IAAM,eAAe,GAAG,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAE9D,IAAM,aAAa,GAAiC,EAAE,CAAC;AAEvD,SAAgB,WAAW,CACzB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AC,cAAc,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAc,EACd,KAAa,EACb,GAAW,EACX,kBAA2B;IAE3B,IAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAClD,yCAAyC;IACzC,IAAI,kBAAkB,EAAE;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE;gBAClC,IAAI,CAAC,IAAA,4BAAY,EAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE;oBACrC,MAAM,IAAI,iBAAS,CAAC,uCAAuC,CAAC,CAAC;iBAC9D;gBACD,MAAM;aACP;SACF;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/parser/serializer.js b/server/node_modules/bson/lib/parser/serializer.js new file mode 100644 index 0000000000..d99ca96113 --- /dev/null +++ b/server/node_modules/bson/lib/parser/serializer.js @@ -0,0 +1,867 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.serializeInto = void 0; +var binary_1 = require("../binary"); +var constants = require("../constants"); +var ensure_buffer_1 = require("../ensure_buffer"); +var error_1 = require("../error"); +var extended_json_1 = require("../extended_json"); +var long_1 = require("../long"); +var map_1 = require("../map"); +var utils_1 = require("./utils"); +var regexp = /\x00/; // eslint-disable-line no-control-regex +var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +/* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ +function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = constants.BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; +} +var SPACE_FOR_FLOAT64 = new Uint8Array(8); +var DV_FOR_FLOAT64 = new DataView(SPACE_FOR_FLOAT64.buffer, SPACE_FOR_FLOAT64.byteOffset, SPACE_FOR_FLOAT64.byteLength); +function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= constants.BSON_INT32_MIN && + value <= constants.BSON_INT32_MAX) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = constants.BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = constants.BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + } + return index; +} +function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = constants.BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = long_1.Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = constants.BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = constants.BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = constants.BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if ((0, utils_1.isUint8Array)(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new error_1.BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; +} +function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = constants.BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set((0, ensure_buffer_1.ensureBuffer)(value), index); + // Adjust the index + index = index + size; + return index; +} +function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new error_1.BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? constants.BSON_DATA_ARRAY : constants.BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; +} +function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = constants.BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; +} +function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? constants.BSON_DATA_LONG : constants.BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = constants.BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; +} +function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = constants.BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value.value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + return index; +} +function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + if (_checkKeys === void 0) { _checkKeys = false; } + if (_depth === void 0) { _depth = 0; } + buffer[index++] = constants.BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = (0, utils_1.normalizedFunctionString)(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} +function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = constants.BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = constants.BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; +} +function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === binary_1.Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === binary_1.Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; +} +function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; +} +function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = "".concat(i); + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new error_1.BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || (0, utils_1.isDate)(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if ((0, utils_1.isUint8Array)(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || (0, utils_1.isRegExp)(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + (0, extended_json_1.isBSONType)(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new error_1.BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else if (object instanceof map_1.Map || (0, utils_1.isMap)(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || (0, utils_1.isBigInt64Array)(value) || (0, utils_1.isBigUInt64Array)(value)) { + throw new error_1.BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || (0, utils_1.isDate)(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if ((0, utils_1.isUint8Array)(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || (0, utils_1.isRegExp)(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new error_1.BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new error_1.BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new error_1.BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || (0, utils_1.isDate)(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if ((0, utils_1.isUint8Array)(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || (0, utils_1.isRegExp)(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new error_1.BSONTypeError("Unrecognized or invalid _bsontype: ".concat(String(value['_bsontype']))); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; +} +exports.serializeInto = serializeInto; +//# sourceMappingURL=serializer.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/parser/serializer.js.map b/server/node_modules/bson/lib/parser/serializer.js.map new file mode 100644 index 0000000000..3261fd40f2 --- /dev/null +++ b/server/node_modules/bson/lib/parser/serializer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../src/parser/serializer.ts"],"names":[],"mappings":";;;AACA,oCAAmC;AAGnC,wCAA0C;AAI1C,kDAAgD;AAChD,kCAAoD;AACpD,kDAA8C;AAE9C,gCAA+B;AAC/B,8BAA6B;AAI7B,iCAQiB;AAgBjB,IAAM,MAAM,GAAG,MAAM,CAAC,CAAC,uCAAuC;AAC9D,IAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;AAEnE;;;;GAIG;AAEH,SAAS,eAAe,CACtB,MAAc,EACd,GAAW,EACX,KAAa,EACb,KAAa,EACb,OAAiB;IAEjB,qBAAqB;IACrB,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC,gBAAgB,CAAC;IAC7C,0BAA0B;IAC1B,IAAM,oBAAoB,GAAG,CAAC,OAAO;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC;QAC7C,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACjD,kBAAkB;IAClB,KAAK,GAAG,KAAK,GAAG,oBAAoB,GAAG,CAAC,CAAC;IACzC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACtB,mBAAmB;IACnB,IAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC/D,yCAAyC;IACzC,MAAM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E,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IAC7C,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IAC9C,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IAC9C,OAAO,KAAK,CAAC;AACf,CAAC;AAtUD,sCAsUC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/parser/utils.js b/server/node_modules/bson/lib/parser/utils.js new file mode 100644 index 0000000000..94e8b5fc5a --- /dev/null +++ b/server/node_modules/bson/lib/parser/utils.js @@ -0,0 +1,115 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deprecate = exports.isObjectLike = exports.isDate = exports.haveBuffer = exports.isMap = exports.isRegExp = exports.isBigUInt64Array = exports.isBigInt64Array = exports.isUint8Array = exports.isAnyArrayBuffer = exports.randomBytes = exports.normalizedFunctionString = void 0; +var buffer_1 = require("buffer"); +var global_1 = require("../utils/global"); +/** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ +function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); +} +exports.normalizedFunctionString = normalizedFunctionString; +function isReactNative() { + var g = (0, global_1.getGlobal)(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; +} +var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = buffer_1.Buffer.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; +}; +var detectRandomBytes = function () { + if (process.browser) { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + var target_1 = window.crypto || window.msCrypto; // allow for IE11 + if (target_1 && target_1.getRandomValues) { + return function (size) { return target_1.getRandomValues(buffer_1.Buffer.alloc(size)); }; + } + } + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return function (size) { return global.crypto.getRandomValues(buffer_1.Buffer.alloc(size)); }; + } + return insecureRandomBytes; + } + else { + var requiredRandomBytes = void 0; + try { + requiredRandomBytes = require('crypto').randomBytes; + } + catch (e) { + // keep the fallback + } + // NOTE: in transpiled cases the above require might return null/undefined + return requiredRandomBytes || insecureRandomBytes; + } +}; +exports.randomBytes = detectRandomBytes(); +function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); +} +exports.isAnyArrayBuffer = isAnyArrayBuffer; +function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; +} +exports.isUint8Array = isUint8Array; +function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; +} +exports.isBigInt64Array = isBigInt64Array; +function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; +} +exports.isBigUInt64Array = isBigUInt64Array; +function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; +function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; +} +exports.isMap = isMap; +/** Call to check if your environment has `Buffer` */ +function haveBuffer() { + return typeof global !== 'undefined' && typeof global.Buffer !== 'undefined'; +} +exports.haveBuffer = haveBuffer; +// To ensure that 0.4 of node works correctly +function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; +} +exports.isDate = isDate; +/** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ +function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; +} +exports.isObjectLike = isObjectLike; +function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; +} +exports.deprecate = deprecate; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/parser/utils.js.map b/server/node_modules/bson/lib/parser/utils.js.map new file mode 100644 index 0000000000..6eba4a9bd7 --- /dev/null +++ b/server/node_modules/bson/lib/parser/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/parser/utils.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,0CAA4C;AAI5C;;;GAGG;AACH,SAAgB,wBAAwB,CAAC,EAAY;IACnD,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAC1D,CAAC;AAFD,4DAEC;AAED,SAAS,aAAa;IACpB,IAAM,CAAC,GAAG,IAAA,kBAAS,GAAwC,CAAC;IAC5D,OAAO,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC,CAAC,SAAS,CAAC,OAAO,KAAK,aAAa,CAAC;AAClF,CAAC;AAED,IAAM,mBAAmB,GAAwB,SAAS,mBAAmB,CAAC,IAAY;IACxF,IAAM,eAAe,GAAG,aAAa,EAAE;QACrC,CAAC,CAAC,0IAA0I;QAC5I,CAAC,CAAC,+GAA+G,CAAC;IACpH,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAE9B,IAAM,MAAM,GAAG,eAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC;QAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,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B,SAAS,CAAqB,EAAK,EAAE,OAAe;IAClE,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,SAAS,UAAU;QAAgB,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACnD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,MAAM,GAAG,IAAI,CAAC;SACf;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,UAA0B,CAAC;AACpC,CAAC;AAVD,8BAUC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/regexp.js b/server/node_modules/bson/lib/regexp.js new file mode 100644 index 0000000000..bc1f230ccd --- /dev/null +++ b/server/node_modules/bson/lib/regexp.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSONRegExp = void 0; +var error_1 = require("./error"); +function alphabetize(str) { + return str.split('').sort().join(''); +} +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new error_1.BSONError("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern))); + } + if (this.options.indexOf('\x00') !== -1) { + throw new error_1.BSONError("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options))); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new error_1.BSONError("The regular expression option [".concat(this.options[i], "] is not supported")); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new error_1.BSONTypeError("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(doc))); + }; + return BSONRegExp; +}()); +exports.BSONRegExp = BSONRegExp; +Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); +//# sourceMappingURL=regexp.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/regexp.js.map b/server/node_modules/bson/lib/regexp.js.map new file mode 100644 index 0000000000..134381759b --- /dev/null +++ b/server/node_modules/bson/lib/regexp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexp.js","sourceRoot":"","sources":["../src/regexp.ts"],"names":[],"mappings":";;;AAAA,iCAAmD;AAGnD,SAAS,WAAW,CAAC,GAAW;IAC9B,OAAO,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC;AAgBD;;;;GAIG;AACH;IAKE;;;OAGG;IACH,oBAAY,OAAe,EAAE,OAAgB;QAC3C,IAAI,CAAC,CAAC,IAAI,YAAY,UAAU,CAAC;YAAE,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE3E,IAAI,CAAC,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AAW,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/symbol.js b/server/node_modules/bson/lib/symbol.js new file mode 100644 index 0000000000..cad93173fe --- /dev/null +++ b/server/node_modules/bson/lib/symbol.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSONSymbol = void 0; +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"".concat(this.value, "\")"); + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; +}()); +exports.BSONSymbol = BSONSymbol; +Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); +//# sourceMappingURL=symbol.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/symbol.js.map b/server/node_modules/bson/lib/symbol.js.map new file mode 100644 index 0000000000..3662444d77 --- /dev/null +++ b/server/node_modules/bson/lib/symbol.js.map @@ -0,0 +1 @@ +{"version":3,"file":"symbol.js","sourceRoot":"","sources":["../src/symbol.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACH;IAIE;;OAEG;IACH,oBAAY,KAAa;QACvB,IAAI,CAAC,CAAC,IAAI,YAAY,UAAU,CAAC;YAAE,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;QAEhE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,uCAAuC;IACvC,4BAAO,GAAP;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,6BAAQ,GAAR;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,gBAAgB;IAChB,4BAAO,GAAP;QACE,OAAO,2BAAmB,IAAI,CAAC,KAAK,QAAI,CAAC;IAC3C,CAAC;IAED,2BAAM,GAAN;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,gBAAgB;IAChB,mCAAc,GAAd;QACE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED,gBAAgB;IACT,2BAAgB,GAAvB,UAAwB,GAAuB;QAC7C,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,gBAAgB;IAChB,qBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IACH,iBAAC;AAAD,CAAC,AA7CD,IA6CC;AA7CY,gCAAU;AA+CvB,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/timestamp.js b/server/node_modules/bson/lib/timestamp.js new file mode 100644 index 0000000000..a3a8417c23 --- /dev/null +++ b/server/node_modules/bson/lib/timestamp.js @@ -0,0 +1,102 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Timestamp = exports.LongWithoutOverridesClass = void 0; +var long_1 = require("./long"); +var utils_1 = require("./parser/utils"); +/** @public */ +exports.LongWithoutOverridesClass = long_1.Long; +/** + * @public + * @category BSONType + * */ +var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (long_1.Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if ((0, utils_1.isObjectLike)(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(long_1.Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(long_1.Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(long_1.Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: ".concat(this.getHighBits(), ", i: ").concat(this.getLowBits(), " })"); + }; + Timestamp.MAX_VALUE = long_1.Long.MAX_UNSIGNED_VALUE; + return Timestamp; +}(exports.LongWithoutOverridesClass)); +exports.Timestamp = Timestamp; +//# sourceMappingURL=timestamp.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/timestamp.js.map b/server/node_modules/bson/lib/timestamp.js.map new file mode 100644 index 0000000000..e1a8bef957 --- /dev/null +++ b/server/node_modules/bson/lib/timestamp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../src/timestamp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAA8B;AAC9B,wCAA8C;AAQ9C,cAAc;AACD,QAAA,yBAAyB,GACpC,WAAuC,CAAC;AAU1C;;;KAGK;AACL;IAA+B,6BAAyB;IAmBtD,mBAAY,GAA6C,EAAE,IAAa;QAAxE,iBAkBC;QAjBC,6DAA6D;QAC7D,mBAAmB;QACnB,IAAI,CAAC,CAAC,KAAI,YAAY,SAAS,CAAC;YAAE,OAAO,IAAI,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAElE,IAAI,WAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YACpB,QAAA,kBAAM,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,SAAC;SAChC;aAAM,IAAI,IAAA,oBAAY,EAAC,GA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AAE,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC;IACnE,CAAC;IAED,gBAAgB;IACT,0BAAgB,GAAvB,UAAwB,GAAsB;QAC5C,OAAO,IAAI,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,gBAAgB;IAChB,oBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,2BAAO,GAAP;QACE,OAAO,6BAAsB,IAAI,CAAC,WAAW,EAAE,kBAAQ,IAAI,CAAC,UAAU,EAAE,QAAK,CAAC;IAChF,CAAC;IAzFe,mBAAS,GAAG,WAAI,CAAC,kBAAkB,CAAC;IA0FtD,gBAAC;CAAA,AA7FD,CAA+B,iCAAyB,GA6FvD;AA7FY,8BAAS"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/utils/global.js b/server/node_modules/bson/lib/utils/global.js new file mode 100644 index 0000000000..f4bf444059 --- /dev/null +++ b/server/node_modules/bson/lib/utils/global.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getGlobal = void 0; +function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; +} +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +function getGlobal() { + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + // eslint-disable-next-line @typescript-eslint/no-implied-eval + Function('return this')()); +} +exports.getGlobal = getGlobal; +//# sourceMappingURL=global.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/utils/global.js.map b/server/node_modules/bson/lib/utils/global.js.map new file mode 100644 index 0000000000..9d4ad79956 --- /dev/null +++ b/server/node_modules/bson/lib/utils/global.js.map @@ -0,0 +1 @@ +{"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/utils/global.ts"],"names":[],"mappings":";;;AAMA,SAAS,YAAY,CAAC,eAAoB;IACxC,kCAAkC;IAClC,OAAO,eAAe,IAAI,eAAe,CAAC,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC;AAC5E,CAAC;AAED,uEAAuE;AACvE,SAAgB,SAAS;IACvB,OAAO,CACL,YAAY,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC;QAC1D,YAAY,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC;QAClD,YAAY,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC;QAC9C,YAAY,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC;QAClD,8DAA8D;QAC9D,QAAQ,CAAC,aAAa,CAAC,EAAE,CAC1B,CAAC;AACJ,CAAC;AATD,8BASC"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/uuid_utils.js b/server/node_modules/bson/lib/uuid_utils.js new file mode 100644 index 0000000000..bb1f8b7e6e --- /dev/null +++ b/server/node_modules/bson/lib/uuid_utils.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bufferToUuidHexString = exports.uuidHexStringToBuffer = exports.uuidValidateString = void 0; +var buffer_1 = require("buffer"); +var error_1 = require("./error"); +// Validation regex for v4 uuid (validates with or without dashes) +var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; +var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); +}; +exports.uuidValidateString = uuidValidateString; +var uuidHexStringToBuffer = function (hexString) { + if (!(0, exports.uuidValidateString)(hexString)) { + throw new error_1.BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return buffer_1.Buffer.from(sanitizedHexString, 'hex'); +}; +exports.uuidHexStringToBuffer = uuidHexStringToBuffer; +var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); +}; +exports.bufferToUuidHexString = bufferToUuidHexString; +//# sourceMappingURL=uuid_utils.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/uuid_utils.js.map b/server/node_modules/bson/lib/uuid_utils.js.map new file mode 100644 index 0000000000..f388ec318f --- /dev/null +++ b/server/node_modules/bson/lib/uuid_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uuid_utils.js","sourceRoot":"","sources":["../src/uuid_utils.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iCAAwC;AAExC,kEAAkE;AAClE,IAAM,gBAAgB,GACpB,uHAAuH,CAAC;AAEnH,IAAM,kBAAkB,GAAG,UAAC,GAAW;IAC5C,OAAA,OAAO,GAAG,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;AAArD,CAAqD,CAAC;AAD3C,QAAA,kBAAkB,sBACyB;AAEjD,IAAM,qBAAqB,GAAG,UAAC,SAAiB;IACrD,IAAI,CAAC,IAAA,0BAAkB,EAAC,SAAS,CAAC,EAAE;QAClC,MAAM,IAAI,qBAAa,CACrB,uLAAuL,CACxL,CAAC;KACH;IAED,IAAM,kBAAkB,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACvD,OAAO,eAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC,CAAC;AATW,QAAA,qBAAqB,yBAShC;AAEK,IAAM,qBAAqB,GAAG,UAAC,MAAc,EAAE,aAAoB;IAApB,8BAAA,EAAA,oBAAoB;IACxE,OAAA,aAAa;QACX,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAC5B,GAAG;YACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAC5B,GAAG;YACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAC5B,GAAG;YACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7B,GAAG;YACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC;QAChC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;AAV1B,CAU0B,CAAC;AAXhB,QAAA,qBAAqB,yBAWL"} \ No newline at end of file diff --git a/server/node_modules/bson/lib/validate_utf8.js b/server/node_modules/bson/lib/validate_utf8.js new file mode 100644 index 0000000000..ec78016032 --- /dev/null +++ b/server/node_modules/bson/lib/validate_utf8.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateUtf8 = void 0; +var FIRST_BIT = 0x80; +var FIRST_TWO_BITS = 0xc0; +var FIRST_THREE_BITS = 0xe0; +var FIRST_FOUR_BITS = 0xf0; +var FIRST_FIVE_BITS = 0xf8; +var TWO_BIT_CHAR = 0xc0; +var THREE_BIT_CHAR = 0xe0; +var FOUR_BIT_CHAR = 0xf0; +var CONTINUING_CHAR = 0x80; +/** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ +function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; +} +exports.validateUtf8 = validateUtf8; +//# sourceMappingURL=validate_utf8.js.map \ No newline at end of file diff --git a/server/node_modules/bson/lib/validate_utf8.js.map b/server/node_modules/bson/lib/validate_utf8.js.map new file mode 100644 index 0000000000..f1e975be0c --- /dev/null +++ b/server/node_modules/bson/lib/validate_utf8.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate_utf8.js","sourceRoot":"","sources":["../src/validate_utf8.ts"],"names":[],"mappings":";;;AAAA,IAAM,SAAS,GAAG,IAAI,CAAC;AACvB,IAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,IAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,IAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,IAAM,eAAe,GAAG,IAAI,CAAC;AAE7B,IAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,IAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,IAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,IAAM,eAAe,GAAG,IAAI,CAAC;AAE7B;;;;;GAKG;AACH,SAAgB,YAAY,CAC1B,KAAkC,EAClC,KAAa,EACb,GAAW;IAEX,IAAI,YAAY,GAAG,CAAC,CAAC;IAErB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACnC,IAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtB,IAAI,YAAY,EAAE;YAChB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC,KAAK,eAAe,EAAE;gBAC/C,OAAO,KAAK,CAAC;aACd;YACD,YAAY,IAAI,CAAC,CAAC;SACnB;aAAM,IAAI,IAAI,GAAG,SAAS,EAAE;YAC3B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC,KAAK,YAAY,EAAE;gBAC9C,YAAY,GAAG,CAAC,CAAC;aAClB;iBAAM,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,KAAK,cAAc,EAAE;gBACtD,YAAY,GAAG,CAAC,CAAC;aAClB;iBAAM,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,KAAK,aAAa,EAAE;gBACrD,YAAY,GAAG,CAAC,CAAC;aAClB;iBAAM;gBACL,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,OAAO,CAAC,YAAY,CAAC;AACvB,CAAC;AA7BD,oCA6BC"} \ No newline at end of file diff --git a/server/node_modules/bson/package.json b/server/node_modules/bson/package.json new file mode 100644 index 0000000000..cfe6a2c756 --- /dev/null +++ b/server/node_modules/bson/package.json @@ -0,0 +1,116 @@ +{ + "name": "bson", + "description": "A bson parser for node.js and the browser", + "keywords": [ + "mongodb", + "bson", + "parser" + ], + "files": [ + "lib", + "src", + "dist", + "bson.d.ts", + "etc/prepare.js", + "bower.json" + ], + "types": "bson.d.ts", + "version": "4.7.2", + "author": { + "name": "The MongoDB NodeJS Team", + "email": "dbx-node@mongodb.com" + }, + "license": "Apache-2.0", + "contributors": [], + "repository": "mongodb/js-bson", + "bugs": { + "url": "https://jira.mongodb.org/projects/NODE/issues/" + }, + "devDependencies": { + "@babel/plugin-external-helpers": "^7.10.4", + "@babel/preset-env": "^7.11.0", + "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@microsoft/api-extractor": "^7.28.0", + "@rollup/plugin-babel": "^5.2.0", + "@rollup/plugin-commonjs": "^15.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "@rollup/plugin-replace": "^4.0.0", + "@rollup/plugin-typescript": "^6.0.0", + "@types/node": "^18.0.0", + "@typescript-eslint/eslint-plugin": "^5.30.0", + "@typescript-eslint/parser": "^5.30.0", + "array-includes": "^3.1.3", + "array.prototype.flatmap": "^1.3.0", + "benchmark": "^2.1.4", + "chai": "^4.2.0", + "eslint": "^8.18.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.1.0", + "eslint-plugin-tsdoc": "^0.2.16", + "karma": "^6.3.4", + "karma-chai": "^0.1.0", + "karma-chrome-launcher": "^3.1.0", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-rollup-preprocessor": "^7.0.5", + "mocha": "5.2.0", + "node-fetch": "^2.6.1", + "nyc": "^15.1.0", + "object.entries": "^1.1.5", + "prettier": "^2.7.1", + "rimraf": "^3.0.2", + "rollup": "^2.26.5", + "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-node-globals": "^1.4.0", + "rollup-plugin-node-polyfills": "^0.2.1", + "rollup-plugin-polyfill-node": "^0.7.0", + "standard-version": "^9.5.0", + "ts-node": "^9.0.0", + "tsd": "^0.21.0", + "typescript": "^4.7.4", + "typescript-cached-transpile": "0.0.6", + "uuid": "^8.3.2" + }, + "tsd": { + "directory": "test/types", + "compilerOptions": { + "strict": true, + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node" + } + }, + "config": { + "native": false + }, + "main": "lib/bson.js", + "module": "dist/bson.esm.js", + "browser": { + "./lib/bson.js": "./dist/bson.browser.umd.js", + "./dist/bson.esm.js": "./dist/bson.browser.esm.js" + }, + "engines": { + "node": ">=6.9.0" + }, + "scripts": { + "docs": "typedoc", + "test": "npm run build && npm run test-node && npm run test-browser", + "test-node": "mocha test/node test/*_tests.js", + "test-tsd": "npm run build:dts && tsd", + "test-browser": "node --max-old-space-size=4096 ./node_modules/.bin/karma start karma.conf.js", + "build:ts": "tsc", + "build:dts": "npm run build:ts && api-extractor run --typescript-compiler-folder node_modules/typescript --local && rimraf 'lib/**/*.d.ts*'", + "build:bundle": "rollup -c rollup.config.js", + "build": "npm run build:dts && npm run build:bundle", + "lint": "eslint -v && eslint --ext '.js,.ts' --max-warnings=0 src test && tsc -v && tsc --noEmit && npm run test-tsd", + "format": "eslint --ext '.js,.ts' src test --fix", + "coverage": "nyc npm run test-node", + "coverage:html": "npm run coverage && open ./coverage/index.html", + "prepare": "node etc/prepare.js", + "release": "standard-version -i HISTORY.md" + }, + "dependencies": { + "buffer": "^5.6.0" + } +} diff --git a/server/node_modules/bson/src/binary.ts b/server/node_modules/bson/src/binary.ts new file mode 100644 index 0000000000..d86275c9a2 --- /dev/null +++ b/server/node_modules/bson/src/binary.ts @@ -0,0 +1,481 @@ +import { Buffer } from 'buffer'; +import { ensureBuffer } from './ensure_buffer'; +import { bufferToUuidHexString, uuidHexStringToBuffer, uuidValidateString } from './uuid_utils'; +import { isUint8Array, randomBytes } from './parser/utils'; +import type { EJSONOptions } from './extended_json'; +import { BSONError, BSONTypeError } from './error'; +import { BSON_BINARY_SUBTYPE_UUID_NEW } from './constants'; + +/** @public */ +export type BinarySequence = Uint8Array | Buffer | number[]; + +/** @public */ +export interface BinaryExtendedLegacy { + $type: string; + $binary: string; +} + +/** @public */ +export interface BinaryExtended { + $binary: { + subType: string; + base64: string; + }; +} + +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +export class Binary { + _bsontype!: 'Binary'; + + /** + * Binary default subtype + * @internal + */ + private static readonly BSON_BINARY_SUBTYPE_DEFAULT = 0; + + /** Initial buffer default size */ + static readonly BUFFER_SIZE = 256; + /** Default BSON type */ + static readonly SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + static readonly SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + static readonly SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + static readonly SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + static readonly SUBTYPE_UUID = 4; + /** MD5 BSON type */ + static readonly SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + static readonly SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + static readonly SUBTYPE_COLUMN = 7; + /** User BSON type */ + static readonly SUBTYPE_USER_DEFINED = 128; + + buffer!: Buffer; + sub_type!: number; + position!: number; + + /** + * Create a new Binary instance. + * + * This constructor can accept a string as its first argument. In this case, + * this string will be encoded using ISO-8859-1, **not** using UTF-8. + * This is almost certainly not what you want. Use `new Binary(Buffer.from(string))` + * instead to convert the string to a Buffer using UTF-8 first. + * + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + constructor(buffer?: string | BinarySequence, subType?: number) { + if (!(this instanceof Binary)) return new Binary(buffer, subType); + + if ( + !(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer) + ) { + throw new BSONTypeError( + 'Binary can only be constructed from string, Buffer, TypedArray, or Array' + ); + } + + this.sub_type = subType ?? Binary.BSON_BINARY_SUBTYPE_DEFAULT; + + if (buffer == null) { + // create an empty binary buffer + this.buffer = Buffer.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } else { + if (typeof buffer === 'string') { + // string + this.buffer = Buffer.from(buffer, 'binary'); + } else if (Array.isArray(buffer)) { + // number[] + this.buffer = Buffer.from(buffer); + } else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + + this.position = this.buffer.byteLength; + } + } + + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + put(byteValue: string | number | Uint8Array | Buffer | number[]): void { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + + // Decode the byte value once + let decodedByte: number; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } else { + decodedByte = byteValue[0]; + } + + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } else { + const buffer = Buffer.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + } + + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + write(sequence: string | BinarySequence, offset: number): void { + offset = typeof offset === 'number' ? offset : this.position; + + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + const buffer = Buffer.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + + // Assign the new buffer + this.buffer = buffer; + } + + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + } + + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + read(position: number, length: number): BinarySequence { + length = length && length > 0 ? length : this.position; + + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + } + + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + value(asRaw?: boolean): string | BinarySequence { + asRaw = !!asRaw; + + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + } + + /** the length of the binary sequence */ + length(): number { + return this.position; + } + + toJSON(): string { + return this.buffer.toString('base64'); + } + + toString(format?: string): string { + return this.buffer.toString(format); + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): BinaryExtendedLegacy | BinaryExtended { + options = options || {}; + const base64String = this.buffer.toString('base64'); + + const subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + } + + toUUID(): UUID { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + + throw new BSONError( + `Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${Binary.SUBTYPE_UUID}" is currently supported.` + ); + } + + /** @internal */ + static fromExtendedJSON( + doc: BinaryExtendedLegacy | BinaryExtended | UUIDExtended, + options?: EJSONOptions + ): Binary { + options = options || {}; + let data: Buffer | undefined; + let type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = Buffer.from(doc.$binary, 'base64'); + } else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = Buffer.from(doc.$binary.base64, 'base64'); + } + } + } else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + const asBuffer = this.value(true); + return `new Binary(Buffer.from("${asBuffer.toString('hex')}", "hex"), ${this.sub_type})`; + } +} + +Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); + +/** @public */ +export type UUIDExtended = { + $uuid: string; +}; +const UUID_BYTE_LENGTH = 16; + +/** + * A class representation of the BSON UUID type. + * @public + */ +export class UUID extends Binary { + static cacheHexString: boolean; + + /** UUID hexString cache @internal */ + private __id?: string; + + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + constructor(input?: string | Buffer | UUID) { + let bytes; + let hexStr; + if (input == null) { + bytes = UUID.generate(); + } else if (input instanceof UUID) { + bytes = Buffer.from(input.buffer); + hexStr = input.__id; + } else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ensureBuffer(input); + } else if (typeof input === 'string') { + bytes = uuidHexStringToBuffer(input); + } else { + throw new BSONTypeError( + 'Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).' + ); + } + super(bytes, BSON_BINARY_SUBTYPE_UUID_NEW); + this.__id = hexStr; + } + + /** + * The UUID bytes + * @readonly + */ + get id(): Buffer { + return this.buffer; + } + + set id(value: Buffer) { + this.buffer = value; + + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + } + + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + toHexString(includeDashes = true): string { + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + + const uuidHexString = bufferToUuidHexString(this.id, includeDashes); + + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + + return uuidHexString; + } + + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + toString(encoding?: string): string { + return encoding ? this.id.toString(encoding) : this.toHexString(); + } + + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + toJSON(): string { + return this.toHexString(); + } + + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + equals(otherId: string | Buffer | UUID): boolean { + if (!otherId) { + return false; + } + + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + + try { + return new UUID(otherId).id.equals(this.id); + } catch { + return false; + } + } + + /** + * Creates a Binary instance from the current UUID. + */ + toBinary(): Binary { + return new Binary(this.id, Binary.SUBTYPE_UUID); + } + + /** + * Generates a populated buffer containing a v4 uuid + */ + static generate(): Buffer { + const bytes = randomBytes(UUID_BYTE_LENGTH); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + + return Buffer.from(bytes); + } + + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + static isValid(input: string | Buffer | UUID): boolean { + if (!input) { + return false; + } + + if (input instanceof UUID) { + return true; + } + + if (typeof input === 'string') { + return uuidValidateString(input); + } + + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== UUID_BYTE_LENGTH) { + return false; + } + + return (input[6] & 0xf0) === 0x40 && (input[8] & 0x80) === 0x80; + } + + return false; + } + + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + static createFromHexString(hexString: string): UUID { + const buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + } + + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new UUID("${this.toHexString()}")`; + } +} diff --git a/server/node_modules/bson/src/bson.ts b/server/node_modules/bson/src/bson.ts new file mode 100644 index 0000000000..d32cfe8345 --- /dev/null +++ b/server/node_modules/bson/src/bson.ts @@ -0,0 +1,330 @@ +import { Buffer } from 'buffer'; +import { Binary, UUID } from './binary'; +import { Code } from './code'; +import { DBRef } from './db_ref'; +import { Decimal128 } from './decimal128'; +import { Double } from './double'; +import { ensureBuffer } from './ensure_buffer'; +import { EJSON } from './extended_json'; +import { Int32 } from './int_32'; +import { Long } from './long'; +import { Map } from './map'; +import { MaxKey } from './max_key'; +import { MinKey } from './min_key'; +import { ObjectId } from './objectid'; +import { BSONError, BSONTypeError } from './error'; +import { calculateObjectSize as internalCalculateObjectSize } from './parser/calculate_size'; +// Parts of the parser +import { deserialize as internalDeserialize, DeserializeOptions } from './parser/deserializer'; +import { serializeInto as internalSerialize, SerializeOptions } from './parser/serializer'; +import { BSONRegExp } from './regexp'; +import { BSONSymbol } from './symbol'; +import { Timestamp } from './timestamp'; +export type { UUIDExtended, BinaryExtended, BinaryExtendedLegacy, BinarySequence } from './binary'; +export type { CodeExtended } from './code'; +export { + BSON_BINARY_SUBTYPE_BYTE_ARRAY, + BSON_BINARY_SUBTYPE_DEFAULT, + BSON_BINARY_SUBTYPE_FUNCTION, + BSON_BINARY_SUBTYPE_MD5, + BSON_BINARY_SUBTYPE_USER_DEFINED, + BSON_BINARY_SUBTYPE_UUID, + BSON_BINARY_SUBTYPE_UUID_NEW, + BSON_BINARY_SUBTYPE_ENCRYPTED, + BSON_BINARY_SUBTYPE_COLUMN, + BSON_DATA_ARRAY, + BSON_DATA_BINARY, + BSON_DATA_BOOLEAN, + BSON_DATA_CODE, + BSON_DATA_CODE_W_SCOPE, + BSON_DATA_DATE, + BSON_DATA_DBPOINTER, + BSON_DATA_DECIMAL128, + BSON_DATA_INT, + BSON_DATA_LONG, + BSON_DATA_MAX_KEY, + BSON_DATA_MIN_KEY, + BSON_DATA_NULL, + BSON_DATA_NUMBER, + BSON_DATA_OBJECT, + BSON_DATA_OID, + BSON_DATA_REGEXP, + BSON_DATA_STRING, + BSON_DATA_SYMBOL, + BSON_DATA_TIMESTAMP, + BSON_DATA_UNDEFINED, + BSON_INT32_MAX, + BSON_INT32_MIN, + BSON_INT64_MAX, + BSON_INT64_MIN +} from './constants'; +export type { DBRefLike } from './db_ref'; +export type { Decimal128Extended } from './decimal128'; +export type { DoubleExtended } from './double'; +export type { EJSONOptions } from './extended_json'; +export { EJSON } from './extended_json'; +export type { Int32Extended } from './int_32'; +export type { LongExtended } from './long'; +export type { MaxKeyExtended } from './max_key'; +export type { MinKeyExtended } from './min_key'; +export type { ObjectIdExtended, ObjectIdLike } from './objectid'; +export type { BSONRegExpExtended, BSONRegExpExtendedLegacy } from './regexp'; +export type { BSONSymbolExtended } from './symbol'; +export type { LongWithoutOverrides, TimestampExtended, TimestampOverrides } from './timestamp'; +export { LongWithoutOverridesClass } from './timestamp'; +export type { SerializeOptions, DeserializeOptions }; +export { + Code, + Map, + BSONSymbol, + DBRef, + Binary, + ObjectId, + UUID, + Long, + Timestamp, + Double, + Int32, + MinKey, + MaxKey, + BSONRegExp, + Decimal128, + // In 4.0.0 and 4.0.1, this property name was changed to ObjectId to match the class name. + // This caused interoperability problems with previous versions of the library, so in + // later builds we changed it back to ObjectID (capital D) to match legacy implementations. + ObjectId as ObjectID +}; +export { BSONError, BSONTypeError } from './error'; + +/** @public */ +export interface Document { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; +} + +/** @internal */ +// Default Max Size +const MAXSIZE = 1024 * 1024 * 17; + +// Current Internal Temporary Serialization Buffer +let buffer = Buffer.alloc(MAXSIZE); + +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +export function setInternalBufferSize(size: number): void { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = Buffer.alloc(size); + } +} + +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +export function serialize(object: Document, options: SerializeOptions = {}): Buffer { + // Unpack the options + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const minInternalBufferSize = + typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = Buffer.alloc(minInternalBufferSize); + } + + // Attempt to serialize + const serializationIndex = internalSerialize( + buffer, + object, + checkKeys, + 0, + 0, + serializeFunctions, + ignoreUndefined, + [] + ); + + // Create the final buffer + const finishedBuffer = Buffer.alloc(serializationIndex); + + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + + // Return the buffer + return finishedBuffer; +} + +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +export function serializeWithBufferAndIndex( + object: Document, + finalBuffer: Buffer, + options: SerializeOptions = {} +): number { + // Unpack the options + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const startIndex = typeof options.index === 'number' ? options.index : 0; + + // Attempt to serialize + const serializationIndex = internalSerialize( + buffer, + object, + checkKeys, + 0, + 0, + serializeFunctions, + ignoreUndefined + ); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + + // Return the index + return startIndex + serializationIndex - 1; +} + +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +export function deserialize( + buffer: Buffer | ArrayBufferView | ArrayBuffer, + options: DeserializeOptions = {} +): Document { + return internalDeserialize(buffer instanceof Buffer ? buffer : ensureBuffer(buffer), options); +} + +/** @public */ +export type CalculateObjectSizeOptions = Pick< + SerializeOptions, + 'serializeFunctions' | 'ignoreUndefined' +>; + +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +export function calculateObjectSize( + object: Document, + options: CalculateObjectSizeOptions = {} +): number { + options = options || {}; + + const serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + + return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined); +} + +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +export function deserializeStream( + data: Buffer | ArrayBufferView | ArrayBuffer, + startIndex: number, + numberOfDocuments: number, + documents: Document[], + docStartIndex: number, + options: DeserializeOptions +): number { + const internalOptions = Object.assign( + { allowObjectSmallerThanBufferSize: true, index: 0 }, + options + ); + const bufferData = ensureBuffer(data); + + let index = startIndex; + // Loop over all documents + for (let i = 0; i < numberOfDocuments; i++) { + // Find size of the document + const size = + bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = internalDeserialize(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + + // Return object containing end index of parsing and list of documents + return index; +} + +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +const BSON = { + Binary, + Code, + DBRef, + Decimal128, + Double, + Int32, + Long, + UUID, + Map, + MaxKey, + MinKey, + ObjectId, + ObjectID: ObjectId, + BSONRegExp, + BSONSymbol, + Timestamp, + EJSON, + setInternalBufferSize, + serialize, + serializeWithBufferAndIndex, + deserialize, + calculateObjectSize, + deserializeStream, + BSONError, + BSONTypeError +}; +export default BSON; diff --git a/server/node_modules/bson/src/code.ts b/server/node_modules/bson/src/code.ts new file mode 100644 index 0000000000..86a4fb19cf --- /dev/null +++ b/server/node_modules/bson/src/code.ts @@ -0,0 +1,61 @@ +import type { Document } from './bson'; + +/** @public */ +export interface CodeExtended { + $code: string | Function; + $scope?: Document; +} + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +export class Code { + _bsontype!: 'Code'; + + code!: string | Function; + scope?: Document; + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + constructor(code: string | Function, scope?: Document) { + if (!(this instanceof Code)) return new Code(code, scope); + + this.code = code; + this.scope = scope; + } + + toJSON(): { code: string | Function; scope?: Document } { + return { code: this.code, scope: this.scope }; + } + + /** @internal */ + toExtendedJSON(): CodeExtended { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + + return { $code: this.code }; + } + + /** @internal */ + static fromExtendedJSON(doc: CodeExtended): Code { + return new Code(doc.$code, doc.$scope); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + const codeJson = this.toJSON(); + return `new Code("${String(codeJson.code)}"${ + codeJson.scope ? `, ${JSON.stringify(codeJson.scope)}` : '' + })`; + } +} + +Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); diff --git a/server/node_modules/bson/src/constants.ts b/server/node_modules/bson/src/constants.ts new file mode 100644 index 0000000000..6af63e6942 --- /dev/null +++ b/server/node_modules/bson/src/constants.ts @@ -0,0 +1,110 @@ +/** @internal */ +export const BSON_INT32_MAX = 0x7fffffff; +/** @internal */ +export const BSON_INT32_MIN = -0x80000000; +/** @internal */ +export const BSON_INT64_MAX = Math.pow(2, 63) - 1; +/** @internal */ +export const BSON_INT64_MIN = -Math.pow(2, 63); + +/** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ +export const JS_INT_MAX = Math.pow(2, 53); + +/** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ +export const JS_INT_MIN = -Math.pow(2, 53); + +/** Number BSON Type @internal */ +export const BSON_DATA_NUMBER = 1; + +/** String BSON Type @internal */ +export const BSON_DATA_STRING = 2; + +/** Object BSON Type @internal */ +export const BSON_DATA_OBJECT = 3; + +/** Array BSON Type @internal */ +export const BSON_DATA_ARRAY = 4; + +/** Binary BSON Type @internal */ +export const BSON_DATA_BINARY = 5; + +/** Binary BSON Type @internal */ +export const BSON_DATA_UNDEFINED = 6; + +/** ObjectId BSON Type @internal */ +export const BSON_DATA_OID = 7; + +/** Boolean BSON Type @internal */ +export const BSON_DATA_BOOLEAN = 8; + +/** Date BSON Type @internal */ +export const BSON_DATA_DATE = 9; + +/** null BSON Type @internal */ +export const BSON_DATA_NULL = 10; + +/** RegExp BSON Type @internal */ +export const BSON_DATA_REGEXP = 11; + +/** Code BSON Type @internal */ +export const BSON_DATA_DBPOINTER = 12; + +/** Code BSON Type @internal */ +export const BSON_DATA_CODE = 13; + +/** Symbol BSON Type @internal */ +export const BSON_DATA_SYMBOL = 14; + +/** Code with Scope BSON Type @internal */ +export const BSON_DATA_CODE_W_SCOPE = 15; + +/** 32 bit Integer BSON Type @internal */ +export const BSON_DATA_INT = 16; + +/** Timestamp BSON Type @internal */ +export const BSON_DATA_TIMESTAMP = 17; + +/** Long BSON Type @internal */ +export const BSON_DATA_LONG = 18; + +/** Decimal128 BSON Type @internal */ +export const BSON_DATA_DECIMAL128 = 19; + +/** MinKey BSON Type @internal */ +export const BSON_DATA_MIN_KEY = 0xff; + +/** MaxKey BSON Type @internal */ +export const BSON_DATA_MAX_KEY = 0x7f; + +/** Binary Default Type @internal */ +export const BSON_BINARY_SUBTYPE_DEFAULT = 0; + +/** Binary Function Type @internal */ +export const BSON_BINARY_SUBTYPE_FUNCTION = 1; + +/** Binary Byte Array Type @internal */ +export const BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; + +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ +export const BSON_BINARY_SUBTYPE_UUID = 3; + +/** Binary UUID Type @internal */ +export const BSON_BINARY_SUBTYPE_UUID_NEW = 4; + +/** Binary MD5 Type @internal */ +export const BSON_BINARY_SUBTYPE_MD5 = 5; + +/** Encrypted BSON type @internal */ +export const BSON_BINARY_SUBTYPE_ENCRYPTED = 6; + +/** Column BSON type @internal */ +export const BSON_BINARY_SUBTYPE_COLUMN = 7; + +/** Binary User Defined Type @internal */ +export const BSON_BINARY_SUBTYPE_USER_DEFINED = 128; diff --git a/server/node_modules/bson/src/db_ref.ts b/server/node_modules/bson/src/db_ref.ts new file mode 100644 index 0000000000..750c5be93d --- /dev/null +++ b/server/node_modules/bson/src/db_ref.ts @@ -0,0 +1,124 @@ +import type { Document } from './bson'; +import type { EJSONOptions } from './extended_json'; +import type { ObjectId } from './objectid'; +import { isObjectLike } from './parser/utils'; + +/** @public */ +export interface DBRefLike { + $ref: string; + $id: ObjectId; + $db?: string; +} + +/** @internal */ +export function isDBRefLike(value: unknown): value is DBRefLike { + return ( + isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string') + ); +} + +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +export class DBRef { + _bsontype!: 'DBRef'; + + collection!: string; + oid!: ObjectId; + db?: string; + fields!: Document; + + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + constructor(collection: string, oid: ObjectId, db?: string, fields?: Document) { + if (!(this instanceof DBRef)) return new DBRef(collection, oid, db, fields); + + // check if namespace has been provided + const parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift()!; + } + + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + + /** @internal */ + get namespace(): string { + return this.collection; + } + + set namespace(value: string) { + this.collection = value; + } + + toJSON(): DBRefLike & Document { + const o = Object.assign( + { + $ref: this.collection, + $id: this.oid + }, + this.fields + ); + + if (this.db != null) o.$db = this.db; + return o; + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): DBRefLike { + options = options || {}; + let o: DBRefLike = { + $ref: this.collection, + $id: this.oid + }; + + if (options.legacy) { + return o; + } + + if (this.db) o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + } + + /** @internal */ + static fromExtendedJSON(doc: DBRefLike): DBRef { + const copy = Object.assign({}, doc) as Partial; + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + // NOTE: if OID is an ObjectId class it will just print the oid string. + const oid = + this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return `new DBRef("${this.namespace}", new ObjectId("${String(oid)}")${ + this.db ? `, "${this.db}"` : '' + })`; + } +} + +Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); diff --git a/server/node_modules/bson/src/decimal128.ts b/server/node_modules/bson/src/decimal128.ts new file mode 100644 index 0000000000..8759986482 --- /dev/null +++ b/server/node_modules/bson/src/decimal128.ts @@ -0,0 +1,773 @@ +import { Buffer } from 'buffer'; +import { BSONTypeError } from './error'; +import { Long } from './long'; +import { isUint8Array } from './parser/utils'; + +const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +const PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; + +const EXPONENT_MAX = 6111; +const EXPONENT_MIN = -6176; +const EXPONENT_BIAS = 6176; +const MAX_DIGITS = 34; + +// Nan value bits as 32 bit values (due to lack of longs) +const NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +// Infinity value bits 32 bit values (due to lack of longs) +const INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +const INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); + +const EXPONENT_REGEX = /^([-+])?(\d+)?$/; + +// Extract least significant 5 bits +const COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +const EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +const COMBINATION_INFINITY = 30; +// Value of combination field for NaN +const COMBINATION_NAN = 31; + +// Detect if the value is a digit +function isDigit(value: string): boolean { + return !isNaN(parseInt(value, 10)); +} + +// Divide two uint128 values +function divideu128(value: { parts: [number, number, number, number] }) { + const DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + let _rem = Long.fromNumber(0); + + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + + for (let i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + + return { quotient: value, rem: _rem }; +} + +// Multiply two Long values and return the 128 bit value +function multiply64x2(left: Long, right: Long): { high: Long; low: Long } { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + + const leftHigh = left.shiftRightUnsigned(32); + const leftLow = new Long(left.getLowBits(), 0); + const rightHigh = right.shiftRightUnsigned(32); + const rightLow = new Long(right.getLowBits(), 0); + + let productHigh = leftHigh.multiply(rightHigh); + let productMid = leftHigh.multiply(rightLow); + const productMid2 = leftLow.multiply(rightHigh); + let productLow = leftLow.multiply(rightLow); + + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + + // Return the 128 bit result + return { high: productHigh, low: productLow }; +} + +function lessThan(left: Long, right: Long): boolean { + // Make values unsigned + const uhleft = left.high >>> 0; + const uhright = right.high >>> 0; + + // Compare high bits first + if (uhleft < uhright) { + return true; + } else if (uhleft === uhright) { + const ulleft = left.low >>> 0; + const ulright = right.low >>> 0; + if (ulleft < ulright) return true; + } + + return false; +} + +function invalidErr(string: string, message: string) { + throw new BSONTypeError(`"${string}" is not a valid Decimal128 string - ${message}`); +} + +/** @public */ +export interface Decimal128Extended { + $numberDecimal: string; +} + +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +export class Decimal128 { + _bsontype!: 'Decimal128'; + + readonly bytes!: Buffer; + + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + constructor(bytes: Buffer | string) { + if (!(this instanceof Decimal128)) return new Decimal128(bytes); + + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + static fromString(representation: string): Decimal128 { + // Parse state tracking + let isNegative = false; + let sawRadix = false; + let foundNonZero = false; + + // Total number of significant digits (no leading or trailing zero) + let significantDigits = 0; + // Total number of significand digits read + let nDigitsRead = 0; + // Total number of digits (no leading zeros) + let nDigits = 0; + // The number of the digits after radix + let radixPosition = 0; + // The index of the first non-zero in *str* + let firstNonZero = 0; + + // Digits Array + const digits = [0]; + // The number of digits in digits + let nDigitsStored = 0; + // Insertion pointer for digits + let digitsInsert = 0; + // The index of the first non-zero digit + let firstDigit = 0; + // The index of the last digit + let lastDigit = 0; + + // Exponent + let exponent = 0; + // loop index over array + let i = 0; + // The high 17 digits of the significand + let significandHigh = new Long(0, 0); + // The low 17 digits of the significand + let significandLow = new Long(0, 0); + // The biased exponent + let biasedExponent = 0; + + // Read index + let index = 0; + + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + + // Results + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); + + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + + const unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + + const e = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; + + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) invalidErr(representation, 'missing exponent power'); + + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) invalidErr(representation, 'missing exponent base'); + + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } else if (representation[index] === 'N') { + return new Decimal128(Buffer.from(NAN_BUFFER)); + } + } + + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) invalidErr(representation, 'contains multiple periods'); + + sawRadix = true; + index = index + 1; + continue; + } + + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + + foundNonZero = true; + + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + + if (foundNonZero) nDigits = nDigits + 1; + if (sawRadix) radixPosition = radixPosition + 1; + + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + const match = representation.substr(++index).match(EXPONENT_REGEX); + + // No digits read + if (!match || !match[2]) return new Decimal128(Buffer.from(NAN_BUFFER)); + + // Get exponent + exponent = parseInt(match[0], 10); + + // Adjust the index + index = index + match[0].length; + } + + // Return not a number + if (representation[index]) return new Decimal128(Buffer.from(NAN_BUFFER)); + + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } else { + exponent = exponent - radixPosition; + } + + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } else { + // adjust to round + lastDigit = lastDigit - 1; + } + + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } else { + // Check if we have a zero then just hard clamp, otherwise fail + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + + if (roundBit) { + let dIdx = lastDigit; + + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } else { + return new Decimal128( + Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER) + ); + } + } + } + } + } + } + + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } else if (lastDigit - firstDigit < 17) { + let dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } else { + let dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + + significandLow = Long.fromNumber(digits[dIdx++]); + + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + + const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + + // Encode combination, exponent, and significand. + if ( + significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1)) + ) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or( + Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)) + ); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + + dec.low = significand.low; + + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + + // Encode into a buffer + const buffer = Buffer.alloc(16); + index = 0; + + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + + // Return the new Decimal128 + return new Decimal128(buffer); + } + + /** Create a string representation of the raw Decimal128 value */ + toString(): string { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + + // decoded biased exponent (14 bits) + let biased_exponent; + // the number of significand digits + let significand_digits = 0; + // the base-10 digits in the significand + const significand = new Array(36); + for (let i = 0; i < significand.length; i++) significand[i] = 0; + // read pointer into significand + let index = 0; + + // true if the number is zero + let is_zero = false; + + // the most significant significand bits (50-46) + let significand_msb; + // temporary storage for significand decoding + let significand128: { parts: [number, number, number, number] } = { parts: [0, 0, 0, 0] }; + // indexing variables + let j, k; + + // Output string + const string: string[] = []; + + // Unpack index + index = 0; + + // Buffer reference + const buffer = this.bytes; + + // Unpack the low 64bits into a long + // bits 96 - 127 + const low = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + const midl = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Unpack the high 64bits into a long + // bits 32 - 63 + const midh = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + const high = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Unpack index + index = 0; + + // Create the state of the decimal + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + + // Decode combination field and exponent + // bits 1 - 5 + const combination = (high >> 26) & COMBINATION_MASK; + + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } else if (combination === COMBINATION_NAN) { + return 'NaN'; + } else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + + // unbiased exponent + const exponent = biased_exponent - EXPONENT_BIAS; + + // Create string of significand digits + + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + + if ( + significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0 + ) { + is_zero = true; + } else { + for (k = 3; k >= 0; k--) { + let least_digits = 0; + // Perform the divide + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) continue; + + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + + // the exponent if scientific notation is used + const scientific_exponent = significand_digits - 1 + exponent; + + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) string.push(`E+${exponent}`); + else if (exponent < 0) string.push(`E${exponent}`); + return string.join(''); + } + + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; + + if (significand_digits) { + string.push('.'); + } + + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push(`+${scientific_exponent}`); + } else { + string.push(`${scientific_exponent}`); + } + } else { + // Regular format with no decimal place + if (exponent >= 0) { + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + } else { + let radix_position = significand_digits + exponent; + + // non-zero digits before radix + if (radix_position > 0) { + for (let i = 0; i < radix_position; i++) { + string.push(`${significand[index++]}`); + } + } else { + string.push('0'); + } + + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + + for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push(`${significand[index++]}`); + } + } + } + + return string.join(''); + } + + toJSON(): Decimal128Extended { + return { $numberDecimal: this.toString() }; + } + + /** @internal */ + toExtendedJSON(): Decimal128Extended { + return { $numberDecimal: this.toString() }; + } + + /** @internal */ + static fromExtendedJSON(doc: Decimal128Extended): Decimal128 { + return Decimal128.fromString(doc.$numberDecimal); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new Decimal128("${this.toString()}")`; + } +} + +Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); diff --git a/server/node_modules/bson/src/double.ts b/server/node_modules/bson/src/double.ts new file mode 100644 index 0000000000..96e5fcc6ad --- /dev/null +++ b/server/node_modules/bson/src/double.ts @@ -0,0 +1,83 @@ +import type { EJSONOptions } from './extended_json'; + +/** @public */ +export interface DoubleExtended { + $numberDouble: string; +} + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +export class Double { + _bsontype!: 'Double'; + + value!: number; + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + constructor(value: number) { + if (!(this instanceof Double)) return new Double(value); + + if ((value as unknown) instanceof Number) { + value = value.valueOf(); + } + + this.value = +value; + } + + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + valueOf(): number { + return this.value; + } + + toJSON(): number { + return this.value; + } + + toString(radix?: number): string { + return this.value.toString(radix); + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): number | DoubleExtended { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + + if (Object.is(Math.sign(this.value), -0)) { + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + return { $numberDouble: `-${this.value.toFixed(1)}` }; + } + + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + } + + /** @internal */ + static fromExtendedJSON(doc: DoubleExtended, options?: EJSONOptions): number | Double { + const doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + const eJSON = this.toExtendedJSON() as DoubleExtended; + return `new Double(${eJSON.$numberDouble})`; + } +} + +Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); diff --git a/server/node_modules/bson/src/ensure_buffer.ts b/server/node_modules/bson/src/ensure_buffer.ts new file mode 100644 index 0000000000..8b82a085e5 --- /dev/null +++ b/server/node_modules/bson/src/ensure_buffer.ts @@ -0,0 +1,27 @@ +import { Buffer } from 'buffer'; +import { BSONTypeError } from './error'; +import { isAnyArrayBuffer } from './parser/utils'; + +/** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ +export function ensureBuffer(potentialBuffer: Buffer | ArrayBufferView | ArrayBuffer): Buffer { + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from( + potentialBuffer.buffer, + potentialBuffer.byteOffset, + potentialBuffer.byteLength + ); + } + + if (isAnyArrayBuffer(potentialBuffer)) { + return Buffer.from(potentialBuffer); + } + + throw new BSONTypeError('Must use either Buffer or TypedArray'); +} diff --git a/server/node_modules/bson/src/error.ts b/server/node_modules/bson/src/error.ts new file mode 100644 index 0000000000..8f1a41736c --- /dev/null +++ b/server/node_modules/bson/src/error.ts @@ -0,0 +1,23 @@ +/** @public */ +export class BSONError extends Error { + constructor(message: string) { + super(message); + Object.setPrototypeOf(this, BSONError.prototype); + } + + get name(): string { + return 'BSONError'; + } +} + +/** @public */ +export class BSONTypeError extends TypeError { + constructor(message: string) { + super(message); + Object.setPrototypeOf(this, BSONTypeError.prototype); + } + + get name(): string { + return 'BSONTypeError'; + } +} diff --git a/server/node_modules/bson/src/extended_json.ts b/server/node_modules/bson/src/extended_json.ts new file mode 100644 index 0000000000..90269623bf --- /dev/null +++ b/server/node_modules/bson/src/extended_json.ts @@ -0,0 +1,462 @@ +import { Binary } from './binary'; +import type { Document } from './bson'; +import { Code } from './code'; +import { DBRef, isDBRefLike } from './db_ref'; +import { Decimal128 } from './decimal128'; +import { Double } from './double'; +import { BSONError, BSONTypeError } from './error'; +import { Int32 } from './int_32'; +import { Long } from './long'; +import { MaxKey } from './max_key'; +import { MinKey } from './min_key'; +import { ObjectId } from './objectid'; +import { isDate, isObjectLike, isRegExp } from './parser/utils'; +import { BSONRegExp } from './regexp'; +import { BSONSymbol } from './symbol'; +import { Timestamp } from './timestamp'; + +/** @public */ +export type EJSONOptions = EJSON.Options; + +/** @internal */ +type BSONType = + | Binary + | Code + | DBRef + | Decimal128 + | Double + | Int32 + | Long + | MaxKey + | MinKey + | ObjectId + | BSONRegExp + | BSONSymbol + | Timestamp; + +export function isBSONType(value: unknown): value is BSONType { + return ( + isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string' + ); +} + +// INT32 boundaries +const BSON_INT32_MAX = 0x7fffffff; +const BSON_INT32_MIN = -0x80000000; +// INT64 boundaries +// const BSON_INT64_MAX = 0x7fffffffffffffff; // TODO(NODE-4377): This number cannot be precisely represented in JS +const BSON_INT64_MAX = 0x8000000000000000; +const BSON_INT64_MIN = -0x8000000000000000; + +// all the types where we don't need to do any special processing and can just pass the EJSON +//straight to type.fromExtendedJSON +const keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +} as const; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value: any, options: EJSON.Options = {}) { + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) return new Int32(value); + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) return Long.fromNumber(value); + } + + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') return value; + + // upgrade deprecated undefined to null + if (value.$undefined) return null; + + const keys = Object.keys(value).filter( + k => k.startsWith('$') && value[k] != null + ) as (keyof typeof keysToCodecs)[]; + for (let i = 0; i < keys.length; i++) { + const c = keysToCodecs[keys[i]]; + if (c) return c.fromExtendedJSON(value, options); + } + + if (value.$date != null) { + const d = value.$date; + const date = new Date(); + + if (options.legacy) { + if (typeof d === 'number') date.setTime(d); + else if (typeof d === 'string') date.setTime(Date.parse(d)); + } else { + if (typeof d === 'string') date.setTime(Date.parse(d)); + else if (Long.isLong(d)) date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) date.setTime(d); + } + return date; + } + + if (value.$code != null) { + const copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + + return Code.fromExtendedJSON(value); + } + + if (isDBRefLike(value) || value.$dbPointer) { + const v = value.$ref ? value : value.$dbPointer; + + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) return v; + + const dollarKeys = Object.keys(v).filter(k => k.startsWith('$')); + let valid = true; + dollarKeys.forEach(k => { + if (['$ref', '$id', '$db'].indexOf(k) === -1) valid = false; + }); + + // only make DBRef if $ keys are all valid + if (valid) return DBRef.fromExtendedJSON(v); + } + + return value; +} + +type EJSONSerializeOptions = EJSON.Options & { + seenObjects: { obj: unknown; propertyName: string }[]; +}; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array: any[], options: EJSONSerializeOptions): any[] { + return array.map((v: unknown, index: number) => { + options.seenObjects.push({ propertyName: `index ${index}`, obj: null }); + try { + return serializeValue(v, options); + } finally { + options.seenObjects.pop(); + } + }); +} + +function getISOString(date: Date) { + const isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value: any, options: EJSONSerializeOptions): any { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + const index = options.seenObjects.findIndex(entry => entry.obj === value); + if (index !== -1) { + const props = options.seenObjects.map(entry => entry.propertyName); + const leadingPart = props + .slice(0, index) + .map(prop => `${prop} -> `) + .join(''); + const alreadySeen = props[index]; + const circularPart = + ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(prop => `${prop} -> `) + .join(''); + const current = props[props.length - 1]; + const leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + const dashes = '-'.repeat( + circularPart.length + (alreadySeen.length + current.length) / 2 - 1 + ); + + throw new BSONTypeError( + 'Converting circular structure to EJSON:\n' + + ` ${leadingPart}${alreadySeen}${circularPart}${current}\n` + + ` ${leadingSpace}\\${dashes}/` + ); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + + if (Array.isArray(value)) return serializeArray(value, options); + + if (value === undefined) return null; + + if (value instanceof Date || isDate(value)) { + const dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + const int32Range = value >= BSON_INT32_MIN && value <= BSON_INT32_MAX, + int64Range = value >= BSON_INT64_MIN && value <= BSON_INT64_MAX; + + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) return { $numberInt: value.toString() }; + if (int64Range) return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + + if (value instanceof RegExp || isRegExp(value)) { + let flags = value.flags; + if (flags === undefined) { + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + + const rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + + if (value != null && typeof value === 'object') return serializeDocument(value, options); + return value; +} + +const BSON_TYPE_MAPPINGS = { + Binary: (o: Binary) => new Binary(o.value(), o.sub_type), + Code: (o: Code) => new Code(o.code, o.scope), + DBRef: (o: DBRef) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), // "namespace" for 1.x library backwards compat + Decimal128: (o: Decimal128) => new Decimal128(o.bytes), + Double: (o: Double) => new Double(o.value), + Int32: (o: Int32) => new Int32(o.value), + Long: ( + o: Long & { + low_: number; + high_: number; + unsigned_: boolean | undefined; + } + ) => + Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, + o.low != null ? o.high : o.high_, + o.low != null ? o.unsigned : o.unsigned_ + ), + MaxKey: () => new MaxKey(), + MinKey: () => new MinKey(), + ObjectID: (o: ObjectId) => new ObjectId(o), + ObjectId: (o: ObjectId) => new ObjectId(o), // support 4.0.0/4.0.1 before _bsontype was reverted back to ObjectID + BSONRegExp: (o: BSONRegExp) => new BSONRegExp(o.pattern, o.options), + Symbol: (o: BSONSymbol) => new BSONSymbol(o.value), + Timestamp: (o: Timestamp) => Timestamp.fromBits(o.low, o.high) +} as const; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc: any, options: EJSONSerializeOptions) { + if (doc == null || typeof doc !== 'object') throw new BSONError('not an object instance'); + + const bsontype: BSONType['_bsontype'] = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + const _doc: Document = {}; + for (const name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + const value = serializeValue(doc[name], options); + if (name === '__proto__') { + Object.defineProperty(_doc, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } else { + _doc[name] = value; + } + } finally { + options.seenObjects.pop(); + } + } + return _doc; + } else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let outDoc: any = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef( + serializeValue(outDoc.collection, options), + serializeValue(outDoc.oid, options), + serializeValue(outDoc.db, options), + serializeValue(outDoc.fields, options) + ); + } + + return outDoc.toExtendedJSON(options); + } else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} + +/** + * EJSON parse / stringify API + * @public + */ +// the namespace here is used to emulate `export * as EJSON from '...'` +// which as of now (sept 2020) api-extractor does not support +// eslint-disable-next-line @typescript-eslint/no-namespace +export namespace EJSON { + export interface Options { + /** Output using the Extended JSON v1 spec */ + legacy?: boolean; + /** Enable Extended JSON's `relaxed` mode, which attempts to return native JS types where possible, rather than BSON types */ + relaxed?: boolean; + /** + * Disable Extended JSON's `relaxed` mode, which attempts to return BSON types where possible, rather than native JS types + * @deprecated Please use the relaxed property instead + */ + strict?: boolean; + } + + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + export function parse(text: string, options?: EJSON.Options): SerializableTypes { + const finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') finalOptions.relaxed = !finalOptions.strict; + + return JSON.parse(text, (key, value) => { + if (key.indexOf('\x00') !== -1) { + throw new BSONError( + `BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}` + ); + } + return deserializeValue(value, finalOptions); + }); + } + + export type JSONPrimitive = string | number | boolean | null; + export type SerializableTypes = Document | Array | JSONPrimitive; + + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + export function stringify( + value: SerializableTypes, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSON.Options, + space?: string | number, + options?: EJSON.Options + ): string { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + + const doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer as Parameters[1], space); + } + + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + export function serialize(value: SerializableTypes, options?: EJSON.Options): Document { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + export function deserialize(ejson: Document, options?: EJSON.Options): SerializableTypes { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } +} diff --git a/server/node_modules/bson/src/int_32.ts b/server/node_modules/bson/src/int_32.ts new file mode 100644 index 0000000000..b3b5760cc1 --- /dev/null +++ b/server/node_modules/bson/src/int_32.ts @@ -0,0 +1,70 @@ +import type { EJSONOptions } from './extended_json'; + +/** @public */ +export interface Int32Extended { + $numberInt: string; +} + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +export class Int32 { + _bsontype!: 'Int32'; + + value!: number; + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + constructor(value: number | string) { + if (!(this instanceof Int32)) return new Int32(value); + + if ((value as unknown) instanceof Number) { + value = value.valueOf(); + } + + this.value = +value | 0; + } + + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + valueOf(): number { + return this.value; + } + + toString(radix?: number): string { + return this.value.toString(radix); + } + + toJSON(): number { + return this.value; + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): number | Int32Extended { + if (options && (options.relaxed || options.legacy)) return this.value; + return { $numberInt: this.value.toString() }; + } + + /** @internal */ + static fromExtendedJSON(doc: Int32Extended, options?: EJSONOptions): number | Int32 { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new Int32(${this.valueOf()})`; + } +} + +Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); diff --git a/server/node_modules/bson/src/long.ts b/server/node_modules/bson/src/long.ts new file mode 100644 index 0000000000..ed3f6e1b7b --- /dev/null +++ b/server/node_modules/bson/src/long.ts @@ -0,0 +1,1040 @@ +import type { EJSONOptions } from './extended_json'; +import { isObjectLike } from './parser/utils'; +import type { Timestamp } from './timestamp'; + +interface LongWASMHelpers { + /** Gets the high bits of the last operation performed */ + get_high(this: void): number; + div_u( + this: void, + lowBits: number, + highBits: number, + lowBitsDivisor: number, + highBitsDivisor: number + ): number; + div_s( + this: void, + lowBits: number, + highBits: number, + lowBitsDivisor: number, + highBitsDivisor: number + ): number; + rem_u( + this: void, + lowBits: number, + highBits: number, + lowBitsDivisor: number, + highBitsDivisor: number + ): number; + rem_s( + this: void, + lowBits: number, + highBits: number, + lowBitsDivisor: number, + highBitsDivisor: number + ): number; + mul( + this: void, + lowBits: number, + highBits: number, + lowBitsMultiplier: number, + highBitsMultiplier: number + ): number; +} + +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +let wasm: LongWASMHelpers | undefined = undefined; + +/* We do not want to have to include DOM types just for this check */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare const WebAssembly: any; + +try { + wasm = new WebAssembly.Instance( + new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11]) + ), + {} + ).exports as unknown as LongWASMHelpers; +} catch { + // no wasm support +} + +const TWO_PWR_16_DBL = 1 << 16; +const TWO_PWR_24_DBL = 1 << 24; +const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + +/** A cache of the Long representations of small integer values. */ +const INT_CACHE: { [key: number]: Long } = {}; + +/** A cache of the Long representations of small unsigned integer values. */ +const UINT_CACHE: { [key: number]: Long } = {}; + +/** @public */ +export interface LongExtended { + $numberLong: string; +} + +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +export class Long { + _bsontype!: 'Long'; + + /** An indicator used to reliably determine if an object is a Long or not. */ + __isLong__!: true; + + /** + * The high 32 bits as a signed value. + */ + high!: number; + + /** + * The low 32 bits as a signed value. + */ + low!: number; + + /** + * Whether unsigned or not. + */ + unsigned!: boolean; + + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(low: number | bigint | string = 0, high?: number | boolean, unsigned?: boolean) { + if (!(this instanceof Long)) return new Long(low, high, unsigned); + + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } else { + this.low = low | 0; + this.high = (high as number) | 0; + this.unsigned = !!unsigned; + } + + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + + static TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + + /** Maximum unsigned value. */ + static MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + static ZERO = Long.fromInt(0); + /** Unsigned zero. */ + static UZERO = Long.fromInt(0, true); + /** Signed one. */ + static ONE = Long.fromInt(1); + /** Unsigned one. */ + static UONE = Long.fromInt(1, true); + /** Signed negative one. */ + static NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + static MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + static MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long { + return new Long(lowBits, highBits, unsigned); + } + + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromInt(value: number, unsigned?: boolean): Long { + let obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) INT_CACHE[value] = obj; + return obj; + } + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromNumber(value: number, unsigned?: boolean): Long { + if (isNaN(value)) return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) return Long.UZERO; + if (value >= TWO_PWR_64_DBL) return Long.MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) return Long.MAX_VALUE; + } + if (value < 0) return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBigInt(value: bigint, unsigned?: boolean): Long { + return Long.fromString(value.toString(), unsigned); + } + + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean, radix?: number): Long { + if (str.length === 0) throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError('radix'); + + let p; + if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + const radixToPower = Long.fromNumber(Math.pow(radix, 8)); + + let result = Long.ZERO; + for (let i = 0; i < str.length; i += 8) { + const size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + const power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + } + + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long { + return new Long( + bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), + bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), + unsigned + ); + } + + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long { + return new Long( + (bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], + (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], + unsigned + ); + } + + /** + * Tests if the specified object is a Long. + */ + static isLong(value: unknown): value is Long { + return isObjectLike(value) && value['__isLong__'] === true; + } + + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + static fromValue( + val: number | string | { low: number; high: number; unsigned?: boolean }, + unsigned?: boolean + ): Long { + if (typeof val === 'number') return Long.fromNumber(val, unsigned); + if (typeof val === 'string') return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits( + val.low, + val.high, + typeof unsigned === 'boolean' ? unsigned : val.unsigned + ); + } + + /** Returns the sum of this and the specified Long. */ + add(addend: string | number | Long | Timestamp): Long { + if (!Long.isLong(addend)) addend = Long.fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + + const b48 = addend.high >>> 16; + const b32 = addend.high & 0xffff; + const b16 = addend.low >>> 16; + const b00 = addend.low & 0xffff; + + let c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + and(other: string | number | Long | Timestamp): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } + + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + compare(other: string | number | Long | Timestamp): 0 | 1 | -1 { + if (!Long.isLong(other)) other = Long.fromValue(other); + if (this.eq(other)) return 0; + const thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) return -1; + if (!thisNeg && otherNeg) return 1; + // At this point the sign bits are the same + if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + } + + /** This is an alias of {@link Long.compare} */ + comp(other: string | number | Long | Timestamp): 0 | 1 | -1 { + return this.compare(other); + } + + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + divide(divisor: string | number | Long | Timestamp): Long { + if (!Long.isLong(divisor)) divisor = Long.fromValue(divisor); + if (divisor.isZero()) throw Error('division by zero'); + + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if ( + !this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1 + ) { + // be consistent with non-wasm code path + return this; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + + if (this.isZero()) return this.unsigned ? Long.UZERO : Long.ZERO; + let approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(Long.MIN_VALUE)) return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) divisor = divisor.toUnsigned(); + if (divisor.gt(this)) return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + // eslint-disable-next-line @typescript-eslint/no-this-alias + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + let approxRes = Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) approxRes = Long.ONE; + + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } + + /**This is an alias of {@link Long.divide} */ + div(divisor: string | number | Long | Timestamp): Long { + return this.divide(divisor); + } + + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + equals(other: string | number | Long | Timestamp): boolean { + if (!Long.isLong(other)) other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + } + + /** This is an alias of {@link Long.equals} */ + eq(other: string | number | Long | Timestamp): boolean { + return this.equals(other); + } + + /** Gets the high 32 bits as a signed integer. */ + getHighBits(): number { + return this.high; + } + + /** Gets the high 32 bits as an unsigned integer. */ + getHighBitsUnsigned(): number { + return this.high >>> 0; + } + + /** Gets the low 32 bits as a signed integer. */ + getLowBits(): number { + return this.low; + } + + /** Gets the low 32 bits as an unsigned integer. */ + getLowBitsUnsigned(): number { + return this.low >>> 0; + } + + /** Gets the number of bits needed to represent the absolute value of this Long. */ + getNumBitsAbs(): number { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit: number; + for (bit = 31; bit > 0; bit--) if ((val & (1 << bit)) !== 0) break; + return this.high !== 0 ? bit + 33 : bit + 1; + } + + /** Tests if this Long's value is greater than the specified's. */ + greaterThan(other: string | number | Long | Timestamp): boolean { + return this.comp(other) > 0; + } + + /** This is an alias of {@link Long.greaterThan} */ + gt(other: string | number | Long | Timestamp): boolean { + return this.greaterThan(other); + } + + /** Tests if this Long's value is greater than or equal the specified's. */ + greaterThanOrEqual(other: string | number | Long | Timestamp): boolean { + return this.comp(other) >= 0; + } + + /** This is an alias of {@link Long.greaterThanOrEqual} */ + gte(other: string | number | Long | Timestamp): boolean { + return this.greaterThanOrEqual(other); + } + /** This is an alias of {@link Long.greaterThanOrEqual} */ + ge(other: string | number | Long | Timestamp): boolean { + return this.greaterThanOrEqual(other); + } + + /** Tests if this Long's value is even. */ + isEven(): boolean { + return (this.low & 1) === 0; + } + + /** Tests if this Long's value is negative. */ + isNegative(): boolean { + return !this.unsigned && this.high < 0; + } + + /** Tests if this Long's value is odd. */ + isOdd(): boolean { + return (this.low & 1) === 1; + } + + /** Tests if this Long's value is positive. */ + isPositive(): boolean { + return this.unsigned || this.high >= 0; + } + + /** Tests if this Long's value equals zero. */ + isZero(): boolean { + return this.high === 0 && this.low === 0; + } + + /** Tests if this Long's value is less than the specified's. */ + lessThan(other: string | number | Long | Timestamp): boolean { + return this.comp(other) < 0; + } + + /** This is an alias of {@link Long#lessThan}. */ + lt(other: string | number | Long | Timestamp): boolean { + return this.lessThan(other); + } + + /** Tests if this Long's value is less than or equal the specified's. */ + lessThanOrEqual(other: string | number | Long | Timestamp): boolean { + return this.comp(other) <= 0; + } + + /** This is an alias of {@link Long.lessThanOrEqual} */ + lte(other: string | number | Long | Timestamp): boolean { + return this.lessThanOrEqual(other); + } + + /** Returns this Long modulo the specified. */ + modulo(divisor: string | number | Long | Timestamp): Long { + if (!Long.isLong(divisor)) divisor = Long.fromValue(divisor); + + // use wasm support if present + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + + return this.sub(this.div(divisor).mul(divisor)); + } + + /** This is an alias of {@link Long.modulo} */ + mod(divisor: string | number | Long | Timestamp): Long { + return this.modulo(divisor); + } + /** This is an alias of {@link Long.modulo} */ + rem(divisor: string | number | Long | Timestamp): Long { + return this.modulo(divisor); + } + + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + multiply(multiplier: string | number | Long | Timestamp): Long { + if (this.isZero()) return Long.ZERO; + if (!Long.isLong(multiplier)) multiplier = Long.fromValue(multiplier); + + // use wasm support if present + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + + if (multiplier.isZero()) return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + + if (this.isNegative()) { + if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); + else return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 0xffff; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 0xffff; + + let c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + + /** This is an alias of {@link Long.multiply} */ + mul(multiplier: string | number | Long | Timestamp): Long { + return this.multiply(multiplier); + } + + /** Returns the Negation of this Long's value. */ + negate(): Long { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) return Long.MIN_VALUE; + return this.not().add(Long.ONE); + } + + /** This is an alias of {@link Long.negate} */ + neg(): Long { + return this.negate(); + } + + /** Returns the bitwise NOT of this Long. */ + not(): Long { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + } + + /** Tests if this Long's value differs from the specified's. */ + notEquals(other: string | number | Long | Timestamp): boolean { + return !this.equals(other); + } + + /** This is an alias of {@link Long.notEquals} */ + neq(other: string | number | Long | Timestamp): boolean { + return this.notEquals(other); + } + /** This is an alias of {@link Long.notEquals} */ + ne(other: string | number | Long | Timestamp): boolean { + return this.notEquals(other); + } + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: number | string | Long): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } + + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftLeft(numBits: number | Long): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return Long.fromBits( + this.low << numBits, + (this.high << numBits) | (this.low >>> (32 - numBits)), + this.unsigned + ); + else return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + } + + /** This is an alias of {@link Long.shiftLeft} */ + shl(numBits: number | Long): Long { + return this.shiftLeft(numBits); + } + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRight(numBits: number | Long): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return Long.fromBits( + (this.low >>> numBits) | (this.high << (32 - numBits)), + this.high >> numBits, + this.unsigned + ); + else return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + } + + /** This is an alias of {@link Long.shiftRight} */ + shr(numBits: number | Long): Long { + return this.shiftRight(numBits); + } + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRightUnsigned(numBits: Long | number): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return Long.fromBits( + (low >>> numBits) | (high << (32 - numBits)), + high >>> numBits, + this.unsigned + ); + } else if (numBits === 32) return Long.fromBits(high, 0, this.unsigned); + else return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + } + + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shr_u(numBits: number | Long): Long { + return this.shiftRightUnsigned(numBits); + } + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shru(numBits: number | Long): Long { + return this.shiftRightUnsigned(numBits); + } + + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + subtract(subtrahend: string | number | Long | Timestamp): Long { + if (!Long.isLong(subtrahend)) subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } + + /** This is an alias of {@link Long.subtract} */ + sub(subtrahend: string | number | Long | Timestamp): Long { + return this.subtract(subtrahend); + } + + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + toInt(): number { + return this.unsigned ? this.low >>> 0 : this.low; + } + + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + toNumber(): number { + if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + } + + /** Converts the Long to a BigInt (arbitrary precision). */ + toBigInt(): bigint { + return BigInt(this.toString()); + } + + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + toBytes(le?: boolean): number[] { + return le ? this.toBytesLE() : this.toBytesBE(); + } + + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + toBytesLE(): number[] { + const hi = this.high, + lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + } + + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + toBytesBE(): number[] { + const hi = this.high, + lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + } + + /** + * Converts this Long to signed. + */ + toSigned(): Long { + if (!this.unsigned) return this; + return Long.fromBits(this.low, this.high, false); + } + + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + toString(radix?: number): string { + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError('radix'); + if (this.isZero()) return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + const radixLong = Long.fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else return '-' + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + let rem: Long = this; + let result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } else { + while (digits.length < 6) digits = '0' + digits; + result = '' + digits + result; + } + } + } + + /** Converts this Long to unsigned. */ + toUnsigned(): Long { + if (this.unsigned) return this; + return Long.fromBits(this.low, this.high, true); + } + + /** Returns the bitwise XOR of this Long and the given one. */ + xor(other: Long | number | string): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + + /** This is an alias of {@link Long.isZero} */ + eqz(): boolean { + return this.isZero(); + } + + /** This is an alias of {@link Long.lessThanOrEqual} */ + le(other: string | number | Long | Timestamp): boolean { + return this.lessThanOrEqual(other); + } + + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + toExtendedJSON(options?: EJSONOptions): number | LongExtended { + if (options && options.relaxed) return this.toNumber(); + return { $numberLong: this.toString() }; + } + static fromExtendedJSON(doc: { $numberLong: string }, options?: EJSONOptions): number | Long { + const result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new Long("${this.toString()}"${this.unsigned ? ', true' : ''})`; + } +} + +Object.defineProperty(Long.prototype, '__isLong__', { value: true }); +Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); diff --git a/server/node_modules/bson/src/map.ts b/server/node_modules/bson/src/map.ts new file mode 100644 index 0000000000..ba00329687 --- /dev/null +++ b/server/node_modules/bson/src/map.ts @@ -0,0 +1,119 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +// We have an ES6 Map available, return the native instance + +import { getGlobal } from './utils/global'; + +/** @public */ +let bsonMap: MapConstructor; + +const bsonGlobal = getGlobal<{ Map?: MapConstructor }>(); +if (bsonGlobal.Map) { + bsonMap = bsonGlobal.Map; +} else { + // We will return a polyfill + bsonMap = class Map { + private _keys: string[]; + private _values: Record; + constructor(array: [string, any][] = []) { + this._keys = []; + this._values = {}; + + for (let i = 0; i < array.length; i++) { + if (array[i] == null) continue; // skip null and undefined + const entry = array[i]; + const key = entry[0]; + const value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + clear() { + this._keys = []; + this._values = {}; + } + delete(key: string) { + const value = this._values[key]; + if (value == null) return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + } + entries() { + let index = 0; + + return { + next: () => { + const key = this._keys[index++]; + return { + value: key !== undefined ? [key, this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + } + forEach(callback: (this: this, value: any, key: string, self: this) => void, self?: this) { + self = self || this; + + for (let i = 0; i < this._keys.length; i++) { + const key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + } + get(key: string) { + return this._values[key] ? this._values[key].v : undefined; + } + has(key: string) { + return this._values[key] != null; + } + keys() { + let index = 0; + + return { + next: () => { + const key = this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + } + set(key: string, value: any) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + } + values() { + let index = 0; + + return { + next: () => { + const key = this._keys[index++]; + return { + value: key !== undefined ? this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + } + get size() { + return this._keys.length; + } + } as unknown as MapConstructor; +} + +export { bsonMap as Map }; diff --git a/server/node_modules/bson/src/max_key.ts b/server/node_modules/bson/src/max_key.ts new file mode 100644 index 0000000000..0ff3d3633d --- /dev/null +++ b/server/node_modules/bson/src/max_key.ts @@ -0,0 +1,38 @@ +/** @public */ +export interface MaxKeyExtended { + $maxKey: 1; +} + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +export class MaxKey { + _bsontype!: 'MaxKey'; + + constructor() { + if (!(this instanceof MaxKey)) return new MaxKey(); + } + + /** @internal */ + toExtendedJSON(): MaxKeyExtended { + return { $maxKey: 1 }; + } + + /** @internal */ + static fromExtendedJSON(): MaxKey { + return new MaxKey(); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return 'new MaxKey()'; + } +} + +Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); diff --git a/server/node_modules/bson/src/min_key.ts b/server/node_modules/bson/src/min_key.ts new file mode 100644 index 0000000000..f872b1eb10 --- /dev/null +++ b/server/node_modules/bson/src/min_key.ts @@ -0,0 +1,38 @@ +/** @public */ +export interface MinKeyExtended { + $minKey: 1; +} + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +export class MinKey { + _bsontype!: 'MinKey'; + + constructor() { + if (!(this instanceof MinKey)) return new MinKey(); + } + + /** @internal */ + toExtendedJSON(): MinKeyExtended { + return { $minKey: 1 }; + } + + /** @internal */ + static fromExtendedJSON(): MinKey { + return new MinKey(); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return 'new MinKey()'; + } +} + +Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); diff --git a/server/node_modules/bson/src/objectid.ts b/server/node_modules/bson/src/objectid.ts new file mode 100644 index 0000000000..7bf012d7b7 --- /dev/null +++ b/server/node_modules/bson/src/objectid.ts @@ -0,0 +1,354 @@ +import { Buffer } from 'buffer'; +import { ensureBuffer } from './ensure_buffer'; +import { BSONTypeError } from './error'; +import { deprecate, isUint8Array, randomBytes } from './parser/utils'; + +// Regular expression that checks for hex value +const checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); + +// Unique sequence for the current process (initialized on first use) +let PROCESS_UNIQUE: Uint8Array | null = null; + +/** @public */ +export interface ObjectIdLike { + id: string | Buffer; + __id?: string; + toHexString(): string; +} + +/** @public */ +export interface ObjectIdExtended { + $oid: string; +} + +const kId = Symbol('id'); + +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +export class ObjectId { + _bsontype!: 'ObjectID'; + + /** @internal */ + static index = Math.floor(Math.random() * 0xffffff); + + static cacheHexString: boolean; + + /** ObjectId Bytes @internal */ + private [kId]!: Buffer; + /** ObjectId hexString cache @internal */ + private __id?: string; + + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + constructor(inputId?: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array) { + if (!(this instanceof ObjectId)) return new ObjectId(inputId); + + // workingId is set based on type of input and whether valid id exists for the input + let workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError( + 'Argument passed in must have an id that is of type string or Buffer' + ); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = Buffer.from(inputId.toHexString(), 'hex'); + } else { + workingId = inputId.id; + } + } else { + workingId = inputId; + } + + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof Buffer ? workingId : ensureBuffer(workingId); + } else if (typeof workingId === 'string') { + if (workingId.length === 12) { + const bytes = Buffer.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = Buffer.from(workingId, 'hex'); + } else { + throw new BSONTypeError( + 'Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer' + ); + } + } else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + + /** + * The ObjectId bytes + * @readonly + */ + get id(): Buffer { + return this[kId]; + } + + set id(value: Buffer) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + } + + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get generationTime(): number { + return this.id.readInt32BE(0); + } + + set generationTime(value: number) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + } + + /** Returns the ObjectId id as a 24 character hex string representation */ + toHexString(): string { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + + const hexString = this.id.toString('hex'); + + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + + return hexString; + } + + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + static getInc(): number { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + } + + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + static generate(time?: number): Buffer { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + + const inc = ObjectId.getInc(); + const buffer = Buffer.alloc(12); + + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + + return buffer; + } + + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + toString(format?: string): string { + // Is the id a buffer then use the buffer toString method to return the format + if (format) return this.id.toString(format); + return this.toHexString(); + } + + /** Converts to its JSON the 24 character hex string representation. */ + toJSON(): string { + return this.toHexString(); + } + + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + equals(otherId: string | ObjectId | ObjectIdLike): boolean { + if (otherId === undefined || otherId === null) { + return false; + } + + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + + if ( + typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id) + ) { + return otherId === Buffer.prototype.toString.call(this.id, 'latin1'); + } + + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return Buffer.from(otherId).equals(this.id); + } + + if ( + typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function' + ) { + const otherIdString = otherId.toHexString(); + const thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + + return false; + } + + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + getTimestamp(): Date { + const timestamp = new Date(); + const time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + } + + /** @internal */ + static createPk(): ObjectId { + return new ObjectId(); + } + + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + static createFromTime(time: number): ObjectId { + const buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + } + + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + static createFromHexString(hexString: string): ObjectId { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError( + 'Argument passed in must be a single String of 12 bytes or a string of 24 hex characters' + ); + } + + return new ObjectId(Buffer.from(hexString, 'hex')); + } + + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + static isValid(id: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array): boolean { + if (id == null) return false; + + try { + new ObjectId(id); + return true; + } catch { + return false; + } + } + + /** @internal */ + toExtendedJSON(): ObjectIdExtended { + if (this.toHexString) return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + } + + /** @internal */ + static fromExtendedJSON(doc: ObjectIdExtended): ObjectId { + return new ObjectId(doc.$oid); + } + + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new ObjectId("${this.toHexString()}")`; + } +} + +// Deprecated methods +Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate( + (time: number) => ObjectId.generate(time), + 'Please use the static `ObjectId.generate(time)` instead' + ) +}); + +Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(() => ObjectId.getInc(), 'Please use the static `ObjectId.getInc()` instead') +}); + +Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(() => ObjectId.getInc(), 'Please use the static `ObjectId.getInc()` instead') +}); + +Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(() => ObjectId.getInc(), 'Please use the static `ObjectId.getInc()` instead') +}); + +Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); diff --git a/server/node_modules/bson/src/parser/calculate_size.ts b/server/node_modules/bson/src/parser/calculate_size.ts new file mode 100644 index 0000000000..cc7f431e6d --- /dev/null +++ b/server/node_modules/bson/src/parser/calculate_size.ts @@ -0,0 +1,228 @@ +import { Buffer } from 'buffer'; +import { Binary } from '../binary'; +import type { Document } from '../bson'; +import * as constants from '../constants'; +import { isAnyArrayBuffer, isDate, isRegExp, normalizedFunctionString } from './utils'; + +export function calculateObjectSize( + object: Document, + serializeFunctions?: boolean, + ignoreUndefined?: boolean +): number { + let totalLength = 4 + 1; + + if (Array.isArray(object)) { + for (let i = 0; i < object.length; i++) { + totalLength += calculateElement( + i.toString(), + object[i], + serializeFunctions, + true, + ignoreUndefined + ); + } + } else { + // If we have toBSON defined, override the current object + + if (typeof object?.toBSON === 'function') { + object = object.toBSON(); + } + + // Calculate size + for (const key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + + return totalLength; +} + +/** @internal */ +function calculateElement( + name: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any, + serializeFunctions = false, + isArray = false, + ignoreUndefined = false +) { + // If we have toBSON defined, override the current object + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + + switch (typeof value) { + case 'string': + return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1; + case 'number': + if ( + Math.floor(value) === value && + value >= constants.JS_INT_MIN && + value <= constants.JS_INT_MAX + ) { + if (value >= constants.BSON_INT32_MIN && value <= constants.BSON_INT32_MAX) { + // 32 bit + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } else { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } else { + // 64 bit + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + } else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } else if (value instanceof Date || isDate(value)) { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } else if ( + ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value) + ) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength + ); + } else if ( + value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp' + ) { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + Buffer.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined) + ); + } else { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + Buffer.byteLength(value.code.toString(), 'utf8') + + 1 + ); + } + } else if (value['_bsontype'] === 'Binary') { + const binary: Binary = value; + // Check what kind of subtype we have + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + (binary.position + 1 + 4 + 1 + 4) + ); + } else { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (binary.position + 1 + 4 + 1) + ); + } + } else if (value['_bsontype'] === 'Symbol') { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + Buffer.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1 + ); + } else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + const ordered_values = Object.assign( + { + $ref: value.collection, + $id: value.oid + }, + value.fields + ); + + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined) + ); + } else if (value instanceof RegExp || isRegExp(value)) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1 + ); + } else if (value['_bsontype'] === 'BSONRegExp') { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.pattern, 'utf8') + + 1 + + Buffer.byteLength(value.options, 'utf8') + + 1 + ); + } else { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + + 1 + ); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1 + ); + } else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined) + ); + } else if (serializeFunctions) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + ); + } + } + } + + return 0; +} diff --git a/server/node_modules/bson/src/parser/deserializer.ts b/server/node_modules/bson/src/parser/deserializer.ts new file mode 100644 index 0000000000..faef442f4a --- /dev/null +++ b/server/node_modules/bson/src/parser/deserializer.ts @@ -0,0 +1,782 @@ +import { Buffer } from 'buffer'; +import { Binary } from '../binary'; +import type { Document } from '../bson'; +import { Code } from '../code'; +import * as constants from '../constants'; +import { DBRef, DBRefLike, isDBRefLike } from '../db_ref'; +import { Decimal128 } from '../decimal128'; +import { Double } from '../double'; +import { BSONError } from '../error'; +import { Int32 } from '../int_32'; +import { Long } from '../long'; +import { MaxKey } from '../max_key'; +import { MinKey } from '../min_key'; +import { ObjectId } from '../objectid'; +import { BSONRegExp } from '../regexp'; +import { BSONSymbol } from '../symbol'; +import { Timestamp } from '../timestamp'; +import { validateUtf8 } from '../validate_utf8'; + +/** @public */ +export interface DeserializeOptions { + /** evaluate functions in the BSON document scoped to the object deserialized. */ + evalFunctions?: boolean; + /** cache evaluated functions for reuse. */ + cacheFunctions?: boolean; + /** + * use a crc32 code for caching, otherwise use the string of the function. + * @deprecated this option to use the crc32 function never worked as intended + * due to the fact that the crc32 function itself was never implemented. + * */ + cacheFunctionsCrc32?: boolean; + /** when deserializing a Long will fit it into a Number if it's smaller than 53 bits */ + promoteLongs?: boolean; + /** when deserializing a Binary will return it as a node.js Buffer instance. */ + promoteBuffers?: boolean; + /** when deserializing will promote BSON values to their Node.js closest equivalent types. */ + promoteValues?: boolean; + /** allow to specify if there what fields we wish to return as unserialized raw buffer. */ + fieldsAsRaw?: Document; + /** return BSON regular expressions as BSONRegExp instances. */ + bsonRegExp?: boolean; + /** allows the buffer to be larger than the parsed BSON object */ + allowObjectSmallerThanBufferSize?: boolean; + /** Offset into buffer to begin reading document from */ + index?: number; + + raw?: boolean; + /** Allows for opt-out utf-8 validation for all keys or + * specified keys. Must be all true or all false. + * + * @example + * ```js + * // disables validation on all keys + * validation: { utf8: false } + * + * // enables validation only on specified keys a, b, and c + * validation: { utf8: { a: true, b: true, c: true } } + * + * // disables validation only on specified keys a, b + * validation: { utf8: { a: false, b: false } } + * ``` + */ + validation?: { utf8: boolean | Record | Record }; +} + +// Internal long versions +const JS_INT_MAX_LONG = Long.fromNumber(constants.JS_INT_MAX); +const JS_INT_MIN_LONG = Long.fromNumber(constants.JS_INT_MIN); + +const functionCache: { [hash: string]: Function } = {}; + +export function deserialize( + buffer: Buffer, + options: DeserializeOptions, + isArray?: boolean +): Document { + options = options == null ? {} : options; + const index = options && options.index ? options.index : 0; + // Read the document size + const size = + buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + + if (size < 5) { + throw new BSONError(`bson size must be >= 5, is ${size}`); + } + + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError(`buffer length ${buffer.length} must be >= bson size ${size}`); + } + + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError(`buffer length ${buffer.length} must === bson size ${size}`); + } + + if (size + index > buffer.byteLength) { + throw new BSONError( + `(bson size ${size} + options.index ${index} must be <= buffer length ${buffer.byteLength})` + ); + } + + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError( + "One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00" + ); + } + + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); +} + +const allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; + +function deserializeObject( + buffer: Buffer, + index: number, + options: DeserializeOptions, + isArray = false +) { + const evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + const cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + + const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + + // Return raw bson buffer instead of parsing it + const raw = options['raw'] == null ? false : options['raw']; + + // Return BSONRegExp objects instead of native regular expressions + const bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + + // Controls the promotion of values vs wrapper classes + const promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + const promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + const promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + + // Ensures default validation option if none given + const validation = options.validation == null ? { utf8: true } : options.validation; + + // Shows if global utf-8 validation is enabled or disabled + let globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + let validationSetting: boolean; + // Set of keys either to enable or disable validation on + const utf8KeysSet = new Set(); + + // Check for boolean uniformity and empty validation option + const utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } else { + globalUTFValidation = false; + const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(item => item === validationSetting)) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (const key of Object.keys(utf8ValidatedKeys)) { + utf8KeysSet.add(key); + } + } + + // Set the start index + const startIndex = index; + + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) throw new BSONError('corrupt bson message < 5 bytes long'); + + // Read the document size + const size = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) throw new BSONError('corrupt bson message'); + + // Create holding object + const object: Document = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + let arrayIndex = 0; + const done = false; + + let isPossibleDBRef = isArray ? false : null; + + // While we have more left data left keep parsing + const dataview = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength); + while (!done) { + // Read the type + const elementType = buffer[index++]; + + // If we get a zero it's the last byte, exit + if (elementType === 0) break; + + // Get the start search index + let i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) throw new BSONError('Bad BSON Document: illegal CString'); + + // Represents the key + const name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + + // shouldValidateKey is true if the key should be validated, false otherwise + let shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } else { + shouldValidateKey = !validationSetting; + } + + if (isPossibleDBRef !== false && (name as string)[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name as string); + } + let value; + + index = i + 1; + + if (elementType === constants.BSON_DATA_STRING) { + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } else if (elementType === constants.BSON_DATA_OID) { + const oid = Buffer.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } else if (elementType === constants.BSON_DATA_INT && promoteValues === false) { + value = new Int32( + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24) + ); + } else if (elementType === constants.BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } else if (elementType === constants.BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(dataview.getFloat64(index, true)); + index = index + 8; + } else if (elementType === constants.BSON_DATA_NUMBER) { + value = dataview.getFloat64(index, true); + index = index + 8; + } else if (elementType === constants.BSON_DATA_DATE) { + const lowBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const highBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } else if (elementType === constants.BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } else if (elementType === constants.BSON_DATA_OBJECT) { + const _index = index; + const objectSize = + buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } else { + let objectOptions = options; + if (!globalUTFValidation) { + objectOptions = { ...options, validation: { utf8: shouldValidateKey } }; + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + + index = index + objectSize; + } else if (elementType === constants.BSON_DATA_ARRAY) { + const _index = index; + const objectSize = + buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + let arrayOptions = options; + + // Stop index + const stopIndex = index + objectSize; + + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (const n in options) { + ( + arrayOptions as { + [key: string]: DeserializeOptions[keyof DeserializeOptions]; + } + )[n] = options[n as keyof DeserializeOptions]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = { ...arrayOptions, validation: { utf8: shouldValidateKey } }; + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + + if (buffer[index - 1] !== 0) throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) throw new BSONError('corrupted array bson'); + } else if (elementType === constants.BSON_DATA_UNDEFINED) { + value = undefined; + } else if (elementType === constants.BSON_DATA_NULL) { + value = null; + } else if (elementType === constants.BSON_DATA_LONG) { + // Unpack the low and high bits + const lowBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const highBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } else { + value = long; + } + } else if (elementType === constants.BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + const bytes = Buffer.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + const decimal128 = new Decimal128(bytes) as Decimal128 | { toObject(): unknown }; + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } else { + value = decimal128; + } + } else if (elementType === constants.BSON_DATA_BINARY) { + let binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const totalBinarySize = binarySize; + const subType = buffer[index++]; + + // Did we have a negative binary size, throw + if (binarySize < 0) throw new BSONError('Negative binary type element size found'); + + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + if (subType === constants.BSON_BINARY_SUBTYPE_UUID_NEW) { + value = value.toUUID(); + } + } + } else { + const _buffer = Buffer.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + + if (promoteBuffers && promoteValues) { + value = _buffer; + } else if (subType === constants.BSON_BINARY_SUBTYPE_UUID_NEW) { + value = new Binary(buffer.slice(index, index + binarySize), subType).toUUID(); + } else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } + + // Update the index + index = index + binarySize; + } else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + + // For each option add the corresponding one for javascript + const optionsArray = new Array(regExpOptions.length); + + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + + value = new RegExp(source, optionsArray.join('')); + } else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const source = buffer.toString('utf8', index, i); + index = i + 1; + + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + + // Set the object + value = new BSONRegExp(source, regExpOptions); + } else if (elementType === constants.BSON_DATA_SYMBOL) { + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + const symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } else if (elementType === constants.BSON_DATA_TIMESTAMP) { + const lowBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const highBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + + value = new Timestamp(lowBits, highBits); + } else if (elementType === constants.BSON_DATA_MIN_KEY) { + value = new MinKey(); + } else if (elementType === constants.BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } else if (elementType === constants.BSON_DATA_CODE) { + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + const functionString = getValidatedString( + buffer, + index, + index + stringSize - 1, + shouldValidateKey + ); + + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } else { + value = isolateEval(functionString); + } + } else { + value = new Code(functionString); + } + + // Update parse index position + index = index + stringSize; + } else if (elementType === constants.BSON_DATA_CODE_W_SCOPE) { + const totalSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + + // Get the code string size + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + + // Javascript function + const functionString = getValidatedString( + buffer, + index, + index + stringSize - 1, + shouldValidateKey + ); + // Update parse index position + index = index + stringSize; + // Parse the element + const _index = index; + // Decode the size of the object document + const objectSize = + buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + const scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } else { + value = isolateEval(functionString); + } + + value.scope = scopeObject; + } else { + value = new Code(functionString, scopeObject); + } + } else if (elementType === constants.BSON_DATA_DBPOINTER) { + // Get the code string size + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + const namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + + // Read the oid + const oidBuffer = Buffer.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + const oid = new ObjectId(oidBuffer); + + // Update the index + index = index + 12; + + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } else { + throw new BSONError( + `Detected unknown BSON type ${elementType.toString(16)} for fieldname "${name}"` + ); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } else { + object[name] = value; + } + } + + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) return object; + + if (isDBRefLike(object)) { + const copy = Object.assign({}, object) as Partial; + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + + return object; +} + +/** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ +function isolateEval( + functionString: string, + functionCache?: { [hash: string]: Function }, + object?: Document +) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + if (!functionCache) return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + // eslint-disable-next-line @typescript-eslint/no-implied-eval + functionCache[functionString] = new Function(functionString); + } + + // Set the object + return functionCache[functionString].bind(object); +} + +function getValidatedString( + buffer: Buffer, + start: number, + end: number, + shouldValidateUtf8: boolean +) { + const value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (let i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; +} diff --git a/server/node_modules/bson/src/parser/serializer.ts b/server/node_modules/bson/src/parser/serializer.ts new file mode 100644 index 0000000000..e76402aa39 --- /dev/null +++ b/server/node_modules/bson/src/parser/serializer.ts @@ -0,0 +1,1076 @@ +import type { Buffer } from 'buffer'; +import { Binary } from '../binary'; +import type { BSONSymbol, DBRef, Document, MaxKey } from '../bson'; +import type { Code } from '../code'; +import * as constants from '../constants'; +import type { DBRefLike } from '../db_ref'; +import type { Decimal128 } from '../decimal128'; +import type { Double } from '../double'; +import { ensureBuffer } from '../ensure_buffer'; +import { BSONError, BSONTypeError } from '../error'; +import { isBSONType } from '../extended_json'; +import type { Int32 } from '../int_32'; +import { Long } from '../long'; +import { Map } from '../map'; +import type { MinKey } from '../min_key'; +import type { ObjectId } from '../objectid'; +import type { BSONRegExp } from '../regexp'; +import { + isBigInt64Array, + isBigUInt64Array, + isDate, + isMap, + isRegExp, + isUint8Array, + normalizedFunctionString +} from './utils'; + +/** @public */ +export interface SerializeOptions { + /** the serializer will check if keys are valid. */ + checkKeys?: boolean; + /** serialize the javascript functions **(default:false)**. */ + serializeFunctions?: boolean; + /** serialize will not emit undefined fields **(default:true)** */ + ignoreUndefined?: boolean; + /** @internal Resize internal buffer */ + minInternalBufferSize?: number; + /** the index in the buffer where we wish to start serializing into */ + index?: number; +} + +const regexp = /\x00/; // eslint-disable-line no-control-regex +const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); + +/* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ + +function serializeString( + buffer: Buffer, + key: string, + value: string, + index: number, + isArray?: boolean +) { + // Encode String type + buffer[index++] = constants.BSON_DATA_STRING; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + const size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; +} + +const SPACE_FOR_FLOAT64 = new Uint8Array(8); +const DV_FOR_FLOAT64 = new DataView( + SPACE_FOR_FLOAT64.buffer, + SPACE_FOR_FLOAT64.byteOffset, + SPACE_FOR_FLOAT64.byteLength +); +function serializeNumber( + buffer: Buffer, + key: string, + value: number, + index: number, + isArray?: boolean +) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if ( + Number.isInteger(value) && + value >= constants.BSON_INT32_MIN && + value <= constants.BSON_INT32_MAX + ) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = constants.BSON_DATA_INT; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } else { + // Encode as double + buffer[index++] = constants.BSON_DATA_NUMBER; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + DV_FOR_FLOAT64.setFloat64(0, value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + // Adjust index + index = index + 8; + } + + return index; +} + +function serializeNull(buffer: Buffer, key: string, _: unknown, index: number, isArray?: boolean) { + // Set long type + buffer[index++] = constants.BSON_DATA_NULL; + + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} + +function serializeBoolean( + buffer: Buffer, + key: string, + value: boolean, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_BOOLEAN; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; +} + +function serializeDate(buffer: Buffer, key: string, value: Date, index: number, isArray?: boolean) { + // Write the type + buffer[index++] = constants.BSON_DATA_DATE; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Write the date + const dateInMilis = Long.fromNumber(value.getTime()); + const lowBits = dateInMilis.getLowBits(); + const highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} + +function serializeRegExp( + buffer: Buffer, + key: string, + value: RegExp, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) buffer[index++] = 0x69; // i + if (value.global) buffer[index++] = 0x73; // s + if (value.multiline) buffer[index++] = 0x6d; // m + + // Add ending zero + buffer[index++] = 0x00; + return index; +} + +function serializeBSONRegExp( + buffer: Buffer, + key: string, + value: BSONRegExp, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; +} + +function serializeMinMax( + buffer: Buffer, + key: string, + value: MinKey | MaxKey, + index: number, + isArray?: boolean +) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = constants.BSON_DATA_NULL; + } else if (value._bsontype === 'MinKey') { + buffer[index++] = constants.BSON_DATA_MIN_KEY; + } else { + buffer[index++] = constants.BSON_DATA_MAX_KEY; + } + + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} + +function serializeObjectId( + buffer: Buffer, + key: string, + value: ObjectId, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_OID; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + + // Adjust index + return index + 12; +} + +function serializeBuffer( + buffer: Buffer, + key: string, + value: Buffer | Uint8Array, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + const size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = constants.BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; +} + +function serializeObject( + buffer: Buffer, + key: string, + value: Document, + index: number, + checkKeys = false, + depth = 0, + serializeFunctions = false, + ignoreUndefined = true, + isArray = false, + path: Document[] = [] +) { + for (let i = 0; i < path.length; i++) { + if (path[i] === value) throw new BSONError('cyclic dependency detected'); + } + + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? constants.BSON_DATA_ARRAY : constants.BSON_DATA_OBJECT; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const endIndex = serializeInto( + buffer, + value, + checkKeys, + index, + depth + 1, + serializeFunctions, + ignoreUndefined, + path + ); + // Pop stack + path.pop(); + return endIndex; +} + +function serializeDecimal128( + buffer: Buffer, + key: string, + value: Decimal128, + index: number, + isArray?: boolean +) { + buffer[index++] = constants.BSON_DATA_DECIMAL128; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; +} + +function serializeLong(buffer: Buffer, key: string, value: Long, index: number, isArray?: boolean) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? constants.BSON_DATA_LONG : constants.BSON_DATA_TIMESTAMP; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + const lowBits = value.getLowBits(); + const highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} + +function serializeInt32( + buffer: Buffer, + key: string, + value: Int32 | number, + index: number, + isArray?: boolean +) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = constants.BSON_DATA_INT; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; +} + +function serializeDouble( + buffer: Buffer, + key: string, + value: Double, + index: number, + isArray?: boolean +) { + // Encode as double + buffer[index++] = constants.BSON_DATA_NUMBER; + + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Write float + DV_FOR_FLOAT64.setFloat64(0, value.value, true); + buffer.set(SPACE_FOR_FLOAT64, index); + + // Adjust index + index = index + 8; + return index; +} + +function serializeFunction( + buffer: Buffer, + key: string, + value: Function, + index: number, + _checkKeys = false, + _depth = 0, + isArray?: boolean +) { + buffer[index++] = constants.BSON_DATA_CODE; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + const functionString = normalizedFunctionString(value); + + // Write the string + const size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} + +function serializeCode( + buffer: Buffer, + key: string, + value: Code, + index: number, + checkKeys = false, + depth = 0, + serializeFunctions = false, + ignoreUndefined = true, + isArray = false +) { + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = constants.BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Starting index + let startIndex = index; + + // Serialize the function + // Get the function string + const functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + const codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + + // + // Serialize the scope value + const endIndex = serializeInto( + buffer, + value.scope, + checkKeys, + index, + depth + 1, + serializeFunctions, + ignoreUndefined + ); + index = endIndex - 1; + + // Writ the total + const totalSize = endIndex - startIndex; + + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } else { + buffer[index++] = constants.BSON_DATA_CODE; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + const functionString = value.code.toString(); + // Write the string + const size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + + return index; +} + +function serializeBinary( + buffer: Buffer, + key: string, + value: Binary, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + const data = value.value(true) as Buffer | Uint8Array; + // Calculate size + let size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; +} + +function serializeSymbol( + buffer: Buffer, + key: string, + value: BSONSymbol, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_SYMBOL; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + const size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; +} + +function serializeDBRef( + buffer: Buffer, + key: string, + value: DBRef, + index: number, + depth: number, + serializeFunctions: boolean, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_OBJECT; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + let startIndex = index; + let output: DBRefLike = { + $ref: value.collection || value.namespace, // "namespace" was what library 1.x called "collection" + $id: value.oid + }; + + if (value.db != null) { + output.$db = value.db; + } + + output = Object.assign(output, value.fields); + const endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + + // Calculate object size + const size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; +} + +export function serializeInto( + buffer: Buffer, + object: Document, + checkKeys = false, + startingIndex = 0, + depth = 0, + serializeFunctions = false, + ignoreUndefined = true, + path: Document[] = [] +): number { + startingIndex = startingIndex || 0; + path = path || []; + + // Push the object to the path + path.push(object); + + // Start place to serialize into + let index = startingIndex + 4; + + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (let i = 0; i < object.length; i++) { + const key = `${i}`; + let value = object[i]; + + // Is there an override value + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined, + true, + path + ); + } else if ( + typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128' + ) { + index = serializeDecimal128(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } else if (value['_bsontype'] === 'Code') { + index = serializeCode( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined, + true + ); + } else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError(`Unrecognized or invalid _bsontype: ${String(value['_bsontype'])}`); + } + } + } else if (object instanceof Map || isMap(object)) { + const iterator = object.entries(); + let done = false; + + while (!done) { + // Unpack the next entry + const entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) continue; + + // Get the entry values + const key = entry.value[0]; + const value = entry.value[1]; + + // Check the type of the value + const type = typeof value; + + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined, + false, + path + ); + } else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } else if (value['_bsontype'] === 'Code') { + index = serializeCode( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined + ); + } else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError(`Unrecognized or invalid _bsontype: ${String(value['_bsontype'])}`); + } + } + } else { + if (typeof object?.toBSON === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + + // Iterate over all the keys + for (const key in object) { + let value = object[key]; + // Is there an override value + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + + // Check the type of the value + const type = typeof value; + + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } else if (value === undefined) { + if (ignoreUndefined === false) index = serializeNull(buffer, key, value, index); + } else if (value === null) { + index = serializeNull(buffer, key, value, index); + } else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined, + false, + path + ); + } else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } else if (value['_bsontype'] === 'Code') { + index = serializeCode( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined + ); + } else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError(`Unrecognized or invalid _bsontype: ${String(value['_bsontype'])}`); + } + } + } + + // Remove the path + path.pop(); + + // Final padding byte for object + buffer[index++] = 0x00; + + // Final size + const size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; +} diff --git a/server/node_modules/bson/src/parser/utils.ts b/server/node_modules/bson/src/parser/utils.ts new file mode 100644 index 0000000000..abf935df5b --- /dev/null +++ b/server/node_modules/bson/src/parser/utils.ts @@ -0,0 +1,127 @@ +import { Buffer } from 'buffer'; +import { getGlobal } from '../utils/global'; + +type RandomBytesFunction = (size: number) => Uint8Array; + +/** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ +export function normalizedFunctionString(fn: Function): string { + return fn.toString().replace('function(', 'function ('); +} + +function isReactNative() { + const g = getGlobal<{ navigator?: { product?: string } }>(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; +} + +const insecureRandomBytes: RandomBytesFunction = function insecureRandomBytes(size: number) { + const insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + + const result = Buffer.alloc(size); + for (let i = 0; i < size; ++i) result[i] = Math.floor(Math.random() * 256); + return result; +}; + +/* We do not want to have to include DOM types just for this check */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare let window: any; +declare let require: Function; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare let global: any; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare let process: any; // Used by @rollup/plugin-replace + +const detectRandomBytes = (): RandomBytesFunction => { + if (process.browser) { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + const target = window.crypto || window.msCrypto; // allow for IE11 + if (target && target.getRandomValues) { + return size => target.getRandomValues(Buffer.alloc(size)); + } + } + + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return size => global.crypto.getRandomValues(Buffer.alloc(size)); + } + + return insecureRandomBytes; + } else { + let requiredRandomBytes: RandomBytesFunction | null | undefined; + try { + requiredRandomBytes = require('crypto').randomBytes; + } catch (e) { + // keep the fallback + } + + // NOTE: in transpiled cases the above require might return null/undefined + + return requiredRandomBytes || insecureRandomBytes; + } +}; + +export const randomBytes = detectRandomBytes(); + +export function isAnyArrayBuffer(value: unknown): value is ArrayBuffer { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes( + Object.prototype.toString.call(value) + ); +} + +export function isUint8Array(value: unknown): value is Uint8Array { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; +} + +export function isBigInt64Array(value: unknown): value is BigInt64Array { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; +} + +export function isBigUInt64Array(value: unknown): value is BigUint64Array { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; +} + +export function isRegExp(d: unknown): d is RegExp { + return Object.prototype.toString.call(d) === '[object RegExp]'; +} + +export function isMap(d: unknown): d is Map { + return Object.prototype.toString.call(d) === '[object Map]'; +} + +/** Call to check if your environment has `Buffer` */ +export function haveBuffer(): boolean { + return typeof global !== 'undefined' && typeof global.Buffer !== 'undefined'; +} + +// To ensure that 0.4 of node works correctly +export function isDate(d: unknown): d is Date { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; +} + +/** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ +export function isObjectLike(candidate: unknown): candidate is Record { + return typeof candidate === 'object' && candidate !== null; +} + +declare let console: { warn(...message: unknown[]): void }; +export function deprecate(fn: T, message: string): T { + let warned = false; + function deprecated(this: unknown, ...args: unknown[]) { + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated as unknown as T; +} diff --git a/server/node_modules/bson/src/regexp.ts b/server/node_modules/bson/src/regexp.ts new file mode 100644 index 0000000000..efd56280a1 --- /dev/null +++ b/server/node_modules/bson/src/regexp.ts @@ -0,0 +1,105 @@ +import { BSONError, BSONTypeError } from './error'; +import type { EJSONOptions } from './extended_json'; + +function alphabetize(str: string): string { + return str.split('').sort().join(''); +} + +/** @public */ +export interface BSONRegExpExtendedLegacy { + $regex: string | BSONRegExp; + $options: string; +} + +/** @public */ +export interface BSONRegExpExtended { + $regularExpression: { + pattern: string; + options: string; + }; +} + +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +export class BSONRegExp { + _bsontype!: 'BSONRegExp'; + + pattern!: string; + options!: string; + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + constructor(pattern: string, options?: string) { + if (!(this instanceof BSONRegExp)) return new BSONRegExp(pattern, options); + + this.pattern = pattern; + this.options = alphabetize(options ?? ''); + + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError( + `BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}` + ); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError( + `BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}` + ); + } + + // Validate options + for (let i = 0; i < this.options.length; i++) { + if ( + !( + this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u' + ) + ) { + throw new BSONError(`The regular expression option [${this.options[i]}] is not supported`); + } + } + } + + static parseOptions(options?: string): string { + return options ? options.split('').sort().join('') : ''; + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): BSONRegExpExtendedLegacy | BSONRegExpExtended { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + } + + /** @internal */ + static fromExtendedJSON(doc: BSONRegExpExtendedLegacy | BSONRegExpExtended): BSONRegExp { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc as unknown as BSONRegExp; + } + } else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp( + doc.$regularExpression.pattern, + BSONRegExp.parseOptions(doc.$regularExpression.options) + ); + } + throw new BSONTypeError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); + } +} + +Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); diff --git a/server/node_modules/bson/src/symbol.ts b/server/node_modules/bson/src/symbol.ts new file mode 100644 index 0000000000..1e82fc1c3b --- /dev/null +++ b/server/node_modules/bson/src/symbol.ts @@ -0,0 +1,58 @@ +/** @public */ +export interface BSONSymbolExtended { + $symbol: string; +} + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +export class BSONSymbol { + _bsontype!: 'Symbol'; + + value!: string; + /** + * @param value - the string representing the symbol. + */ + constructor(value: string) { + if (!(this instanceof BSONSymbol)) return new BSONSymbol(value); + + this.value = value; + } + + /** Access the wrapped string value. */ + valueOf(): string { + return this.value; + } + + toString(): string { + return this.value; + } + + /** @internal */ + inspect(): string { + return `new BSONSymbol("${this.value}")`; + } + + toJSON(): string { + return this.value; + } + + /** @internal */ + toExtendedJSON(): BSONSymbolExtended { + return { $symbol: this.value }; + } + + /** @internal */ + static fromExtendedJSON(doc: BSONSymbolExtended): BSONSymbol { + return new BSONSymbol(doc.$symbol); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } +} + +Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); diff --git a/server/node_modules/bson/src/timestamp.ts b/server/node_modules/bson/src/timestamp.ts new file mode 100644 index 0000000000..4c4b7e74c8 --- /dev/null +++ b/server/node_modules/bson/src/timestamp.ts @@ -0,0 +1,119 @@ +import { Long } from './long'; +import { isObjectLike } from './parser/utils'; + +/** @public */ +export type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect'; +/** @public */ +export type LongWithoutOverrides = new (low: unknown, high?: number, unsigned?: boolean) => { + [P in Exclude]: Long[P]; +}; +/** @public */ +export const LongWithoutOverridesClass: LongWithoutOverrides = + Long as unknown as LongWithoutOverrides; + +/** @public */ +export interface TimestampExtended { + $timestamp: { + t: number; + i: number; + }; +} + +/** + * @public + * @category BSONType + * */ +export class Timestamp extends LongWithoutOverridesClass { + _bsontype!: 'Timestamp'; + + static readonly MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + + /** + * @param low - A 64-bit Long representing the Timestamp. + */ + constructor(long: Long); + /** + * @param value - A pair of two values indicating timestamp and increment. + */ + constructor(value: { t: number; i: number }); + /** + * @param low - the low (signed) 32 bits of the Timestamp. + * @param high - the high (signed) 32 bits of the Timestamp. + * @deprecated Please use `Timestamp({ t: high, i: low })` or `Timestamp(Long(low, high))` instead. + */ + constructor(low: number, high: number); + constructor(low: number | Long | { t: number; i: number }, high?: number) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + if (!(this instanceof Timestamp)) return new Timestamp(low, high); + + if (Long.isLong(low)) { + super(low.low, low.high, true); + } else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + super(low.i, low.t, true); + } else { + super(low, high, true); + } + Object.defineProperty(this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + } + + toJSON(): { $timestamp: string } { + return { + $timestamp: this.toString() + }; + } + + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + static fromInt(value: number): Timestamp { + return new Timestamp(Long.fromInt(value, true)); + } + + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + static fromNumber(value: number): Timestamp { + return new Timestamp(Long.fromNumber(value, true)); + } + + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Timestamp { + return new Timestamp(lowBits, highBits); + } + + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + static fromString(str: string, optRadix: number): Timestamp { + return new Timestamp(Long.fromString(str, true, optRadix)); + } + + /** @internal */ + toExtendedJSON(): TimestampExtended { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + } + + /** @internal */ + static fromExtendedJSON(doc: TimestampExtended): Timestamp { + return new Timestamp(doc.$timestamp); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new Timestamp({ t: ${this.getHighBits()}, i: ${this.getLowBits()} })`; + } +} diff --git a/server/node_modules/bson/src/utils/global.ts b/server/node_modules/bson/src/utils/global.ts new file mode 100644 index 0000000000..3e45ffb8b7 --- /dev/null +++ b/server/node_modules/bson/src/utils/global.ts @@ -0,0 +1,22 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* We do not want to have to include DOM types just for this check */ +declare const window: unknown; +declare const self: unknown; +declare const global: unknown; + +function checkForMath(potentialGlobal: any) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; +} + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +export function getGlobal>(): T { + return ( + checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + // eslint-disable-next-line @typescript-eslint/no-implied-eval + Function('return this')() + ); +} diff --git a/server/node_modules/bson/src/uuid_utils.ts b/server/node_modules/bson/src/uuid_utils.ts new file mode 100644 index 0000000000..f37b065925 --- /dev/null +++ b/server/node_modules/bson/src/uuid_utils.ts @@ -0,0 +1,33 @@ +import { Buffer } from 'buffer'; +import { BSONTypeError } from './error'; + +// Validation regex for v4 uuid (validates with or without dashes) +const VALIDATION_REGEX = + /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; + +export const uuidValidateString = (str: string): boolean => + typeof str === 'string' && VALIDATION_REGEX.test(str); + +export const uuidHexStringToBuffer = (hexString: string): Buffer => { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError( + 'UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".' + ); + } + + const sanitizedHexString = hexString.replace(/-/g, ''); + return Buffer.from(sanitizedHexString, 'hex'); +}; + +export const bufferToUuidHexString = (buffer: Buffer, includeDashes = true): string => + includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); diff --git a/server/node_modules/bson/src/validate_utf8.ts b/server/node_modules/bson/src/validate_utf8.ts new file mode 100644 index 0000000000..e1da934c69 --- /dev/null +++ b/server/node_modules/bson/src/validate_utf8.ts @@ -0,0 +1,47 @@ +const FIRST_BIT = 0x80; +const FIRST_TWO_BITS = 0xc0; +const FIRST_THREE_BITS = 0xe0; +const FIRST_FOUR_BITS = 0xf0; +const FIRST_FIVE_BITS = 0xf8; + +const TWO_BIT_CHAR = 0xc0; +const THREE_BIT_CHAR = 0xe0; +const FOUR_BIT_CHAR = 0xf0; +const CONTINUING_CHAR = 0x80; + +/** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ +export function validateUtf8( + bytes: { [index: number]: number }, + start: number, + end: number +): boolean { + let continuation = 0; + + for (let i = start; i < end; i += 1) { + const byte = bytes[i]; + + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } else { + return false; + } + } + } + + return !continuation; +} diff --git a/server/node_modules/buffer/AUTHORS.md b/server/node_modules/buffer/AUTHORS.md new file mode 100644 index 0000000000..22eb17129e --- /dev/null +++ b/server/node_modules/buffer/AUTHORS.md @@ -0,0 +1,70 @@ +# Authors + +#### Ordered by first contribution. + +- Romain Beauxis (toots@rastageeks.org) +- Tobias Koppers (tobias.koppers@googlemail.com) +- Janus (ysangkok@gmail.com) +- Rainer Dreyer (rdrey1@gmail.com) +- Tõnis Tiigi (tonistiigi@gmail.com) +- James Halliday (mail@substack.net) +- Michael Williamson (mike@zwobble.org) +- elliottcable (github@elliottcable.name) +- rafael (rvalle@livelens.net) +- Andrew Kelley (superjoe30@gmail.com) +- Andreas Madsen (amwebdk@gmail.com) +- Mike Brevoort (mike.brevoort@pearson.com) +- Brian White (mscdex@mscdex.net) +- Feross Aboukhadijeh (feross@feross.org) +- Ruben Verborgh (ruben@verborgh.org) +- eliang (eliang.cs@gmail.com) +- Jesse Tane (jesse.tane@gmail.com) +- Alfonso Boza (alfonso@cloud.com) +- Mathias Buus (mathiasbuus@gmail.com) +- Devon Govett (devongovett@gmail.com) +- Daniel Cousens (github@dcousens.com) +- Joseph Dykstra (josephdykstra@gmail.com) +- Parsha Pourkhomami (parshap+git@gmail.com) +- Damjan Košir (damjan.kosir@gmail.com) +- daverayment (dave.rayment@gmail.com) +- kawanet (u-suke@kawa.net) +- Linus Unnebäck (linus@folkdatorn.se) +- Nolan Lawson (nolan.lawson@gmail.com) +- Calvin Metcalf (calvin.metcalf@gmail.com) +- Koki Takahashi (hakatasiloving@gmail.com) +- Guy Bedford (guybedford@gmail.com) +- Jan Schär (jscissr@gmail.com) +- RaulTsc (tomescu.raul@gmail.com) +- Matthieu Monsch (monsch@alum.mit.edu) +- Dan Ehrenberg (littledan@chromium.org) +- Kirill Fomichev (fanatid@ya.ru) +- Yusuke Kawasaki (u-suke@kawa.net) +- DC (dcposch@dcpos.ch) +- John-David Dalton (john.david.dalton@gmail.com) +- adventure-yunfei (adventure030@gmail.com) +- Emil Bay (github@tixz.dk) +- Sam Sudar (sudar.sam@gmail.com) +- Volker Mische (volker.mische@gmail.com) +- David Walton (support@geekstocks.com) +- Сковорода Никита Андреевич (chalkerx@gmail.com) +- greenkeeper[bot] (greenkeeper[bot]@users.noreply.github.com) +- ukstv (sergey.ukustov@machinomy.com) +- Renée Kooi (renee@kooi.me) +- ranbochen (ranbochen@qq.com) +- Vladimir Borovik (bobahbdb@gmail.com) +- greenkeeper[bot] (23040076+greenkeeper[bot]@users.noreply.github.com) +- kumavis (aaron@kumavis.me) +- Sergey Ukustov (sergey.ukustov@machinomy.com) +- Fei Liu (liu.feiwood@gmail.com) +- Blaine Bublitz (blaine.bublitz@gmail.com) +- clement (clement@seald.io) +- Koushik Dutta (koushd@gmail.com) +- Jordan Harband (ljharb@gmail.com) +- Niklas Mischkulnig (mischnic@users.noreply.github.com) +- Nikolai Vavilov (vvnicholas@gmail.com) +- Fedor Nezhivoi (gyzerok@users.noreply.github.com) +- Peter Newman (peternewman@users.noreply.github.com) +- mathmakgakpak (44949126+mathmakgakpak@users.noreply.github.com) +- jkkang (jkkang@smartauth.kr) + +#### Generated by bin/update-authors.sh. diff --git a/server/node_modules/buffer/LICENSE b/server/node_modules/buffer/LICENSE new file mode 100644 index 0000000000..d6bf75dcf1 --- /dev/null +++ b/server/node_modules/buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh, and other contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/server/node_modules/buffer/README.md b/server/node_modules/buffer/README.md new file mode 100644 index 0000000000..9a23d7cfa3 --- /dev/null +++ b/server/node_modules/buffer/README.md @@ -0,0 +1,410 @@ +# buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/buffer/master.svg +[travis-url]: https://travis-ci.org/feross/buffer +[npm-image]: https://img.shields.io/npm/v/buffer.svg +[npm-url]: https://npmjs.org/package/buffer +[downloads-image]: https://img.shields.io/npm/dm/buffer.svg +[downloads-url]: https://npmjs.org/package/buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### The buffer module from [node.js](https://nodejs.org/), for the browser. + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[saucelabs-image]: https://saucelabs.com/browser-matrix/buffer.svg +[saucelabs-url]: https://saucelabs.com/u/buffer + +With [browserify](http://browserify.org), simply `require('buffer')` or use the `Buffer` global and you will get this module. + +The goal is to provide an API that is 100% identical to +[node's Buffer API](https://nodejs.org/api/buffer.html). Read the +[official docs](https://nodejs.org/api/buffer.html) for the full list of properties, +instance methods, and class methods that are supported. + +## features + +- Manipulate binary data like a boss, in all browsers! +- Super fast. Backed by Typed Arrays (`Uint8Array`/`ArrayBuffer`, not `Object`) +- Extremely small bundle size (**6.75KB minified + gzipped**, 51.9KB with comments) +- Excellent browser support (Chrome, Firefox, Edge, Safari 9+, IE 11, iOS 9+, Android, etc.) +- Preserves Node API exactly, with one minor difference (see below) +- Square-bracket `buf[4]` notation works! +- Does not modify any browser prototypes or put anything on `window` +- Comprehensive test suite (including all buffer tests from node.js core) + +## install + +To use this module directly (without browserify), install it: + +```bash +npm install buffer +``` + +This module was previously called **native-buffer-browserify**, but please use **buffer** +from now on. + +If you do not use a bundler, you can use the [standalone script](https://bundle.run/buffer). + +## usage + +The module's API is identical to node's `Buffer` API. Read the +[official docs](https://nodejs.org/api/buffer.html) for the full list of properties, +instance methods, and class methods that are supported. + +As mentioned above, `require('buffer')` or use the `Buffer` global with +[browserify](http://browserify.org) and this module will automatically be included +in your bundle. Almost any npm module will work in the browser, even if it assumes that +the node `Buffer` API will be available. + +To depend on this module explicitly (without browserify), require it like this: + +```js +var Buffer = require('buffer/').Buffer // note: the trailing slash is important! +``` + +To require this module explicitly, use `require('buffer/')` which tells the node.js module +lookup algorithm (also used by browserify) to use the **npm module** named `buffer` +instead of the **node.js core** module named `buffer`! + + +## how does it work? + +The Buffer constructor returns instances of `Uint8Array` that have their prototype +changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`, +so the returned instances will have all the node `Buffer` methods and the +`Uint8Array` methods. Square bracket notation works as expected -- it returns a +single octet. + +The `Uint8Array` prototype remains unmodified. + + +## tracking the latest node api + +This module tracks the Buffer API in the latest (unstable) version of node.js. The Buffer +API is considered **stable** in the +[node stability index](https://nodejs.org/docs/latest/api/documentation.html#documentation_stability_index), +so it is unlikely that there will ever be breaking changes. +Nonetheless, when/if the Buffer API changes in node, this module's API will change +accordingly. + +## related packages + +- [`buffer-reverse`](https://www.npmjs.com/package/buffer-reverse) - Reverse a buffer +- [`buffer-xor`](https://www.npmjs.com/package/buffer-xor) - Bitwise xor a buffer +- [`is-buffer`](https://www.npmjs.com/package/is-buffer) - Determine if an object is a Buffer without including the whole `Buffer` package + +## conversion packages + +### convert typed array to buffer + +Use [`typedarray-to-buffer`](https://www.npmjs.com/package/typedarray-to-buffer) to convert any kind of typed array to a `Buffer`. Does not perform a copy, so it's super fast. + +### convert buffer to typed array + +`Buffer` is a subclass of `Uint8Array` (which is a typed array). So there is no need to explicitly convert to typed array. Just use the buffer as a `Uint8Array`. + +### convert blob to buffer + +Use [`blob-to-buffer`](https://www.npmjs.com/package/blob-to-buffer) to convert a `Blob` to a `Buffer`. + +### convert buffer to blob + +To convert a `Buffer` to a `Blob`, use the `Blob` constructor: + +```js +var blob = new Blob([ buffer ]) +``` + +Optionally, specify a mimetype: + +```js +var blob = new Blob([ buffer ], { type: 'text/html' }) +``` + +### convert arraybuffer to buffer + +To convert an `ArrayBuffer` to a `Buffer`, use the `Buffer.from` function. Does not perform a copy, so it's super fast. + +```js +var buffer = Buffer.from(arrayBuffer) +``` + +### convert buffer to arraybuffer + +To convert a `Buffer` to an `ArrayBuffer`, use the `.buffer` property (which is present on all `Uint8Array` objects): + +```js +var arrayBuffer = buffer.buffer.slice( + buffer.byteOffset, buffer.byteOffset + buffer.byteLength +) +``` + +Alternatively, use the [`to-arraybuffer`](https://www.npmjs.com/package/to-arraybuffer) module. + +## performance + +See perf tests in `/perf`. + +`BrowserBuffer` is the browser `buffer` module (this repo). `Uint8Array` is included as a +sanity check (since `BrowserBuffer` uses `Uint8Array` under the hood, `Uint8Array` will +always be at least a bit faster). Finally, `NodeBuffer` is the node.js buffer module, +which is included to compare against. + +NOTE: Performance has improved since these benchmarks were taken. PR welcome to update the README. + +### Chrome 38 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 11,457,464 ops/sec | ±0.86% | 66 | ✓ | +| Uint8Array#bracket-notation | 10,824,332 ops/sec | ±0.74% | 65 | | +| | | | | +| BrowserBuffer#concat | 450,532 ops/sec | ±0.76% | 68 | | +| Uint8Array#concat | 1,368,911 ops/sec | ±1.50% | 62 | ✓ | +| | | | | +| BrowserBuffer#copy(16000) | 903,001 ops/sec | ±0.96% | 67 | | +| Uint8Array#copy(16000) | 1,422,441 ops/sec | ±1.04% | 66 | ✓ | +| | | | | +| BrowserBuffer#copy(16) | 11,431,358 ops/sec | ±0.46% | 69 | | +| Uint8Array#copy(16) | 13,944,163 ops/sec | ±1.12% | 68 | ✓ | +| | | | | +| BrowserBuffer#new(16000) | 106,329 ops/sec | ±6.70% | 44 | | +| Uint8Array#new(16000) | 131,001 ops/sec | ±2.85% | 31 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 1,554,491 ops/sec | ±1.60% | 65 | | +| Uint8Array#new(16) | 6,623,930 ops/sec | ±1.66% | 65 | ✓ | +| | | | | +| BrowserBuffer#readDoubleBE | 112,830 ops/sec | ±0.51% | 69 | ✓ | +| DataView#getFloat64 | 93,500 ops/sec | ±0.57% | 68 | | +| | | | | +| BrowserBuffer#readFloatBE | 146,678 ops/sec | ±0.95% | 68 | ✓ | +| DataView#getFloat32 | 99,311 ops/sec | ±0.41% | 67 | | +| | | | | +| BrowserBuffer#readUInt32LE | 843,214 ops/sec | ±0.70% | 69 | ✓ | +| DataView#getUint32 | 103,024 ops/sec | ±0.64% | 67 | | +| | | | | +| BrowserBuffer#slice | 1,013,941 ops/sec | ±0.75% | 67 | | +| Uint8Array#subarray | 1,903,928 ops/sec | ±0.53% | 67 | ✓ | +| | | | | +| BrowserBuffer#writeFloatBE | 61,387 ops/sec | ±0.90% | 67 | | +| DataView#setFloat32 | 141,249 ops/sec | ±0.40% | 66 | ✓ | + + +### Firefox 33 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 20,800,421 ops/sec | ±1.84% | 60 | | +| Uint8Array#bracket-notation | 20,826,235 ops/sec | ±2.02% | 61 | ✓ | +| | | | | +| BrowserBuffer#concat | 153,076 ops/sec | ±2.32% | 61 | | +| Uint8Array#concat | 1,255,674 ops/sec | ±8.65% | 52 | ✓ | +| | | | | +| BrowserBuffer#copy(16000) | 1,105,312 ops/sec | ±1.16% | 63 | | +| Uint8Array#copy(16000) | 1,615,911 ops/sec | ±0.55% | 66 | ✓ | +| | | | | +| BrowserBuffer#copy(16) | 16,357,599 ops/sec | ±0.73% | 68 | | +| Uint8Array#copy(16) | 31,436,281 ops/sec | ±1.05% | 68 | ✓ | +| | | | | +| BrowserBuffer#new(16000) | 52,995 ops/sec | ±6.01% | 35 | | +| Uint8Array#new(16000) | 87,686 ops/sec | ±5.68% | 45 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 252,031 ops/sec | ±1.61% | 66 | | +| Uint8Array#new(16) | 8,477,026 ops/sec | ±0.49% | 68 | ✓ | +| | | | | +| BrowserBuffer#readDoubleBE | 99,871 ops/sec | ±0.41% | 69 | | +| DataView#getFloat64 | 285,663 ops/sec | ±0.70% | 68 | ✓ | +| | | | | +| BrowserBuffer#readFloatBE | 115,540 ops/sec | ±0.42% | 69 | | +| DataView#getFloat32 | 288,722 ops/sec | ±0.82% | 68 | ✓ | +| | | | | +| BrowserBuffer#readUInt32LE | 633,926 ops/sec | ±1.08% | 67 | ✓ | +| DataView#getUint32 | 294,808 ops/sec | ±0.79% | 64 | | +| | | | | +| BrowserBuffer#slice | 349,425 ops/sec | ±0.46% | 69 | | +| Uint8Array#subarray | 5,965,819 ops/sec | ±0.60% | 65 | ✓ | +| | | | | +| BrowserBuffer#writeFloatBE | 59,980 ops/sec | ±0.41% | 67 | | +| DataView#setFloat32 | 317,634 ops/sec | ±0.63% | 68 | ✓ | + +### Safari 8 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 10,279,729 ops/sec | ±2.25% | 56 | ✓ | +| Uint8Array#bracket-notation | 10,030,767 ops/sec | ±2.23% | 59 | | +| | | | | +| BrowserBuffer#concat | 144,138 ops/sec | ±1.38% | 65 | | +| Uint8Array#concat | 4,950,764 ops/sec | ±1.70% | 63 | ✓ | +| | | | | +| BrowserBuffer#copy(16000) | 1,058,548 ops/sec | ±1.51% | 64 | | +| Uint8Array#copy(16000) | 1,409,666 ops/sec | ±1.17% | 65 | ✓ | +| | | | | +| BrowserBuffer#copy(16) | 6,282,529 ops/sec | ±1.88% | 58 | | +| Uint8Array#copy(16) | 11,907,128 ops/sec | ±2.87% | 58 | ✓ | +| | | | | +| BrowserBuffer#new(16000) | 101,663 ops/sec | ±3.89% | 57 | | +| Uint8Array#new(16000) | 22,050,818 ops/sec | ±6.51% | 46 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 176,072 ops/sec | ±2.13% | 64 | | +| Uint8Array#new(16) | 24,385,731 ops/sec | ±5.01% | 51 | ✓ | +| | | | | +| BrowserBuffer#readDoubleBE | 41,341 ops/sec | ±1.06% | 67 | | +| DataView#getFloat64 | 322,280 ops/sec | ±0.84% | 68 | ✓ | +| | | | | +| BrowserBuffer#readFloatBE | 46,141 ops/sec | ±1.06% | 65 | | +| DataView#getFloat32 | 337,025 ops/sec | ±0.43% | 69 | ✓ | +| | | | | +| BrowserBuffer#readUInt32LE | 151,551 ops/sec | ±1.02% | 66 | | +| DataView#getUint32 | 308,278 ops/sec | ±0.94% | 67 | ✓ | +| | | | | +| BrowserBuffer#slice | 197,365 ops/sec | ±0.95% | 66 | | +| Uint8Array#subarray | 9,558,024 ops/sec | ±3.08% | 58 | ✓ | +| | | | | +| BrowserBuffer#writeFloatBE | 17,518 ops/sec | ±1.03% | 63 | | +| DataView#setFloat32 | 319,751 ops/sec | ±0.48% | 68 | ✓ | + + +### Node 0.11.14 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 10,489,828 ops/sec | ±3.25% | 90 | | +| Uint8Array#bracket-notation | 10,534,884 ops/sec | ±0.81% | 92 | ✓ | +| NodeBuffer#bracket-notation | 10,389,910 ops/sec | ±0.97% | 87 | | +| | | | | +| BrowserBuffer#concat | 487,830 ops/sec | ±2.58% | 88 | | +| Uint8Array#concat | 1,814,327 ops/sec | ±1.28% | 88 | ✓ | +| NodeBuffer#concat | 1,636,523 ops/sec | ±1.88% | 73 | | +| | | | | +| BrowserBuffer#copy(16000) | 1,073,665 ops/sec | ±0.77% | 90 | | +| Uint8Array#copy(16000) | 1,348,517 ops/sec | ±0.84% | 89 | ✓ | +| NodeBuffer#copy(16000) | 1,289,533 ops/sec | ±0.82% | 93 | | +| | | | | +| BrowserBuffer#copy(16) | 12,782,706 ops/sec | ±0.74% | 85 | | +| Uint8Array#copy(16) | 14,180,427 ops/sec | ±0.93% | 92 | ✓ | +| NodeBuffer#copy(16) | 11,083,134 ops/sec | ±1.06% | 89 | | +| | | | | +| BrowserBuffer#new(16000) | 141,678 ops/sec | ±3.30% | 67 | | +| Uint8Array#new(16000) | 161,491 ops/sec | ±2.96% | 60 | | +| NodeBuffer#new(16000) | 292,699 ops/sec | ±3.20% | 55 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 1,655,466 ops/sec | ±2.41% | 82 | | +| Uint8Array#new(16) | 14,399,926 ops/sec | ±0.91% | 94 | ✓ | +| NodeBuffer#new(16) | 3,894,696 ops/sec | ±0.88% | 92 | | +| | | | | +| BrowserBuffer#readDoubleBE | 109,582 ops/sec | ±0.75% | 93 | ✓ | +| DataView#getFloat64 | 91,235 ops/sec | ±0.81% | 90 | | +| NodeBuffer#readDoubleBE | 88,593 ops/sec | ±0.96% | 81 | | +| | | | | +| BrowserBuffer#readFloatBE | 139,854 ops/sec | ±1.03% | 85 | ✓ | +| DataView#getFloat32 | 98,744 ops/sec | ±0.80% | 89 | | +| NodeBuffer#readFloatBE | 92,769 ops/sec | ±0.94% | 93 | | +| | | | | +| BrowserBuffer#readUInt32LE | 710,861 ops/sec | ±0.82% | 92 | | +| DataView#getUint32 | 117,893 ops/sec | ±0.84% | 91 | | +| NodeBuffer#readUInt32LE | 851,412 ops/sec | ±0.72% | 93 | ✓ | +| | | | | +| BrowserBuffer#slice | 1,673,877 ops/sec | ±0.73% | 94 | | +| Uint8Array#subarray | 6,919,243 ops/sec | ±0.67% | 90 | ✓ | +| NodeBuffer#slice | 4,617,604 ops/sec | ±0.79% | 93 | | +| | | | | +| BrowserBuffer#writeFloatBE | 66,011 ops/sec | ±0.75% | 93 | | +| DataView#setFloat32 | 127,760 ops/sec | ±0.72% | 93 | ✓ | +| NodeBuffer#writeFloatBE | 103,352 ops/sec | ±0.83% | 93 | | + +### iojs 1.8.1 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 10,990,488 ops/sec | ±1.11% | 91 | | +| Uint8Array#bracket-notation | 11,268,757 ops/sec | ±0.65% | 97 | | +| NodeBuffer#bracket-notation | 11,353,260 ops/sec | ±0.83% | 94 | ✓ | +| | | | | +| BrowserBuffer#concat | 378,954 ops/sec | ±0.74% | 94 | | +| Uint8Array#concat | 1,358,288 ops/sec | ±0.97% | 87 | | +| NodeBuffer#concat | 1,934,050 ops/sec | ±1.11% | 78 | ✓ | +| | | | | +| BrowserBuffer#copy(16000) | 894,538 ops/sec | ±0.56% | 84 | | +| Uint8Array#copy(16000) | 1,442,656 ops/sec | ±0.71% | 96 | | +| NodeBuffer#copy(16000) | 1,457,898 ops/sec | ±0.53% | 92 | ✓ | +| | | | | +| BrowserBuffer#copy(16) | 12,870,457 ops/sec | ±0.67% | 95 | | +| Uint8Array#copy(16) | 16,643,989 ops/sec | ±0.61% | 93 | ✓ | +| NodeBuffer#copy(16) | 14,885,848 ops/sec | ±0.74% | 94 | | +| | | | | +| BrowserBuffer#new(16000) | 109,264 ops/sec | ±4.21% | 63 | | +| Uint8Array#new(16000) | 138,916 ops/sec | ±1.87% | 61 | | +| NodeBuffer#new(16000) | 281,449 ops/sec | ±3.58% | 51 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 1,362,935 ops/sec | ±0.56% | 99 | | +| Uint8Array#new(16) | 6,193,090 ops/sec | ±0.64% | 95 | ✓ | +| NodeBuffer#new(16) | 4,745,425 ops/sec | ±1.56% | 90 | | +| | | | | +| BrowserBuffer#readDoubleBE | 118,127 ops/sec | ±0.59% | 93 | ✓ | +| DataView#getFloat64 | 107,332 ops/sec | ±0.65% | 91 | | +| NodeBuffer#readDoubleBE | 116,274 ops/sec | ±0.94% | 95 | | +| | | | | +| BrowserBuffer#readFloatBE | 150,326 ops/sec | ±0.58% | 95 | ✓ | +| DataView#getFloat32 | 110,541 ops/sec | ±0.57% | 98 | | +| NodeBuffer#readFloatBE | 121,599 ops/sec | ±0.60% | 87 | | +| | | | | +| BrowserBuffer#readUInt32LE | 814,147 ops/sec | ±0.62% | 93 | | +| DataView#getUint32 | 137,592 ops/sec | ±0.64% | 90 | | +| NodeBuffer#readUInt32LE | 931,650 ops/sec | ±0.71% | 96 | ✓ | +| | | | | +| BrowserBuffer#slice | 878,590 ops/sec | ±0.68% | 93 | | +| Uint8Array#subarray | 2,843,308 ops/sec | ±1.02% | 90 | | +| NodeBuffer#slice | 4,998,316 ops/sec | ±0.68% | 90 | ✓ | +| | | | | +| BrowserBuffer#writeFloatBE | 65,927 ops/sec | ±0.74% | 93 | | +| DataView#setFloat32 | 139,823 ops/sec | ±0.97% | 89 | ✓ | +| NodeBuffer#writeFloatBE | 135,763 ops/sec | ±0.65% | 96 | | +| | | | | + +## Testing the project + +First, install the project: + + npm install + +Then, to run tests in Node.js, run: + + npm run test-node + +To test locally in a browser, you can run: + + npm run test-browser-es5-local # For ES5 browsers that don't support ES6 + npm run test-browser-es6-local # For ES6 compliant browsers + +This will print out a URL that you can then open in a browser to run the tests, using [airtap](https://www.npmjs.com/package/airtap). + +To run automated browser tests using Saucelabs, ensure that your `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables are set, then run: + + npm test + +This is what's run in Travis, to check against various browsers. The list of browsers is kept in the `bin/airtap-es5.yml` and `bin/airtap-es6.yml` files. + +## JavaScript Standard Style + +This module uses [JavaScript Standard Style](https://github.com/feross/standard). + +[![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +To test that the code conforms to the style, `npm install` and run: + + ./node_modules/.bin/standard + +## credit + +This was originally forked from [buffer-browserify](https://github.com/toots/buffer-browserify). + +## Security Policies and Procedures + +The `buffer` team and community take all security bugs in `buffer` seriously. Please see our [security policies and procedures](https://github.com/feross/security) document to learn how to report issues. + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org), and other contributors. Originally forked from an MIT-licensed module by Romain Beauxis. diff --git a/server/node_modules/buffer/index.d.ts b/server/node_modules/buffer/index.d.ts new file mode 100644 index 0000000000..5d1a804e5a --- /dev/null +++ b/server/node_modules/buffer/index.d.ts @@ -0,0 +1,186 @@ +export class Buffer extends Uint8Array { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + reverse(): this; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer | Uint8Array): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initializing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; +} diff --git a/server/node_modules/buffer/index.js b/server/node_modules/buffer/index.js new file mode 100644 index 0000000000..609cf31139 --- /dev/null +++ b/server/node_modules/buffer/index.js @@ -0,0 +1,1817 @@ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + +'use strict' + +var base64 = require('base64-js') +var ieee754 = require('ieee754') +var customInspectSymbol = + (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation + ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 + +var K_MAX_LENGTH = 0x7fffffff +exports.kMaxLength = K_MAX_LENGTH + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ +Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() + +if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && + typeof console.error === 'function') { + console.error( + 'This browser lacks typed array (Uint8Array) support which is required by ' + + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' + ) +} + +function typedArraySupport () { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1) + var proto = { foo: function () { return 42 } } + Object.setPrototypeOf(proto, Uint8Array.prototype) + Object.setPrototypeOf(arr, proto) + return arr.foo() === 42 + } catch (e) { + return false + } +} + +Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.buffer + } +}) + +Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.byteOffset + } +}) + +function createBuffer (length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"') + } + // Return an augmented `Uint8Array` instance + var buf = new Uint8Array(length) + Object.setPrototypeOf(buf, Buffer.prototype) + return buf +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ) + } + return allocUnsafe(arg) + } + return from(arg, encodingOrOffset, length) +} + +Buffer.poolSize = 8192 // not used by this implementation + +function from (value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value) + } + + if (value == null) { + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof SharedArrayBuffer !== 'undefined' && + (isInstance(value, SharedArrayBuffer) || + (value && isInstance(value.buffer, SharedArrayBuffer)))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + var valueOf = value.valueOf && value.valueOf() + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + var b = fromObject(value) + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from( + value[Symbol.toPrimitive]('string'), encodingOrOffset, length + ) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length) +} + +// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: +// https://github.com/feross/buffer/pull/148 +Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype) +Object.setPrototypeOf(Buffer, Uint8Array) + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number') + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } +} + +function alloc (size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill) + } + return createBuffer(size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding) +} + +function allocUnsafe (size) { + assertSize(size) + return createBuffer(size < 0 ? 0 : checked(size) | 0) +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + var length = byteLength(string, encoding) | 0 + var buf = createBuffer(length) + + var actual = buf.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual) + } + + return buf +} + +function fromArrayLike (array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + var buf = createBuffer(length) + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255 + } + return buf +} + +function fromArrayView (arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView) + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) + } + return fromArrayLike(arrayView) +} + +function fromArrayBuffer (array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds') + } + + var buf + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array) + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset) + } else { + buf = new Uint8Array(array, byteOffset, length) + } + + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(buf, Buffer.prototype) + + return buf +} + +function fromObject (obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + var buf = createBuffer(len) + + if (buf.length === 0) { + return buf + } + + obj.copy(buf, 0, 0, len) + return buf + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) + } + return fromArrayLike(obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } +} + +function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} + +Buffer.isBuffer = function isBuffer (b) { + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false +} + +Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos) + } else { + Uint8Array.prototype.set.call( + buffer, + buf, + pos + ) + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } else { + buf.copy(buffer, pos) + } + pos += buf.length + } + return buffer +} + +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) + } + + var len = string.length + var mustMatch = (arguments.length > 2 && arguments[2] === true) + if (!mustMatch && len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + var loweredCase = false + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) +// to detect a Buffer instance. It's not possible to use `instanceof Buffer` +// reliably in a browserify context because there could be multiple different +// copies of the 'buffer' package in use. This method works even for Buffer +// instances that were created from another copy of the `buffer` package. +// See: https://github.com/feross/buffer/issues/154 +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} + +Buffer.prototype.toString = function toString () { + var length = this.length + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.toLocaleString = Buffer.prototype.toString + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() + if (this.length > max) str += ' ... ' + return '' +} +if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength) + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } + + return -1 +} + +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} + +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + var strLen = string.length + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (numberIsNaN(parsed)) return i + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0 + if (isFinite(length)) { + length = length >>> 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) + ? 4 + : (firstByte > 0xDF) + ? 3 + : (firstByte > 0xBF) + ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]] + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf = this.subarray(start, end) + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(newBuf, Buffer.prototype) + + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUintLE = +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUintBE = +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUint8 = +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUint16LE = +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUint16BE = +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUint32LE = +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUint32BE = +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer.prototype.writeUintLE = +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUintBE = +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUint8 = +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeUint16LE = +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeUint16BE = +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeUint32LE = +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeUint32BE = +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end) + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ) + } + + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if ((encoding === 'utf8' && code < 128) || + encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code + } + } + } else if (typeof val === 'number') { + val = val & 255 + } else if (typeof val === 'boolean') { + val = Number(val) + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding) + var len = bytes.length + if (len === 0) { + throw new TypeError('The value "' + val + + '" is invalid for argument "value"') + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0] + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass +// the `instanceof` check but they should be treated as of that type. +// See: https://github.com/feross/buffer/issues/166 +function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) +} +function numberIsNaN (obj) { + // For IE11 support + return obj !== obj // eslint-disable-line no-self-compare +} + +// Create lookup table for `toString('hex')` +// See: https://github.com/feross/buffer/issues/219 +var hexSliceLookupTable = (function () { + var alphabet = '0123456789abcdef' + var table = new Array(256) + for (var i = 0; i < 16; ++i) { + var i16 = i * 16 + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j] + } + } + return table +})() diff --git a/server/node_modules/buffer/package.json b/server/node_modules/buffer/package.json new file mode 100644 index 0000000000..3b1b4986f8 --- /dev/null +++ b/server/node_modules/buffer/package.json @@ -0,0 +1,96 @@ +{ + "name": "buffer", + "description": "Node.js Buffer API, for the browser", + "version": "5.7.1", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/buffer/issues" + }, + "contributors": [ + "Romain Beauxis ", + "James Halliday " + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + }, + "devDependencies": { + "airtap": "^3.0.0", + "benchmark": "^2.1.4", + "browserify": "^17.0.0", + "concat-stream": "^2.0.0", + "hyperquest": "^2.1.3", + "is-buffer": "^2.0.4", + "is-nan": "^1.3.0", + "split": "^1.0.1", + "standard": "*", + "tape": "^5.0.1", + "through2": "^4.0.2", + "uglify-js": "^3.11.3" + }, + "homepage": "https://github.com/feross/buffer", + "jspm": { + "map": { + "./index.js": { + "node": "@node/buffer" + } + } + }, + "keywords": [ + "arraybuffer", + "browser", + "browserify", + "buffer", + "compatible", + "dataview", + "uint8array" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/buffer.git" + }, + "scripts": { + "perf": "browserify --debug perf/bracket-notation.js > perf/bundle.js && open perf/index.html", + "perf-node": "node perf/bracket-notation.js && node perf/concat.js && node perf/copy-big.js && node perf/copy.js && node perf/new-big.js && node perf/new.js && node perf/readDoubleBE.js && node perf/readFloatBE.js && node perf/readUInt32LE.js && node perf/slice.js && node perf/writeFloatBE.js", + "size": "browserify -r ./ | uglifyjs -c -m | gzip | wc -c", + "test": "standard && node ./bin/test.js", + "test-browser-es5": "airtap -- test/*.js", + "test-browser-es5-local": "airtap --local -- test/*.js", + "test-browser-es6": "airtap -- test/*.js test/node/*.js", + "test-browser-es6-local": "airtap --local -- test/*.js test/node/*.js", + "test-node": "tape test/*.js test/node/*.js", + "update-authors": "./bin/update-authors.sh" + }, + "standard": { + "ignore": [ + "test/node/**/*.js", + "test/common.js", + "test/_polyfill.js", + "perf/**/*.js" + ], + "globals": [ + "SharedArrayBuffer" + ] + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/server/node_modules/cacheable-request/LICENSE b/server/node_modules/cacheable-request/LICENSE deleted file mode 100644 index f27ee9b418..0000000000 --- a/server/node_modules/cacheable-request/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Luke Childs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/server/node_modules/cacheable-request/README.md b/server/node_modules/cacheable-request/README.md deleted file mode 100644 index 725e7e0df4..0000000000 --- a/server/node_modules/cacheable-request/README.md +++ /dev/null @@ -1,206 +0,0 @@ -# cacheable-request - -> Wrap native HTTP requests with RFC compliant cache support - -[![Build Status](https://travis-ci.org/lukechilds/cacheable-request.svg?branch=master)](https://travis-ci.org/lukechilds/cacheable-request) -[![Coverage Status](https://coveralls.io/repos/github/lukechilds/cacheable-request/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/cacheable-request?branch=master) -[![npm](https://img.shields.io/npm/dm/cacheable-request.svg)](https://www.npmjs.com/package/cacheable-request) -[![npm](https://img.shields.io/npm/v/cacheable-request.svg)](https://www.npmjs.com/package/cacheable-request) - -[RFC 7234](http://httpwg.org/specs/rfc7234.html) compliant HTTP caching for native Node.js HTTP/HTTPS requests. Caching works out of the box in memory or is easily pluggable with a wide range of storage adapters. - -**Note:** This is a low level wrapper around the core HTTP modules, it's not a high level request library. - -## Features - -- Only stores cacheable responses as defined by RFC 7234 -- Fresh cache entries are served directly from cache -- Stale cache entries are revalidated with `If-None-Match`/`If-Modified-Since` headers -- 304 responses from revalidation requests use cached body -- Updates `Age` header on cached responses -- Can completely bypass cache on a per request basis -- In memory cache by default -- Official support for Redis, MongoDB, SQLite, PostgreSQL and MySQL storage adapters -- Easily plug in your own or third-party storage adapters -- If DB connection fails, cache is automatically bypassed ([disabled by default](#optsautomaticfailover)) -- Adds cache support to any existing HTTP code with minimal changes -- Uses [http-cache-semantics](https://github.com/pornel/http-cache-semantics) internally for HTTP RFC 7234 compliance - -## Install - -```shell -npm install cacheable-request -``` - -## Usage - -```js -const http = require('http'); -const CacheableRequest = require('cacheable-request'); - -// Then instead of -const req = http.request('http://example.com', cb); -req.end(); - -// You can do -const cacheableRequest = new CacheableRequest(http.request); -const cacheReq = cacheableRequest('http://example.com', cb); -cacheReq.on('request', req => req.end()); -// Future requests to 'example.com' will be returned from cache if still valid - -// You pass in any other http.request API compatible method to be wrapped with cache support: -const cacheableRequest = new CacheableRequest(https.request); -const cacheableRequest = new CacheableRequest(electron.net); -``` - -## Storage Adapters - -`cacheable-request` uses [Keyv](https://github.com/lukechilds/keyv) to support a wide range of storage adapters. - -For example, to use Redis as a cache backend, you just need to install the official Redis Keyv storage adapter: - -``` -npm install @keyv/redis -``` - -And then you can pass `CacheableRequest` your connection string: - -```js -const cacheableRequest = new CacheableRequest(http.request, 'redis://user:pass@localhost:6379'); -``` - -[View all official Keyv storage adapters.](https://github.com/lukechilds/keyv#official-storage-adapters) - -Keyv also supports anything that follows the Map API so it's easy to write your own storage adapter or use a third-party solution. - -e.g The following are all valid storage adapters - -```js -const storageAdapter = new Map(); -// or -const storageAdapter = require('./my-storage-adapter'); -// or -const QuickLRU = require('quick-lru'); -const storageAdapter = new QuickLRU({ maxSize: 1000 }); - -const cacheableRequest = new CacheableRequest(http.request, storageAdapter); -``` - -View the [Keyv docs](https://github.com/lukechilds/keyv) for more information on how to use storage adapters. - -## API - -### new cacheableRequest(request, [storageAdapter]) - -Returns the provided request function wrapped with cache support. - -#### request - -Type: `function` - -Request function to wrap with cache support. Should be [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) or a similar API compatible request function. - -#### storageAdapter - -Type: `Keyv storage adapter`
-Default: `new Map()` - -A [Keyv](https://github.com/lukechilds/keyv) storage adapter instance, or connection string if using with an official Keyv storage adapter. - -### Instance - -#### cacheableRequest(opts, [cb]) - -Returns an event emitter. - -##### opts - -Type: `object`, `string` - -- Any of the default request functions options. -- Any [`http-cache-semantics`](https://github.com/kornelski/http-cache-semantics#constructor-options) options. -- Any of the following: - -###### opts.cache - -Type: `boolean`
-Default: `true` - -If the cache should be used. Setting this to false will completely bypass the cache for the current request. - -###### opts.strictTtl - -Type: `boolean`
-Default: `false` - -If set to `true` once a cached resource has expired it is deleted and will have to be re-requested. - -If set to `false` (default), after a cached resource's TTL expires it is kept in the cache and will be revalidated on the next request with `If-None-Match`/`If-Modified-Since` headers. - -###### opts.maxTtl - -Type: `number`
-Default: `undefined` - -Limits TTL. The `number` represents milliseconds. - -###### opts.automaticFailover - -Type: `boolean`
-Default: `false` - -When set to `true`, if the DB connection fails we will automatically fallback to a network request. DB errors will still be emitted to notify you of the problem even though the request callback may succeed. - -###### opts.forceRefresh - -Type: `boolean`
-Default: `false` - -Forces refreshing the cache. If the response could be retrieved from the cache, it will perform a new request and override the cache instead. - -##### cb - -Type: `function` - -The callback function which will receive the response as an argument. - -The response can be either a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage) or a [responselike object](https://github.com/lukechilds/responselike). The response will also have a `fromCache` property set with a boolean value. - -##### .on('request', request) - -`request` event to get the request object of the request. - -**Note:** This event will only fire if an HTTP request is actually made, not when a response is retrieved from cache. However, you should always handle the `request` event to end the request and handle any potential request errors. - -##### .on('response', response) - -`response` event to get the response object from the HTTP request or cache. - -##### .on('error', error) - -`error` event emitted in case of an error with the cache. - -Errors emitted here will be an instance of `CacheableRequest.RequestError` or `CacheableRequest.CacheError`. You will only ever receive a `RequestError` if the request function throws (normally caused by invalid user input). Normal request errors should be handled inside the `request` event. - -To properly handle all error scenarios you should use the following pattern: - -```js -cacheableRequest('example.com', cb) - .on('error', err => { - if (err instanceof CacheableRequest.CacheError) { - handleCacheError(err); // Cache error - } else if (err instanceof CacheableRequest.RequestError) { - handleRequestError(err); // Request function thrown - } - }) - .on('request', req => { - req.on('error', handleRequestError); // Request error emitted - req.end(); - }); -``` - -**Note:** Database connection errors are emitted here, however `cacheable-request` will attempt to re-request the resource and bypass the cache on a connection error. Therefore a database connection error doesn't necessarily mean the request won't be fulfilled. - -## License - -MIT © Luke Childs diff --git a/server/node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js b/server/node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js deleted file mode 100644 index 2dd75745df..0000000000 --- a/server/node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; -const {PassThrough: PassThroughStream} = require('stream'); - -module.exports = options => { - options = {...options}; - - const {array} = options; - let {encoding} = options; - const isBuffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || 'utf8'; - } - - if (isBuffer) { - encoding = null; - } - - const stream = new PassThroughStream({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - let length = 0; - const chunks = []; - - stream.on('data', chunk => { - chunks.push(chunk); - - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return chunks; - } - - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); - }; - - stream.getBufferedLength = () => length; - - return stream; -}; diff --git a/server/node_modules/cacheable-request/node_modules/get-stream/index.d.ts b/server/node_modules/cacheable-request/node_modules/get-stream/index.d.ts deleted file mode 100644 index 7b98134d9f..0000000000 --- a/server/node_modules/cacheable-request/node_modules/get-stream/index.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -/// -import {Stream} from 'stream'; - -declare class MaxBufferErrorClass extends Error { - readonly name: 'MaxBufferError'; - constructor(); -} - -declare namespace getStream { - interface Options { - /** - Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `MaxBufferError` error. - - @default Infinity - */ - readonly maxBuffer?: number; - } - - interface OptionsWithEncoding extends Options { - /** - [Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. - - @default 'utf8' - */ - readonly encoding?: EncodingType; - } - - type MaxBufferError = MaxBufferErrorClass; -} - -declare const getStream: { - /** - Get the `stream` as a string. - - @returns A promise that resolves when the end event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. - - @example - ``` - import * as fs from 'fs'; - import getStream = require('get-stream'); - - (async () => { - const stream = fs.createReadStream('unicorn.txt'); - - console.log(await getStream(stream)); - // ,,))))))));, - // __)))))))))))))), - // \|/ -\(((((''''((((((((. - // -*-==//////(('' . `)))))), - // /|\ ))| o ;-. '((((( ,(, - // ( `| / ) ;))))' ,_))^;(~ - // | | | ,))((((_ _____------~~~-. %,;(;(>';'~ - // o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ - // ; ''''```` `: `:::|\,__,%% );`'; ~ - // | _ ) / `:|`----' `-' - // ______/\/~ | / / - // /~;;.____/;;' / ___--,-( `;;;/ - // / // _;______;'------~~~~~ /;;/\ / - // // | | / ; \;;,\ - // (<_ | ; /',/-----' _> - // \_| ||_ //~;~~~~~~~~~ - // `\_| (,~~ - // \~\ - // ~~ - })(); - ``` - */ - (stream: Stream, options?: getStream.OptionsWithEncoding): Promise; - - /** - Get the `stream` as a buffer. - - It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. - */ - buffer( - stream: Stream, - options?: getStream.OptionsWithEncoding - ): Promise; - - /** - Get the `stream` as an array of values. - - It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: - - - When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). - - When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. - - When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. - */ - array( - stream: Stream, - options?: getStream.Options - ): Promise; - array( - stream: Stream, - options: getStream.OptionsWithEncoding<'buffer'> - ): Promise; - array( - stream: Stream, - options: getStream.OptionsWithEncoding - ): Promise; - - MaxBufferError: typeof MaxBufferErrorClass; - - // TODO: Remove this for the next major release - default: typeof getStream; -}; - -export = getStream; diff --git a/server/node_modules/cacheable-request/node_modules/get-stream/index.js b/server/node_modules/cacheable-request/node_modules/get-stream/index.js deleted file mode 100644 index 71f3991934..0000000000 --- a/server/node_modules/cacheable-request/node_modules/get-stream/index.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; -const {constants: BufferConstants} = require('buffer'); -const pump = require('pump'); -const bufferStream = require('./buffer-stream'); - -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} - -async function getStream(inputStream, options) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - - options = { - maxBuffer: Infinity, - ...options - }; - - const {maxBuffer} = options; - - let stream; - await new Promise((resolve, reject) => { - const rejectPromise = error => { - // Don't retrieve an oversized buffer. - if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { - error.bufferedData = stream.getBufferedValue(); - } - - reject(error); - }; - - stream = pump(inputStream, bufferStream(options), error => { - if (error) { - rejectPromise(error); - return; - } - - resolve(); - }); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - - return stream.getBufferedValue(); -} - -module.exports = getStream; -// TODO: Remove this for the next major release -module.exports.default = getStream; -module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); -module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); -module.exports.MaxBufferError = MaxBufferError; diff --git a/server/node_modules/cacheable-request/node_modules/get-stream/license b/server/node_modules/cacheable-request/node_modules/get-stream/license deleted file mode 100644 index fa7ceba3eb..0000000000 --- a/server/node_modules/cacheable-request/node_modules/get-stream/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/cacheable-request/node_modules/get-stream/package.json b/server/node_modules/cacheable-request/node_modules/get-stream/package.json deleted file mode 100644 index 21896bf9f9..0000000000 --- a/server/node_modules/cacheable-request/node_modules/get-stream/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "get-stream@^5.1.0", - "_id": "get-stream@5.2.0", - "_inBundle": false, - "_integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "_location": "/cacheable-request/get-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "get-stream@^5.1.0", - "name": "get-stream", - "escapedName": "get-stream", - "rawSpec": "^5.1.0", - "saveSpec": null, - "fetchSpec": "^5.1.0" - }, - "_requiredBy": [ - "/cacheable-request" - ], - "_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "_shasum": "4966a1795ee5ace65e706c4b7beb71257d6e22d3", - "_spec": "get-stream@^5.1.0", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\cacheable-request", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/get-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "pump": "^3.0.0" - }, - "deprecated": false, - "description": "Get a stream as a string, buffer, or array", - "devDependencies": { - "@types/node": "^12.0.7", - "ava": "^2.0.0", - "into-stream": "^5.0.0", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts", - "buffer-stream.js" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/get-stream#readme", - "keywords": [ - "get", - "stream", - "promise", - "concat", - "string", - "text", - "buffer", - "read", - "data", - "consume", - "readable", - "readablestream", - "array", - "object" - ], - "license": "MIT", - "name": "get-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/get-stream.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "5.2.0" -} diff --git a/server/node_modules/cacheable-request/node_modules/get-stream/readme.md b/server/node_modules/cacheable-request/node_modules/get-stream/readme.md deleted file mode 100644 index 7d7565dc6a..0000000000 --- a/server/node_modules/cacheable-request/node_modules/get-stream/readme.md +++ /dev/null @@ -1,124 +0,0 @@ -# get-stream [![Build Status](https://travis-ci.com/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.com/github/sindresorhus/get-stream) - -> Get a stream as a string, buffer, or array - -## Install - -``` -$ npm install get-stream -``` - -## Usage - -```js -const fs = require('fs'); -const getStream = require('get-stream'); - -(async () => { - const stream = fs.createReadStream('unicorn.txt'); - - console.log(await getStream(stream)); - /* - ,,))))))));, - __)))))))))))))), - \|/ -\(((((''''((((((((. - -*-==//////(('' . `)))))), - /|\ ))| o ;-. '((((( ,(, - ( `| / ) ;))))' ,_))^;(~ - | | | ,))((((_ _____------~~~-. %,;(;(>';'~ - o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ - ; ''''```` `: `:::|\,__,%% );`'; ~ - | _ ) / `:|`----' `-' - ______/\/~ | / / - /~;;.____/;;' / ___--,-( `;;;/ - / // _;______;'------~~~~~ /;;/\ / - // | | / ; \;;,\ - (<_ | ; /',/-----' _> - \_| ||_ //~;~~~~~~~~~ - `\_| (,~~ - \~\ - ~~ - */ -})(); -``` - -## API - -The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. - -### getStream(stream, options?) - -Get the `stream` as a string. - -#### options - -Type: `object` - -##### encoding - -Type: `string`\ -Default: `'utf8'` - -[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. - -##### maxBuffer - -Type: `number`\ -Default: `Infinity` - -Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `getStream.MaxBufferError` error. - -### getStream.buffer(stream, options?) - -Get the `stream` as a buffer. - -It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. - -### getStream.array(stream, options?) - -Get the `stream` as an array of values. - -It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: - -- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). - -- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. - -- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. - -## Errors - -If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. - -```js -(async () => { - try { - await getStream(streamThatErrorsAtTheEnd('unicorn')); - } catch (error) { - console.log(error.bufferedData); - //=> 'unicorn' - } -})() -``` - -## FAQ - -### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? - -This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. - -## Related - -- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/server/node_modules/cacheable-request/node_modules/lowercase-keys/index.d.ts b/server/node_modules/cacheable-request/node_modules/lowercase-keys/index.d.ts deleted file mode 100644 index dc90a75167..0000000000 --- a/server/node_modules/cacheable-request/node_modules/lowercase-keys/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** -Lowercase the keys of an object. - -@returns A new object with the keys lowercased. - -@example -``` -import lowercaseKeys = require('lowercase-keys'); - -lowercaseKeys({FOO: true, bAr: false}); -//=> {foo: true, bar: false} -``` -*/ -declare function lowercaseKeys(object: {[key: string]: T}): {[key: string]: T}; - -export = lowercaseKeys; diff --git a/server/node_modules/cacheable-request/node_modules/lowercase-keys/index.js b/server/node_modules/cacheable-request/node_modules/lowercase-keys/index.js deleted file mode 100644 index 357fb8f4e4..0000000000 --- a/server/node_modules/cacheable-request/node_modules/lowercase-keys/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -module.exports = object => { - const result = {}; - - for (const [key, value] of Object.entries(object)) { - result[key.toLowerCase()] = value; - } - - return result; -}; diff --git a/server/node_modules/cacheable-request/node_modules/lowercase-keys/license b/server/node_modules/cacheable-request/node_modules/lowercase-keys/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/server/node_modules/cacheable-request/node_modules/lowercase-keys/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/cacheable-request/node_modules/lowercase-keys/package.json b/server/node_modules/cacheable-request/node_modules/lowercase-keys/package.json deleted file mode 100644 index db75d0f509..0000000000 --- a/server/node_modules/cacheable-request/node_modules/lowercase-keys/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "lowercase-keys@^2.0.0", - "_id": "lowercase-keys@2.0.0", - "_inBundle": false, - "_integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "_location": "/cacheable-request/lowercase-keys", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lowercase-keys@^2.0.0", - "name": "lowercase-keys", - "escapedName": "lowercase-keys", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/cacheable-request" - ], - "_resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "_shasum": "2603e78b7b4b0006cbca2fbcc8a3202558ac9479", - "_spec": "lowercase-keys@^2.0.0", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\cacheable-request", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/lowercase-keys/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Lowercase the keys of an object", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/lowercase-keys#readme", - "keywords": [ - "object", - "assign", - "extend", - "properties", - "lowercase", - "lower-case", - "case", - "keys", - "key" - ], - "license": "MIT", - "name": "lowercase-keys", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/lowercase-keys.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "2.0.0" -} diff --git a/server/node_modules/cacheable-request/node_modules/lowercase-keys/readme.md b/server/node_modules/cacheable-request/node_modules/lowercase-keys/readme.md deleted file mode 100644 index b1ed06108d..0000000000 --- a/server/node_modules/cacheable-request/node_modules/lowercase-keys/readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# lowercase-keys [![Build Status](https://travis-ci.org/sindresorhus/lowercase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/lowercase-keys) - -> Lowercase the keys of an object - - -## Install - -``` -$ npm install lowercase-keys -``` - - -## Usage - -```js -const lowercaseKeys = require('lowercase-keys'); - -lowercaseKeys({FOO: true, bAr: false}); -//=> {foo: true, bar: false} -``` - - -## API - -### lowercaseKeys(object) - -Returns a new object with the keys lowercased. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/server/node_modules/cacheable-request/package.json b/server/node_modules/cacheable-request/package.json deleted file mode 100644 index 214f280413..0000000000 --- a/server/node_modules/cacheable-request/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_from": "cacheable-request@^6.0.0", - "_id": "cacheable-request@6.1.0", - "_inBundle": false, - "_integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", - "_location": "/cacheable-request", - "_phantomChildren": { - "pump": "3.0.0" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "cacheable-request@^6.0.0", - "name": "cacheable-request", - "escapedName": "cacheable-request", - "rawSpec": "^6.0.0", - "saveSpec": null, - "fetchSpec": "^6.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "_shasum": "20ffb8bd162ba4be11e9567d823db651052ca912", - "_spec": "cacheable-request@^6.0.0", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\got", - "author": { - "name": "Luke Childs", - "email": "lukechilds123@gmail.com", - "url": "http://lukechilds.co.uk" - }, - "bugs": { - "url": "https://github.com/lukechilds/cacheable-request/issues" - }, - "bundleDependencies": false, - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "deprecated": false, - "description": "Wrap native HTTP requests with RFC compliant cache support", - "devDependencies": { - "@keyv/sqlite": "^2.0.0", - "ava": "^1.1.0", - "coveralls": "^3.0.0", - "create-test-server": "3.0.0", - "delay": "^4.0.0", - "eslint-config-xo-lukechilds": "^1.0.0", - "nyc": "^14.1.1", - "pify": "^4.0.0", - "sqlite3": "^4.0.2", - "this": "^1.0.2", - "xo": "^0.23.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "src" - ], - "homepage": "https://github.com/lukechilds/cacheable-request#readme", - "keywords": [ - "HTTP", - "HTTPS", - "cache", - "caching", - "layer", - "cacheable", - "RFC 7234", - "RFC", - "7234", - "compliant" - ], - "license": "MIT", - "main": "src/index.js", - "name": "cacheable-request", - "repository": { - "type": "git", - "url": "git+https://github.com/lukechilds/cacheable-request.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "test": "xo && nyc ava" - }, - "version": "6.1.0", - "xo": { - "extends": "xo-lukechilds" - } -} diff --git a/server/node_modules/cacheable-request/src/index.js b/server/node_modules/cacheable-request/src/index.js deleted file mode 100644 index 3fcea3f90b..0000000000 --- a/server/node_modules/cacheable-request/src/index.js +++ /dev/null @@ -1,251 +0,0 @@ -'use strict'; - -const EventEmitter = require('events'); -const urlLib = require('url'); -const normalizeUrl = require('normalize-url'); -const getStream = require('get-stream'); -const CachePolicy = require('http-cache-semantics'); -const Response = require('responselike'); -const lowercaseKeys = require('lowercase-keys'); -const cloneResponse = require('clone-response'); -const Keyv = require('keyv'); - -class CacheableRequest { - constructor(request, cacheAdapter) { - if (typeof request !== 'function') { - throw new TypeError('Parameter `request` must be a function'); - } - - this.cache = new Keyv({ - uri: typeof cacheAdapter === 'string' && cacheAdapter, - store: typeof cacheAdapter !== 'string' && cacheAdapter, - namespace: 'cacheable-request' - }); - - return this.createCacheableRequest(request); - } - - createCacheableRequest(request) { - return (opts, cb) => { - let url; - if (typeof opts === 'string') { - url = normalizeUrlObject(urlLib.parse(opts)); - opts = {}; - } else if (opts instanceof urlLib.URL) { - url = normalizeUrlObject(urlLib.parse(opts.toString())); - opts = {}; - } else { - const [pathname, ...searchParts] = (opts.path || '').split('?'); - const search = searchParts.length > 0 ? - `?${searchParts.join('?')}` : - ''; - url = normalizeUrlObject({ ...opts, pathname, search }); - } - - opts = { - headers: {}, - method: 'GET', - cache: true, - strictTtl: false, - automaticFailover: false, - ...opts, - ...urlObjectToRequestOptions(url) - }; - opts.headers = lowercaseKeys(opts.headers); - - const ee = new EventEmitter(); - const normalizedUrlString = normalizeUrl( - urlLib.format(url), - { - stripWWW: false, - removeTrailingSlash: false, - stripAuthentication: false - } - ); - const key = `${opts.method}:${normalizedUrlString}`; - let revalidate = false; - let madeRequest = false; - - const makeRequest = opts => { - madeRequest = true; - let requestErrored = false; - let requestErrorCallback; - - const requestErrorPromise = new Promise(resolve => { - requestErrorCallback = () => { - if (!requestErrored) { - requestErrored = true; - resolve(); - } - }; - }); - - const handler = response => { - if (revalidate && !opts.forceRefresh) { - response.status = response.statusCode; - const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); - if (!revalidatedPolicy.modified) { - const headers = revalidatedPolicy.policy.responseHeaders(); - response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); - response.cachePolicy = revalidatedPolicy.policy; - response.fromCache = true; - } - } - - if (!response.fromCache) { - response.cachePolicy = new CachePolicy(opts, response, opts); - response.fromCache = false; - } - - let clonedResponse; - if (opts.cache && response.cachePolicy.storable()) { - clonedResponse = cloneResponse(response); - - (async () => { - try { - const bodyPromise = getStream.buffer(response); - - await Promise.race([ - requestErrorPromise, - new Promise(resolve => response.once('end', resolve)) - ]); - - if (requestErrored) { - return; - } - - const body = await bodyPromise; - - const value = { - cachePolicy: response.cachePolicy.toObject(), - url: response.url, - statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, - body - }; - - let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; - if (opts.maxTtl) { - ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; - } - - await this.cache.set(key, value, ttl); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } else if (opts.cache && revalidate) { - (async () => { - try { - await this.cache.delete(key); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } - - ee.emit('response', clonedResponse || response); - if (typeof cb === 'function') { - cb(clonedResponse || response); - } - }; - - try { - const req = request(opts, handler); - req.once('error', requestErrorCallback); - req.once('abort', requestErrorCallback); - ee.emit('request', req); - } catch (error) { - ee.emit('error', new CacheableRequest.RequestError(error)); - } - }; - - (async () => { - const get = async opts => { - await Promise.resolve(); - - const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; - if (typeof cacheEntry === 'undefined') { - return makeRequest(opts); - } - - const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); - if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { - const headers = policy.responseHeaders(); - const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); - response.cachePolicy = policy; - response.fromCache = true; - - ee.emit('response', response); - if (typeof cb === 'function') { - cb(response); - } - } else { - revalidate = cacheEntry; - opts.headers = policy.revalidationHeaders(opts); - makeRequest(opts); - } - }; - - const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); - this.cache.once('error', errorHandler); - ee.on('response', () => this.cache.removeListener('error', errorHandler)); - - try { - await get(opts); - } catch (error) { - if (opts.automaticFailover && !madeRequest) { - makeRequest(opts); - } - - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - - return ee; - }; - } -} - -function urlObjectToRequestOptions(url) { - const options = { ...url }; - options.path = `${url.pathname || '/'}${url.search || ''}`; - delete options.pathname; - delete options.search; - return options; -} - -function normalizeUrlObject(url) { - // If url was parsed by url.parse or new URL: - // - hostname will be set - // - host will be hostname[:port] - // - port will be set if it was explicit in the parsed string - // Otherwise, url was from request options: - // - hostname or host may be set - // - host shall not have port encoded - return { - protocol: url.protocol, - auth: url.auth, - hostname: url.hostname || url.host || 'localhost', - port: url.port, - pathname: url.pathname, - search: url.search - }; -} - -CacheableRequest.RequestError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'RequestError'; - Object.assign(this, error); - } -}; - -CacheableRequest.CacheError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'CacheError'; - Object.assign(this, error); - } -}; - -module.exports = CacheableRequest; diff --git a/server/node_modules/camelcase/index.d.ts b/server/node_modules/camelcase/index.d.ts deleted file mode 100644 index 58f2069adc..0000000000 --- a/server/node_modules/camelcase/index.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -declare namespace camelcase { - interface Options { - /** - Uppercase the first character: `foo-bar` → `FooBar`. - - @default false - */ - readonly pascalCase?: boolean; - } -} - -declare const camelcase: { - /** - Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`. - - @param input - String to convert to camel case. - - @example - ``` - import camelCase = require('camelcase'); - - camelCase('foo-bar'); - //=> 'fooBar' - - camelCase('foo_bar'); - //=> 'fooBar' - - camelCase('Foo-Bar'); - //=> 'fooBar' - - camelCase('Foo-Bar', {pascalCase: true}); - //=> 'FooBar' - - camelCase('--foo.bar', {pascalCase: false}); - //=> 'fooBar' - - camelCase('foo bar'); - //=> 'fooBar' - - console.log(process.argv[3]); - //=> '--foo-bar' - camelCase(process.argv[3]); - //=> 'fooBar' - - camelCase(['foo', 'bar']); - //=> 'fooBar' - - camelCase(['__foo__', '--bar'], {pascalCase: true}); - //=> 'FooBar' - ``` - */ - (input: string | ReadonlyArray, options?: camelcase.Options): string; - - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function camelcase( - // input: string | ReadonlyArray, - // options?: camelcase.Options - // ): string; - // export = camelcase; - default: typeof camelcase; -}; - -export = camelcase; diff --git a/server/node_modules/camelcase/index.js b/server/node_modules/camelcase/index.js deleted file mode 100644 index 579f99b47f..0000000000 --- a/server/node_modules/camelcase/index.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -const preserveCamelCase = string => { - let isLastCharLower = false; - let isLastCharUpper = false; - let isLastLastCharUpper = false; - - for (let i = 0; i < string.length; i++) { - const character = string[i]; - - if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) { - string = string.slice(0, i) + '-' + string.slice(i); - isLastCharLower = false; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = true; - i++; - } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) { - string = string.slice(0, i - 1) + '-' + string.slice(i - 1); - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = false; - isLastCharLower = true; - } else { - isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character; - } - } - - return string; -}; - -const camelCase = (input, options) => { - if (!(typeof input === 'string' || Array.isArray(input))) { - throw new TypeError('Expected the input to be `string | string[]`'); - } - - options = Object.assign({ - pascalCase: false - }, options); - - const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x; - - if (Array.isArray(input)) { - input = input.map(x => x.trim()) - .filter(x => x.length) - .join('-'); - } else { - input = input.trim(); - } - - if (input.length === 0) { - return ''; - } - - if (input.length === 1) { - return options.pascalCase ? input.toUpperCase() : input.toLowerCase(); - } - - const hasUpperCase = input !== input.toLowerCase(); - - if (hasUpperCase) { - input = preserveCamelCase(input); - } - - input = input - .replace(/^[_.\- ]+/, '') - .toLowerCase() - .replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase()) - .replace(/\d+(\w|$)/g, m => m.toUpperCase()); - - return postProcess(input); -}; - -module.exports = camelCase; -// TODO: Remove this for the next major release -module.exports.default = camelCase; diff --git a/server/node_modules/camelcase/license b/server/node_modules/camelcase/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/server/node_modules/camelcase/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/camelcase/package.json b/server/node_modules/camelcase/package.json deleted file mode 100644 index c382ee1770..0000000000 --- a/server/node_modules/camelcase/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "camelcase@^5.3.1", - "_id": "camelcase@5.3.1", - "_inBundle": false, - "_integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "_location": "/camelcase", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "camelcase@^5.3.1", - "name": "camelcase", - "escapedName": "camelcase", - "rawSpec": "^5.3.1", - "saveSpec": null, - "fetchSpec": "^5.3.1" - }, - "_requiredBy": [ - "/boxen" - ], - "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "_shasum": "e3c9b31569e106811df242f715725a1f4c494320", - "_spec": "camelcase@^5.3.1", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\boxen", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/camelcase/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/camelcase#readme", - "keywords": [ - "camelcase", - "camel-case", - "camel", - "case", - "dash", - "hyphen", - "dot", - "underscore", - "separator", - "string", - "text", - "convert", - "pascalcase", - "pascal-case" - ], - "license": "MIT", - "name": "camelcase", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/camelcase.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "5.3.1" -} diff --git a/server/node_modules/camelcase/readme.md b/server/node_modules/camelcase/readme.md deleted file mode 100644 index fde27261b2..0000000000 --- a/server/node_modules/camelcase/readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase) - -> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar` - ---- - -
- - Get professional support for 'camelcase' with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- - -## Install - -``` -$ npm install camelcase -``` - - -## Usage - -```js -const camelCase = require('camelcase'); - -camelCase('foo-bar'); -//=> 'fooBar' - -camelCase('foo_bar'); -//=> 'fooBar' - -camelCase('Foo-Bar'); -//=> 'fooBar' - -camelCase('Foo-Bar', {pascalCase: true}); -//=> 'FooBar' - -camelCase('--foo.bar', {pascalCase: false}); -//=> 'fooBar' - -camelCase('foo bar'); -//=> 'fooBar' - -console.log(process.argv[3]); -//=> '--foo-bar' -camelCase(process.argv[3]); -//=> 'fooBar' - -camelCase(['foo', 'bar']); -//=> 'fooBar' - -camelCase(['__foo__', '--bar'], {pascalCase: true}); -//=> 'FooBar' -``` - - -## API - -### camelCase(input, [options]) - -#### input - -Type: `string` `string[]` - -String to convert to camel case. - -#### options - -Type: `Object` - -##### pascalCase - -Type: `boolean`
-Default: `false` - -Uppercase the first character: `foo-bar` → `FooBar` - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## Related - -- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module -- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase -- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string -- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/server/node_modules/chalk/index.d.ts b/server/node_modules/chalk/index.d.ts deleted file mode 100644 index 7e22c45ec9..0000000000 --- a/server/node_modules/chalk/index.d.ts +++ /dev/null @@ -1,411 +0,0 @@ -declare const enum LevelEnum { - /** - All colors disabled. - */ - None = 0, - - /** - Basic 16 colors support. - */ - Basic = 1, - - /** - ANSI 256 colors support. - */ - Ansi256 = 2, - - /** - Truecolor 16 million colors support. - */ - TrueColor = 3 -} - -/** -Basic foreground colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type ForegroundColor = - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray' - | 'grey' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright'; - -/** -Basic background colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type BackgroundColor = - | 'bgBlack' - | 'bgRed' - | 'bgGreen' - | 'bgYellow' - | 'bgBlue' - | 'bgMagenta' - | 'bgCyan' - | 'bgWhite' - | 'bgGray' - | 'bgGrey' - | 'bgBlackBright' - | 'bgRedBright' - | 'bgGreenBright' - | 'bgYellowBright' - | 'bgBlueBright' - | 'bgMagentaBright' - | 'bgCyanBright' - | 'bgWhiteBright'; - -/** -Basic colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type Color = ForegroundColor | BackgroundColor; - -declare type Modifiers = - | 'reset' - | 'bold' - | 'dim' - | 'italic' - | 'underline' - | 'inverse' - | 'hidden' - | 'strikethrough' - | 'visible'; - -declare namespace chalk { - type Level = LevelEnum; - - interface Options { - /** - Specify the color support for Chalk. - By default, color support is automatically detected based on the environment. - */ - level?: Level; - } - - interface Instance { - /** - Return a new Chalk instance. - */ - new (options?: Options): Chalk; - } - - /** - Detect whether the terminal supports color. - */ - interface ColorSupport { - /** - The color level used by Chalk. - */ - level: Level; - - /** - Return whether Chalk supports basic 16 colors. - */ - hasBasic: boolean; - - /** - Return whether Chalk supports ANSI 256 colors. - */ - has256: boolean; - - /** - Return whether Chalk supports Truecolor 16 million colors. - */ - has16m: boolean; - } - - interface ChalkFunction { - /** - Use a template string. - - @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) - - @example - ``` - import chalk = require('chalk'); - - log(chalk` - CPU: {red ${cpu.totalPercent}%} - RAM: {green ${ram.used / ram.total * 100}%} - DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} - `); - ``` - */ - (text: TemplateStringsArray, ...placeholders: unknown[]): string; - - (...text: unknown[]): string; - } - - interface Chalk extends ChalkFunction { - /** - Return a new Chalk instance. - */ - Instance: Instance; - - /** - The color support for Chalk. - By default, color support is automatically detected based on the environment. - */ - level: Level; - - /** - Use HEX value to set text color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.hex('#DEADED'); - ``` - */ - hex(color: string): Chalk; - - /** - Use keyword color value to set text color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.keyword('orange'); - ``` - */ - keyword(color: string): Chalk; - - /** - Use RGB values to set text color. - */ - rgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set text color. - */ - hsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set text color. - */ - hsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set text color. - */ - hwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - */ - ansi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(index: number): Chalk; - - /** - Use HEX value to set background color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgHex('#DEADED'); - ``` - */ - bgHex(color: string): Chalk; - - /** - Use keyword color value to set background color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgKeyword('orange'); - ``` - */ - bgKeyword(color: string): Chalk; - - /** - Use RGB values to set background color. - */ - bgRgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set background color. - */ - bgHsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set background color. - */ - bgHsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set background color. - */ - bgHwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - Use the foreground code, not the background code (for example, not 41, nor 101). - */ - bgAnsi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. - */ - bgAnsi256(index: number): Chalk; - - /** - Modifier: Resets the current color chain. - */ - readonly reset: Chalk; - - /** - Modifier: Make text bold. - */ - readonly bold: Chalk; - - /** - Modifier: Emitting only a small amount of light. - */ - readonly dim: Chalk; - - /** - Modifier: Make text italic. (Not widely supported) - */ - readonly italic: Chalk; - - /** - Modifier: Make text underline. (Not widely supported) - */ - readonly underline: Chalk; - - /** - Modifier: Inverse background and foreground colors. - */ - readonly inverse: Chalk; - - /** - Modifier: Prints the text, but makes it invisible. - */ - readonly hidden: Chalk; - - /** - Modifier: Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: Chalk; - - /** - Modifier: Prints the text only when Chalk has a color support level > 0. - Can be useful for things that are purely cosmetic. - */ - readonly visible: Chalk; - - readonly black: Chalk; - readonly red: Chalk; - readonly green: Chalk; - readonly yellow: Chalk; - readonly blue: Chalk; - readonly magenta: Chalk; - readonly cyan: Chalk; - readonly white: Chalk; - - /* - Alias for `blackBright`. - */ - readonly gray: Chalk; - - /* - Alias for `blackBright`. - */ - readonly grey: Chalk; - - readonly blackBright: Chalk; - readonly redBright: Chalk; - readonly greenBright: Chalk; - readonly yellowBright: Chalk; - readonly blueBright: Chalk; - readonly magentaBright: Chalk; - readonly cyanBright: Chalk; - readonly whiteBright: Chalk; - - readonly bgBlack: Chalk; - readonly bgRed: Chalk; - readonly bgGreen: Chalk; - readonly bgYellow: Chalk; - readonly bgBlue: Chalk; - readonly bgMagenta: Chalk; - readonly bgCyan: Chalk; - readonly bgWhite: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGray: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGrey: Chalk; - - readonly bgBlackBright: Chalk; - readonly bgRedBright: Chalk; - readonly bgGreenBright: Chalk; - readonly bgYellowBright: Chalk; - readonly bgBlueBright: Chalk; - readonly bgMagentaBright: Chalk; - readonly bgCyanBright: Chalk; - readonly bgWhiteBright: Chalk; - } -} - -/** -Main Chalk object that allows to chain styles together. -Call the last one as a method with a string argument. -Order doesn't matter, and later styles take precedent in case of a conflict. -This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. -*/ -declare const chalk: chalk.Chalk & chalk.ChalkFunction & { - supportsColor: chalk.ColorSupport | false; - Level: typeof LevelEnum; - Color: Color; - ForegroundColor: ForegroundColor; - BackgroundColor: BackgroundColor; - Modifiers: Modifiers; - stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; -}; - -export = chalk; diff --git a/server/node_modules/chalk/license b/server/node_modules/chalk/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/server/node_modules/chalk/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/chalk/node_modules/has-flag/index.d.ts b/server/node_modules/chalk/node_modules/has-flag/index.d.ts deleted file mode 100644 index a0a48c8911..0000000000 --- a/server/node_modules/chalk/node_modules/has-flag/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** -Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag. - -@param flag - CLI flag to look for. The `--` prefix is optional. -@param argv - CLI arguments. Default: `process.argv`. -@returns Whether the flag exists. - -@example -``` -// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow - -// foo.ts -import hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` -*/ -declare function hasFlag(flag: string, argv?: string[]): boolean; - -export = hasFlag; diff --git a/server/node_modules/chalk/node_modules/has-flag/index.js b/server/node_modules/chalk/node_modules/has-flag/index.js deleted file mode 100644 index b6f80b1f8f..0000000000 --- a/server/node_modules/chalk/node_modules/has-flag/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; diff --git a/server/node_modules/chalk/node_modules/has-flag/license b/server/node_modules/chalk/node_modules/has-flag/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/server/node_modules/chalk/node_modules/has-flag/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/chalk/node_modules/has-flag/package.json b/server/node_modules/chalk/node_modules/has-flag/package.json deleted file mode 100644 index c820df59ed..0000000000 --- a/server/node_modules/chalk/node_modules/has-flag/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_from": "has-flag@^4.0.0", - "_id": "has-flag@4.0.0", - "_inBundle": false, - "_integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "_location": "/chalk/has-flag", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "has-flag@^4.0.0", - "name": "has-flag", - "escapedName": "has-flag", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/chalk/supports-color" - ], - "_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "_shasum": "944771fd9c81c81265c4d6941860da06bb59479b", - "_spec": "has-flag@^4.0.0", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\chalk\\node_modules\\supports-color", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/has-flag/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if argv has a specific flag", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/has-flag#readme", - "keywords": [ - "has", - "check", - "detect", - "contains", - "find", - "flag", - "cli", - "command-line", - "argv", - "process", - "arg", - "args", - "argument", - "arguments", - "getopt", - "minimist", - "optimist" - ], - "license": "MIT", - "name": "has-flag", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-flag.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "4.0.0" -} diff --git a/server/node_modules/chalk/node_modules/has-flag/readme.md b/server/node_modules/chalk/node_modules/has-flag/readme.md deleted file mode 100644 index 3f72dff29a..0000000000 --- a/server/node_modules/chalk/node_modules/has-flag/readme.md +++ /dev/null @@ -1,89 +0,0 @@ -# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) - -> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag - -Correctly stops looking after an `--` argument terminator. - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- - - -## Install - -``` -$ npm install has-flag -``` - - -## Usage - -```js -// foo.js -const hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` - -``` -$ node foo.js -f --unicorn --foo=bar -- --rainbow -``` - - -## API - -### hasFlag(flag, [argv]) - -Returns a boolean for whether the flag exists. - -#### flag - -Type: `string` - -CLI flag to look for. The `--` prefix is optional. - -#### argv - -Type: `string[]`
-Default: `process.argv` - -CLI arguments. - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/server/node_modules/chalk/node_modules/supports-color/browser.js b/server/node_modules/chalk/node_modules/supports-color/browser.js deleted file mode 100644 index 62afa3a742..0000000000 --- a/server/node_modules/chalk/node_modules/supports-color/browser.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -module.exports = { - stdout: false, - stderr: false -}; diff --git a/server/node_modules/chalk/node_modules/supports-color/index.js b/server/node_modules/chalk/node_modules/supports-color/index.js deleted file mode 100644 index 6fada390fb..0000000000 --- a/server/node_modules/chalk/node_modules/supports-color/index.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; -const os = require('os'); -const tty = require('tty'); -const hasFlag = require('has-flag'); - -const {env} = process; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - forceColor = 0; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = 1; -} - -if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === 'true') { - forceColor = 1; - } else if (env.FORCE_COLOR === 'false') { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - - if (haveStream && !streamIsTTY && forceColor === undefined) { - return 0; - } - - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } - - if (process.platform === 'win32') { - // Windows 10 build 10586 is the first Windows release that supports 256 colors. - // Windows 10 build 14931 is the first release that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - - if ('COLORTERM' in env) { - return 1; - } - - return min; -} - -function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); -} - -module.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) -}; diff --git a/server/node_modules/chalk/node_modules/supports-color/license b/server/node_modules/chalk/node_modules/supports-color/license deleted file mode 100644 index e7af2f7710..0000000000 --- a/server/node_modules/chalk/node_modules/supports-color/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/chalk/node_modules/supports-color/package.json b/server/node_modules/chalk/node_modules/supports-color/package.json deleted file mode 100644 index a923c586c9..0000000000 --- a/server/node_modules/chalk/node_modules/supports-color/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "supports-color@^7.1.0", - "_id": "supports-color@7.2.0", - "_inBundle": false, - "_integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "_location": "/chalk/supports-color", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "supports-color@^7.1.0", - "name": "supports-color", - "escapedName": "supports-color", - "rawSpec": "^7.1.0", - "saveSpec": null, - "fetchSpec": "^7.1.0" - }, - "_requiredBy": [ - "/chalk" - ], - "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "_shasum": "1b7dcdcb32b8138801b3e478ba6a51caa89648da", - "_spec": "supports-color@^7.1.0", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/chalk/supports-color/issues" - }, - "bundleDependencies": false, - "dependencies": { - "has-flag": "^4.0.0" - }, - "deprecated": false, - "description": "Detect whether a terminal supports color", - "devDependencies": { - "ava": "^1.4.1", - "import-fresh": "^3.0.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "browser.js" - ], - "homepage": "https://github.com/chalk/supports-color#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "license": "MIT", - "name": "supports-color", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/supports-color.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "7.2.0" -} diff --git a/server/node_modules/chalk/node_modules/supports-color/readme.md b/server/node_modules/chalk/node_modules/supports-color/readme.md deleted file mode 100644 index 3654228586..0000000000 --- a/server/node_modules/chalk/node_modules/supports-color/readme.md +++ /dev/null @@ -1,76 +0,0 @@ -# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) - -> Detect whether a terminal supports color - - -## Install - -``` -$ npm install supports-color -``` - - -## Usage - -```js -const supportsColor = require('supports-color'); - -if (supportsColor.stdout) { - console.log('Terminal stdout supports color'); -} - -if (supportsColor.stdout.has256) { - console.log('Terminal stdout supports 256 colors'); -} - -if (supportsColor.stderr.has16m) { - console.log('Terminal stderr supports 16 million colors (truecolor)'); -} -``` - - -## API - -Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. - -The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: - -- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) -- `.level = 2` and `.has256 = true`: 256 color support -- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) - - -## Info - -It obeys the `--color` and `--no-color` CLI flags. - -For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. - -Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. - - -## Related - -- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- diff --git a/server/node_modules/chalk/package.json b/server/node_modules/chalk/package.json deleted file mode 100644 index a854fc1cb4..0000000000 --- a/server/node_modules/chalk/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_from": "chalk@^3.0.0", - "_id": "chalk@3.0.0", - "_inBundle": false, - "_integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "_location": "/chalk", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "chalk@^3.0.0", - "name": "chalk", - "escapedName": "chalk", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/boxen", - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "_shasum": "3f73c2bf526591f574cc492c51e2456349f844e4", - "_spec": "chalk@^3.0.0", - "_where": "C:\\Users\\User\\CodeYourFuture\\Full-Stack-Project-Assessment\\server\\node_modules\\update-notifier", - "bugs": { - "url": "https://github.com/chalk/chalk/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "deprecated": false, - "description": "Terminal string styling done right", - "devDependencies": { - "ava": "^2.4.0", - "coveralls": "^3.0.7", - "execa": "^3.2.0", - "import-fresh": "^3.1.0", - "matcha": "^0.7.0", - "nyc": "^14.1.1", - "resolve-from": "^5.0.0", - "tsd": "^0.7.4", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "source", - "index.d.ts" - ], - "homepage": "https://github.com/chalk/chalk#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "main": "source", - "name": "chalk", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/chalk.git" - }, - "scripts": { - "bench": "matcha benchmark.js", - "test": "xo && nyc ava && tsd" - }, - "version": "3.0.0", - "xo": { - "rules": { - "unicorn/prefer-string-slice": "off", - "unicorn/prefer-includes": "off" - } - } -} diff --git a/server/node_modules/chalk/readme.md b/server/node_modules/chalk/readme.md deleted file mode 100644 index 877cb93b78..0000000000 --- a/server/node_modules/chalk/readme.md +++ /dev/null @@ -1,304 +0,0 @@ -

-
-
- Chalk -
-
-
-

- -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) - - - - -## Highlights - -- Expressive API -- Highly performant -- Ability to nest styles -- [256/Truecolor color support](#256-and-truecolor-color-support) -- Auto-detects color support -- Doesn't extend `String.prototype` -- Clean and focused -- Actively maintained -- [Used by ~46,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 1, 2019 - - -## Install - -```console -$ npm install chalk -``` - - -## Usage - -```js -const chalk = require('chalk'); - -console.log(chalk.blue('Hello world!')); -``` - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -const chalk = require('chalk'); -const log = console.log; - -// Combine styled and normal strings -log(chalk.blue('Hello') + ' World' + chalk.red('!')); - -// Compose multiple styles using the chainable API -log(chalk.blue.bgRed.bold('Hello world!')); - -// Pass in multiple arguments -log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); - -// Nest styles -log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); - -// Nest styles of the same type even (color, underline, background) -log(chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -)); - -// ES2015 template literal -log(` -CPU: ${chalk.red('90%')} -RAM: ${chalk.green('40%')} -DISK: ${chalk.yellow('70%')} -`); - -// ES2015 tagged template literal -log(chalk` -CPU: {red ${cpu.totalPercent}%} -RAM: {green ${ram.used / ram.total * 100}%} -DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} -`); - -// Use RGB colors in terminal emulators that support it. -log(chalk.keyword('orange')('Yay for orange colored text!')); -log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); -log(chalk.hex('#DEADED').bold('Bold gray!')); -``` - -Easily define your own themes: - -```js -const chalk = require('chalk'); - -const error = chalk.bold.red; -const warning = chalk.keyword('orange'); - -console.log(error('Error!')); -console.log(warning('Warning!')); -``` - -Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): - -```js -const name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> 'Hello Sindre' -``` - - -## API - -### chalk.`